diff --git a/CookieMonster.js b/CookieMonster.js index dc173ae..49d8928 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -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 diff --git a/src/Disp.js b/src/Disp.js index 0092f57..7816777 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -286,6 +286,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 @@ -405,23 +425,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