mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Global variable wrappers (#25325)
* Add the system for managed global variables * Travis ban old globals * So you CAN inline proccall, that's neat * Fix that * master.dm * Remove the hack procs * Move InitGlobals to the proper spot * configuration.dm * Fix the missing pre-slash * clockcult.dm * This is probably for the best * Doy * Fix shit * Rest of the DEFINES tree * Fix * Use global. for access * Update find_references_in_globals Always hated that proc Whoever made it must've bee a r e a l idiot... * __HELPERS tree * Move global initialization to master. Fix the declaration * database.dm * Dat newline * I said DECLARATIVE order! * Here's something you can chew on @Iamgoofball * game_modes.dm * Fix this * genetics.dm * flavor_misc.dm * More stuff * Do it mso's way. Keep the controllers as global * Make master actually see it * Fix * Finish _globalvars/lists * Finish the rest of the _globalvars tree * This is weird * Migrate the controllers * SLOTH -> GLOB * Lighting globals * round_start_time -> ticker * PAI card list -> pai SS * record_id_num -> static * Diseases list -> SSdisease * More disease globals to the SS * More disease stuff * Emote list * Better and better * Bluh * So much stuff * Ahh * Wires * dview * station_areas * Teleportlocs * blood_splatter_icons * Stuff and such * More stuff * RAD IO * More stuff and such * Blob shit * Changeling stuff * Add "Balance" to changelogs * Balance for changelog compiler + Auto Tagging * Update the PR template * hivemind_bank * Bip * sacrificed * Good shit * Better define * More cult shit * Devil shit * Gang shit * > borers Fix shit * Rename the define * Nuke * Objectives * Sandbox * Multiverse sword * Announce systems * Stuff and such * TC con * Airlock * doppllllerrrrrr * holopads * Shut up byond you inconsistent fuck * Sneaky fuck * Burp * Bip * Fixnshit * Port without regard * askdlfjs; * asdfjasoidojfi * Protected globals and more * SO MANY * ajsimkvahsaoisd * akfdsiaopwimfeoiwafaw * gsdfigjosidjfgiosdg * AHHHHHHHHHHHHHHHHHHHHHHH!!!!! * facerolll * ASDFASDFASDF * Removes the unused parts of dmm_suite * WIP * Fix quote * asdfjauwfnkjs * afwlunhskjfda * asfjlaiwuefhaf * SO CLOSE * wwwweeeeeewwwww * agdgmoewranwg * HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!? * Fix syntax errors * 100 errors * Another 100 * So many... * Ugh * More shit * kilme * Stuuuuuufffff * ajrgmrlshio;djfa;sdkl * jkbhkhjbmjvjmh * soi soi soi * butt * TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING * lllllllllllllllllllllllllllllllllllllllllll * afsdijfiawhnflnjhnwsdfs * yugykihlugk,kj * time to go * STUFFF!!! * AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!! * ngoaijdjlfkamsdlkf * Break time * aufjsdklfalsjfi * CONTROL KAY AND PRAY * IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * Goteem * Fix testing mode * This does not belong in this PR * Convert it to a controller * Eh, fuck this option * Revert controllerization Ill do it some other time * Fix * Working controllerization * FOR THE LOVE OF CHRIST PROTECT THE LOGS * Protect admins and deadmins * Use the inbuilt proc
This commit is contained in:
committed by
duncathan salt
parent
e550f019b0
commit
9e1ef0ffe2
@@ -1,4 +1,4 @@
|
||||
var/datum/events/keycard_events = new()
|
||||
GLOBAL_DATUM_INIT(keycard_events, /datum/events, new)
|
||||
|
||||
/obj/machinery/keycard_auth
|
||||
name = "Keycard Authentication Device"
|
||||
@@ -10,7 +10,7 @@ var/datum/events/keycard_events = new()
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 6
|
||||
power_channel = ENVIRON
|
||||
req_access = list(access_keycard_auth)
|
||||
req_access = list(GLOB.access_keycard_auth)
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/datum/callback/ev
|
||||
var/event = ""
|
||||
@@ -20,15 +20,15 @@ var/datum/events/keycard_events = new()
|
||||
|
||||
/obj/machinery/keycard_auth/New()
|
||||
. = ..()
|
||||
ev = keycard_events.addEvent("triggerEvent", CALLBACK(src, .proc/triggerEvent))
|
||||
ev = GLOB.keycard_events.addEvent("triggerEvent", CALLBACK(src, .proc/triggerEvent))
|
||||
|
||||
/obj/machinery/keycard_auth/Destroy()
|
||||
keycard_events.clearEvent("triggerEvent", ev)
|
||||
GLOB.keycard_events.clearEvent("triggerEvent", ev)
|
||||
qdel(ev)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/keycard_auth/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "keycard_auth", name, 375, 125, master_ui, state)
|
||||
@@ -39,7 +39,7 @@ var/datum/events/keycard_events = new()
|
||||
data["waiting"] = waiting
|
||||
data["auth_required"] = event_source ? event_source.event : 0
|
||||
data["red_alert"] = (seclevel2num(get_security_level()) >= SEC_LEVEL_RED) ? 1 : 0
|
||||
data["emergency_maint"] = emergency_access
|
||||
data["emergency_maint"] = GLOB.emergency_access
|
||||
return data
|
||||
|
||||
/obj/machinery/keycard_auth/ui_status(mob/user)
|
||||
@@ -72,7 +72,7 @@ var/datum/events/keycard_events = new()
|
||||
triggerer = usr
|
||||
event = event_type
|
||||
waiting = 1
|
||||
keycard_events.fireEvent("triggerEvent", src)
|
||||
GLOB.keycard_events.fireEvent("triggerEvent", src)
|
||||
addtimer(CALLBACK(src, .proc/eventSent), 20)
|
||||
|
||||
/obj/machinery/keycard_auth/proc/eventSent()
|
||||
@@ -101,14 +101,14 @@ var/datum/events/keycard_events = new()
|
||||
feedback_inc("alert_keycard_auth_maint",1)
|
||||
|
||||
|
||||
/var/emergency_access = 0
|
||||
GLOBAL_VAR_INIT(emergency_access, FALSE)
|
||||
/proc/make_maint_all_access()
|
||||
for(var/area/maintenance/A in world)
|
||||
for(var/obj/machinery/door/airlock/D in A)
|
||||
D.emergency = 1
|
||||
D.update_icon(0)
|
||||
minor_announce("Access restrictions on maintenance and external airlocks have been lifted.", "Attention! Station-wide emergency declared!",1)
|
||||
emergency_access = 1
|
||||
GLOB.emergency_access = TRUE
|
||||
|
||||
/proc/revoke_maint_all_access()
|
||||
for(var/area/maintenance/A in world)
|
||||
@@ -116,4 +116,4 @@ var/datum/events/keycard_events = new()
|
||||
D.emergency = 0
|
||||
D.update_icon(0)
|
||||
minor_announce("Access restrictions in maintenance areas have been restored.", "Attention! Station-wide emergency rescinded:")
|
||||
emergency_access = 0
|
||||
GLOB.emergency_access = FALSE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/var/security_level = 0
|
||||
GLOBAL_VAR_INIT(security_level, 0)
|
||||
//0 = code green
|
||||
//1 = code blue
|
||||
//2 = code red
|
||||
@@ -18,21 +18,21 @@
|
||||
level = SEC_LEVEL_DELTA
|
||||
|
||||
//Will not be announced if you try to set to the same level as it already is
|
||||
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level)
|
||||
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
|
||||
switch(level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
minor_announce(config.alert_desc_green, "Attention! Security level lowered to green:")
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(security_level >= SEC_LEVEL_RED)
|
||||
if(GLOB.security_level >= SEC_LEVEL_RED)
|
||||
SSshuttle.emergency.modTimer(4)
|
||||
else
|
||||
SSshuttle.emergency.modTimer(2)
|
||||
security_level = SEC_LEVEL_GREEN
|
||||
for(var/obj/machinery/firealarm/FA in machines)
|
||||
GLOB.security_level = SEC_LEVEL_GREEN
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(FA.z == ZLEVEL_STATION)
|
||||
FA.update_icon()
|
||||
if(SEC_LEVEL_BLUE)
|
||||
if(security_level < SEC_LEVEL_BLUE)
|
||||
if(GLOB.security_level < SEC_LEVEL_BLUE)
|
||||
minor_announce(config.alert_desc_blue_upto, "Attention! Security level elevated to blue:",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
@@ -40,50 +40,50 @@
|
||||
minor_announce(config.alert_desc_blue_downto, "Attention! Security level lowered to blue:")
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
SSshuttle.emergency.modTimer(2)
|
||||
security_level = SEC_LEVEL_BLUE
|
||||
for(var/obj/machinery/firealarm/FA in machines)
|
||||
GLOB.security_level = SEC_LEVEL_BLUE
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(FA.z == ZLEVEL_STATION)
|
||||
FA.update_icon()
|
||||
if(SEC_LEVEL_RED)
|
||||
if(security_level < SEC_LEVEL_RED)
|
||||
if(GLOB.security_level < SEC_LEVEL_RED)
|
||||
minor_announce(config.alert_desc_red_upto, "Attention! Code red!",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(security_level == SEC_LEVEL_GREEN)
|
||||
if(GLOB.security_level == SEC_LEVEL_GREEN)
|
||||
SSshuttle.emergency.modTimer(0.25)
|
||||
else
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
else
|
||||
minor_announce(config.alert_desc_red_downto, "Attention! Code red!")
|
||||
security_level = SEC_LEVEL_RED
|
||||
GLOB.security_level = SEC_LEVEL_RED
|
||||
|
||||
/* - At the time of commit, setting status displays didn't work properly
|
||||
var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world)
|
||||
if(CC)
|
||||
CC.post_status("alert", "redalert")*/
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in machines)
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(FA.z == ZLEVEL_STATION)
|
||||
FA.update_icon()
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in machines)
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
|
||||
pod.admin_controlled = 0
|
||||
if(SEC_LEVEL_DELTA)
|
||||
minor_announce(config.alert_desc_delta, "Attention! Delta security level reached!",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(security_level == SEC_LEVEL_GREEN)
|
||||
if(GLOB.security_level == SEC_LEVEL_GREEN)
|
||||
SSshuttle.emergency.modTimer(0.25)
|
||||
else if(security_level == SEC_LEVEL_BLUE)
|
||||
else if(GLOB.security_level == SEC_LEVEL_BLUE)
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
security_level = SEC_LEVEL_DELTA
|
||||
for(var/obj/machinery/firealarm/FA in machines)
|
||||
GLOB.security_level = SEC_LEVEL_DELTA
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(FA.z == ZLEVEL_STATION)
|
||||
FA.update_icon()
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in machines)
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
|
||||
pod.admin_controlled = 0
|
||||
else
|
||||
return
|
||||
|
||||
/proc/get_security_level()
|
||||
switch(security_level)
|
||||
switch(GLOB.security_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
return "green"
|
||||
if(SEC_LEVEL_BLUE)
|
||||
|
||||
Reference in New Issue
Block a user