Files
CookieMonster/dist/Footer.js
2021-03-09 23:14:47 +01:00

1 line
1.4 KiB
JavaScript

(()=>{if(CM.init=function(){CM.Footer.isInitzializing=!0;let o=!0;Game.version!==Number(CM.VersionMajor)&&(o=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?`)),o&&(CM.Main.DelayInit(),Game.registerHook("draw",CM.Disp.Draw),Game.registerHook("logic",CM.Main.Loop),CM.Footer.isInitzializing=!1)},CM.save=function(){return JSON.stringify({settings:CM.Options,version:`${CM.VersionMajor}.${CM.VersionMinor}`})},CM.load=function(o){const e=JSON.parse(o);CM.Sim.InitData(),CM.Config.LoadConfig(e.settings),e.version!==`${CM.VersionMajor}.${CM.VersionMinor}`&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},CM.Footer.AddJscolor=function(){CM.Footer.Jscolor=document.createElement("script"),CM.Footer.Jscolor.type="text/javascript",CM.Footer.Jscolor.setAttribute("src","https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js"),document.head.appendChild(CM.Footer.Jscolor)},void 0===CM.Footer.isInitzializing){CM.Footer.AddJscolor();const o=setInterval((function(){"undefined"!=typeof jscolor&&(jscolor.init(),Game.registerMod("CookieMonster",CM),clearInterval(o))}),500)}})();