Incorporated Modding API

This commit is contained in:
Daniel van Noord
2020-12-21 22:53:23 +01:00
parent e6118f14c2
commit 203dc8137e
8 changed files with 147 additions and 92 deletions

View File

@@ -211,24 +211,6 @@ CM.Loop = function() {
CM.Cache.UpdateAvgCPS()
}
CM.Init = function() {
var proceed = true;
if (Game.version != CM.VersionMajor) {
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
}
if (proceed) {
CM.Cache.AddQueue();
CM.Disp.AddJscolor();
var delay = setInterval(function() {
if (typeof Queue !== 'undefined' && typeof jscolor !== 'undefined') {
CM.DelayInit();
clearInterval(delay);
}
}, 500);
}
}
CM.DelayInit = function() {
CM.Sim.InitData();
CM.Cache.InitCache();
@@ -265,18 +247,9 @@ CM.DelayInit = function() {
l("upgrades").style.display = "flex";
l("upgrades").style["flex-wrap"] = "wrap";
CM.Main.RegisterHooks();
Game.Win('Third-party');
}
/**
* Hook custom methods into the game
*/
CM.Main.RegisterHooks = function() {
Game.registerHook('draw', CM.Disp.Draw);
}
/********
* Section: Functions related to checking for changes in Minigames/GC's/Ticker
* TODO: Possibly move this section */