Check for new mods and update functions #560
This commit is contained in:
File diff suppressed because one or more lines are too long
12
src/Main.js
12
src/Main.js
@@ -15,6 +15,14 @@ CM.Main.Loop = function() {
|
|||||||
CM.Disp.UpdateAscendState();
|
CM.Disp.UpdateAscendState();
|
||||||
}
|
}
|
||||||
if (!Game.OnAscend && Game.AscendTimer === 0) {
|
if (!Game.OnAscend && Game.AscendTimer === 0) {
|
||||||
|
// Check if any other mods have been loaded
|
||||||
|
if (CM.Main.LastModCount != Object.keys(Game.mods).length) {
|
||||||
|
CM.Sim.CreateSimFunctions();
|
||||||
|
CM.Sim.InitData();
|
||||||
|
CM.Cache.InitCache();
|
||||||
|
CM.Main.LastModCount = Object.keys(Game.mods).length;
|
||||||
|
}
|
||||||
|
|
||||||
// CM.Sim.DoSims is set whenever CPS has changed
|
// CM.Sim.DoSims is set whenever CPS has changed
|
||||||
if (CM.Sim.DoSims) {
|
if (CM.Sim.DoSims) {
|
||||||
CM.Cache.CacheIncome();
|
CM.Cache.CacheIncome();
|
||||||
@@ -71,6 +79,9 @@ CM.Main.DelayInit = function() {
|
|||||||
CM.Sim.InitData();
|
CM.Sim.InitData();
|
||||||
CM.Cache.InitCache();
|
CM.Cache.InitCache();
|
||||||
|
|
||||||
|
// Stored to check if we need to re-initiliaze data
|
||||||
|
CM.Main.LastModCount = Object.keys(Game.mods).length
|
||||||
|
|
||||||
// Creating visual elements
|
// Creating visual elements
|
||||||
CM.Disp.CreateCssArea();
|
CM.Disp.CreateCssArea();
|
||||||
CM.Disp.CreateBotBar();
|
CM.Disp.CreateBotBar();
|
||||||
@@ -98,6 +109,7 @@ CM.Main.DelayInit = function() {
|
|||||||
else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!', '', '', 1, 1);
|
else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!', '', '', 1, 1);
|
||||||
|
|
||||||
Game.Win('Third-party');
|
Game.Win('Third-party');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
|
|||||||
Reference in New Issue
Block a user