mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-30 16:48:12 +01:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Selis
Kashargul
parent
06f0821bcf
commit
f7219329ca
@@ -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]", "Solar Central Government", "Central Command Job Boards", "Supply") // YW EDIT
|
||||
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) // CH edit begins here; this allows borgs to use fax machines, meant for the Unity and Clerical modules.
|
||||
user.set_machine(src)
|
||||
@@ -80,7 +80,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
|
||||
|
||||
@@ -150,7 +150,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)
|
||||
@@ -253,7 +253,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
|
||||
|
||||
@@ -304,8 +304,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()
|
||||
@@ -328,7 +328,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)
|
||||
|
||||
@@ -383,7 +383,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
|
||||
|
||||
|
||||
@@ -402,7 +402,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))
|
||||
|
||||
@@ -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>")
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user