Complete overhaul of code structure and relevant files (#639)

This commit is contained in:
Daniël van Noord
2021-03-14 00:41:14 +01:00
committed by GitHub
parent bb34bce9a5
commit 1bffb58782
163 changed files with 7369 additions and 10882 deletions

17
src/InitSaveLoad/load.js Normal file
View File

@@ -0,0 +1,17 @@
import { LoadConfig } from '../Config/SaveLoadReload/SaveLoadReloadSettings';
import { VersionMajor, VersionMinor } from '../Data/Moddata';
import InitData from '../Sim/InitializeData/InitData';
/**
* This creates a load function to the CM object. Per Game code/comments:
* "do stuff with the string data you saved previously"
*/
export default function load(str) {
const save = JSON.parse(str);
InitData();
LoadConfig(save.settings);
if (save.version !== `${VersionMajor}.${VersionMinor}`) {
if (Game.prefs.popups) Game.Popup('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!');
else Game.Notify('A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', '', '', 0, 1);
}
}