Move CM.Disp.Draw out of bottom bar section
This commit is contained in:
@@ -1174,6 +1174,26 @@ CM.Disp.UpdateBackground = function() {
|
||||
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function handles custom drawing for the Game.Draw() function.
|
||||
* It is hooked on 'draw' by CM.RegisterHooks()
|
||||
*/
|
||||
CM.Disp.Draw = function () {
|
||||
// Draw autosave timer in stats menu
|
||||
if (
|
||||
(Game.prefs.autosave && Game.drawT % 10 == 0) && // with autosave ON and every 10 ticks
|
||||
(Game.onMenu == 'stats' && CM.Config.Stats) // while being on the stats menu only
|
||||
) {
|
||||
var timer = document.getElementById('CMStatsAutosaveTimer');
|
||||
if (timer) {
|
||||
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.T % (Game.fps * 60)), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/********
|
||||
* Section: Functions related to the Bottom Bar */
|
||||
|
||||
/**
|
||||
* This function toggle the bottom bar
|
||||
* It is called by CM.Disp.UpdateAscendState() and a change in CM.Config.BotBar
|
||||
@@ -1293,23 +1313,6 @@ CM.Disp.CreateBotBarBuildingColumn = function(buildingName) {
|
||||
time.appendChild(document.createElement('td'));
|
||||
}
|
||||
|
||||
/**
|
||||
* This function handles custom drawing for the Game.Draw() function.
|
||||
* It is hooked on 'draw' by CM.RegisterHooks()
|
||||
*/
|
||||
CM.Disp.Draw = function () {
|
||||
// Draw autosave timer in stats menu
|
||||
if (
|
||||
(Game.prefs.autosave && Game.drawT % 10 == 0) && // with autosave ON and every 10 ticks
|
||||
(Game.onMenu == 'stats' && CM.Config.Stats) // while being on the stats menu only
|
||||
) {
|
||||
var timer = document.getElementById('CMStatsAutosaveTimer');
|
||||
if (timer) {
|
||||
timer.innerText = Game.sayTime(Game.fps * 60 - (Game.T % (Game.fps * 60)), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/********
|
||||
* Section: Functions related to the Timer Bar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user