mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 03:26:37 +01:00
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:
@@ -21,7 +21,7 @@ If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to
|
||||
If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2
|
||||
By design, d1 is the smallest direction and d2 is the highest
|
||||
*/
|
||||
var/list/possible_cable_coil_colours = list(
|
||||
GLOBAL_LIST_INIT(possible_cable_coil_colours, list(
|
||||
"White" = COLOR_WHITE,
|
||||
"Silver" = COLOR_SILVER,
|
||||
"Gray" = COLOR_GRAY,
|
||||
@@ -41,7 +41,7 @@ var/list/possible_cable_coil_colours = list(
|
||||
"Orange" = COLOR_ORANGE,
|
||||
"Beige" = COLOR_BEIGE,
|
||||
"Brown" = COLOR_BROWN
|
||||
)
|
||||
))
|
||||
|
||||
/obj/structure/cable
|
||||
level = 1
|
||||
@@ -589,9 +589,9 @@ var/list/possible_cable_coil_colours = list(
|
||||
if(!selected_color)
|
||||
return
|
||||
|
||||
var/final_color = possible_cable_coil_colours[selected_color]
|
||||
var/final_color = GLOB.possible_cable_coil_colours[selected_color]
|
||||
if(!final_color)
|
||||
final_color = possible_cable_coil_colours["Red"]
|
||||
final_color = GLOB.possible_cable_coil_colours["Red"]
|
||||
selected_color = "red"
|
||||
color = final_color
|
||||
to_chat(user, span_notice("You change \the [src]'s color to [lowertext(selected_color)]."))
|
||||
@@ -604,7 +604,7 @@ var/list/possible_cable_coil_colours = list(
|
||||
|
||||
/obj/item/stack/cable_coil/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
var/selected_type = tgui_input_list(user, "Pick new colour.", "Cable Colour", possible_cable_coil_colours)
|
||||
var/selected_type = tgui_input_list(user, "Pick new colour.", "Cable Colour", GLOB.possible_cable_coil_colours)
|
||||
set_cable_color(selected_type, user)
|
||||
return
|
||||
return ..()
|
||||
@@ -630,7 +630,7 @@ var/list/possible_cable_coil_colours = list(
|
||||
set name = "Change Colour"
|
||||
set category = "Object"
|
||||
|
||||
var/selected_type = tgui_input_list(usr, "Pick new colour.", "Cable Colour", possible_cable_coil_colours)
|
||||
var/selected_type = tgui_input_list(usr, "Pick new colour.", "Cable Colour", GLOB.possible_cable_coil_colours)
|
||||
set_cable_color(selected_type, usr)
|
||||
|
||||
// Items usable on a cable coil :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/list/fusion_reactions
|
||||
GLOBAL_LIST(fusion_reactions)
|
||||
|
||||
/decl/fusion_reaction
|
||||
var/p_react = "" // Primary reactant.
|
||||
@@ -15,21 +15,21 @@ var/list/fusion_reactions
|
||||
return 0
|
||||
|
||||
/proc/get_fusion_reaction(var/p_react, var/s_react, var/m_energy)
|
||||
if(!fusion_reactions)
|
||||
fusion_reactions = list()
|
||||
if(!GLOB.fusion_reactions)
|
||||
GLOB.fusion_reactions = list()
|
||||
for(var/rtype in subtypesof(/decl/fusion_reaction))
|
||||
var/decl/fusion_reaction/cur_reaction = new rtype()
|
||||
if(!fusion_reactions[cur_reaction.p_react])
|
||||
fusion_reactions[cur_reaction.p_react] = list()
|
||||
fusion_reactions[cur_reaction.p_react][cur_reaction.s_react] = cur_reaction
|
||||
if(!fusion_reactions[cur_reaction.s_react])
|
||||
fusion_reactions[cur_reaction.s_react] = list()
|
||||
fusion_reactions[cur_reaction.s_react][cur_reaction.p_react] = cur_reaction
|
||||
if(!GLOB.fusion_reactions[cur_reaction.p_react])
|
||||
GLOB.fusion_reactions[cur_reaction.p_react] = list()
|
||||
GLOB.fusion_reactions[cur_reaction.p_react][cur_reaction.s_react] = cur_reaction
|
||||
if(!GLOB.fusion_reactions[cur_reaction.s_react])
|
||||
GLOB.fusion_reactions[cur_reaction.s_react] = list()
|
||||
GLOB.fusion_reactions[cur_reaction.s_react][cur_reaction.p_react] = cur_reaction
|
||||
|
||||
if(fusion_reactions.Find(p_react))
|
||||
var/list/secondary_reactions = fusion_reactions[p_react]
|
||||
if(GLOB.fusion_reactions.Find(p_react))
|
||||
var/list/secondary_reactions = GLOB.fusion_reactions[p_react]
|
||||
if(secondary_reactions.Find(s_react))
|
||||
return fusion_reactions[p_react][s_react]
|
||||
return GLOB.fusion_reactions[p_react][s_react]
|
||||
|
||||
// Material fuels
|
||||
// deuterium
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/power/supermatter/attack_hand(mob/user as mob)
|
||||
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_warning("\The [user] reaches out and touches \the [src], inducing a resonance... [TU.his] body starts to glow and bursts into flames before flashing into ash."),\
|
||||
span_danger("You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\""),\
|
||||
span_warning("You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat."))
|
||||
@@ -474,7 +474,7 @@
|
||||
return
|
||||
if(isliving(AM))
|
||||
var/mob/living/M = AM
|
||||
var/datum/gender/T = gender_datums[M.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[M.get_visible_gender()]
|
||||
AM.visible_message(span_warning("\The [AM] slams into \the [src] inducing a resonance... [T.his] body starts to glow and catch flame before flashing into ash."),\
|
||||
span_danger("You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\""),\
|
||||
span_warning("You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat."))
|
||||
|
||||
Reference in New Issue
Block a user