mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-28 07:12:30 +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);
|
.appendTo(menu);
|
||||||
|
|
||||||
$('<span>')
|
$('<span>')
|
||||||
.addClass('menuBtn')
|
.addClass('hyper menuBtn')
|
||||||
.text(_('hyper.'))
|
.text(_('hyper.'))
|
||||||
.click(function(){
|
.click(Engine.triggerHyperMode)
|
||||||
Engine.options.doubleTime = !Engine.options.doubleTime;
|
|
||||||
if(Engine.options.doubleTime)
|
|
||||||
$(this).text(_('classic.'));
|
|
||||||
else
|
|
||||||
$(this).text(_('hyper.'));
|
|
||||||
})
|
|
||||||
.appendTo(menu);
|
.appendTo(menu);
|
||||||
|
|
||||||
$('<span>')
|
$('<span>')
|
||||||
@@ -220,6 +214,14 @@
|
|||||||
Ship.init();
|
Ship.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($SM.get('config.lightsOff', true)){
|
||||||
|
Engine.turnLightsOff();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($SM.get('config.hyperMode', true)){
|
||||||
|
Engine.triggerHyperMode();
|
||||||
|
}
|
||||||
|
|
||||||
Engine.saveLanguage();
|
Engine.saveLanguage();
|
||||||
Engine.travelTo(Room);
|
Engine.travelTo(Room);
|
||||||
|
|
||||||
@@ -476,16 +478,29 @@
|
|||||||
if (darkCss == null) {
|
if (darkCss == null) {
|
||||||
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
|
$('head').append('<link rel="stylesheet" href="css/dark.css" type="text/css" title="darkenLights" />');
|
||||||
$('.lightsOff').text(_('lights on.'));
|
$('.lightsOff').text(_('lights on.'));
|
||||||
|
$SM.set('config.lightsOff', true, true);
|
||||||
} else if (darkCss.disabled) {
|
} else if (darkCss.disabled) {
|
||||||
darkCss.disabled = false;
|
darkCss.disabled = false;
|
||||||
$('.lightsOff').text(_('lights on.'));
|
$('.lightsOff').text(_('lights on.'));
|
||||||
|
$SM.set('config.lightsOff', true,true);
|
||||||
} else {
|
} else {
|
||||||
$("#darkenLights").attr("disabled", "disabled");
|
$("#darkenLights").attr("disabled", "disabled");
|
||||||
darkCss.disabled = true;
|
darkCss.disabled = true;
|
||||||
$('.lightsOff').text(_('lights off.'));
|
$('.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
|
// Gets a guid
|
||||||
getGuid: function() {
|
getGuid: function() {
|
||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
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
|
'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
|
'outfit', // used to temporarily store the items to be taken on the path
|
||||||
|
'config'
|
||||||
];
|
];
|
||||||
|
|
||||||
for(var which in cats) {
|
for(var which in cats) {
|
||||||
|
|||||||
Reference in New Issue
Block a user