Minor Nightmode Fixes (#1305)

bugfix: "Global nightmode toggle no longer affects security as was originally intended."
tweak: "Manually turning on nightmode will prevent the automatic system from turning it off."
This commit is contained in:
Lohikar
2016-12-25 17:42:40 -06:00
committed by skull132
parent 4f32cc1231
commit 7375af6c19
6 changed files with 18 additions and 3 deletions
@@ -3,6 +3,7 @@ var/datum/controller/process/night_lighting/nl_ctrl
/datum/controller/process/night_lighting/
var/isactive = 0
var/firstrun = 1
var/manual_override = 0
/datum/controller/process/night_lighting/proc/is_active()
return isactive
@@ -28,6 +29,8 @@ var/datum/controller/process/night_lighting/nl_ctrl
/datum/controller/process/night_lighting/doWork()
if (manual_override) // don't automatically change lighting if it was manually changed in-game
return
switch (worldtime2ticks())
if (0 to config.nl_finish)
+3 -1
View File
@@ -1435,10 +1435,12 @@ area/space/atmosalert()
//Security
/area/security
no_light_control = 1
/area/security/main
name = "\improper Security Office"
icon_state = "security"
no_light_control = 1
/area/security/lobby
name = "\improper Security Lobby"
@@ -15,6 +15,11 @@
// whether to only select areas explicitly marked for nightlighting
var/wl_only = context == "all" ? 0 : 1
if (!wl_only && lstate == "dark")
nl_ctrl.manual_override = 1
else if (!wl_only)
nl_ctrl.manual_override = 0
if (lstate == "dark")
log_and_message_admins("enabled night-mode [wl_only ? "in public areas" : "globally"].", lusr)
nl_ctrl.activate(wl_only)
+1 -1
View File
@@ -903,7 +903,7 @@
return 1
if (href_list["lmode"])
src.toggle_nightlight()
src.toggle_nightlight(href_list["lmode"])
update_icon()
else if(!istype(usr, /mob/living/silicon) && (locked && !emagged))
+5
View File
@@ -0,0 +1,5 @@
author: Lohikar
delete-after: True
changes:
- bugfix: "Global nightmode toggle no longer affects security as was originally intended."
- tweak: "Manually turning on nightmode will prevent the automatic system from turning it off."
+1 -1
View File
@@ -108,7 +108,7 @@
Night Lighting:
</div>
<div class="itemContent"; style="width: 105px">
{{:helper.link('On', 'night', {'lmode' : 1}, data.lightingMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'lmode' : 1}, data.lightingMode ? null : 'selected')}}
{{:helper.link('On', 'night', {'lmode' : 'on'}, data.lightingMode ? 'selected' : null)}}{{:helper.link('Off', 'close', {'lmode' : 'off'}, data.lightingMode ? null : 'selected')}}
</div>
</div>