Check for new mods and update functions #560

This commit is contained in:
Daniël van Noord
2021-02-21 10:40:52 +01:00
parent e4e364ade3
commit e2d5c7e6e2
2 changed files with 13 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -15,6 +15,14 @@ CM.Main.Loop = function() {
CM.Disp.UpdateAscendState();
}
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
if (CM.Sim.DoSims) {
CM.Cache.CacheIncome();
@@ -71,6 +79,9 @@ CM.Main.DelayInit = function() {
CM.Sim.InitData();
CM.Cache.InitCache();
// Stored to check if we need to re-initiliaze data
CM.Main.LastModCount = Object.keys(Game.mods).length
// Creating visual elements
CM.Disp.CreateCssArea();
CM.Disp.CreateBotBar();
@@ -98,6 +109,7 @@ CM.Main.DelayInit = function() {
else Game.Notify('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' loaded!', '', '', 1, 1);
Game.Win('Third-party');
};
/********