Conversion many Globals to Managed Globals (Part 1) (#17121)

* Conversion of some Globals to Managed Globals

* Fix

* for later

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-04-17 20:16:53 +02:00
committed by GitHub
parent 6a47a779d5
commit 21dcf0555b
229 changed files with 1227 additions and 1220 deletions
+14 -14
View File
@@ -1,9 +1,9 @@
var/list/obj/machinery/photocopier/faxmachine/allfaxes = list()
GLOBAL_LIST_EMPTY_TYPED(allfaxes, /obj/machinery/photocopier/faxmachine)
var/list/admin_departments = list("[using_map.boss_name]", "Virgo-Prime Governmental Authority", "Virgo-Erigonne Job Boards", "Supply")
var/list/alldepartments = list()
var/global/last_fax_role_request
GLOBAL_LIST_EMPTY(alldepartments)
GLOBAL_VAR(last_fax_role_request)
var/list/adminfaxes = list() //cache for faxes that have been sent to admins
GLOBAL_LIST_EMPTY(adminfaxes) //cache for faxes that have been sent to admins
/obj/machinery/photocopier/faxmachine
name = "fax machine"
@@ -30,10 +30,10 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
/obj/machinery/photocopier/faxmachine/Initialize(mapload)
. = ..()
allfaxes += src
GLOB.allfaxes += src
if(!destination) destination = "[using_map.boss_name]"
if( !(("[department]" in alldepartments) || ("[department]" in admin_departments)) )
alldepartments |= department
if( !(("[department]" in GLOB.alldepartments) || ("[department]" in admin_departments)) )
GLOB.alldepartments |= department
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob)
user.set_machine(src)
@@ -76,7 +76,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
return
if(L.stat || L.restrained())
return
if(last_fax_role_request && (world.time - last_fax_role_request < 5 MINUTES))
if(GLOB.last_fax_role_request && (world.time - GLOB.last_fax_role_request < 5 MINUTES))
to_chat(L, span_warning("The global automated relays are still recalibrating. Try again later or relay your request in written form for processing."))
return
@@ -146,7 +146,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
message_color = ping_dept.color
message_chat_rolerequest(message_color, ping_name, reason, role)
last_fax_role_request = world.time
GLOB.last_fax_role_request = world.time
to_chat(L, span_notice("Your request was transmitted."))
/obj/machinery/photocopier/faxmachine/tgui_interact(mob/user, datum/tgui/ui)
@@ -249,7 +249,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
if("dept")
var/lastdestination = destination
destination = tgui_input_list(ui.user, "Which department?", "Choose a department", (alldepartments + admin_departments))
destination = tgui_input_list(ui.user, "Which department?", "Choose a department", (GLOB.alldepartments + admin_departments))
if(!destination)
destination = lastdestination
@@ -300,8 +300,8 @@ Extracted to its own procedure for easier logic handling with paper bundles.
to_chat(user, "No input found. Please hang up and try your call again.")
return
department = input
if( !(("[department]" in alldepartments) || ("[department]" in admin_departments)) && !(department == "Unknown"))
alldepartments |= department
if( !(("[department]" in GLOB.alldepartments) || ("[department]" in admin_departments)) && !(department == "Unknown"))
GLOB.alldepartments |= department
else if(istype(O, /obj/item/toner))
if(toner <= 10) //allow replacing when low toner is affecting the print darkness
user.drop_item()
@@ -324,7 +324,7 @@ Extracted to its own procedure for easier logic handling with paper bundles.
use_power(200)
var/success = 0
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes)
if( F.department == destination )
success = F.receivefax(copyitem)
@@ -379,7 +379,7 @@ Extracted to its own procedure for easier logic handling with paper bundles.
return
rcvdcopy.loc = null //hopefully this shouldn't cause trouble
adminfaxes += rcvdcopy
GLOB.adminfaxes += rcvdcopy
//message badmins that a fax has arrived
+1 -1
View File
@@ -377,7 +377,7 @@
/obj/item/paper/proc/burnpaper(obj/item/flame/P, mob/user)
var/class = "warning"
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
if(P.lit && !user.restrained())
if(istype(P, /obj/item/flame/lighter/zippo))
+1 -1
View File
@@ -78,7 +78,7 @@
if(P.lit && !user.restrained())
if(istype(P, /obj/item/flame/lighter/zippo))
class = "rose>"
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
user.visible_message("<span class='[class]'>[user] holds \the [P] up to \the [src], it looks like [TU.he] [TU.is] trying to burn it!</span>", \
"<span class='[class]'>You hold \the [P] up to \the [src], burning it slowly.</span>")
+1 -1
View File
@@ -162,7 +162,7 @@
..()
/obj/item/shreddedp/proc/burnpaper(var/obj/item/flame/lighter/P, var/mob/user)
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
if(user.restrained())
return
if(!P.lit)
+2 -2
View File
@@ -21,7 +21,7 @@
/********
* photo *
********/
var/global/photo_count = 0
GLOBAL_VAR_INIT(photo_count, 0)
/obj/item/photo
name = "photo"
@@ -39,7 +39,7 @@ var/global/photo_count = 0
/obj/item/photo/Initialize(mapload)
. = ..()
id = photo_count++
id = GLOB.photo_count++
/obj/item/photo/attack_self(mob/user as mob)
user.examinate(src)