diff --git a/aurorastation.dme b/aurorastation.dme
index d71b823d0dc..07c317507a3 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -3469,6 +3469,7 @@
#include "code\modules\tgui\states\deep_inventory.dm"
#include "code\modules\tgui\states\default.dm"
#include "code\modules\tgui\states\hands.dm"
+#include "code\modules\tgui\states\heavy_vehicle.dm"
#include "code\modules\tgui\states\human_adjacent.dm"
#include "code\modules\tgui\states\human_adjacent_loc.dm"
#include "code\modules\tgui\states\inventory.dm"
diff --git a/code/controllers/subsystems/ghostroles.dm b/code/controllers/subsystems/ghostroles.dm
index 25258cce46f..9af6bde3f65 100644
--- a/code/controllers/subsystems/ghostroles.dm
+++ b/code/controllers/subsystems/ghostroles.dm
@@ -100,7 +100,7 @@ SUBSYSTEM_DEF(ghostroles)
return get_turf(P)
/datum/controller/subsystem/ghostroles/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/controller/subsystem/ghostroles/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
diff --git a/code/controllers/subsystems/pai.dm b/code/controllers/subsystems/pai.dm
index db7bf4f11bf..94ddfc25182 100644
--- a/code/controllers/subsystems/pai.dm
+++ b/code/controllers/subsystems/pai.dm
@@ -22,7 +22,7 @@ SUBSYSTEM_DEF(pai)
default_pai_software = SSpai.default_pai_software
/datum/controller/subsystem/pai/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/controller/subsystem/pai/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
diff --git a/code/controllers/subsystems/records.dm b/code/controllers/subsystems/records.dm
index 3a646e60559..cc0c6ac53b8 100644
--- a/code/controllers/subsystems/records.dm
+++ b/code/controllers/subsystems/records.dm
@@ -188,7 +188,7 @@ SUBSYSTEM_DEF(records)
update_static_data_for_all_viewers()
/datum/controller/subsystem/records/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/controller/subsystem/records/ui_status(mob/user, datum/ui_state/state)
return (isnewplayer(user) || isobserver(user) || issilicon(user)) ? UI_INTERACTIVE : UI_CLOSE
diff --git a/code/controllers/subsystems/vote.dm b/code/controllers/subsystems/vote.dm
index 7e460fb600b..321b0828285 100644
--- a/code/controllers/subsystems/vote.dm
+++ b/code/controllers/subsystems/vote.dm
@@ -326,7 +326,7 @@ SUBSYSTEM_DEF(vote)
)
/datum/controller/subsystem/vote/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/controller/subsystem/vote/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
diff --git a/code/datums/components/local_network.dm b/code/datums/components/local_network.dm
index 94514ad7c37..fdce8aa8a49 100644
--- a/code/datums/components/local_network.dm
+++ b/code/datums/components/local_network.dm
@@ -54,7 +54,7 @@
/datum/component/local_network_member/proc/get_new_tag(mob/user)
var/new_ident = input(user, "Enter a new ident tag.", "[parent]", id_tag) as null|text
- if(new_ident && parent && user.Adjacent(parent) && CanInteract(user, physical_state))
+ if(new_ident && parent && user.Adjacent(parent) && CanInteract(user, GLOB.physical_state))
return set_tag(user, new_ident)
//
diff --git a/code/datums/late_choices.dm b/code/datums/late_choices.dm
index d50ef425d1f..6c23f9bf353 100755
--- a/code/datums/late_choices.dm
+++ b/code/datums/late_choices.dm
@@ -17,7 +17,7 @@
return ..()
/datum/late_choices/ui_state(mob/user)
- return new_player_state
+ return GLOB.new_player_state
/datum/late_choices/ui_status(mob/user, datum/ui_state/state)
return isnewplayer(user) ? UI_INTERACTIVE : UI_CLOSE
diff --git a/code/datums/tgui_module.dm b/code/datums/tgui_module.dm
index 4c0cc44fda0..88afcf8c18e 100644
--- a/code/datums/tgui_module.dm
+++ b/code/datums/tgui_module.dm
@@ -1,11 +1,11 @@
/datum/tgui_module/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/tgui_module/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
/datum/tgui_module/moderator/ui_state(mob/user)
- return moderator_state
+ return GLOB.moderator_state
/datum/tgui_module/admin/ui_state(mob/user)
- return admin_state
+ return GLOB.admin_state
diff --git a/code/datums/uplink/uplink_items.dm b/code/datums/uplink/uplink_items.dm
index 5f462db5363..ea058a20189 100644
--- a/code/datums/uplink/uplink_items.dm
+++ b/code/datums/uplink/uplink_items.dm
@@ -54,7 +54,7 @@ var/datum/uplink/uplink
if(!can_buy_telecrystals && !can_buy_bluecrystals)
return
- if(U.CanUseTopic(user, inventory_state) != STATUS_INTERACTIVE)
+ if(U.CanUseTopic(user, GLOB.inventory_state) != STATUS_INTERACTIVE)
return
var/goods = get_goods(U, get_turf(user), user, extra_args)
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index d447f453943..f0724be4383 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -277,7 +277,7 @@ var/global/list/wire_name_directory = list()
return UI_CLOSE
/datum/wires/ui_state(mob/user)
- return physical_state
+ return GLOB.physical_state
/datum/wires/ui_interact(mob/user, datum/tgui/ui)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 37b3e2ab123..8111b3f4a83 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -639,7 +639,7 @@ pixel_x = 10;
ui_interact(user)
wires.interact(user)
-/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/ui_state/state = default_state)
+/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/ui_state/state = GLOB.default_state)
var/data = list()
var/remote_connection = 0
var/remote_access = 0
diff --git a/code/game/machinery/autolathe/autolathe.dm b/code/game/machinery/autolathe/autolathe.dm
index 103e78babb4..6305db6669c 100644
--- a/code/game/machinery/autolathe/autolathe.dm
+++ b/code/game/machinery/autolathe/autolathe.dm
@@ -43,15 +43,6 @@
/obj/item/stock_parts/console_screen
)
-/obj/machinery/autolathe/mounted
- name = "\improper mounted autolathe"
- density = FALSE
- anchored = FALSE
- idle_power_usage = FALSE
- active_power_usage = FALSE
- interact_offline = TRUE
- does_flick = FALSE
-
/obj/machinery/autolathe/Initialize()
..()
wires = new(src)
@@ -381,6 +372,18 @@
user.remove_from_mob(O)
qdel(O)
+/obj/machinery/autolathe/mounted
+ name = "\improper mounted autolathe"
+ density = FALSE
+ anchored = FALSE
+ idle_power_usage = FALSE
+ active_power_usage = FALSE
+ interact_offline = TRUE
+ does_flick = FALSE
+
+/obj/machinery/autolathe/mounted/ui_state(mob/user)
+ return GLOB.heavy_vehicle_state
+
/// Queue items are needed so that the queue knows exactly what it's doing.
/datum/autolathe_queue_item
/// The recipe singleton. We need to know exactly what we're making.
diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm
index 504b7975ef8..06db8086692 100644
--- a/code/game/machinery/body_scanner.dm
+++ b/code/game/machinery/body_scanner.dm
@@ -878,7 +878,7 @@
return ..()
/obj/machinery/body_scanconsole/embedded/ui_state(mob/user)
- return human_adjacent_loc_state
+ return GLOB.human_adjacent_loc_state
/obj/machinery/body_scanconsole/embedded/get_connected()
if(monitor_console)
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 4a67b86f8a3..36ce7323ae2 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -159,7 +159,7 @@
..()
queue_icon_update()
-/obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = default_state)
+/obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = GLOB.default_state)
var/data[0]
data["alertLevel"] = get_security_level()
data["time"] = src.time
@@ -294,7 +294,7 @@ Just a object used in constructing fire alarms
A.partyreset()
return
-/obj/machinery/firealarm/partyalarm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = default_state)
+/obj/machinery/firealarm/partyalarm/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = GLOB.default_state)
var/data[0]
data["alertLevel"] = get_security_level()
data["time"] = src.time
diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm
index f52ab445e50..b08bd5e55f5 100644
--- a/code/game/objects/items/devices/tvcamera.dm
+++ b/code/game/objects/items/devices/tvcamera.dm
@@ -42,7 +42,7 @@
popup.set_content(jointext(dat,null))
popup.open()
-/obj/item/device/tvcamera/Topic(bred, href_list, state = physical_state)
+/obj/item/device/tvcamera/Topic(bred, href_list, state = GLOB.physical_state)
if(..())
return 1
if(href_list["channel"])
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index bfb33490395..52a8887900f 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -36,7 +36,7 @@
STOP_PROCESSING(SSprocessing, src)
return ..()
-/obj/Topic(href, href_list, var/datum/ui_state/state = default_state)
+/obj/Topic(href, href_list, var/datum/ui_state/state = GLOB.default_state)
if(..())
return 1
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index cadd924a155..13d3ed83bf9 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -42,7 +42,7 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
- H.change_appearance(APPEARANCE_ALL_HAIR, H, FALSE, ui_state = default_state, state_object = src)
+ H.change_appearance(APPEARANCE_ALL_HAIR, H, FALSE, ui_state = GLOB.default_state, state_object = src)
/obj/structure/mirror/proc/shatter()
if(shattered) return
@@ -185,4 +185,4 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
- H.change_appearance(APPEARANCE_HAIR, H, FALSE, ui_state = default_state, state_object = src)
+ H.change_appearance(APPEARANCE_HAIR, H, FALSE, ui_state = GLOB.default_state, state_object = src)
diff --git a/code/game/objects/structures/under_wardrobe.dm b/code/game/objects/structures/under_wardrobe.dm
index 1242d9f9361..2ddde93d74f 100644
--- a/code/game/objects/structures/under_wardrobe.dm
+++ b/code/game/objects/structures/under_wardrobe.dm
@@ -72,7 +72,7 @@
if(!UWC)
return
var/datum/category_item/underwear/selected_underwear = tgui_input_list(H, "Choose your underwear.", "Choose Underwear", UWC.items, H.all_underwear[UWC.name])
- if(selected_underwear && CanUseTopic(H, default_state))
+ if(selected_underwear && CanUseTopic(H, GLOB.default_state))
H.all_underwear[UWC.name] = selected_underwear
H.hide_underwear[UWC.name] = FALSE
. = TRUE
diff --git a/code/modules/acting/acting_items.dm b/code/modules/acting/acting_items.dm
index 73c1aa4c408..0e059213996 100644
--- a/code/modules/acting/acting_items.dm
+++ b/code/modules/acting/acting_items.dm
@@ -28,7 +28,7 @@
if(!istype(H))
return
- H.change_appearance(APPEARANCE_ALL, H, TRUE, H.generate_valid_species(), null, ui_state = default_state, state_object = src, update_id = TRUE)
+ H.change_appearance(APPEARANCE_ALL, H, TRUE, H.generate_valid_species(), null, ui_state = GLOB.default_state, state_object = src, update_id = TRUE)
var/getName = sanitizeName(sanitize_readd_odd_symbols(sanitize(input(H, "Would you like to change your name to something else?", "Name change") as null|text)))
if(getName)
H.real_name = getName
diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm
index 994750cbcd0..4b874d77175 100644
--- a/code/modules/awaymissions/bluespaceartillery.dm
+++ b/code/modules/awaymissions/bluespaceartillery.dm
@@ -23,7 +23,7 @@
onclose(user, "scroll")
return
-/obj/machinery/computer/artillerycontrol/Topic(href, href_list, var/datum/ui_state/state = default_state)
+/obj/machinery/computer/artillerycontrol/Topic(href, href_list, var/datum/ui_state/state = GLOB.default_state)
if(..())
return 1
diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm
index 966fe31c21b..2f1496f8682 100644
--- a/code/modules/clothing/spacesuits/rig/modules/computer.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm
@@ -23,7 +23,7 @@
to_chat(usr, SPAN_WARNING("Your module is not installed in a hardsuit."))
return
- module.holder.ui_interact(usr, nano_state = contained_state)
+ module.holder.ui_interact(usr, nano_state = GLOB.contained_state)
/mob
var/get_rig_stats = 0
diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm
index 028166cb990..6b5798ffb2e 100644
--- a/code/modules/clothing/spacesuits/rig/rig.dm
+++ b/code/modules/clothing/spacesuits/rig/rig.dm
@@ -489,7 +489,7 @@
cell.use(cost*10)
return 1
-/obj/item/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/nano_state = inventory_state)
+/obj/item/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/nano_state = GLOB.inventory_state)
if(!user)
return
diff --git a/code/modules/ghostroles/spawnpoint/spawnpoint.dm b/code/modules/ghostroles/spawnpoint/spawnpoint.dm
index dda4b375883..4cac828db12 100644
--- a/code/modules/ghostroles/spawnpoint/spawnpoint.dm
+++ b/code/modules/ghostroles/spawnpoint/spawnpoint.dm
@@ -91,7 +91,7 @@
return data
/obj/effect/ghostspawpoint/ui_state(mob/user)
- return observer_state
+ return GLOB.observer_state
/obj/effect/ghostspawpoint/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm
index c8b4f707e68..6192d774b1a 100644
--- a/code/modules/heavy_vehicle/mech_interaction.dm
+++ b/code/modules/heavy_vehicle/mech_interaction.dm
@@ -425,7 +425,7 @@
if(MC && MC.brute_damage)
damaged_parts += MC
var/obj/item/mech_component/to_fix = tgui_input_list(user, "Which component would you like to fix?", "Fix Component", damaged_parts)
- if(CanInteract(user, physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.brute_damage)
+ if(CanInteract(user, GLOB.physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.brute_damage)
to_fix.repair_brute_generic(attacking_item, user)
return
else if(attacking_item.iscoil())
@@ -436,7 +436,7 @@
if(MC && MC.burn_damage)
damaged_parts += MC
var/obj/item/mech_component/to_fix = tgui_input_list(user, "Which component would you like to fix?", "Fix Component", damaged_parts)
- if(CanInteract(user, physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.burn_damage)
+ if(CanInteract(user, GLOB.physical_state) && !QDELETED(to_fix) && (to_fix in src) && to_fix.burn_damage)
to_fix.repair_burn_generic(attacking_item, user)
return
else if(attacking_item.iscrowbar())
diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm
index 3c9f811ae87..f0713a60d85 100644
--- a/code/modules/integrated_electronics/core/assemblies.dm
+++ b/code/modules/integrated_electronics/core/assemblies.dm
@@ -70,7 +70,7 @@
return implant
/obj/item/device/electronic_assembly/proc/check_interactivity(mob/user)
- if(!CanInteract(user, physical_state))
+ if(!CanInteract(user, GLOB.physical_state))
return 0
return 1
diff --git a/code/modules/integrated_electronics/core/device.dm b/code/modules/integrated_electronics/core/device.dm
index b96a3815d57..2b3c6ee55d6 100644
--- a/code/modules/integrated_electronics/core/device.dm
+++ b/code/modules/integrated_electronics/core/device.dm
@@ -99,6 +99,6 @@
. = ..()
/obj/item/device/electronic_assembly/device/check_interactivity(mob/user)
- if(!CanInteract(user, state = deep_inventory_state))
+ if(!CanInteract(user, state = GLOB.deep_inventory_state))
return 0
return 1
diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm
index 00386526209..3edf6478e2b 100644
--- a/code/modules/integrated_electronics/core/integrated_circuit.dm
+++ b/code/modules/integrated_electronics/core/integrated_circuit.dm
@@ -63,7 +63,7 @@ a creative player the means to solve many problems. Circuits are held inside an
/obj/item/integrated_circuit/proc/check_interactivity(mob/user)
if(assembly)
return assembly.check_interactivity(user)
- else if(!CanInteract(user, physical_state))
+ else if(!CanInteract(user, GLOB.physical_state))
return 0
return 1
@@ -180,7 +180,7 @@ a creative player the means to solve many problems. Circuits are held inside an
B.set_content(HTML.Join())
B.open()
-/obj/item/integrated_circuit/Topic(href, href_list, state = always_state)
+/obj/item/integrated_circuit/Topic(href, href_list, state = GLOB.always_state)
if(!check_interactivity(usr))
return
if (assembly && !assembly.opened)
diff --git a/code/modules/integrated_electronics/core/special_pins/list_pin.dm b/code/modules/integrated_electronics/core/special_pins/list_pin.dm
index a7610df5edd..c4f9f67a145 100644
--- a/code/modules/integrated_electronics/core/special_pins/list_pin.dm
+++ b/code/modules/integrated_electronics/core/special_pins/list_pin.dm
@@ -132,7 +132,7 @@
/datum/integrated_io/list/display_pin_type()
return IC_FORMAT_LIST
-/datum/integrated_io/list/Topic(href, href_list, state = always_state)
+/datum/integrated_io/list/Topic(href, href_list, state = GLOB.always_state)
if(!holder.check_interactivity(usr))
return
if(..())
diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm
index c40567e7d25..32d2f9b4b33 100644
--- a/code/modules/integrated_electronics/core/tools.dm
+++ b/code/modules/integrated_electronics/core/tools.dm
@@ -117,7 +117,7 @@
/obj/item/device/integrated_electronics/debugger/attack_self(mob/user)
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
- if(!CanInteract(user, physical_state))
+ if(!CanInteract(user, GLOB.physical_state))
return
var/new_data = null
@@ -125,13 +125,13 @@
if("string")
accepting_refs = 0
new_data = sanitize(input("Now type in a string.","[src] string writing") as null|text, MAX_MESSAGE_LEN, 1, 0, 1)
- if(istext(new_data) && CanInteract(user, physical_state))
+ if(istext(new_data) && CanInteract(user, GLOB.physical_state))
data_to_write = new_data
to_chat(user, "You set \the [src]'s memory to \"[new_data]\".")
if("number")
accepting_refs = 0
new_data = input("Now type in a number.","[src] number writing") as null|num
- if(isnum(new_data) && CanInteract(user, physical_state))
+ if(isnum(new_data) && CanInteract(user, GLOB.physical_state))
data_to_write = new_data
to_chat(user, "You set \the [src]'s memory to [new_data].")
if("ref")
diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm
index a21d459f10b..086505bf726 100644
--- a/code/modules/integrated_electronics/subtypes/memory.dm
+++ b/code/modules/integrated_electronics/subtypes/memory.dm
@@ -91,7 +91,7 @@
/obj/item/integrated_circuit/memory/constant/attack_self(mob/user)
var/datum/integrated_io/O = outputs[1]
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
- if(!CanInteract(user, physical_state))
+ if(!CanInteract(user, GLOB.physical_state))
return
var/new_data = null
@@ -99,13 +99,13 @@
if("string")
accepting_refs = 0
new_data = sanitize(input("Now type in a string.","[src] string writing") as null|text, MAX_MESSAGE_LEN, 1, 0, 1)
- if(istext(new_data) && CanInteract(user, physical_state))
+ if(istext(new_data) && CanInteract(user, GLOB.physical_state))
data = new_data
to_chat(user, "You set \the [src]'s memory to [O.display_data(data)].")
if("number")
accepting_refs = 0
new_data = input("Now type in a number.","[src] number writing") as null|num
- if(isnum(new_data) && CanInteract(user, physical_state))
+ if(isnum(new_data) && CanInteract(user, GLOB.physical_state))
data = new_data
to_chat(user, "You set \the [src]'s memory to [O.display_data(data)].")
if("ref")
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 36042c0a8f3..8a6f8e72e4d 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -63,7 +63,7 @@
add_fingerprint(user)
ui_interact(user)
-/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/ui_state/state = default_state)
+/obj/machinery/mineral/stacking_unit_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/ui_state/state = GLOB.default_state)
if(!setup_machine(user))
return
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
index 8c989abfd8f..6601dd59404 100644
--- a/code/modules/mob/living/carbon/human/appearance.dm
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -1,4 +1,4 @@
-/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/mob/user = src, var/check_species_whitelist = TRUE, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/list/culture_restriction = list(), var/list/origin_restriction = list(), var/datum/ui_state/ui_state = always_state, var/datum/state_object = src, var/update_id = FALSE)
+/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/mob/user = src, var/check_species_whitelist = TRUE, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/list/culture_restriction = list(), var/list/origin_restriction = list(), var/datum/ui_state/ui_state = GLOB.always_state, var/datum/state_object = src, var/update_id = FALSE)
var/datum/tgui_module/appearance_changer/AC = new /datum/tgui_module/appearance_changer(src, check_species_whitelist, species_whitelist, species_blacklist, culture_restriction, origin_restriction, ui_state, state_object, update_id)
AC.flags = flags
AC.ui_interact(user)
diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm
index 57f696513f6..4910c76de05 100644
--- a/code/modules/nano/modules/human_appearance.dm
+++ b/code/modules/nano/modules/human_appearance.dm
@@ -28,7 +28,7 @@
var/list/culture_restrictions = list()
var/list/origin_restrictions = list()
-/datum/tgui_module/appearance_changer/New(var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/list/culture_restriction = list(), var/list/origin_restriction = list(), var/datum/ui_state/set_ui_state = always_state, var/datum/set_state_object = null, var/update_id)
+/datum/tgui_module/appearance_changer/New(var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/list/culture_restriction = list(), var/list/origin_restriction = list(), var/datum/ui_state/set_ui_state = GLOB.always_state, var/datum/set_state_object = null, var/update_id)
..()
ui_state = set_ui_state
state_object = set_state_object
diff --git a/code/modules/nano/modules/nano_module.dm b/code/modules/nano/modules/nano_module.dm
index 8488e24a6d0..00f7bb7d590 100644
--- a/code/modules/nano/modules/nano_module.dm
+++ b/code/modules/nano/modules/nano_module.dm
@@ -12,7 +12,7 @@
/datum/nano_module/ui_host()
return host ? host.ui_host() : src
-/datum/nano_module/proc/can_still_topic(var/datum/ui_state/state = default_state)
+/datum/nano_module/proc/can_still_topic(var/datum/ui_state/state = GLOB.default_state)
return CanUseTopic(usr, state) == STATUS_INTERACTIVE
/datum/nano_module/proc/check_eye(var/mob/user)
diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm
index 678c3811a6f..dc15f0dcd54 100644
--- a/code/modules/nano/nanoexternal.dm
+++ b/code/modules/nano/nanoexternal.dm
@@ -33,7 +33,7 @@
* @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui
* @param force_open boolean Force the UI to (re)open, even if it's already open
*/
-/datum/proc/nanoui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nanoui/master_ui = null, var/datum/ui_state/state = default_state)
+/datum/proc/nanoui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nanoui/master_ui = null, var/datum/ui_state/state = GLOB.default_state)
return
// Used by the Nano UI Manager (/datum/SSnanoui) to track UIs opened by this mob
diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm
index 9289843e82f..6950ca06aee 100644
--- a/code/modules/nano/nanoui.dm
+++ b/code/modules/nano/nanoui.dm
@@ -71,7 +71,7 @@ nanoui is used to open and update nano browser uis
*
* @return /nanoui new nanoui object
*/
-/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/ui_state/state = default_state)
+/datum/nanoui/New(nuser, nsrc_object, nui_key, ntemplate_filename, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, var/datum/nanoui/master_ui = null, var/datum/ui_state/state = GLOB.default_state)
user = nuser
src_object = nsrc_object
ui_key = nui_key
diff --git a/code/modules/overmap/ships/computers/engine_control.dm b/code/modules/overmap/ships/computers/engine_control.dm
index b8b2bf0087f..8755c1de513 100644
--- a/code/modules/overmap/ships/computers/engine_control.dm
+++ b/code/modules/overmap/ships/computers/engine_control.dm
@@ -77,7 +77,7 @@
if(href_list["set_global_limit"])
var/newlim = tgui_input_number(usr, "Input the new thrust limit.", "Thrust Limit", connected.thrust_limit*100, 100, 0)
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return TOPIC_NOACTION
connected.thrust_limit = Clamp(newlim/100, 0, 1)
for(var/datum/ship_engine/E in connected.engines)
@@ -94,7 +94,7 @@
if(href_list["set_limit"])
var/datum/ship_engine/E = locate(href_list["engine"])
var/newlim = tgui_input_number(usr, "Input the new thrust limit.", "Thrust Limit", E.get_thrust_limit(), 100, 0)
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return
var/limit = Clamp(newlim/100, 0, 1)
if(istype(E))
diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm
index 67299ce97ac..864b450de2d 100644
--- a/code/modules/overmap/ships/computers/helm.dm
+++ b/code/modules/overmap/ships/computers/helm.dm
@@ -194,7 +194,7 @@
if(action == "add")
var/datum/computer_file/data/waypoint/R = new()
var/sec_name = input("Input naviation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return FALSE
if(!sec_name)
sec_name = "Sector #[known_sectors.len]"
@@ -208,10 +208,10 @@
R.fields["y"] = connected.y
if("new")
var/newx = input("Input new entry x coordinate", "Coordinate input", connected.x) as num
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return TRUE
var/newy = input("Input new entry y coordinate", "Coordinate input", connected.y) as num
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return FALSE
R.fields["x"] = Clamp(newx, 1, world.maxx)
R.fields["y"] = Clamp(newy, 1, world.maxy)
@@ -225,14 +225,14 @@
if (action == "setx")
var/newx = input("Input new destination x coordinate", "Coordinate input", dx) as num|null
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return
if (newx)
dx = Clamp(newx, 1, world.maxx)
if (action == "sety")
var/newy = input("Input new destination y coordinate", "Coordinate input", dy) as num|null
- if(!CanInteract(usr, physical_state))
+ if(!CanInteract(usr, GLOB.physical_state))
return
if (newy)
dy = Clamp(newy, 1, world.maxy)
diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm
index 32fc4888ba6..742030871cf 100644
--- a/code/modules/overmap/ships/computers/sensors.dm
+++ b/code/modules/overmap/ships/computers/sensors.dm
@@ -256,14 +256,14 @@
if(sensors)
if (action == "range")
var/nrange = tgui_input_number("Set new sensors range", "Sensor range", sensors.range, sensors.max_range, 1)
- if(!CanInteract(usr, default_state))
+ if(!CanInteract(usr, GLOB.default_state))
return FALSE
if (nrange)
sensors.set_desired_range(Clamp(nrange, 1, sensors.max_range))
return TRUE
if(action == "range_choice")
var/nrange = text2num(params["range_choice"])
- if(!CanInteract(usr, default_state))
+ if(!CanInteract(usr, GLOB.default_state))
return FALSE
if(nrange)
sensors.set_desired_range(Clamp(nrange, 1, sensors.max_range))
diff --git a/code/modules/overmap/ships/computers/shuttle.dm b/code/modules/overmap/ships/computers/shuttle.dm
index c5aa86131eb..ec6a5cb04f5 100644
--- a/code/modules/overmap/ships/computers/shuttle.dm
+++ b/code/modules/overmap/ships/computers/shuttle.dm
@@ -59,7 +59,7 @@
D = tgui_input_list(usr, "Choose shuttle destination.", "Shuttle Destination", possible_d)
else
to_chat(usr, SPAN_WARNING("No valid landing sites in range."))
- if(CanInteract(user, physical_state) && (D in possible_d))
+ if(CanInteract(user, GLOB.physical_state) && (D in possible_d))
shuttle.set_destination(possible_d[D])
return TRUE
diff --git a/code/modules/psionics/interface/ui_hub.dm b/code/modules/psionics/interface/ui_hub.dm
index 0230c934f1a..467ebfb79c7 100644
--- a/code/modules/psionics/interface/ui_hub.dm
+++ b/code/modules/psionics/interface/ui_hub.dm
@@ -43,7 +43,7 @@
ui.open()
/obj/screen/psi/hub/ui_state(mob/user)
- return conscious_state
+ return GLOB.conscious_state
/obj/screen/psi/hub/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
diff --git a/code/modules/surgery/facial_surgery.dm b/code/modules/surgery/facial_surgery.dm
index c33e24e3eb2..456d6383288 100644
--- a/code/modules/surgery/facial_surgery.dm
+++ b/code/modules/surgery/facial_surgery.dm
@@ -81,7 +81,7 @@
target.dna.real_name = getName
if(target.mind)
target.mind.name = target.name
- target.change_appearance(APPEARANCE_PLASTICSURGERY, user, TRUE, ui_state = default_state, state_object = target)
+ target.change_appearance(APPEARANCE_PLASTICSURGERY, user, TRUE, ui_state = GLOB.default_state, state_object = target)
target.op_stage.face = FACE_ALTERED
@@ -229,7 +229,7 @@
target.dna.real_name = getName
if(target.mind)
target.mind.name = target.name
- target.change_appearance(APPEARANCE_PLASTICSURGERY, user, TRUE, ui_state = default_state, state_object = target)
+ target.change_appearance(APPEARANCE_PLASTICSURGERY, user, TRUE, ui_state = GLOB.default_state, state_object = target)
target.op_stage.face = FACE_ALTERED
diff --git a/code/modules/synthesized_instruments/real_instruments.dm b/code/modules/synthesized_instruments/real_instruments.dm
index 9e52907b365..49c726800c1 100644
--- a/code/modules/synthesized_instruments/real_instruments.dm
+++ b/code/modules/synthesized_instruments/real_instruments.dm
@@ -45,12 +45,12 @@
var/t = ""
do
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", owner.name), t) as message)
- if(!CanInteractWith(usr, owner, physical_state))
+ if(!CanInteractWith(usr, owner, GLOB.physical_state))
return
if(length(t) >= 2*src.maximum_lines*src.maximum_line_length)
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
- if(!CanInteractWith(usr, owner, physical_state))
+ if(!CanInteractWith(usr, owner, GLOB.physical_state))
return
if(cont == "no")
break
@@ -98,7 +98,7 @@
src.player.song.sustain_timer = max(min(player.song.sustain_timer+value, musical_config.longest_sustain_timer), 1)
if ("soft_coeff")
var/new_coeff = input(usr, "from [musical_config.gentlest_drop] to [musical_config.steepest_drop]") as num
- if(!CanInteractWith(usr, owner, physical_state))
+ if(!CanInteractWith(usr, owner, GLOB.physical_state))
return
new_coeff = round(min(max(new_coeff, musical_config.gentlest_drop), musical_config.steepest_drop), 0.001)
src.player.song.soft_coeff = new_coeff
@@ -112,7 +112,7 @@
categories |= instrument.category
var/category = input(usr, "Choose a category") as null|anything in categories
- if(!CanInteractWith(usr, owner, physical_state))
+ if(!CanInteractWith(usr, owner, GLOB.physical_state))
return
var/list/instruments_available = list()
for (var/key in as_list)
@@ -121,7 +121,7 @@
instruments_available += key
var/new_instrument = input(usr, "Choose an instrument") as null|anything in instruments_available
- if(!CanInteractWith(usr, owner, physical_state))
+ if(!CanInteractWith(usr, owner, GLOB.physical_state))
return
if (new_instrument)
src.player.song.instrument_data = instruments[new_instrument]
diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm
index 04715ec05d0..48235d976f5 100644
--- a/code/modules/tgui/external.dm
+++ b/code/modules/tgui/external.dm
@@ -119,7 +119,7 @@
* This is a proc over a var for memory reasons
*/
/datum/proc/ui_state(mob/user)
- return default_state
+ return GLOB.default_state
/**
* global
diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm
index 051d78fa863..de537ef90e3 100644
--- a/code/modules/tgui/states.dm
+++ b/code/modules/tgui/states.dm
@@ -119,7 +119,7 @@
return ..()
/// NanoUI compat, remove when done
-/datum/proc/CanUseTopic(mob/user, datum/ui_state/state = default_state)
+/datum/proc/CanUseTopic(mob/user, datum/ui_state/state = GLOB.default_state)
var/datum/src_object = ui_host()
return state.can_use_topic(src_object, user)
diff --git a/code/modules/tgui/states/admin.dm b/code/modules/tgui/states/admin.dm
index f43213ffdc2..7eeefe02812 100644
--- a/code/modules/tgui/states/admin.dm
+++ b/code/modules/tgui/states/admin.dm
@@ -9,11 +9,11 @@
* Checks that the user has the correlating rights.
*/
-/var/global/datum/ui_state/admin_state/admin_state = new(R_ADMIN)
-/var/global/datum/ui_state/admin_state/moderator_state = new(R_MOD)
-/var/global/datum/ui_state/admin_state/debug_state = new(R_DEBUG)
-/var/global/datum/ui_state/admin_state/fun_state = new(R_FUN)
-/var/global/datum/ui_state/admin_state/staff_state = new()
+GLOBAL_DATUM_INIT(admin_state, /datum/ui_state/admin_state, new(R_ADMIN))
+GLOBAL_DATUM_INIT(moderator_state, /datum/ui_state/admin_state, new(R_MOD))
+GLOBAL_DATUM_INIT(debug_state, /datum/ui_state/admin_state, new(R_DEBUG))
+GLOBAL_DATUM_INIT(fun_state, /datum/ui_state/admin_state, new(R_FUN))
+GLOBAL_DATUM_INIT(staff_state, /datum/ui_state/admin_state, new)
/datum/ui_state/admin_state
var/rights_to_check = null
diff --git a/code/modules/tgui/states/always.dm b/code/modules/tgui/states/always.dm
index 6a6cd6d75e9..2406dbb2b9b 100644
--- a/code/modules/tgui/states/always.dm
+++ b/code/modules/tgui/states/always.dm
@@ -9,7 +9,7 @@
* Always grants the user UI_INTERACTIVE. Period.
*/
-var/global/datum/ui_state/always_state/always_state = new()
+GLOBAL_DATUM_INIT(always_state, /datum/ui_state/always_state, new)
/datum/ui_state/always_state/can_use_topic(src_object, mob/user)
return UI_INTERACTIVE
diff --git a/code/modules/tgui/states/conscious.dm b/code/modules/tgui/states/conscious.dm
index ba1f621b527..8e35a97da32 100644
--- a/code/modules/tgui/states/conscious.dm
+++ b/code/modules/tgui/states/conscious.dm
@@ -9,7 +9,7 @@
* Only checks if the user is conscious.
*/
-var/global/datum/ui_state/conscious_state/conscious_state = new
+GLOBAL_DATUM_INIT(conscious_state, /datum/ui_state/conscious_state, new)
/datum/ui_state/conscious_state/can_use_topic(src_object, mob/user)
if(user.stat == CONSCIOUS)
diff --git a/code/modules/tgui/states/contained.dm b/code/modules/tgui/states/contained.dm
index 5af1c93bd94..d84bbc0ebe3 100644
--- a/code/modules/tgui/states/contained.dm
+++ b/code/modules/tgui/states/contained.dm
@@ -9,7 +9,7 @@
* Checks that the user is inside the src_object.
*/
-var/global/datum/ui_state/contained_state/contained_state = new
+GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
/datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user)
if(!src_object.contains(user))
diff --git a/code/modules/tgui/states/deep_inventory.dm b/code/modules/tgui/states/deep_inventory.dm
index 6291b663a69..a7351a0d2d9 100644
--- a/code/modules/tgui/states/deep_inventory.dm
+++ b/code/modules/tgui/states/deep_inventory.dm
@@ -10,7 +10,7 @@
* (backpack, box, toolbox, etc) inventory.
*/
-var/global/datum/ui_state/deep_inventory_state/deep_inventory_state = new
+GLOBAL_DATUM_INIT(deep_inventory_state, /datum/ui_state/deep_inventory_state, new)
/datum/ui_state/deep_inventory_state/can_use_topic(src_object, mob/user)
if(!user.contains(src_object))
diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm
index 45209cb3e6a..d40a2e6b91b 100644
--- a/code/modules/tgui/states/default.dm
+++ b/code/modules/tgui/states/default.dm
@@ -10,7 +10,7 @@
* and view for robots.
*/
-var/global/datum/ui_state/default/default_state = new
+GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
/datum/ui_state/default/can_use_topic(src_object, mob/user)
return user.default_can_use_topic(src_object) // Call the individual mob-overridden procs.
diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm
index 188a313f394..3ea6bb0b981 100644
--- a/code/modules/tgui/states/hands.dm
+++ b/code/modules/tgui/states/hands.dm
@@ -9,7 +9,7 @@
* Checks that the src_object is in the user's hands.
*/
-var/global/datum/ui_state/hands_state/hands_state = new
+GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
/datum/ui_state/hands_state/can_use_topic(src_object, mob/user)
. = user.shared_ui_interaction(src_object)
diff --git a/code/modules/tgui/states/heavy_vehicle.dm b/code/modules/tgui/states/heavy_vehicle.dm
new file mode 100644
index 00000000000..fc8fe8f27bc
--- /dev/null
+++ b/code/modules/tgui/states/heavy_vehicle.dm
@@ -0,0 +1,24 @@
+/*!
+ * Copyright (c) 2020 Aleksej Komarov
+ * SPDX-License-Identifier: MIT
+ */
+
+/**
+ * tgui state: heavy_vehicle
+ *
+ * Checks that the user is inside a mech, that the mech is powered and is the right one.
+ *
+ */
+
+GLOBAL_DATUM_INIT(heavy_vehicle_state, /datum/ui_state/heavy_vehicle, new)
+
+/datum/ui_state/heavy_vehicle/can_use_topic(src_object, mob/user)
+ . = user.shared_ui_interaction(src_object)
+
+ if(!istype(src_object, /obj/item/mecha_equipment))
+ return
+ var/obj/item/mecha_equipment/mecha_equip = src_object
+ if(ismech(user.loc))
+ var/mob/living/heavy_vehicle/mech = user.loc
+ if(mecha_equip.owner == mech && mech.power == MECH_POWER_ON)
+ return UI_INTERACTIVE
diff --git a/code/modules/tgui/states/human_adjacent.dm b/code/modules/tgui/states/human_adjacent.dm
index ba316758b99..b9208f96cd6 100644
--- a/code/modules/tgui/states/human_adjacent.dm
+++ b/code/modules/tgui/states/human_adjacent.dm
@@ -10,7 +10,7 @@
* human adjacent user.
*/
-var/global/datum/ui_state/human_adjacent_state/human_adjacent_state = new
+GLOBAL_DATUM_INIT(human_adjacent_state, /datum/ui_state/human_adjacent_state, new)
/datum/ui_state/human_adjacent_state/can_use_topic(src_object, mob/user)
. = user.default_can_use_topic(src_object)
diff --git a/code/modules/tgui/states/human_adjacent_loc.dm b/code/modules/tgui/states/human_adjacent_loc.dm
index bb93882458e..a2d1d9299f4 100644
--- a/code/modules/tgui/states/human_adjacent_loc.dm
+++ b/code/modules/tgui/states/human_adjacent_loc.dm
@@ -5,7 +5,7 @@
* human adjacent user.
*/
-var/global/datum/ui_state/human_adjacent_loc_state/human_adjacent_loc_state = new
+GLOBAL_DATUM_INIT(human_adjacent_loc_state, /datum/ui_state/human_adjacent_loc_state, new)
/datum/ui_state/human_adjacent_loc_state/can_use_topic(src_object, mob/user)
var/turf/src_object_turf = get_turf(src_object)
diff --git a/code/modules/tgui/states/inventory.dm b/code/modules/tgui/states/inventory.dm
index 43ff41ce6fe..4bc121b278a 100644
--- a/code/modules/tgui/states/inventory.dm
+++ b/code/modules/tgui/states/inventory.dm
@@ -10,7 +10,7 @@
* (hand, ear, pocket, belt, etc) inventory.
*/
-var/global/datum/ui_state/inventory_state/inventory_state = new
+GLOBAL_DATUM_INIT(inventory_state, /datum/ui_state/inventory_state, new)
/datum/ui_state/inventory_state/can_use_topic(src_object, mob/user)
if(!(src_object in user))
diff --git a/code/modules/tgui/states/never.dm b/code/modules/tgui/states/never.dm
index 21e19e38da0..dc081960b08 100644
--- a/code/modules/tgui/states/never.dm
+++ b/code/modules/tgui/states/never.dm
@@ -6,10 +6,10 @@
/**
* tgui state: never_state
*
- * Always closes the UI, no matter what. See the ui_state in religious_tool.dm to see an example
+ * Always closes the UI, no matter what.
*/
-var/global/datum/ui_state/never_state/never_state = new
+GLOBAL_DATUM_INIT(never_state, /datum/ui_state/never_state, new)
/datum/ui_state/never_state/can_use_topic(src_object, mob/user)
return UI_CLOSE
diff --git a/code/modules/tgui/states/new_player.dm b/code/modules/tgui/states/new_player.dm
index 252dad4e7e8..cd33bcfcfae 100644
--- a/code/modules/tgui/states/new_player.dm
+++ b/code/modules/tgui/states/new_player.dm
@@ -4,7 +4,7 @@
* Checks that the user is a /mob/dead/new_player
*/
-var/global/datum/ui_state/new_player_state/new_player_state = new
+GLOBAL_DATUM_INIT(new_player_state, /datum/ui_state/new_player_state, new)
/datum/ui_state/new_player_state/can_use_topic(src_object, mob/user)
return isnewplayer(user) ? UI_INTERACTIVE : UI_CLOSE
diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm
index e8fa10131b0..49ba2460151 100644
--- a/code/modules/tgui/states/not_incapacitated.dm
+++ b/code/modules/tgui/states/not_incapacitated.dm
@@ -9,7 +9,7 @@
* Checks that the user isn't incapacitated
*/
-var/global/datum/ui_state/not_incapacitated_state/not_incapacitated_state = new
+GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_state, new)
/**
* tgui state: not_incapacitated_turf_state
diff --git a/code/modules/tgui/states/notcontained.dm b/code/modules/tgui/states/notcontained.dm
index 1fa2361a696..018e0fa0304 100644
--- a/code/modules/tgui/states/notcontained.dm
+++ b/code/modules/tgui/states/notcontained.dm
@@ -10,7 +10,7 @@
* default checks.
*/
-var/global/datum/ui_state/notcontained_state/notcontained_state = new
+GLOBAL_DATUM_INIT(notcontained_state, /datum/ui_state/notcontained_state, new)
/datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user)
. = user.shared_ui_interaction(src_object)
diff --git a/code/modules/tgui/states/observer.dm b/code/modules/tgui/states/observer.dm
index 6a5801ff1cf..4081fd7dc21 100644
--- a/code/modules/tgui/states/observer.dm
+++ b/code/modules/tgui/states/observer.dm
@@ -9,7 +9,7 @@
* Checks that the user is an observer/ghost.
*/
-var/global/datum/ui_state/observer_state/observer_state = new
+GLOBAL_DATUM_INIT(observer_state, /datum/ui_state/observer_state, new)
/datum/ui_state/observer_state/can_use_topic(src_object, mob/user)
if(isobserver(user))
diff --git a/code/modules/tgui/states/physical.dm b/code/modules/tgui/states/physical.dm
index d835be480c0..216b39281d1 100644
--- a/code/modules/tgui/states/physical.dm
+++ b/code/modules/tgui/states/physical.dm
@@ -9,7 +9,7 @@
* Short-circuits the default state to only check physical distance.
*/
-var/global/datum/ui_state/physical/physical_state = new
+GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
/datum/ui_state/physical/can_use_topic(src_object, mob/user)
. = user.shared_ui_interaction(src_object)
diff --git a/code/modules/tgui/states/reverse_contained.dm b/code/modules/tgui/states/reverse_contained.dm
index 2f1eb5789a1..a6d1034a789 100644
--- a/code/modules/tgui/states/reverse_contained.dm
+++ b/code/modules/tgui/states/reverse_contained.dm
@@ -10,7 +10,7 @@
* Checks if src_object is inside of user.
*/
-var/global/datum/ui_state/reverse_contained_state/reverse_contained_state = new
+GLOBAL_DATUM_INIT(reverse_contained_state, /datum/ui_state/reverse_contained_state, new)
/datum/ui_state/reverse_contained_state/can_use_topic(atom/src_object, mob/user)
if(!user.contains(src_object))
diff --git a/code/modules/tgui/states/self.dm b/code/modules/tgui/states/self.dm
index 970ac4221a9..f7cef3f6005 100644
--- a/code/modules/tgui/states/self.dm
+++ b/code/modules/tgui/states/self.dm
@@ -9,7 +9,7 @@
* Only checks that the user and src_object are the same.
*/
-var/global/datum/ui_state/self_state/self_state = new
+GLOBAL_DATUM_INIT(self_state, /datum/ui_state/self_state, new)
/datum/ui_state/self_state/can_use_topic(src_object, mob/user)
if(src_object != user)
diff --git a/code/modules/tgui/states/zlevel.dm b/code/modules/tgui/states/zlevel.dm
index 3fb81d3b725..f1a2282b3c2 100644
--- a/code/modules/tgui/states/zlevel.dm
+++ b/code/modules/tgui/states/zlevel.dm
@@ -9,7 +9,7 @@
* Only checks that the Z-level of the user and src_object are the same.
*/
-var/global/datum/ui_state/z_state/z_state = new
+GLOBAL_DATUM_INIT(z_state, /datum/ui_state/z_state, new)
/datum/ui_state/z_state/can_use_topic(src_object, mob/user)
var/turf/turf_obj = get_turf(src_object)
diff --git a/code/modules/tgui_input/alert.dm b/code/modules/tgui_input/alert.dm
index 030f3abd7cb..01c1375ac60 100644
--- a/code/modules/tgui_input/alert.dm
+++ b/code/modules/tgui_input/alert.dm
@@ -94,7 +94,7 @@
closed = TRUE
/datum/tgui_alert/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/tgui_alert/ui_static_data(mob/user)
var/list/data = list()
diff --git a/code/modules/tgui_input/list.dm b/code/modules/tgui_input/list.dm
index fb53698ce02..405a815a414 100644
--- a/code/modules/tgui_input/list.dm
+++ b/code/modules/tgui_input/list.dm
@@ -103,7 +103,7 @@
closed = TRUE
/datum/tgui_list_input/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/tgui_list_input/ui_static_data(mob/user)
var/list/data = list()
diff --git a/code/modules/tgui_input/number.dm b/code/modules/tgui_input/number.dm
index f3bb7cc42cb..988d344112b 100644
--- a/code/modules/tgui_input/number.dm
+++ b/code/modules/tgui_input/number.dm
@@ -108,7 +108,7 @@
closed = TRUE
/datum/tgui_input_number/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/tgui_input_number/ui_static_data(mob/user)
var/list/data = list()
diff --git a/code/modules/tgui_input/text.dm b/code/modules/tgui_input/text.dm
index 3336b5f84d4..32021830c2c 100644
--- a/code/modules/tgui_input/text.dm
+++ b/code/modules/tgui_input/text.dm
@@ -106,7 +106,7 @@
closed = TRUE
/datum/tgui_input_text/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/datum/tgui_input_text/ui_static_data(mob/user)
var/list/data = list()
diff --git a/code/modules/vehicles/droppod.dm b/code/modules/vehicles/droppod.dm
index 832f66ef418..c8450272326 100644
--- a/code/modules/vehicles/droppod.dm
+++ b/code/modules/vehicles/droppod.dm
@@ -170,7 +170,7 @@
ui.open()
/obj/vehicle/droppod/ui_state(mob/user)
- return always_state
+ return GLOB.always_state
/obj/vehicle/droppod/ui_data(mob/user)
var/list/data = list()
diff --git a/html/changelogs/mattatlas-aria.yml b/html/changelogs/mattatlas-aria.yml
new file mode 100644
index 00000000000..b30dd56cac7
--- /dev/null
+++ b/html/changelogs/mattatlas-aria.yml
@@ -0,0 +1,41 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: MattAtlas
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - bugfix: "You can now alt click the mounted autolathe on a mech to access it."