mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-19 03:49:10 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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."
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user