Merge pull request #420 from Chorizorro/fix/disp
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;
|
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
|
* This function toggle the bottom bar
|
||||||
* It is called by CM.Disp.UpdateAscendState() and a change in CM.Config.BotBar
|
* 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'));
|
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
|
* Section: Functions related to the Timer Bar
|
||||||
|
|
||||||
|
|||||||
37
src/Disp.js
37
src/Disp.js
@@ -286,6 +286,26 @@ CM.Disp.UpdateBackground = function() {
|
|||||||
Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight;
|
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
|
* This function toggle the bottom bar
|
||||||
* It is called by CM.Disp.UpdateAscendState() and a change in CM.Config.BotBar
|
* It is called by CM.Disp.UpdateAscendState() and a change in CM.Config.BotBar
|
||||||
@@ -405,23 +425,6 @@ CM.Disp.CreateBotBarBuildingColumn = function(buildingName) {
|
|||||||
time.appendChild(document.createElement('td'));
|
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
|
* Section: Functions related to the Timer Bar
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user