mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Hyper mode and LightsOff is now stored in the State
This commit is contained in:
committed by
Blake Grotewold
parent
f85b8fdf7e
commit
8320156f42
+23
-8
@@ -140,15 +140,9 @@
|
||||
.appendTo(menu);
|
||||
|
||||
$('<span>')
|
||||
.addClass('menuBtn')
|
||||
.addClass('hyper menuBtn')
|
||||
.text(_('hyper.'))
|
||||
.click(function(){
|
||||
Engine.options.doubleTime = !Engine.options.doubleTime;
|
||||
if(Engine.options.doubleTime)
|
||||
$(this).text(_('classic.'));
|
||||
else
|
||||
$(this).text(_('hyper.'));
|
||||
})
|
||||
.click(Engine.triggerHyperMode)
|
||||
.appendTo(menu);
|
||||
|
||||
$('<span>')
|
||||
@@ -220,6 +214,14 @@
|
||||
Ship.init();
|
||||
}
|
||||
|
||||
if($SM.get('config.lightsOff', true)){
|
||||
Engine.turnLightsOff();
|
||||
}
|
||||
|
||||
if($SM.get('config.hyperMode', true)){
|
||||
Engine.triggerHyperMode();
|
||||
}
|
||||
|
||||
Engine.saveLanguage();
|
||||
Engine.travelTo(Room);
|
||||
|
||||
@@ -476,16 +478,29 @@
|
||||
if (darkCss == null) {
|
||||
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
|
||||
$('.lightsOff').text(_('lights on.'));
|
||||
$SM.set('config.lightsOff', true, true);
|
||||
} else if (darkCss.disabled) {
|
||||
darkCss.disabled = false;
|
||||
$('.lightsOff').text(_('lights on.'));
|
||||
$SM.set('config.lightsOff', true,true);
|
||||
} else {
|
||||
$("#darkenLights").attr("disabled", "disabled");
|
||||
darkCss.disabled = true;
|
||||
$('.lightsOff').text(_('lights off.'));
|
||||
$SM.set('config.lightsOff', false, true);
|
||||
}
|
||||
},
|
||||
|
||||
triggerHyperMode: function(){
|
||||
Engine.options.doubleTime = !Engine.options.doubleTime;
|
||||
if(Engine.options.doubleTime)
|
||||
$('.hyper').text(_('classic.'));
|
||||
else
|
||||
$('.hyper').text(_('hyper.'));
|
||||
|
||||
$SM.set('config.hyperMode', Engine.options.doubleTime, false);
|
||||
},
|
||||
|
||||
// Gets a guid
|
||||
getGuid: function() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
|
||||
@@ -36,7 +36,8 @@ var StateManager = {
|
||||
'game', //mostly location related: fire temp, workers, population, world map, etc
|
||||
'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
|
||||
'outfit', // used to temporarily store the items to be taken on the path
|
||||
'config'
|
||||
];
|
||||
|
||||
for(var which in cats) {
|
||||
|
||||
Reference in New Issue
Block a user