mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-11 15:07:12 +08:00
Merge pull request #196 from rgravina/162_save_path_outfit
Include state of Path outfit in save game
This commit is contained in:
+5
-1
@@ -46,7 +46,7 @@ var Path = {
|
|||||||
cooldown: World.DEATH_COOLDOWN
|
cooldown: World.DEATH_COOLDOWN
|
||||||
}).appendTo(this.panel);
|
}).appendTo(this.panel);
|
||||||
|
|
||||||
Path.outfit = {};
|
Path.outfit = $SM.get('outfit');
|
||||||
|
|
||||||
Engine.updateSlider();
|
Engine.updateSlider();
|
||||||
|
|
||||||
@@ -269,6 +269,7 @@ var Path = {
|
|||||||
var maxExtraByStore = $SM.get('stores["'+supply+'"]', true) - cur;
|
var maxExtraByStore = $SM.get('stores["'+supply+'"]', true) - cur;
|
||||||
var maxExtraByBtn = btn.data;
|
var maxExtraByBtn = btn.data;
|
||||||
Path.outfit[supply] = cur + Math.min(maxExtraByBtn, Math.min(maxExtraByWeight, maxExtraByStore));
|
Path.outfit[supply] = cur + Math.min(maxExtraByBtn, Math.min(maxExtraByWeight, maxExtraByStore));
|
||||||
|
$SM.set('outfit['+supply+']', Path.outfit[supply])
|
||||||
Path.updateOutfitting();
|
Path.updateOutfitting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -280,6 +281,7 @@ var Path = {
|
|||||||
cur = typeof cur == 'number' ? cur : 0;
|
cur = typeof cur == 'number' ? cur : 0;
|
||||||
if(cur > 0) {
|
if(cur > 0) {
|
||||||
Path.outfit[supply] = Math.max(0, cur - btn.data);
|
Path.outfit[supply] = Math.max(0, cur - btn.data);
|
||||||
|
$SM.set('outfit['+supply+']', Path.outfit[supply])
|
||||||
Path.updateOutfitting();
|
Path.updateOutfitting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -288,6 +290,7 @@ var Path = {
|
|||||||
Path.setTitle();
|
Path.setTitle();
|
||||||
Path.updateOutfitting();
|
Path.updateOutfitting();
|
||||||
Path.updatePerks(true);
|
Path.updatePerks(true);
|
||||||
|
$SM.set('outfit', Path.outfit);
|
||||||
|
|
||||||
Engine.moveStoresView($('#perks'), transition_diff);
|
Engine.moveStoresView($('#perks'), transition_diff);
|
||||||
},
|
},
|
||||||
@@ -300,6 +303,7 @@ var Path = {
|
|||||||
for(var k in Path.outfit) {
|
for(var k in Path.outfit) {
|
||||||
$SM.add('stores["'+k+'"]', -Path.outfit[k]);
|
$SM.add('stores["'+k+'"]', -Path.outfit[k]);
|
||||||
}
|
}
|
||||||
|
$SM.remove('outfit');
|
||||||
World.onArrival();
|
World.onArrival();
|
||||||
$('#outerSlider').animate({left: '-700px'}, 300);
|
$('#outerSlider').animate({left: '-700px'}, 300);
|
||||||
Engine.activeModule = World;
|
Engine.activeModule = World;
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ var StateManager = {
|
|||||||
'timers',
|
'timers',
|
||||||
'game', //mostly location related: fire temp, workers, population, world map, etc
|
'game', //mostly location related: fire temp, workers, population, world map, etc
|
||||||
'playStats', //anything play related: play time, loads, etc
|
'playStats', //anything play related: play time, loads, etc
|
||||||
'previous' // prestige, score, trophies (in future), achievements (again, not yet), 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
|
||||||
];
|
];
|
||||||
|
|
||||||
for(var which in cats) {
|
for(var which in cats) {
|
||||||
|
|||||||
Reference in New Issue
Block a user