Check for delayed events

This triggers onload for all those events whose (possible) reward is registered with a time delay.
This commit is contained in:
Andrea Rendine
2015-05-09 02:17:42 +02:00
committed by Blake Grotewold
parent cb717b41d0
commit da0d39b579
4 changed files with 126 additions and 34 deletions
+17 -1
View File
@@ -37,7 +37,8 @@ var StateManager = {
'playStats', //anything play related: play time, loads, etc
'previous', // prestige, score, trophies (in future), achievements (again, not yet), etc
'outfit', // used to temporarily store the items to be taken on the path
'config'
'config',
'wait' // mysterious wanderers are coming back
];
for(var which in cats) {
@@ -192,6 +193,21 @@ var StateManager = {
}
},
removeBranch(stateName, noEvent) {
for(var i in $SM.get(stateName)){
if(typeof $SM.get(stateName)[i] == 'object'){
$SM.removeBranch(stateName +'["'+ i +'"]');
}
}
if($.isEmptyObject($SM.get(stateName))){
$SM.remove(stateName);
}
if(!noEvent){
Engine.saveGame();
$SM.fireUpdate(stateName);
}
},
//creates full reference from input
//hopefully this won't ever need to be more complicated
buildPath: function(input){