mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 23:48:28 +01:00
Refactor: refactor security levels (#21899)
* refactor: datumize security levels * refactor: implement `SSsecurity_level` for handling security level related stuff * feat: returns back old `delta_alarm` sound * refactor: adjust existing code to use `SSsecurity_level` * fix: remove redundunt new init order * fix: fix type in var * refactor: apply reviewer changes * fix: replace `can_fire=FALSE` with `ss_flags = SS_NO_FIRE`, as subsystem will never fire * fix: use `flags` instead of `ss_flags` for subsystem Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> * fix: replace old security level interactions * feat: implement `Recover` proc for `SSsecurity_level` * refactor: add clearer doc for `security_level_set_timer_id` propery of `SSsecurirt_level` * refactor: swap `security_level` datum properties to make it clearer to read * refactor: move initialization code from `New` to `Initialize` for `/obj/machinery/firealarm` * fix: revert back `delta_alarm` annoing sound, use `delta_claxon` on change to delta security level --------- Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
|
||||
/obj/machinery/keycard_auth/ui_data()
|
||||
var/list/data = list()
|
||||
data["redAvailable"] = GLOB.security_level == SEC_LEVEL_RED ? FALSE : TRUE
|
||||
data["redAvailable"] = SSsecurity_level.get_current_level_as_number() != SEC_LEVEL_RED
|
||||
data["swiping"] = swiping
|
||||
data["busy"] = busy
|
||||
data["event"] = active && event_source && event_source.event ? event_source.event : event
|
||||
@@ -172,7 +172,7 @@
|
||||
SHOULD_NOT_SLEEP(TRUE) // trigger_armed_response_team sleeps, which can cause issues for procs that call trigger_event(). We want to avoid that
|
||||
switch(event)
|
||||
if("Red Alert")
|
||||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(set_security_level), SEC_LEVEL_RED)
|
||||
INVOKE_ASYNC(SSsecurity_level, TYPE_PROC_REF(/datum/controller/subsystem/security_level, set_level), SEC_LEVEL_RED)
|
||||
if("Grant Emergency Maintenance Access")
|
||||
make_maint_all_access()
|
||||
if("Revoke Emergency Maintenance Access")
|
||||
|
||||
Reference in New Issue
Block a user