mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
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:
committed by
Blake Grotewold
parent
cb717b41d0
commit
da0d39b579
+17
-1
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user