diff --git a/code/__HELPERS/unique_ids.dm b/code/__HELPERS/unique_ids.dm
new file mode 100644
index 000000000..549f5c710
--- /dev/null
+++ b/code/__HELPERS/unique_ids.dm
@@ -0,0 +1,44 @@
+// Unique Datum Identifiers
+
+// Basically, a replacement for plain \refs that ensure the reference still
+// points to the exact same datum/client, but doesn't prevent GC like tags do.
+
+// An unintended side effect of the way UIDs are formatted is that the locate()
+// proc will ignore the number and attempt to locate the reference. I consider
+// this a feature, since it means they're conveniently backwards compatible.
+
+// Turns this:
+// var/myref = "\ref[mydatum]"
+// var/datum/D = locate(myref)
+// into this:
+// var/myUID = mydatum.UID()
+// var/datum/D = locateUID(myUID)
+
+GLOBAL_VAR_INIT(next_unique_datum_id, 1)
+
+// /client/var/tmp/unique_datum_id = null
+
+/datum/proc/UID()
+ if(!unique_datum_id)
+ var/tag_backup = tag
+ tag = null // Grab the raw ref, not the tag
+ unique_datum_id = "\ref[src]_[GLOB.next_unique_datum_id++]"
+ tag = tag_backup
+ return unique_datum_id
+
+/proc/locateUID(uid)
+ if(!istext(uid))
+ return null
+
+ var/splitat = findlasttext(uid, "_")
+
+ if(!splitat)
+ return null
+
+ var/datum/D = locate(copytext(uid, 1, splitat))
+
+ // We might locate a client instead of a datum, but just using : is easier
+ // than actually checking and typecasting
+ if(D && D:unique_datum_id == uid)
+ return D
+ return null
diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm
index 9fc689ff9..ea50256b6 100644
--- a/code/controllers/subsystem/tgui.dm
+++ b/code/controllers/subsystem/tgui.dm
@@ -1,8 +1,14 @@
+ /**
+ * tgui subsystem
+ *
+ * Contains all tgui state and subsystem code.
+ **/
+
+
SUBSYSTEM_DEF(tgui)
name = "tgui"
wait = 9
flags = SS_NO_INIT
- priority = FIRE_PRIORITY_TGUI
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
var/list/currentrun = list()
@@ -11,14 +17,13 @@ SUBSYSTEM_DEF(tgui)
var/basehtml // The HTML base used for all UIs.
/datum/controller/subsystem/tgui/PreInit()
- basehtml = file2text('tgui-next/packages/tgui/public/tgui-main.html')
+ basehtml = file2text('tgui/packages/tgui/public/tgui.html')
/datum/controller/subsystem/tgui/Shutdown()
close_all_uis()
-/datum/controller/subsystem/tgui/stat_entry(msg)
- msg = "P:[length(open_uis)]"
- return ..()
+/datum/controller/subsystem/tgui/stat_entry()
+ ..("P:[processing_uis.len]")
/datum/controller/subsystem/tgui/fire(resumed = 0)
if (!resumed)
@@ -34,5 +39,4 @@ SUBSYSTEM_DEF(tgui)
else
processing_uis.Remove(ui)
if (MC_TICK_CHECK)
- return
-
+ return
\ No newline at end of file
diff --git a/code/datums/components/crafting/craft.dm b/code/datums/components/crafting/craft.dm
index 35966e18e..cc480f8ea 100644
--- a/code/datums/components/crafting/craft.dm
+++ b/code/datums/components/crafting/craft.dm
@@ -309,7 +309,7 @@
if(user == parent)
ui_interact(user)
-/datum/component/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state)
+/datum/component/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_not_incapacitated_turf_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
cur_category = categories[1]
@@ -318,7 +318,7 @@
cur_subcategory = subcats[1]
else
cur_subcategory = CAT_NONE
- ui = new(user, src, ui_key, "personal_crafting", "Crafting Menu", 700, 800, master_ui, state)
+ ui = new(user, src, ui_key, "PersonalCrafting", "Crafting Menu", 700, 800, master_ui, state)
ui.open()
diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm
index 25094518b..dd7b4509a 100644
--- a/code/datums/components/material_container.dm
+++ b/code/datums/components/material_container.dm
@@ -91,7 +91,7 @@
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
if(isnull(requested_amount) || (requested_amount <= 0))
return
- if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || user.physical_can_use_topic(current_parent) < UI_INTERACTIVE || user.get_active_held_item() != active_held)
+ if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || user.physical_can_use_tgui_topic(current_parent) < UI_INTERACTIVE || user.get_active_held_item() != active_held)
return
if(!user.temporarilyRemoveItemFromInventory(I))
to_chat(user, "[I] is stuck to you and cannot be placed into [parent].")
diff --git a/code/datums/components/uplink.dm b/code/datums/components/uplink.dm
index a8e03946b..a492510ad 100644
--- a/code/datums/components/uplink.dm
+++ b/code/datums/components/uplink.dm
@@ -24,11 +24,11 @@ GLOBAL_LIST_EMPTY(uplinks)
var/unlock_note
var/unlock_code
var/failsafe_code
- var/datum/ui_state/checkstate
+ var/datum/tgui_state/checkstate
var/compact_mode = FALSE
var/debug = FALSE
-/datum/component/uplink/Initialize(_owner, _lockable = TRUE, _enabled = FALSE, datum/game_mode/_gamemode, starting_tc = 20, datum/ui_state/_checkstate)
+/datum/component/uplink/Initialize(_owner, _lockable = TRUE, _enabled = FALSE, datum/game_mode/_gamemode, starting_tc = 20, datum/tgui_state/_checkstate)
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
@@ -118,14 +118,14 @@ GLOBAL_LIST_EMPTY(uplinks)
return COMPONENT_NO_INTERACT
/datum/component/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
state = checkstate ? checkstate : state
active = TRUE
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "uplink", name, 620, 580, master_ui, state)
+ ui = new(user, src, ui_key, "Uplink", name, 620, 580, master_ui, state)
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
- ui.set_style("syndicate")
+ // ui.set_style("syndicate")
ui.open()
/datum/component/uplink/ui_host(mob/user)
diff --git a/code/datums/datum.dm b/code/datums/datum.dm
index 7e1867700..22534e8c2 100644
--- a/code/datums/datum.dm
+++ b/code/datums/datum.dm
@@ -8,6 +8,7 @@
var/signal_enabled = FALSE
var/datum_flags = NONE
var/datum/weakref/weak_reference
+ var/tmp/unique_datum_id = null
#ifdef TESTING
var/running_find_references
diff --git a/code/datums/spawners_menu.dm b/code/datums/spawners_menu.dm
index fac6f7fd1..02f1f4dc4 100644
--- a/code/datums/spawners_menu.dm
+++ b/code/datums/spawners_menu.dm
@@ -6,10 +6,10 @@
qdel(src)
owner = new_owner
-/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
+/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_observer_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "spawners_menu", "Spawners Menu", 700, 600, master_ui, state)
+ ui = new(user, src, ui_key, "SpawnersMenu", "Spawners Menu", 700, 600, master_ui, state)
ui.open()
/datum/spawners_menu/ui_data(mob/user)
diff --git a/code/datums/wires/_wires.dm b/code/datums/wires/_wires.dm
index d4a5dcdeb..cf66d0574 100644
--- a/code/datums/wires/_wires.dm
+++ b/code/datums/wires/_wires.dm
@@ -213,10 +213,10 @@
return UI_CLOSE
/datum/wires/ui_interact(mob/user, ui_key = "wires", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "wires", "[holder.name] Wires", 350, 150 + wires.len * 30, master_ui, state)
+ ui = new(user, src, ui_key, "Wires", "[holder.name] Wires", 350, 150 + wires.len * 30, master_ui, state)
ui.open()
/datum/wires/ui_data(mob/user)
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 99cecc13c..29216a304 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -195,14 +195,14 @@
. += "Alt-click [src] to [state_open ? "close" : "open"] it."
/obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
- if(controls_inside && state == GLOB.notcontained_state)
- state = GLOB.default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it.
+ if(controls_inside && state == GLOB.tgui_notcontained_state)
+ state = GLOB.tgui_default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it.
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "sleeper", name, 550, 700, master_ui, state)
+ ui = new(user, src, ui_key, "Sleeper", name, 550, 700, master_ui, state)
ui.open()
/obj/machinery/sleeper/ui_data()
diff --git a/code/game/machinery/bank_machine.dm b/code/game/machinery/bank_machine.dm
index 41867a852..17d3c44e6 100644
--- a/code/game/machinery/bank_machine.dm
+++ b/code/game/machinery/bank_machine.dm
@@ -53,10 +53,10 @@
next_warning = world.time + minimum_time_between_warnings
/obj/machinery/computer/bank_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "bank_machine", name, 320, 165, master_ui, state)
+ ui = new(user, src, ui_key, "BankMachine", name, 320, 165, master_ui, state)
ui.open()
/obj/machinery/computer/bank_machine/ui_data(mob/user)
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index 7439fd1b8..a1393df4e 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -43,10 +43,10 @@
table.computer = src
break
-/obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_state)
+/obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_not_incapacitated_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "operating_computer", name, 350, 470, master_ui, state)
+ ui = new(user, src, ui_key, "OperatingComputer", name, 350, 470, master_ui, state)
ui.open()
/obj/machinery/computer/operating/ui_data(mob/user)
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index 4c9e9aed1..c8b027713 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -20,10 +20,10 @@
return ..()
/obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_alert", name, 350, 300, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosAlertConsole", name, 350, 300, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_alert/ui_data(mob/user)
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index d6ce850da..46fc7db9f 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -124,10 +124,10 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
return ..()
/obj/machinery/computer/atmos_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_control", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosControlConsole", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/ui_data(mob/user)
@@ -266,10 +266,10 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
U.broadcast_status()
/obj/machinery/computer/atmos_control/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_control", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosControlConsole", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/tank/ui_data(mob/user)
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index f6d0fcfc0..aa60a8037 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -76,10 +76,10 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new)
return ..()
/datum/crewmonitor/ui_interact(mob/user, ui_key = "crew", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if (!ui)
- ui = new(user, src, ui_key, "crew", "crew monitor", 800, 600 , master_ui, state)
+ ui = new(user, src, ui_key, "CrewConsole", "crew monitor", 800, 600 , master_ui, state)
ui.open()
/datum/crewmonitor/proc/show(mob/M, source)
diff --git a/code/game/machinery/computer/launchpad_control.dm b/code/game/machinery/computer/launchpad_control.dm
index 1924cd9f2..bcc0df353 100644
--- a/code/game/machinery/computer/launchpad_control.dm
+++ b/code/game/machinery/computer/launchpad_control.dm
@@ -53,10 +53,10 @@
var/obj/machinery/launchpad/pad = launchpads[number]
return pad
-/obj/machinery/computer/launchpad/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/launchpad/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "launchpad_console", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "LaunchpadConsole", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/launchpad/ui_data(mob/user)
diff --git a/code/game/machinery/computer/prisoner/gulag_teleporter.dm b/code/game/machinery/computer/prisoner/gulag_teleporter.dm
index e4a6a0b2d..b908d7ec7 100644
--- a/code/game/machinery/computer/prisoner/gulag_teleporter.dm
+++ b/code/game/machinery/computer/prisoner/gulag_teleporter.dm
@@ -22,10 +22,10 @@
scan_machinery()
/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "gulag_console", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "GulagTeleporterConsole", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_data(mob/user)
diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm
index c3fef3ff9..022e8e113 100644
--- a/code/game/machinery/computer/station_alert.dm
+++ b/code/game/machinery/computer/station_alert.dm
@@ -17,10 +17,10 @@
return ..()
/obj/machinery/computer/station_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "station_alert", name, 325, 500, master_ui, state)
+ ui = new(user, src, ui_key, "StationAlertConsole", name, 325, 500, master_ui, state)
ui.open()
/obj/machinery/computer/station_alert/ui_data(mob/user)
diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm
index 518f38fc3..a30a44f30 100644
--- a/code/game/machinery/computer/teleporter.dm
+++ b/code/game/machinery/computer/teleporter.dm
@@ -35,10 +35,10 @@
return power_station
obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "teleporter", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "Teleporter", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/teleporter/ui_data(mob/user)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index f786cbbcb..948ea78c5 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1485,10 +1485,10 @@
return "photo"
/obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ai_airlock", name, 500, 390, master_ui, state)
+ ui = new(user, src, ui_key, "AiAirlock", name, 500, 390, master_ui, state)
ui.open()
return TRUE
diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm
index 7b90715f2..a1d7aa85f 100644
--- a/code/game/machinery/doors/airlock_electronics.dm
+++ b/code/game/machinery/doors/airlock_electronics.dm
@@ -11,10 +11,10 @@
. += "Has a neat selection menu for modifying airlock access levels."
/obj/item/electronics/airlock/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_hands_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "airlock_electronics", name, 420, 485, master_ui, state)
+ ui = new(user, src, ui_key, "AirlockElectronics", name, 420, 485, master_ui, state)
ui.open()
/obj/item/electronics/airlock/ui_data()
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 3bfcececd..909df84e3 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -146,10 +146,10 @@
timer_duration = new_time
/obj/machinery/door_timer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "brig_timer", name, 300, 138, master_ui, state)
+ ui = new(user, src, ui_key, "BrigTimer", name, 300, 138, master_ui, state)
ui.open()
//icon update function
diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm
index d808dd537..a82da4a22 100644
--- a/code/game/machinery/gulag_item_reclaimer.dm
+++ b/code/game/machinery/gulag_item_reclaimer.dm
@@ -26,10 +26,10 @@
obj_flags |= EMAGGED
/obj/machinery/gulag_item_reclaimer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "gulag_item_reclaimer", name, 300, 400, master_ui, state)
+ ui = new(user, src, ui_key, "GulagItemReclaimer", name, 300, 400, master_ui, state)
ui.open()
/obj/machinery/gulag_item_reclaimer/ui_data(mob/user)
diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm
index 7a507663c..95c1df15a 100644
--- a/code/game/machinery/launch_pad.dm
+++ b/code/game/machinery/launch_pad.dm
@@ -277,11 +277,11 @@
ui_interact(user)
to_chat(user, "[src] projects a display onto your retina.")
-/obj/item/launchpad_remote/ui_interact(mob/user, ui_key = "launchpad_remote", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/item/launchpad_remote/ui_interact(mob/user, ui_key = "launchpad_remote", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "launchpad_remote", "Briefcase Launchpad Remote", 300, 240, master_ui, state) //width, height
- ui.set_style("syndicate")
+ ui = new(user, src, ui_key, "LaunchpadRemote", "Briefcase Launchpad Remote", 300, 240, master_ui, state) //width, height
+ // ui.set_style("syndicate")
ui.open()
ui.set_autoupdate(TRUE)
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 984a911d3..ba9459a83 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -164,10 +164,10 @@
return ..()
/obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "space_heater", name, 400, 305, master_ui, state)
+ ui = new(user, src, ui_key, "SpaceHeater", name, 400, 305, master_ui, state)
ui.open()
/obj/machinery/space_heater/ui_data()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 36e7dd912..cc7e2eb87 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -373,10 +373,10 @@
return ..()
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
+ ui = new(user, src, ui_key, "SuitStorageUnit", name, 400, 305, master_ui, state)
ui.open()
/obj/machinery/suit_storage_unit/ui_data()
diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm
index fdf6ba121..ece2960c7 100644
--- a/code/game/machinery/telecomms/computers/logbrowser.dm
+++ b/code/game/machinery/telecomms/computers/logbrowser.dm
@@ -18,10 +18,10 @@
var/universal_translate = FALSE // set to TRUE(1) if it can translate nonhuman speech
/obj/machinery/computer/telecomms/server/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tcommsserver", "Telecomms Server Monitor", 575, 400, master_ui, state)
+ ui = new(user, src, ui_key, "TelecommsLogBrowser", "Telecomms Server Monitor", 575, 400, master_ui, state)
ui.open()
/obj/machinery/computer/telecomms/server/ui_data(mob/user)
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index 41d417967..0bc716ec9 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -37,11 +37,11 @@
light_color = LIGHT_COLOR_GREEN
/obj/machinery/computer/message_monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "telepdalog", name, 727, 510, master_ui, state)
+ ui = new(user, src, ui_key, "TelecommsPDALog", name, 727, 510, master_ui, state)
ui.open()
/obj/machinery/computer/message_monitor/ui_static_data(mob/user)
diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm
index bca16a0de..26953a66e 100644
--- a/code/game/machinery/telecomms/computers/telemonitor.dm
+++ b/code/game/machinery/telecomms/computers/telemonitor.dm
@@ -18,11 +18,11 @@
circuit = /obj/item/circuitboard/computer/comm_monitor
/obj/machinery/computer/telecomms/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "telemonitor", name, 575, 400, master_ui, state)
+ ui = new(user, src, ui_key, "TelecommsMonitor", name, 575, 400, master_ui, state)
ui.open()
/obj/machinery/computer/telecomms/monitor/ui_data(mob/user)
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 78ecb5a56..7653e111f 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -28,7 +28,7 @@
return ..()
/obj/machinery/telecomms/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
if(!canInteract(user))
if(ui)
ui.close() //haha no.
@@ -36,7 +36,7 @@
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "teleinteract", "[name] Access", 520, 500, master_ui, state)
+ ui = new(user, src, ui_key, "TelecommsInteraction", "[name] Access", 520, 500, master_ui, state)
ui.open()
/obj/machinery/telecomms/ui_data(mob/user)
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index 018c69495..de4b7fa55 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -76,10 +76,10 @@
var/obj/machinery/mech_bay_recharge_port/recharge_port
light_color = LIGHT_COLOR_PINK
-/obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 200, master_ui, state)
+ ui = new(user, src, ui_key, "MechBayPowerConsole", "Mech Bay Power Control Console", 400, 200, master_ui, state)
ui.open()
/obj/machinery/computer/mech_bay_power_console/ui_act(action, params)
diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm
index 499a304b6..5fbe9a691 100644
--- a/code/game/objects/items/RPD.dm
+++ b/code/game/objects/items/RPD.dm
@@ -243,13 +243,13 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
. = replacetext(html, "", assets.css_tag())
/obj/item/pipe_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/pipes)
assets.send(user)
- ui = new(user, src, ui_key, "rpd", name, 425, 472, master_ui, state)
+ ui = new(user, src, ui_key, "RapidPipeDispenser", name, 425, 472, master_ui, state)
ui.open()
/obj/item/pipe_dispenser/ui_data(mob/user)
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 6fa71743a..cb9f4fb50 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -145,12 +145,12 @@
to_chat(user, "There is not enough of [src] left!")
. = TRUE
-/obj/item/toy/crayon/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
+/obj/item/toy/crayon/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_hands_state)
// tgui is a plague upon this codebase
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "crayon", name, 600, 600,
+ ui = new(user, src, ui_key, "Crayon", name, 600, 600,
master_ui, state)
ui.open()
diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm
index 8a0980650..4726e5753 100644
--- a/code/game/objects/items/devices/aicard.dm
+++ b/code/game/objects/items/devices/aicard.dm
@@ -48,10 +48,10 @@
icon_state = initial(icon_state)
/obj/item/aicard/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "intellicard", name, 500, 500, master_ui, state)
+ ui = new(user, src, ui_key, "Intellicard", name, 500, 500, master_ui, state)
ui.open()
/obj/item/aicard/ui_data()
diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm
index d4790cf77..e2150b12c 100644
--- a/code/game/objects/items/devices/dogborg_sleeper.dm
+++ b/code/game/objects/items/devices/dogborg_sleeper.dm
@@ -166,10 +166,11 @@
ui_interact(user)
/obj/item/dogborg/sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
+ // TGUI TODO: do something about this UI
ui = new(user, src, ui_key, "dogborg_sleeper", name, 375, 550, master_ui, state)
ui.open()
diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm
index 080fc0337..7504bea0f 100644
--- a/code/game/objects/items/devices/gps.dm
+++ b/code/game/objects/items/devices/gps.dm
@@ -65,7 +65,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
tracking = TRUE
-/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
+/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state) // Remember to use the appropriate state.
if(emped)
to_chat(user, "[src] fizzles weakly.")
return
@@ -74,7 +74,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
// Variable window height, depending on how many GPS units there are
// to show, clamped to relatively safe range.
var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700)
- ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
+ ui = new(user, src, ui_key, "Gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index efdf05574..18eb49a68 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -93,7 +93,7 @@
/obj/item/radio/intercom/interact(mob/user)
..()
- ui_interact(user, state = GLOB.default_state)
+ ui_interact(user, state = GLOB.tgui_default_state)
/obj/item/radio/intercom/can_receive(freq, level)
if(!on)
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 550e5b942..7b6b6edc5 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -107,7 +107,7 @@
..()
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
. = ..()
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
@@ -118,7 +118,7 @@
ui_height += 6 + channels.len * 21
else
ui_height += 24
- ui = new(user, src, ui_key, "radio", name, ui_width, ui_height, master_ui, state)
+ ui = new(user, src, ui_key, "Radio", name, ui_width, ui_height, master_ui, state)
ui.open()
/obj/item/radio/ui_data(mob/user)
diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm
index 1c3644b8a..37f0bc74f 100644
--- a/code/game/objects/items/eightball.dm
+++ b/code/game/objects/items/eightball.dm
@@ -192,11 +192,11 @@
return top_vote
-/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state = GLOB.always_state)
+/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/tgui_state/state = GLOB.tgui_always_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "eightball", name, 400, 600, master_ui, state)
+ ui = new(user, src, ui_key, "EightBallVote", name, 400, 600, master_ui, state)
ui.open()
/obj/item/toy/eightball/haunted/ui_data(mob/user)
diff --git a/code/game/objects/items/implants/implant_radio.dm b/code/game/objects/items/implants/implant_radio.dm
index 5d3d579a4..7f2b09a03 100644
--- a/code/game/objects/items/implants/implant_radio.dm
+++ b/code/game/objects/items/implants/implant_radio.dm
@@ -9,8 +9,8 @@
/obj/item/implant/radio/activate()
. = ..()
- // needs to be GLOB.deep_inventory_state otherwise it won't open
- radio.ui_interact(usr, "main", null, FALSE, null, GLOB.deep_inventory_state)
+ // needs to be GLOB.tgui_deep_inventory_state otherwise it won't open
+ radio.ui_interact(usr, "main", null, FALSE, null, GLOB.tgui_deep_inventory_state)
/obj/item/implant/radio/implant(mob/living/target, mob/user, silent = FALSE)
. = ..()
diff --git a/code/game/objects/items/implants/implant_uplink.dm b/code/game/objects/items/implants/implant_uplink.dm
index 9895c1e34..e61d91f07 100644
--- a/code/game/objects/items/implants/implant_uplink.dm
+++ b/code/game/objects/items/implants/implant_uplink.dm
@@ -9,7 +9,7 @@
/obj/item/implant/uplink/Initialize(mapload, _owner)
. = ..()
- AddComponent(/datum/component/uplink, _owner, TRUE, FALSE, null, starting_tc, GLOB.not_incapacitated_state)
+ AddComponent(/datum/component/uplink, _owner, TRUE, FALSE, null, starting_tc, GLOB.tgui_not_incapacitated_state)
/obj/item/implanter/uplink
name = "implanter (uplink)"
diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm
index bcb6ce097..9aa6d4d5c 100644
--- a/code/game/objects/items/implants/implantchair.dm
+++ b/code/game/objects/items/implants/implantchair.dm
@@ -27,10 +27,10 @@
update_icon()
-/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "implantchair", name, 375, 280, master_ui, state)
+ ui = new(user, src, ui_key, "ImplantChair", name, 375, 280, master_ui, state)
ui.open()
diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm
index 55d8c8256..348415ba1 100644
--- a/code/game/objects/items/tanks/tanks.dm
+++ b/code/game/objects/items/tanks/tanks.dm
@@ -153,10 +153,10 @@
. = ..()
/obj/item/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tanks", name, 400, 120, master_ui, state)
+ ui = new(user, src, ui_key, "Tank", name, 400, 120, master_ui, state)
ui.open()
/obj/item/tank/ui_data(mob/user)
diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm
index 339b39e3d..19baed8ae 100644
--- a/code/game/objects/structures/artstuff.dm
+++ b/code/game/objects/structures/artstuff.dm
@@ -77,11 +77,11 @@
ui_interact(user)
/obj/item/canvas/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "canvas", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "Canvas", name, ui_x, ui_y, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
@@ -273,16 +273,16 @@
if(persistence_id)
. += "Any painting placed here will be archived at the end of the shift."
if(current_canvas)
- ui_interact(user, state = GLOB.physical_obscured_state)
+ ui_interact(user, state = GLOB.tgui_physical_obscured_state)
. += "Use wirecutters to remove the painting."
//Hyperstation UI hotwire code ahead. No, I'm not particularly proud of this but if it works, it works.
/obj/structure/sign/painting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "canvas", name, current_canvas.ui_x, current_canvas.ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "Canvas", name, current_canvas.ui_x, current_canvas.ui_y, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 5789c5abe..d2f3074dd 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -68,10 +68,10 @@
update_icon()
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tank_dispenser", name, 275, 103, master_ui, state)
+ ui = new(user, src, ui_key, "TankDispenser", name, 275, 103, master_ui, state)
ui.open()
/obj/structure/tank_dispenser/attack_robot(mob/user)
diff --git a/code/modules/NTNet/relays.dm b/code/modules/NTNet/relays.dm
index 373f6451b..f715d8962 100644
--- a/code/modules/NTNet/relays.dm
+++ b/code/modules/NTNet/relays.dm
@@ -64,12 +64,12 @@
SSnetworks.station_network.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
..()
-/obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ntnet_relay", "NTNet Quantum Relay", ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "NtnetRelay", "NTNet Quantum Relay", ui_x, ui_y, master_ui, state)
ui.open()
diff --git a/code/modules/VR/vr_sleeper.dm b/code/modules/VR/vr_sleeper.dm
index bfbf6b5b7..e8ea46a23 100644
--- a/code/modules/VR/vr_sleeper.dm
+++ b/code/modules/VR/vr_sleeper.dm
@@ -77,9 +77,10 @@
return
close_machine(target)
-/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
+ // TGUI TODO: do something about this UI
ui = new(user, src, ui_key, "vr_sleeper", "VR Sleeper", 475, 340, master_ui, state)
ui.open()
diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm
index 1a5c7d335..fdd843127 100644
--- a/code/modules/admin/verbs/borgpanel.dm
+++ b/code/modules/admin/verbs/borgpanel.dm
@@ -33,10 +33,10 @@
borg = to_borg
-/datum/borgpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
+/datum/borgpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_admin_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "borgopanel", "Borg Panel", 700, 700, master_ui, state)
+ ui = new(user, src, ui_key, "BorgPanel", "Borg Panel", 700, 700, master_ui, state)
ui.open()
/datum/borgpanel/ui_data(mob/user)
diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm
index 3cf0a3ee2..8d1e6badc 100644
--- a/code/modules/antagonists/changeling/cellular_emporium.dm
+++ b/code/modules/antagonists/changeling/cellular_emporium.dm
@@ -13,10 +13,10 @@
changeling = null
. = ..()
-/datum/cellular_emporium/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
+/datum/cellular_emporium/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_always_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "cellular_emporium", name, 900, 480, master_ui, state)
+ ui = new(user, src, ui_key, "CellularEmporium", name, 900, 480, master_ui, state)
ui.open()
/datum/cellular_emporium/ui_data(mob/user)
diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm
index 2322a9ef3..84faf4647 100644
--- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm
+++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm
@@ -192,12 +192,13 @@
ui_interact(user)
return TRUE
-/obj/item/clockwork/slab/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
+/obj/item/clockwork/slab/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
+ // TGUI TODO: do something with this UI
ui = new(user, src, ui_key, "clockwork_slab", name, 800, 420, master_ui, state)
ui.set_autoupdate(FALSE) //we'll update this occasionally, but not as often as possible
- ui.set_style("clockwork")
+ // ui.set_style("clockwork")
ui.open()
/obj/item/clockwork/slab/proc/recite_scripture(datum/clockwork_scripture/scripture, mob/living/user)
diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
index dbb49901b..57800e5cd 100644
--- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
+++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm
@@ -260,11 +260,11 @@
ui_mode = NUKEUI_AWAIT_TIMER
-/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=GLOB.default_state)
+/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/tgui_state/state=GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nuclear_bomb", name, 350, 442, master_ui, state)
- ui.set_style(ui_style)
+ ui = new(user, src, ui_key, "NuclearBomb", name, 350, 442, master_ui, state)
+ // ui.set_style(ui_style)
ui.open()
/obj/machinery/nuclearbomb/ui_data(mob/user)
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index e8f21c3f0..28a2152af 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -47,14 +47,14 @@
holder.update_icon()
return
-/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
if(!is_secured(user))
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/ui_width = 280
var/ui_height = 132
- ui = new(user, src, ui_key, "signaler", name, ui_width, ui_height, master_ui, state)
+ ui = new(user, src, ui_key, "Signaler", name, ui_width, ui_height, master_ui, state)
ui.open()
/obj/item/assembly/signaler/ui_data(mob/user)
diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm
index f38c40dc0..3ab1e57aa 100644
--- a/code/modules/asset_cache/asset_list_items.dm
+++ b/code/modules/asset_cache/asset_list_items.dm
@@ -1,27 +1,9 @@
//DEFINITIONS FOR ASSET DATUMS START HERE.
-/* uncomment this and delete the tgui def bellow this for the new tgui
/datum/asset/simple/tgui
assets = list(
"tgui.bundle.js" = 'tgui/packages/tgui/public/tgui.bundle.js',
"tgui.bundle.css" = 'tgui/packages/tgui/public/tgui.bundle.css',
)
-*/
-/datum/asset/simple/tgui
- assets = list(
- // Old TGUI
- "tgui.css" = 'tgui/assets/tgui.css',
- "tgui.js" = 'tgui/assets/tgui.js',
- // tgui-next
- "tgui-main.html" = 'tgui-next/packages/tgui/public/tgui-main.html',
- "tgui.bundle.js" = 'tgui-next/packages/tgui/public/tgui.bundle.js',
- "tgui.bundle.css" = 'tgui-next/packages/tgui/public/tgui.bundle.css',
- // Old TGUI compatability
- "tgui-fallback.html" = 'tgui-next/packages/tgui/public/tgui-fallback.html',
- "shim-html5shiv.js" = 'tgui-next/packages/tgui/public/shim-html5shiv.js',
- "shim-ie8.js" = 'tgui-next/packages/tgui/public/shim-ie8.js',
- "shim-dom4.js" = 'tgui-next/packages/tgui/public/shim-dom4.js',
- "shim-css-om.js" = 'tgui-next/packages/tgui/public/shim-css-om.js',
- )
/datum/asset/group/tgui
children = list(
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 253530bd2..da47471b4 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -237,10 +237,10 @@
return UI_CLOSE
/obj/machinery/airalarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "airalarm", name, 440, 650, master_ui, state)
+ ui = new(user, src, ui_key, "AirAlarm", name, 440, 650, master_ui, state)
ui.open()
/obj/machinery/airalarm/ui_data(mob/user)
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
index 02eb95aca..4e18e253d 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
@@ -88,10 +88,10 @@ Passive gate is similar to the regular pump except:
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosPump", name, 335, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/binary/passive_gate/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
index 9e49953df..72d0fe0b4 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
@@ -108,10 +108,10 @@
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosPump", name, 335, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/binary/pump/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm
index bc58ef158..4ad2b8d64 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm
@@ -61,10 +61,10 @@
open()
/obj/machinery/atmospherics/components/binary/relief_valve/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_relief", name, 335, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosRelief", name, 335, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/binary/relief_valve/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
index dc402e733..b0392ff59 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
@@ -111,10 +111,10 @@
radio_connection.post_signal(src, signal)
/obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_pump", name, 310, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosPump", name, 310, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/binary/volume_pump/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
index 109902066..74bab35d7 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
@@ -135,10 +135,10 @@
return ..()
/obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_filter", name, 475, 185, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosFilter", name, 475, 185, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/trinary/filter/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
index d8a3d7c02..89bc00aa7 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
@@ -133,10 +133,10 @@
parent3.update = TRUE
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_mixer", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosMixer", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/trinary/mixer/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index 0a54503be..960f1bc4b 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -308,10 +308,10 @@
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
+ ui = new(user, src, ui_key, "Cryo", name, 400, 550, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
index 856cf659d..82ef2c75c 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
@@ -137,10 +137,10 @@
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_pump", name, 310, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosPump", name, 310, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/unary/outlet_injector/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm
index 4b6a4a4c1..dfa3c8130 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm
@@ -62,10 +62,10 @@
update_parents()
/obj/machinery/atmospherics/components/unary/relief_valve/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "atmos_relief", name, 335, 115, master_ui, state)
+ ui = new(user, src, ui_key, "AtmosRelief", name, 335, 115, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/unary/relief_valve/ui_data()
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
index 877826c1c..85f7f26cb 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm
@@ -125,10 +125,10 @@
return UI_CLOSE
/obj/machinery/atmospherics/components/unary/thermomachine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "thermomachine", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "ThermoMachine", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/atmospherics/components/unary/thermomachine/ui_data(mob/user)
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index e7f96e05f..c5041343d 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -389,10 +389,10 @@
return FALSE
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "canister", name, 420, 405, master_ui, state)
+ ui = new(user, src, ui_key, "Canister", name, 420, 405, master_ui, state)
ui.open()
/obj/machinery/portable_atmospherics/canister/ui_data()
diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm
index ddb907a2a..d00af7837 100644
--- a/code/modules/atmospherics/machinery/portable/pump.dm
+++ b/code/modules/atmospherics/machinery/portable/pump.dm
@@ -81,10 +81,10 @@
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "portable_pump", name, 300, 315, master_ui, state)
+ ui = new(user, src, ui_key, "PortablePump", name, 300, 315, master_ui, state)
ui.open()
/obj/machinery/portable_atmospherics/pump/ui_data()
diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm
index 0c902e042..800e3eb22 100644
--- a/code/modules/atmospherics/machinery/portable/scrubber.dm
+++ b/code/modules/atmospherics/machinery/portable/scrubber.dm
@@ -64,10 +64,10 @@
update_icon()
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "portable_scrubber", name, 320, 335, master_ui, state)
+ ui = new(user, src, ui_key, "PortableScrubber", name, 320, 335, master_ui, state)
ui.open()
/obj/machinery/portable_atmospherics/scrubber/ui_data()
diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm
index 18d32d3b1..138253067 100644
--- a/code/modules/cargo/centcom_podlauncher.dm
+++ b/code/modules/cargo/centcom_podlauncher.dm
@@ -51,11 +51,11 @@
orderedArea = createOrderedArea(bay) //Order all the turfs in the selected bay (top left to bottom right) to a single list. Used for the "ordered" mode (launchChoice = 1)
/datum/centcom_podlauncher/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, \
-force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)//ui_interact is called when the client verb is called.
+force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_admin_state)//ui_interact is called when the client verb is called.
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "centcom_podlauncher", "Config/Launch Supplypod", 700, 700, master_ui, state)
+ ui = new(user, src, ui_key, "CentcomPodLauncher", "Config/Launch Supplypod", 700, 700, master_ui, state)
ui.open()
/datum/centcom_podlauncher/ui_data(mob/user) //Sends info about the pod to the UI.
diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm
index 7162352d5..f871517ab 100644
--- a/code/modules/cargo/console.dm
+++ b/code/modules/cargo/console.dm
@@ -65,10 +65,10 @@
update_static_data(user)
/obj/machinery/computer/cargo/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "cargo", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "Cargo", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/cargo/ui_data()
@@ -171,7 +171,6 @@
return
if((pack.hidden && !(obj_flags & EMAGGED)) || (pack.contraband && !contraband) || pack.DropPodOnly)
return
-
var/name = "*None Provided*"
var/rank = "*None Provided*"
var/ckey = usr.ckey
diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm
index 00c020e66..d661d0482 100644
--- a/code/modules/cargo/expressconsole.dm
+++ b/code/modules/cargo/expressconsole.dm
@@ -87,10 +87,10 @@
"desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name.
))
-/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
+/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state) // Remember to use the appropriate state.
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "cargo_express", name, 600, 700, master_ui, state)
+ ui = new(user, src, ui_key, "CargoExpress", name, 600, 700, master_ui, state)
ui.open()
/obj/machinery/computer/cargo/express/ui_data(mob/user)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index 5790f028c..fe4fc7835 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -152,10 +152,10 @@
adjust_item_drop_location(O)
-/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "smartvend", name, 440, 550, master_ui, state)
+ ui = new(user, src, ui_key, "SmartVend", name, 440, 550, master_ui, state)
ui.set_autoupdate(FALSE)
ui.open()
diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm
index f4df6dc6c..5afd5316d 100644
--- a/code/modules/holodeck/computer.dm
+++ b/code/modules/holodeck/computer.dm
@@ -78,10 +78,10 @@
. = ..()
toggle_power(!stat)
-/obj/machinery/computer/holodeck/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/holodeck/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "holodeck", name, 400, 500, master_ui, state)
+ ui = new(user, src, ui_key, "Holodeck", name, 400, 500, master_ui, state)
ui.open()
/obj/machinery/computer/holodeck/ui_data(mob/user)
diff --git a/code/modules/language/language_menu.dm b/code/modules/language/language_menu.dm
index eea87f1d8..c7aa44426 100644
--- a/code/modules/language/language_menu.dm
+++ b/code/modules/language/language_menu.dm
@@ -8,10 +8,10 @@
language_holder = null
. = ..()
-/datum/language_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.language_menu_state)
+/datum/language_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.language_menu_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "language_menu", "Language Menu", 700, 600, master_ui, state)
+ ui = new(user, src, ui_key, "LanguageMenu", "Language Menu", 700, 600, master_ui, state)
ui.open()
/datum/language_menu/ui_data(mob/user)
diff --git a/code/modules/library/lib_codex_gigas.dm b/code/modules/library/lib_codex_gigas.dm
index 57bf37d52..89840805e 100644
--- a/code/modules/library/lib_codex_gigas.dm
+++ b/code/modules/library/lib_codex_gigas.dm
@@ -96,10 +96,10 @@
return currentSection != oldSection
/obj/item/book/codex_gigas/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "codex_gigas", name, 450, 450, master_ui, state)
+ ui = new(user, src, ui_key, "CodexGigas", name, 450, 450, master_ui, state)
ui.open()
/obj/item/book/codex_gigas/ui_data(mob/user)
diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm
index bc06e35e6..b88a450c1 100644
--- a/code/modules/library/soapstone.dm
+++ b/code/modules/library/soapstone.dm
@@ -206,10 +206,10 @@
/obj/structure/chisel_message/interact()
return
-/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
+/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_always_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "engraved_message", name, 600, 300, master_ui, state)
+ ui = new(user, src, ui_key, "EngravedMessage", name, 600, 300, master_ui, state)
ui.open()
/obj/structure/chisel_message/ui_data(mob/user)
diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm
index 75481efc9..2fb018daf 100644
--- a/code/modules/mining/laborcamp/laborstacker.dm
+++ b/code/modules/mining/laborcamp/laborstacker.dm
@@ -33,10 +33,10 @@ GLOBAL_LIST(labor_sheet_values)
return a["value"] - b["value"]
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "labor_claim_console", name, 315, 430, master_ui, state)
+ ui = new(user, src, ui_key, "LaborClaimConsole", name, 315, 430, master_ui, state)
ui.open()
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 34262af1d..d85c1205a 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -189,10 +189,10 @@
to_chat(user, "You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].")
return TRUE
-/obj/machinery/mineral/ore_redemption/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/mineral/ore_redemption/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ore_redemption_machine", "Ore Redemption Machine", 440, 550, master_ui, state)
+ ui = new(user, src, ui_key, "OreRedemptionMachine", "Ore Redemption Machine", 440, 550, master_ui, state)
ui.open()
/obj/machinery/mineral/ore_redemption/ui_data(mob/user)
diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm
index d78a406b8..63cb8a04a 100644
--- a/code/modules/mining/satchel_ore_boxdm.dm
+++ b/code/modules/mining/satchel_ore_boxdm.dm
@@ -55,10 +55,10 @@
drop = drop_location()
/obj/structure/ore_box/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ore_box", name, 335, 415, master_ui, state)
+ ui = new(user, src, ui_key, "OreBox", name, 335, 415, master_ui, state)
ui.open()
/obj/structure/ore_box/ui_data()
diff --git a/code/modules/mob/dead/observer/notificationprefs.dm b/code/modules/mob/dead/observer/notificationprefs.dm
index 6c1d76eaf..244ca81e7 100644
--- a/code/modules/mob/dead/observer/notificationprefs.dm
+++ b/code/modules/mob/dead/observer/notificationprefs.dm
@@ -21,10 +21,10 @@
else
src.user = user
-/datum/notificationpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
+/datum/notificationpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_observer_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "notificationpanel", "Notification Preferences", 270, 360, master_ui, state)
+ ui = new(user, src, ui_key, "NotificationPreferences", "Notification Preferences", 270, 360, master_ui, state)
ui.open()
/datum/notificationpanel/ui_data(mob/user)
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index 3e51d6fb2..07e36c9ba 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -113,7 +113,6 @@
/mob/proc/is_holding(obj/item/I)
return get_held_index_of_item(I)
-
//Checks if we're holding an item of type: typepath
/mob/proc/is_holding_item_of_type(typepath)
for(var/obj/item/I in held_items)
diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
index 137cca07d..51c355e23 100644
--- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
@@ -270,11 +270,11 @@
else
ui_interact(owner)
-/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state)
+/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_always_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "slime_swap_body", name, 400, 400, master_ui, state)
+ ui = new(user, src, ui_key, "SlimeBodySwapper", name, 400, 400, master_ui, state)
ui.open()
/datum/action/innate/swap_body/ui_data(mob/user)
diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm
index 15a04235c..2df51f41f 100644
--- a/code/modules/mob/living/silicon/ai/life.dm
+++ b/code/modules/mob/living/silicon/ai/life.dm
@@ -151,7 +151,7 @@
to_chat(src, "Receiving control information from APC.")
sleep(2)
apc_override = 1
- theAPC.ui_interact(src, state = GLOB.conscious_state)
+ theAPC.ui_interact(src, state = GLOB.tgui_conscious_state)
apc_override = 0
aiRestorePowerRoutine = POWER_RESTORATION_APC_FOUND
sleep(50)
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 0e8e009ca..2b91e5270 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -170,10 +170,10 @@
ui_interact(user)
/mob/living/simple_animal/bot/mulebot/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "mulebot", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "Mule", name, ui_x, ui_y, master_ui, state)
ui.open()
/mob/living/simple_animal/bot/mulebot/ui_data(mob/user)
diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm
index 3e67a1487..517fab278 100644
--- a/code/modules/modular_computers/computers/item/computer_ui.dm
+++ b/code/modules/modular_computers/computers/item/computer_ui.dm
@@ -3,7 +3,7 @@
ui_interact(user)
// Operates TGUI
-/obj/item/modular_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/item/modular_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
if(!enabled)
if(ui)
ui.close()
@@ -38,8 +38,8 @@
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
assets.send(user)
- ui = new(user, src, ui_key, "ntos_main", "NtOS Main menu", 400, 500, master_ui, state)
- ui.set_style("ntos")
+ ui = new(user, src, ui_key, "NtosMain", "NtOS Main menu", 400, 500, master_ui, state)
+ // ui.set_style("ntos")
ui.open()
ui.set_autoupdate(state = 1)
diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm
index f661f0ec1..dc85c094d 100644
--- a/code/modules/modular_computers/file_system/program.dm
+++ b/code/modules/modular_computers/file_system/program.dm
@@ -138,7 +138,7 @@
return TRUE
-/datum/computer_file/program/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/datum/computer_file/program/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui && tgui_id)
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
@@ -146,8 +146,8 @@
ui = new(user, src, ui_key, tgui_id, filedesc, ui_x, ui_y, state = state)
- if(ui_style)
- ui.set_style(ui_style)
+ // if(ui_style)
+ // ui.set_style(ui_style)
ui.set_autoupdate(state = 1)
ui.open()
diff --git a/code/modules/modular_computers/file_system/programs/airestorer.dm b/code/modules/modular_computers/file_system/programs/airestorer.dm
index 1aa292f24..a715af66f 100644
--- a/code/modules/modular_computers/file_system/programs/airestorer.dm
+++ b/code/modules/modular_computers/file_system/programs/airestorer.dm
@@ -8,7 +8,7 @@
usage_flags = PROGRAM_CONSOLE
transfer_access = ACCESS_HEADS
available_on_ntnet = 1
- tgui_id = "ntos_ai_restorer"
+ tgui_id = "NtosAiRestorer"
ui_x = 600
ui_y = 400
diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm
index ca075b51e..ebfd3c0ad 100644
--- a/code/modules/modular_computers/file_system/programs/alarm.dm
+++ b/code/modules/modular_computers/file_system/programs/alarm.dm
@@ -7,7 +7,7 @@
requires_ntnet = 1
network_destination = "alarm monitoring network"
size = 5
- tgui_id = "ntos_station_alert"
+ tgui_id = "NtosStationAlertConsole"
ui_x = 315
ui_y = 500
diff --git a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm
index 337e98aca..336f255c5 100644
--- a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm
+++ b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm
@@ -7,7 +7,7 @@
requires_ntnet = 1
available_on_ntnet = 0
available_on_syndinet = 1
- tgui_id = "ntos_net_dos"
+ tgui_id = "NtosNetDos"
ui_style = "syndicate"
ui_x = 400
ui_y = 250
@@ -80,17 +80,8 @@
else if(target && executed)
data["target"] = 1
data["speed"] = dos_speed
-
- // This is mostly visual, generate some strings of 1s and 0s
- // Probability of 1 is equal of completion percentage of DoS attack on this relay.
- // Combined with UI updates this adds quite nice effect to the UI
- var/percentage = target.dos_overload * 100 / target.dos_capacity
- data["dos_strings"] = list()
- for(var/j, j<10, j++)
- var/string = ""
- for(var/i, i<20, i++)
- string = "[string][prob(percentage)]"
- data["dos_strings"] += list(list("nums" = string))
+ data["overload"] = target.dos_overload
+ data["capacity"] = target.dos_capacity
else
data["relays"] = list()
for(var/obj/machinery/ntnet_relay/R in SSnetworks.station_network.relays)
diff --git a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
index 103b70e49..3e8f0edf7 100644
--- a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
+++ b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm
@@ -7,7 +7,7 @@
requires_ntnet = 0
available_on_ntnet = 0
available_on_syndinet = 1
- tgui_id = "ntos_revelation"
+ tgui_id = "NtosRevelation"
ui_style = "syndicate"
ui_x = 400
ui_y = 250
diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm
index 8319dee60..75c51b00e 100644
--- a/code/modules/modular_computers/file_system/programs/card.dm
+++ b/code/modules/modular_computers/file_system/programs/card.dm
@@ -6,7 +6,7 @@
transfer_access = ACCESS_HEADS
requires_ntnet = 0
size = 8
- tgui_id = "ntos_card"
+ tgui_id = "NtosCard"
ui_x = 600
ui_y = 700
@@ -15,7 +15,7 @@
var/show_assignments = 0
var/minor = 0
var/authenticated = 0
- var/list/reg_ids = list()
+ var/reg_ids = 1
var/list/region_access = null
var/list/head_subordinates = null
var/target_dept = 0 //Which department this computer has access to. 0=all departments
@@ -94,6 +94,134 @@
return formatted
+
+/datum/computer_file/program/card_mod/ui_data(mob/user)
+ var/list/data = get_header_data()
+
+ var/obj/item/computer_hardware/card_slot/card_slot
+ var/obj/item/computer_hardware/printer/printer
+
+ if(computer)
+ card_slot = computer.all_components[MC_CARD]
+ printer = computer.all_components[MC_PRINT]
+
+ data["mmode"] = mod_mode
+
+ var/authed = 0
+ if(computer)
+ if(card_slot)
+ var/obj/item/card/id/auth_card = card_slot.stored_card2
+ data["auth_name"] = auth_card ? strip_html_simple(auth_card.name) : "-----"
+ authed = authorized()
+
+
+ if(mod_mode == 2)
+ data["slots"] = list()
+ var/list/pos = list()
+ for(var/datum/job/job in SSjob.occupations)
+ if(job.title in blacklisted)
+ continue
+
+ var/list/status_open = build_manage(job,1)
+ var/list/status_close = build_manage(job,0)
+
+ pos.Add(list(list(
+ "title" = job.title,
+ "current" = job.current_positions,
+ "total" = job.total_positions,
+ "status_open" = (authed && !minor) ? status_open["enable"]: 0,
+ "status_close" = (authed && !minor) ? status_close["enable"] : 0,
+ "desc_open" = status_open["desc"],
+ "desc_close" = status_close["desc"])))
+ data["slots"] = pos
+
+ data["src"] = "[REF(src)]"
+
+
+ if(!mod_mode)
+ data["manifest"] = list()
+ var/list/crew = list()
+ for(var/datum/data/record/t in sortRecord(GLOB.data_core.general))
+ crew.Add(list(list(
+ "name" = t.fields["name"],
+ "rank" = t.fields["rank"])))
+
+ data["manifest"] = crew
+ data["assignments"] = show_assignments
+ if(computer)
+ data["have_id_slot"] = !!card_slot
+ data["have_printer"] = !!printer
+ if(!card_slot && mod_mode == 1)
+ mod_mode = 0 //We can't modify IDs when there is no card reader
+ else
+ data["have_id_slot"] = 0
+ data["have_printer"] = 0
+
+ data["authenticated"] = authed
+
+ if(mod_mode == 1 && computer)
+ if(card_slot)
+ var/obj/item/card/id/id_card = card_slot.stored_card
+
+ data["has_id"] = !!id_card
+ data["id_rank"] = id_card && id_card.assignment ? html_encode(id_card.assignment) : "Unassigned"
+ data["id_owner"] = id_card && id_card.registered_name ? html_encode(id_card.registered_name) : "-----"
+ data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----"
+
+ if(card_slot.stored_card)
+ var/obj/item/card/id/id_card = card_slot.stored_card
+
+ if(is_centcom)
+ var/list/all_centcom_access = list()
+ for(var/access in get_all_centcom_access())
+ all_centcom_access.Add(list(list(
+ "desc" = replacetext(get_centcom_access_desc(access), " ", " "),
+ "ref" = access,
+ "allowed" = (access in id_card.access) ? 1 : 0)))
+ data["all_centcom_access"] = all_centcom_access
+ else
+ var/list/accesses = list()
+ for(var/access in get_region_accesses(reg_ids))
+ if (get_access_desc(access))
+ accesses.Add(list(list(
+ "desc" = replacetext(get_access_desc(access), " ", " "),
+ "ref" = access,
+ "allowed" = (access in id_card.access) ? 1 : 0)))
+
+ var/list/regions = list()
+ for(var/i = 1; i <= 7; i++)
+ if((minor || target_dept) && !(i in region_access))
+ continue
+
+ regions.Add(list(list(
+ "name" = get_region_accesses_name(i),
+ "regid" = i,
+ "selected" = (reg_ids == i) ? 1 : null,
+ "accesses" = (reg_ids == i) ? accesses : null)))
+ data["regions"] = regions
+
+ return data
+
+
+/datum/computer_file/program/card_mod/ui_static_data(mob/user)
+ var/list/data = list()
+
+ data["station_name"] = station_name()
+ data["centcom_access"] = is_centcom
+ data["minor"] = target_dept || minor ? TRUE : FALSE
+
+ if(authenticated)
+ data["engineering_jobs"] = format_jobs(GLOB.engineering_positions)
+ data["medical_jobs"] = format_jobs(GLOB.medical_positions)
+ data["science_jobs"] = format_jobs(GLOB.science_positions)
+ data["security_jobs"] = format_jobs(GLOB.security_positions)
+ data["cargo_jobs"] = format_jobs(GLOB.supply_positions)
+ data["civilian_jobs"] = format_jobs(GLOB.civilian_positions)
+ data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
+
+ return data
+
+
/datum/computer_file/program/card_mod/ui_act(action, params)
if(..())
return 1
@@ -127,11 +255,6 @@
mod_mode = 0
else if (params["target"] == "manage")
mod_mode = 2
- if("PRG_togglea")
- if(show_assignments)
- show_assignments = 0
- else
- show_assignments = 1
if("PRG_print")
if(computer && printer) //This option should never be called if there is no printer
if(mod_mode)
@@ -270,13 +393,8 @@
j.total_positions--
opened_positions[edit_job_target]--
if("PRG_regsel")
- if(!reg_ids)
- reg_ids = list()
var/regsel = text2num(params["region"])
- if(regsel in reg_ids)
- reg_ids -= regsel
- else
- reg_ids += regsel
+ reg_ids = regsel
if(id_card)
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
@@ -290,133 +408,6 @@
/datum/computer_file/program/card_mod/proc/apply_access(obj/item/card/id/id_card, list/accesses)
id_card.access |= accesses
-/datum/computer_file/program/card_mod/ui_data(mob/user)
-
- var/list/data = get_header_data()
-
- var/obj/item/computer_hardware/card_slot/card_slot
- var/obj/item/computer_hardware/printer/printer
-
- if(computer)
- card_slot = computer.all_components[MC_CARD]
- printer = computer.all_components[MC_PRINT]
-
- data["mmode"] = mod_mode
-
- var/authed = 0
- if(computer)
- if(card_slot)
- var/obj/item/card/id/auth_card = card_slot.stored_card2
- data["auth_name"] = auth_card ? strip_html_simple(auth_card.name) : "-----"
- authed = authorized()
-
-
- if(mod_mode == 2)
- data["slots"] = list()
- var/list/pos = list()
- for(var/datum/job/job in SSjob.occupations)
- if(job.title in blacklisted)
- continue
-
- var/list/status_open = build_manage(job,1)
- var/list/status_close = build_manage(job,0)
-
- pos.Add(list(list(
- "title" = job.title,
- "current" = job.current_positions,
- "total" = job.total_positions,
- "status_open" = (authed && !minor) ? status_open["enable"]: 0,
- "status_close" = (authed && !minor) ? status_close["enable"] : 0,
- "desc_open" = status_open["desc"],
- "desc_close" = status_close["desc"])))
- data["slots"] = pos
-
- data["src"] = "[REF(src)]"
- data["station_name"] = station_name()
-
-
- if(!mod_mode)
- data["manifest"] = list()
- var/list/crew = list()
- for(var/datum/data/record/t in sortRecord(GLOB.data_core.general))
- crew.Add(list(list(
- "name" = t.fields["name"],
- "rank" = t.fields["rank"])))
-
- data["manifest"] = crew
- data["assignments"] = show_assignments
- if(computer)
- data["have_id_slot"] = !!card_slot
- data["have_printer"] = !!printer
- if(!card_slot && mod_mode == 1)
- mod_mode = 0 //We can't modify IDs when there is no card reader
- else
- data["have_id_slot"] = 0
- data["have_printer"] = 0
-
- data["centcom_access"] = is_centcom
-
-
- data["authenticated"] = authed
-
-
- if(mod_mode == 1 && computer)
- if(card_slot)
- var/obj/item/card/id/id_card = card_slot.stored_card
-
- data["has_id"] = !!id_card
- data["id_rank"] = id_card && id_card.assignment ? html_encode(id_card.assignment) : "Unassigned"
- data["id_owner"] = id_card && id_card.registered_name ? html_encode(id_card.registered_name) : "-----"
- data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----"
-
- if(show_assignments)
- data["engineering_jobs"] = format_jobs(GLOB.engineering_positions)
- data["medical_jobs"] = format_jobs(GLOB.medical_positions)
- data["science_jobs"] = format_jobs(GLOB.science_positions)
- data["security_jobs"] = format_jobs(GLOB.security_positions)
- data["cargo_jobs"] = format_jobs(GLOB.supply_positions)
- data["civilian_jobs"] = format_jobs(GLOB.civilian_positions)
- data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
-
-
- if(card_slot.stored_card)
- var/obj/item/card/id/id_card = card_slot.stored_card
- if(is_centcom)
- var/list/all_centcom_access = list()
- for(var/access in get_all_centcom_access())
- all_centcom_access.Add(list(list(
- "desc" = replacetext(get_centcom_access_desc(access), " ", " "),
- "ref" = access,
- "allowed" = (access in id_card.access) ? 1 : 0)))
- data["all_centcom_access"] = all_centcom_access
- else
- var/list/regions = list()
- for(var/i = 1; i <= 7; i++)
- if((minor || target_dept) && !(i in region_access))
- continue
-
- var/list/accesses = list()
- if(i in reg_ids)
- for(var/access in get_region_accesses(i))
- if (get_access_desc(access))
- accesses.Add(list(list(
- "desc" = replacetext(get_access_desc(access), " ", " "),
- "ref" = access,
- "allowed" = (access in id_card.access) ? 1 : 0)))
-
- regions.Add(list(list(
- "name" = get_region_accesses_name(i),
- "regid" = i,
- "selected" = (i in reg_ids) ? 1 : null,
- "accesses" = accesses)))
- data["regions"] = regions
-
- data["minor"] = target_dept || minor ? 1 : 0
-
-
- return data
-
-
/datum/computer_file/program/card_mod/proc/build_manage(datum/job,open = FALSE)
var/out = "Denied"
var/can_change= 0
diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm
index 2d60323d1..76da58ea1 100644
--- a/code/modules/modular_computers/file_system/programs/configurator.dm
+++ b/code/modules/modular_computers/file_system/programs/configurator.dm
@@ -14,7 +14,7 @@
ui_y = 630
available_on_ntnet = 0
requires_ntnet = 0
- tgui_id = "ntos_configuration"
+ tgui_id = "NtosConfiguration"
var/obj/item/modular_computer/movable = null
diff --git a/code/modules/modular_computers/file_system/programs/file_browser.dm b/code/modules/modular_computers/file_system/programs/file_browser.dm
index 090d64e9d..4b7dba165 100644
--- a/code/modules/modular_computers/file_system/programs/file_browser.dm
+++ b/code/modules/modular_computers/file_system/programs/file_browser.dm
@@ -7,10 +7,7 @@
requires_ntnet = 0
available_on_ntnet = 0
undeletable = 1
- tgui_id = "ntos_file_manager"
-
- var/open_file
- var/error
+ tgui_id = "NtosFileManager"
/datum/computer_file/program/filemanager/ui_act(action, params)
if(..())
@@ -18,23 +15,8 @@
var/obj/item/computer_hardware/hard_drive/HDD = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/hard_drive/RHDD = computer.all_components[MC_SDD]
- var/obj/item/computer_hardware/printer/printer = computer.all_components[MC_PRINT]
switch(action)
- if("PRG_openfile")
- . = 1
- open_file = params["name"]
- if("PRG_newtextfile")
- . = 1
- var/newname = stripped_input(usr, "Enter file name or leave blank to cancel:", "File rename", max_length=50)
- if(!newname)
- return 1
- if(!HDD)
- return 1
- var/datum/computer_file/data/F = new/datum/computer_file/data()
- F.filename = newname
- F.filetype = "TXT"
- HDD.store_file(F)
if("PRG_deletefile")
. = 1
if(!HDD)
@@ -51,19 +33,6 @@
if(!file || file.undeletable)
return 1
RHDD.remove_file(file)
- if("PRG_closefile")
- . = 1
- open_file = null
- error = null
- if("PRG_clone")
- . = 1
- if(!HDD)
- return 1
- var/datum/computer_file/F = HDD.find_file_by_name(params["name"])
- if(!F || !istype(F))
- return 1
- var/datum/computer_file/C = F.clone(1)
- HDD.store_file(C)
if("PRG_rename")
. = 1
if(!HDD)
@@ -74,47 +43,15 @@
var/newname = stripped_input(usr, "Enter new file name:", "File rename", file.filename, max_length=50)
if(file && newname)
file.filename = newname
- if("PRG_edit")
- . = 1
- if(!open_file)
+ if("PRG_usbrenamefile")
+ if(!RHDD)
return 1
- if(!HDD)
- return 1
- var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
- if(!F || !istype(F))
- return 1
- if(F.do_not_edit && (alert("WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", "No", "Yes") == "No"))
- return 1
- // 16384 is the limit for file length in characters. Currently, papers have value of 2048 so this is 8 times as long, since we can't edit parts of the file independently.
- var/newtext = stripped_multiline_input(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", html_decode(F.stored_data), 16384, TRUE)
- if(!newtext)
- return
- if(F)
- var/datum/computer_file/data/backup = F.clone()
- HDD.remove_file(F)
- F.stored_data = newtext
- F.calculate_size()
- // We can't store the updated file, it's probably too large. Print an error and restore backed up version.
- // This is mostly intended to prevent people from losing texts they spent lot of time working on due to running out of space.
- // They will be able to copy-paste the text from error screen and store it in notepad or something.
- if(!HDD.store_file(F))
- error = "I/O error: Unable to overwrite file. Hard drive is probably full. You may want to backup your changes before closing this window:
[F.stored_data]
"
- HDD.store_file(backup)
- if("PRG_printfile")
- . = 1
- if(!open_file)
- return 1
- if(!HDD)
- return 1
- var/datum/computer_file/data/F = HDD.find_file_by_name(open_file)
- if(!F || !istype(F))
- return 1
- if(!printer)
- error = "Missing Hardware: Your computer does not have required hardware to complete this operation."
- return 1
- if(!printer.print_text("" + prepare_printjob(F.stored_data) + "", open_file))
- error = "Hardware error: Printer was unable to print the file. It may be out of paper."
+ var/datum/computer_file/file = RHDD.find_file_by_name(params["name"])
+ if(!file || !istype(file))
return 1
+ var/newname = stripped_input(usr, "Enter new file name:", "File rename", file.filename, max_length=50)
+ if(file && newname)
+ file.filename = newname
if("PRG_copytousb")
. = 1
if(!HDD || !RHDD)
@@ -190,43 +127,29 @@
var/obj/item/computer_hardware/hard_drive/HDD = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/hard_drive/portable/RHDD = computer.all_components[MC_SDD]
- if(error)
- data["error"] = error
- if(open_file)
- var/datum/computer_file/data/file
- if(!computer || !HDD)
- data["error"] = "I/O ERROR: Unable to access hard drive."
- else
- file = HDD.find_file_by_name(open_file)
- if(!istype(file))
- data["error"] = "I/O ERROR: Unable to open file."
- else
- data["filedata"] = parse_tags(file.stored_data)
- data["filename"] = "[file.filename].[file.filetype]"
+ if(!computer || !HDD)
+ data["error"] = "I/O ERROR: Unable to access hard drive."
else
- if(!computer || !HDD)
- data["error"] = "I/O ERROR: Unable to access hard drive."
- else
- var/list/files[0]
- for(var/datum/computer_file/F in HDD.stored_files)
- files.Add(list(list(
+ var/list/files[0]
+ for(var/datum/computer_file/F in HDD.stored_files)
+ files.Add(list(list(
+ "name" = F.filename,
+ "type" = F.filetype,
+ "size" = F.size,
+ "undeletable" = F.undeletable
+ )))
+ data["files"] = files
+ if(RHDD)
+ data["usbconnected"] = TRUE
+ var/list/usbfiles[0]
+ for(var/datum/computer_file/F in RHDD.stored_files)
+ usbfiles.Add(list(list(
"name" = F.filename,
"type" = F.filetype,
"size" = F.size,
"undeletable" = F.undeletable
)))
- data["files"] = files
- if(RHDD)
- data["usbconnected"] = 1
- var/list/usbfiles[0]
- for(var/datum/computer_file/F in RHDD.stored_files)
- usbfiles.Add(list(list(
- "name" = F.filename,
- "type" = F.filetype,
- "size" = F.size,
- "undeletable" = F.undeletable
- )))
- data["usbfiles"] = usbfiles
+ data["usbfiles"] = usbfiles
return data
diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm
index 92e1453dc..993e9a01e 100644
--- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm
+++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm
@@ -10,7 +10,7 @@
requires_ntnet_feature = NTNET_SOFTWAREDOWNLOAD
available_on_ntnet = 0
ui_header = "downloader_finished.gif"
- tgui_id = "ntos_net_downloader"
+ tgui_id = "NtosNetDownloader"
var/datum/computer_file/program/downloaded_file = null
var/hacked_download = 0
diff --git a/code/modules/modular_computers/file_system/programs/ntmonitor.dm b/code/modules/modular_computers/file_system/programs/ntmonitor.dm
index 2312db7b1..07ccaf8af 100644
--- a/code/modules/modular_computers/file_system/programs/ntmonitor.dm
+++ b/code/modules/modular_computers/file_system/programs/ntmonitor.dm
@@ -7,7 +7,7 @@
requires_ntnet = 1
required_access = ACCESS_NETWORK //NETWORK CONTROL IS A MORE SECURE PROGRAM.
available_on_ntnet = 1
- tgui_id = "ntos_net_monitor"
+ tgui_id = "NtosNetMonitor"
/datum/computer_file/program/ntnetmonitor/ui_act(action, params)
if(..())
diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm
index d8b3f96f4..4ae5bd326 100644
--- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm
+++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm
@@ -9,7 +9,7 @@
network_destination = "NTNRC server"
ui_header = "ntnrc_idle.gif"
available_on_ntnet = 1
- tgui_id = "ntos_net_chat"
+ tgui_id = "NtosNetChat"
ui_x = 900
ui_y = 675
diff --git a/code/modules/modular_computers/file_system/programs/nttransfer.dm b/code/modules/modular_computers/file_system/programs/nttransfer.dm
index 698e55794..ae5423a1a 100644
--- a/code/modules/modular_computers/file_system/programs/nttransfer.dm
+++ b/code/modules/modular_computers/file_system/programs/nttransfer.dm
@@ -8,7 +8,7 @@
requires_ntnet_feature = NTNET_PEERTOPEER
network_destination = "other device via P2P tunnel"
available_on_ntnet = 1
- tgui_id = "ntos_net_transfer"
+ tgui_id = "NtosNetTransfer"
var/error = "" // Error screen
var/server_password = "" // Optional password to download the file.
diff --git a/code/modules/modular_computers/file_system/programs/powermonitor.dm b/code/modules/modular_computers/file_system/programs/powermonitor.dm
index f7c734667..767047619 100644
--- a/code/modules/modular_computers/file_system/programs/powermonitor.dm
+++ b/code/modules/modular_computers/file_system/programs/powermonitor.dm
@@ -11,7 +11,7 @@
requires_ntnet = 0
network_destination = "power monitoring system"
size = 9
- tgui_id = "ntos_power_monitor"
+ tgui_id = "PowerMonitor"
ui_style = "ntos"
ui_x = 550
ui_y = 700
diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm
index dbee59bb3..058b0b95b 100644
--- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm
+++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm
@@ -8,7 +8,7 @@
transfer_access = ACCESS_CONSTRUCTION
network_destination = "supermatter monitoring system"
size = 5
- tgui_id = "ntos_supermatter_monitor"
+ tgui_id = "NtosSupermatterMonitor"
ui_style = "ntos"
ui_x = 600
ui_y = 350
diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm
index 2bed456c4..c13b68028 100644
--- a/code/modules/modular_computers/laptop_vendor.dm
+++ b/code/modules/modular_computers/laptop_vendor.dm
@@ -224,7 +224,7 @@
return TRUE
return FALSE
-/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
if(stat & (BROKEN | NOPOWER | MAINT))
if(ui)
ui.close()
@@ -232,7 +232,7 @@
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if (!ui)
- ui = new(user, src, ui_key, "computer_fabricator", "Personal Computer Vendor", ui_x, ui_y, state = state)
+ ui = new(user, src, ui_key, "ComputerFabricator", "Personal Computer Vendor", ui_x, ui_y, state = state)
ui.open()
/obj/machinery/lapvend/attackby(obj/item/I, mob/user)
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 8c44b02e2..b291a295c 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -840,11 +840,11 @@
return
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "apc", name, 450, 460, master_ui, state)
+ ui = new(user, src, ui_key, "Apc", name, 450, 460, master_ui, state)
ui.open()
/obj/machinery/power/apc/ui_data(mob/user)
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index d0d1e2b47..80e918d05 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -221,10 +221,10 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
return ..()
/obj/machinery/gravity_generator/main/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "gravity_generator", name, 400, 200, master_ui, state)
+ ui = new(user, src, ui_key, "GravityGenerator", name, 400, 200, master_ui, state)
ui.open()
/obj/machinery/gravity_generator/main/ui_data(mob/user)
diff --git a/code/modules/power/monitor.dm b/code/modules/power/monitor.dm
index f4ee102cc..42ab00b36 100644
--- a/code/modules/power/monitor.dm
+++ b/code/modules/power/monitor.dm
@@ -19,7 +19,7 @@
var/record_interval = 50
var/next_record = 0
var/is_secret_monitor = FALSE
- tgui_id = "power_monitor"
+ tgui_id = "PowerMonitor"
ui_style = "ntos"
/obj/machinery/computer/monitor/secret //Hides the power monitor (such as ones on ruins & CentCom) from PDA's to prevent metagaming.
@@ -84,7 +84,7 @@
demand.Cut(1, 2)
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, tgui_id, name, 550, 700, master_ui, state)
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 774f7ba14..ff1deb071 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -314,10 +314,10 @@
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "smes", name, 340, 440, master_ui, state)
+ ui = new(user, src, ui_key, "Smes", name, 340, 440, master_ui, state)
ui.open()
/obj/machinery/power/smes/ui_data()
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index a0eeae1ea..a3a642f86 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -344,10 +344,10 @@
add_overlay(icon_screen)
/obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "solar_control", name, 380, 230, master_ui, state)
+ ui = new(user, src, ui_key, "SolarControl", name, 380, 230, master_ui, state)
ui.open()
/obj/machinery/power/solar_control/ui_data()
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index 13b68c404..dc7d7e2aa 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -306,10 +306,10 @@
compressor = locate(/obj/machinery/power/compressor) in range(7, src)
/obj/machinery/computer/turbine_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "turbine_computer", name, 300, 200, master_ui, state)
+ ui = new(user, src, ui_key, "TurbineComputer", name, 300, 200, master_ui, state)
ui.open()
/obj/machinery/computer/turbine_computer/ui_data(mob/user)
diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
index 9e6cef6e8..ff2643069 100644
--- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm
@@ -179,10 +179,10 @@
update_icon()
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "chem_dispenser", name, 565, 550, master_ui, state)
+ ui = new(user, src, ui_key, "ChemDispenser", name, 565, 550, master_ui, state)
if(user.hallucinating())
ui.set_autoupdate(FALSE) //to not ruin the immersion by constantly changing the fake chemicals
ui.open()
diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm
index 0b61f6e45..6ea1b8140 100644
--- a/code/modules/reagents/chemistry/machinery/chem_heater.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm
@@ -104,10 +104,10 @@
return ..()
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "chem_heater", name, 275, 400, master_ui, state)
+ ui = new(user, src, ui_key, "ChemHeater", name, 275, 400, master_ui, state)
ui.open()
/obj/machinery/chem_heater/ui_data()
diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm
index f602ee593..b2cd6d95a 100644
--- a/code/modules/reagents/chemistry/machinery/chem_master.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_master.dm
@@ -153,12 +153,12 @@
return ..()
/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
assets.send(user)
- ui = new(user, src, ui_key, "chem_master", name, 500, 550, master_ui, state)
+ ui = new(user, src, ui_key, "ChemMaster", name, 500, 550, master_ui, state)
ui.open()
//Insert our custom spritesheet css link into the html
diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
index ed23e7c75..2425cb8ec 100644
--- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
+++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm
@@ -13,10 +13,10 @@
)
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "chem_synthesizer", name, 390, 330, master_ui, state)
+ ui = new(user, src, ui_key, "ChemSynthesizer", name, 390, 330, master_ui, state)
ui.open()
/obj/machinery/chem_dispenser/chem_synthesizer/ui_act(action, params)
diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm
index 42426b46e..a07c94cae 100644
--- a/code/modules/reagents/chemistry/machinery/pandemic.dm
+++ b/code/modules/reagents/chemistry/machinery/pandemic.dm
@@ -120,10 +120,10 @@
else
cut_overlays()
-/obj/machinery/computer/pandemic/ui_interact(mob/user, ui_key = "main", datum/tgui/ui, force_open = FALSE, datum/tgui/master_ui, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/pandemic/ui_interact(mob/user, ui_key = "main", datum/tgui/ui, force_open = FALSE, datum/tgui/master_ui, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "pandemic", name, 520, 550, master_ui, state)
+ ui = new(user, src, ui_key, "Pandemic", name, 520, 550, master_ui, state)
ui.open()
/obj/machinery/computer/pandemic/ui_data(mob/user)
diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
index 4f97321c3..3573a35ca 100644
--- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm
+++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm
@@ -102,10 +102,10 @@
return ..()
/obj/machinery/smoke_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "smoke_machine", name, 350, 350, master_ui, state)
+ ui = new(user, src, ui_key, "SmokeMachine", name, 350, 350, master_ui, state)
ui.open()
/obj/machinery/smoke_machine/ui_data(mob/user)
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index 2e4f3e60f..eaa1be4c9 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -299,12 +299,12 @@
// handle machine interaction
/obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_notcontained_state)
if(stat & BROKEN)
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "disposal_unit", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "DisposalUnit", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/disposal/bin/ui_data(mob/user)
diff --git a/code/modules/research/nanites/nanite_chamber_computer.dm b/code/modules/research/nanites/nanite_chamber_computer.dm
index 33250c5e7..a4f2f29c9 100644
--- a/code/modules/research/nanites/nanite_chamber_computer.dm
+++ b/code/modules/research/nanites/nanite_chamber_computer.dm
@@ -25,10 +25,10 @@
find_chamber()
..()
-/obj/machinery/computer/nanite_chamber_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/nanite_chamber_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nanite_chamber_control", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "NaniteChamberControl", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/nanite_chamber_control/ui_data()
diff --git a/code/modules/research/nanites/nanite_cloud_controller.dm b/code/modules/research/nanites/nanite_cloud_controller.dm
index 0731d3067..e4b69a705 100644
--- a/code/modules/research/nanites/nanite_cloud_controller.dm
+++ b/code/modules/research/nanites/nanite_cloud_controller.dm
@@ -53,10 +53,10 @@
backup.nanites = cloud_copy
investigate_log("[key_name(user)] created a new nanite cloud backup with id #[cloud_id]", INVESTIGATE_NANITES)
-/obj/machinery/computer/nanite_cloud_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/nanite_cloud_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nanite_cloud_control", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "NaniteCloudControl", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/nanite_cloud_controller/ui_data()
diff --git a/code/modules/research/nanites/nanite_program_hub.dm b/code/modules/research/nanites/nanite_program_hub.dm
index ea4392f23..494553655 100644
--- a/code/modules/research/nanites/nanite_program_hub.dm
+++ b/code/modules/research/nanites/nanite_program_hub.dm
@@ -47,10 +47,10 @@
disk.forceMove(drop_location())
disk = null
-/obj/machinery/nanite_program_hub/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/nanite_program_hub/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nanite_program_hub", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "NaniteProgramHub", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/nanite_program_hub/ui_data()
diff --git a/code/modules/research/nanites/nanite_programmer.dm b/code/modules/research/nanites/nanite_programmer.dm
index d81880c6d..e6f4ed221 100644
--- a/code/modules/research/nanites/nanite_programmer.dm
+++ b/code/modules/research/nanites/nanite_programmer.dm
@@ -34,10 +34,10 @@
disk = null
program = null
-/obj/machinery/nanite_programmer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/nanite_programmer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nanite_programmer", name, ui_x, ui_y, master_ui, state)
+ ui = new(user, src, ui_key, "NaniteProgrammer", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/nanite_programmer/ui_data()
diff --git a/code/modules/research/nanites/nanite_remote.dm b/code/modules/research/nanites/nanite_remote.dm
index 71aecc8f2..349936295 100644
--- a/code/modules/research/nanites/nanite_remote.dm
+++ b/code/modules/research/nanites/nanite_remote.dm
@@ -80,10 +80,10 @@
var/datum/nanite_program/relay/N = X
N.relay_signal(code, relay_code, source)
-/obj/item/nanite_remote/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
+/obj/item/nanite_remote/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "nanite_remote", name, 420, 500, master_ui, state)
+ ui = new(user, src, ui_key, "NaniteRemote", name, 420, 500, master_ui, state)
ui.open()
/obj/item/nanite_remote/ui_data()
diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm
index 8a5856340..a3dc822c7 100644
--- a/code/modules/security_levels/keycard_authentication.dm
+++ b/code/modules/security_levels/keycard_authentication.dm
@@ -31,10 +31,10 @@ GLOBAL_DATUM_INIT(keycard_events, /datum/events, new)
return ..()
/obj/machinery/keycard_auth/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_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)
+ ui = new(user, src, ui_key, "KeycardAuth", name, 375, 125, master_ui, state)
ui.open()
/obj/machinery/keycard_auth/ui_data()
diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm
index e2c1ddc1a..56ffb3450 100644
--- a/code/modules/shuttle/emergency.dm
+++ b/code/modules/shuttle/emergency.dm
@@ -16,11 +16,11 @@
say("Please equip your ID card into your ID slot to authenticate.")
. = ..()
-/obj/machinery/computer/emergency_shuttle/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.human_adjacent_state)
+/obj/machinery/computer/emergency_shuttle/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_human_adjacent_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "emergency_shuttle_console", name,
+ ui = new(user, src, ui_key, "EmergencyShuttleConsole", name,
400, 350, master_ui, state)
ui.open()
diff --git a/code/modules/shuttle/manipulator.dm b/code/modules/shuttle/manipulator.dm
index dcfb0793b..519f1c2d3 100644
--- a/code/modules/shuttle/manipulator.dm
+++ b/code/modules/shuttle/manipulator.dm
@@ -44,10 +44,10 @@
// Only admins can use this, but they can use it from anywhere
return user.client && check_rights_for(user.client, R_ADMIN)
-/obj/machinery/shuttle_manipulator/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.admin_state)
+/obj/machinery/shuttle_manipulator/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_admin_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "shuttle_manipulator", name, 800, 600, master_ui, state)
+ ui = new(user, src, ui_key, "ShuttleManipulator", name, 800, 600, master_ui, state)
ui.open()
/proc/shuttlemode2str(mode)
diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm
index 4600a1a0a..839582c8a 100644
--- a/code/modules/station_goals/bsa.dm
+++ b/code/modules/station_goals/bsa.dm
@@ -220,10 +220,10 @@
var/area_aim = FALSE //should also show areas for targeting
/obj/machinery/computer/bsa_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+ datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "bsa", name, 400, 220, master_ui, state)
+ ui = new(user, src, ui_key, "BluespaceArtillery", name, 400, 220, master_ui, state)
ui.open()
/obj/machinery/computer/bsa_control/ui_data()
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index 3073a6fcc..242adf209 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -174,11 +174,11 @@
. = ..()
-/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
+/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
roll_powers(user)
- ui = new(user, src, ui_key, "dna_vault", name, 350, 400, master_ui, state)
+ ui = new(user, src, ui_key, "DnaVault", name, 350, 400, master_ui, state)
ui.open()
diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm
index be88d0ecd..682533dd4 100644
--- a/code/modules/station_goals/shield.dm
+++ b/code/modules/station_goals/shield.dm
@@ -42,10 +42,10 @@
circuit = /obj/item/circuitboard/computer/sat_control
var/notice
-/obj/machinery/computer/sat_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/obj/machinery/computer/sat_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "sat_control", name, 400, 305, master_ui, state)
+ ui = new(user, src, ui_key, "SatelliteControl", name, 400, 305, master_ui, state)
ui.open()
/obj/machinery/computer/sat_control/ui_act(action, params)
diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm
index 38a5a27e0..d67c251ea 100644
--- a/code/modules/tgui/external.dm
+++ b/code/modules/tgui/external.dm
@@ -1,140 +1,151 @@
- /**
- * tgui external
- *
- * Contains all external tgui declarations.
- **/
+/**
+ * tgui external
+ *
+ * Contains all external tgui declarations.
+ */
- /**
- * public
- *
- * Used to open and update UIs.
- * If this proc is not implemented properly, the UI will not update correctly.
- *
- * required user mob The mob who opened/is using the UI.
- * optional ui_key string The ui_key of the UI.
- * optional ui datum/tgui The UI to be updated, if it exists.
- * optional force_open bool If the UI should be re-opened instead of updated.
- * optional master_ui datum/tgui The parent UI.
- * optional state datum/ui_state The state used to determine status.
- **/
-/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+/**
+ * public
+ *
+ * Used to open and update UIs.
+ * If this proc is not implemented properly, the UI will not update correctly.
+ *
+ * required user mob The mob who opened/is using the UI.
+ * optional ui_key string The ui_key of the UI.
+ * optional ui datum/tgui The UI to be updated, if it exists.
+ * optional force_open bool If the UI should be re-opened instead of updated.
+ * optional master_ui datum/tgui The parent UI.
+ * optional state datum/tgui_state The state used to determine status.
+ */
+
+/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
return FALSE // Not implemented.
- /**
- * public
- *
- * Data to be sent to the UI.
- * This must be implemented for a UI to work.
- *
- * required user mob The mob interacting with the UI.
- *
- * return list Data to be sent to the UI.
- **/
+/**
+ * public
+ *
+ * Data to be sent to the UI.
+ * This must be implemented for a UI to work.
+ *
+ * required user mob The mob interacting with the UI.
+ *
+ * return list Data to be sent to the UI.
+ */
/datum/proc/ui_data(mob/user)
return list() // Not implemented.
- /**
- * public
- *
- * Static Data to be sent to the UI.
- * Static data differs from normal data in that it's large data that should be sent infrequently
- * This is implemented optionally for heavy uis that would be sending a lot of redundant data
- * frequently.
- * Gets squished into one object on the frontend side, but the static part is cached.
- *
- * required user mob The mob interacting with the UI.
- *
- * return list Statuic Data to be sent to the UI.
- **/
+/**
+ * public
+ *
+ * Static Data to be sent to the UI.
+ * Static data differs from normal data in that it's large data that should be sent infrequently
+ * This is implemented optionally for heavy uis that would be sending a lot of redundant data
+ * frequently.
+ * Gets squished into one object on the frontend side, but the static part is cached.
+ *
+ * required user mob The mob interacting with the UI.
+ *
+ * return list Statuic Data to be sent to the UI.
+ */
/datum/proc/ui_static_data(mob/user)
return list()
/**
- * public
- *
- * Forces an update on static data. Should be done manually whenever something happens to change static data.
- *
- * required user the mob currently interacting with the ui
- * optional ui ui to be updated
- * optional ui_key ui key of ui to be updated
- *
-**/
+ * public
+ *
+ * Forces an update on static data. Should be done manually whenever something happens to change static data.
+ *
+ * required user the mob currently interacting with the ui
+ * optional ui ui to be updated
+ * optional ui_key ui key of ui to be updated
+ */
/datum/proc/update_static_data(mob/user, datum/tgui/ui, ui_key = "main")
ui = SStgui.try_update_ui(user, src, ui_key, ui)
+ // If there was no ui to update, there's no static data to update either.
if(!ui)
- return //If there was no ui to update, there's no static data to update either.
+ return
ui.push_data(null, ui_static_data(), TRUE)
- /**
- * public
- *
- * Called on a UI when the UI receieves a href.
- * Think of this as Topic().
- *
- * required action string The action/button that has been invoked by the user.
- * required params list A list of parameters attached to the button.
- *
- * return bool If the UI should be updated or not.
- **/
-/datum/proc/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
+/**
+ * public
+ *
+ * Called on a UI when the UI receieves a href.
+ * Think of this as Topic().
+ *
+ * required action string The action/button that has been invoked by the user.
+ * required params list A list of parameters attached to the button.
+ *
+ * return bool If the UI should be updated or not.
+ */
+/datum/proc/ui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
+ // If UI is not interactive or usr calling Topic is not the UI user, bail.
if(!ui || ui.status != UI_INTERACTIVE)
- return 1 // If UI is not interactive or usr calling Topic is not the UI user, bail.
+ return TRUE
- /**
- * public
- *
- * Called on an object when a tgui object is being created, allowing you to customise the html
- * For example: inserting a custom stylesheet that you need in the head
- *
- * For this purpose, some tags are available in the html, to be parsed out with replacetext
- * (customheadhtml) - Additions to the head tag
- *
- * required html the html base text
- *
- **/
+/**
+ * public
+ *
+ * Called on an object when a tgui object is being created, allowing you to
+ * customise the html
+ * For example: inserting a custom stylesheet that you need in the head
+ *
+ * For this purpose, some tags are available in the html, to be parsed out
+ ^ with replacetext
+ * (customheadhtml) - Additions to the head tag
+ *
+ * required html the html base text
+ */
/datum/proc/ui_base_html(html)
return html
- /**
- * private
- *
- * The UI's host object (usually src_object).
- * This allows modules/datums to have the UI attached to them,
- * and be a part of another object.
- **/
+/**
+ * private
+ *
+ * The UI's host object (usually src_object).
+ * This allows modules/datums to have the UI attached to them,
+ * and be a part of another object.
+ */
/datum/proc/ui_host(mob/user)
return src // Default src.
- /**
- * global
- *
- * Used to track UIs for a mob.
- **/
-/mob/var/list/open_uis = list()
- /**
- * public
- *
- * Called on a UI's object when the UI is closed, not to be confused with client/verb/uiclose(), which closes the ui window
- *
- *
- **/
-/datum/proc/ui_close()
+/**
+ * global
+ *
+ * Associative list of JSON-encoded shared states that were set by
+ * tgui clients.
+ */
- /**
- * verb
- *
- * Called by UIs when they are closed.
- * Must be a verb so winset() can call it.
- *
- * required uiref ref The UI that was closed.
- **/
-/client/verb/uiclose(ref as text)
+/datum/var/list/tgui_shared_states
+
+/**
+ * global
+ *
+ * Used to track UIs for a mob.
+ */
+/mob/var/list/open_tguis = list()
+/**
+ * public
+ *
+ * Called on a UI's object when the UI is closed, not to be confused with
+ * client/verb/uiclose(), which closes the ui window
+ */
+/datum/proc/ui_close(mob/user)
+
+/**
+ * verb
+ *
+ * Called by UIs when they are closed.
+ * Must be a verb so winset() can call it.
+ *
+ * required uiref ref The UI that was closed.
+ */
+/client/verb/tguiclose(uid as text)
// Name the verb, and hide it from the user panel.
set name = "uiclose"
- set hidden = 1
+ set hidden = TRUE
// Get the UI based on the ref.
- var/datum/tgui/ui = locate(ref)
+ var/datum/tgui/ui = locateUID(uid)
// If we found the UI, close it.
if(istype(ui))
diff --git a/code/modules/tgui/modules/_base.dm b/code/modules/tgui/modules/_base.dm
new file mode 100644
index 000000000..ce12ac633
--- /dev/null
+++ b/code/modules/tgui/modules/_base.dm
@@ -0,0 +1,21 @@
+/*
+TGUI MODULES
+
+This allows for datum-based TGUIs that can be hooked into objects.
+This is useful for things such as the power monitor, which needs to exist on a physical console in the world, but also as a virtual device the AI can use
+
+Code is pretty much ripped verbatim from nano modules, but with un-needed stuff removed
+*/
+/datum/tgui_module
+ var/name
+ var/datum/host
+
+/datum/tgui_module/New(var/host)
+ src.host = host
+
+/datum/tgui_module/ui_host()
+ return host ? host : src
+
+/datum/tgui_module/ui_close(mob/user)
+ if(host)
+ host.ui_close(user)
diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm
index fc30d171f..42abceb1c 100644
--- a/code/modules/tgui/states.dm
+++ b/code/modules/tgui/states.dm
@@ -1,20 +1,20 @@
- /**
- * tgui states
- *
- * Base state and helpers for states. Just does some sanity checks, implement a state for in-depth checks.
- **/
+/**
+ * tgui states
+ *
+ * Base state and helpers for states. Just does some sanity checks, implement a state for in-depth checks.
+ */
- /**
- * public
- *
- * Checks the UI state for a mob.
- *
- * required user mob The mob who opened/is using the UI.
- * required state datum/ui_state The state to check.
- *
- * return UI_state The state of the UI.
- **/
-/datum/proc/ui_status(mob/user, datum/ui_state/state)
+/**
+ * public
+ *
+ * Checks the UI state for a mob.
+ *
+ * required user mob The mob who opened/is using the UI.
+ * required state datum/tgui_state The state to check.
+ *
+ * return UI_state The state of the UI.
+ */
+/datum/proc/ui_status(mob/user, datum/tgui_state/state)
var/src_object = ui_host(user)
. = UI_CLOSE
if(!state)
@@ -22,7 +22,7 @@
if(isobserver(user))
// If they turn on ghost AI control, admins can always interact.
- if(IsAdminGhost(user))
+ if(user.has_unlimited_silicon_privilege)
. = max(., UI_INTERACTIVE)
// Regular ghosts can always at least view if in range.
@@ -34,72 +34,72 @@
var/result = state.can_use_topic(src_object, user)
. = max(., result)
- /**
- * private
- *
- * Checks if a user can use src_object's UI, and returns the state.
- * Can call a mob proc, which allows overrides for each mob.
- *
- * required src_object datum The object/datum which owns the UI.
- * required user mob The mob who opened/is using the UI.
- *
- * return UI_state The state of the UI.
- **/
-/datum/ui_state/proc/can_use_topic(src_object, mob/user)
+/**
+ * private
+ *
+ * Checks if a user can use src_object's UI, and returns the state.
+ * Can call a mob proc, which allows overrides for each mob.
+ *
+ * required src_object datum The object/datum which owns the UI.
+ * required user mob The mob who opened/is using the UI.
+ *
+ * return UI_state The state of the UI.
+ */
+/datum/tgui_state/proc/can_use_topic(src_object, mob/user)
return UI_CLOSE // Don't allow interaction by default.
- /**
- * public
- *
- * Standard interaction/sanity checks. Different mob types may have overrides.
- *
- * return UI_state The state of the UI.
- **/
-/mob/proc/shared_ui_interaction(src_object)
+/**
+ * public
+ *
+ * Standard interaction/sanity checks. Different mob types may have overrides.
+ *
+ * return UI_state The state of the UI.
+ */
+/mob/proc/shared_tgui_interaction(src_object)
if(!client) // Close UIs if mindless.
return UI_CLOSE
else if(stat) // Disable UIs if unconcious.
return UI_DISABLED
- else if(incapacitated() || lying) // Update UIs if incapicitated but concious.
+ else if(incapacitated()) // Update UIs if incapicitated but concious.
return UI_UPDATE
return UI_INTERACTIVE
-/mob/living/silicon/ai/shared_ui_interaction(src_object)
+/mob/living/silicon/ai/shared_tgui_interaction(src_object)
if(lacks_power()) // Disable UIs if the AI is unpowered.
return UI_DISABLED
return ..()
-/mob/living/silicon/robot/shared_ui_interaction(src_object)
+/mob/living/silicon/robot/shared_tgui_interaction(src_object)
if(!cell || cell.charge <= 0 || lockcharge) // Disable UIs if the Borg is unpowered or locked.
return UI_DISABLED
return ..()
/**
- * public
- *
- * Check the distance for a living mob.
- * Really only used for checks outside the context of a mob.
- * Otherwise, use shared_living_ui_distance().
- *
- * required src_object The object which owns the UI.
- * required user mob The mob who opened/is using the UI.
- *
- * return UI_state The state of the UI.
- **/
-/atom/proc/contents_ui_distance(src_object, mob/living/user)
- return user.shared_living_ui_distance(src_object) // Just call this mob's check.
+ * public
+ *
+ * Check the distance for a living mob.
+ * Really only used for checks outside the context of a mob.
+ * Otherwise, use shared_living_ui_distance().
+ *
+ * required src_object The object which owns the UI.
+ * required user mob The mob who opened/is using the UI.
+ *
+ * return UI_state The state of the UI.
+ */
+/atom/proc/contents_tgui_distance(src_object, mob/living/user)
+ return user.shared_living_tgui_distance(src_object) // Just call this mob's check.
- /**
- * public
- *
- * Distance versus interaction check.
- *
- * required src_object atom/movable The object which owns the UI.
- *
- * return UI_state The state of the UI.
- **/
-/mob/living/proc/shared_living_ui_distance(atom/movable/src_object)
- if(!(src_object in view(src))) // If the object is obscured, close it.
+/**
+ * public
+ *
+ * Distance versus interaction check.
+ *
+ * required src_object atom/movable The object which owns the UI.
+ *
+ * return UI_state The state of the UI.
+ */
+/mob/living/proc/shared_living_tgui_distance(atom/movable/src_object, viewcheck = TRUE)
+ if(viewcheck && !(src_object in view(src))) // If the object is obscured, close it.
return UI_CLOSE
var/dist = get_dist(src_object, src)
@@ -111,7 +111,7 @@
return UI_DISABLED
return UI_CLOSE // Otherwise, we got nothing.
-/mob/living/carbon/human/shared_living_ui_distance(atom/movable/src_object)
+/mob/living/carbon/human/shared_living_tgui_distance(atom/movable/src_object)
if(dna.check_mutation(TK) && tkMaxRangeCheck(src, src_object))
return UI_INTERACTIVE
return ..()
diff --git a/code/modules/tgui/states/admin.dm b/code/modules/tgui/states/admin.dm
index 945a86443..a634cc5cc 100644
--- a/code/modules/tgui/states/admin.dm
+++ b/code/modules/tgui/states/admin.dm
@@ -4,9 +4,9 @@
* Checks that the user is an admin, end-of-story.
**/
-GLOBAL_DATUM_INIT(admin_state, /datum/ui_state/admin_state, new)
+GLOBAL_DATUM_INIT(tgui_admin_state, /datum/tgui_state/admin_state, new)
-/datum/ui_state/admin_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/admin_state/can_use_topic(src_object, mob/user)
if(check_rights_for(user.client, R_ADMIN))
return UI_INTERACTIVE
return UI_CLOSE
diff --git a/code/modules/tgui/states/always.dm b/code/modules/tgui/states/always.dm
index b6c689d5d..46d13dfe9 100644
--- a/code/modules/tgui/states/always.dm
+++ b/code/modules/tgui/states/always.dm
@@ -5,7 +5,7 @@
* Always grants the user UI_INTERACTIVE. Period.
**/
-GLOBAL_DATUM_INIT(always_state, /datum/ui_state/always_state, new)
+GLOBAL_DATUM_INIT(tgui_always_state, /datum/tgui_state/always_state, new)
-/datum/ui_state/always_state/can_use_topic(src_object, mob/user)
+/datum/tgui_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 4323c1391..82171c0a9 100644
--- a/code/modules/tgui/states/conscious.dm
+++ b/code/modules/tgui/states/conscious.dm
@@ -4,9 +4,9 @@
* Only checks if the user is conscious.
**/
-GLOBAL_DATUM_INIT(conscious_state, /datum/ui_state/conscious_state, new)
+GLOBAL_DATUM_INIT(tgui_conscious_state, /datum/tgui_state/conscious_state, new)
-/datum/ui_state/conscious_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/conscious_state/can_use_topic(src_object, mob/user)
if(user.stat == CONSCIOUS)
return UI_INTERACTIVE
return UI_CLOSE
diff --git a/code/modules/tgui/states/contained.dm b/code/modules/tgui/states/contained.dm
index 7387f7e6c..af3cb9dfc 100644
--- a/code/modules/tgui/states/contained.dm
+++ b/code/modules/tgui/states/contained.dm
@@ -4,9 +4,9 @@
* Checks that the user is inside the src_object.
**/
-GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
+GLOBAL_DATUM_INIT(tgui_contained_state, /datum/tgui_state/contained_state, new)
-/datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user)
+/datum/tgui_state/contained_state/can_use_topic(atom/src_object, mob/user)
if(!src_object.contains(user))
return UI_CLOSE
- return user.shared_ui_interaction(src_object)
+ return user.shared_tgui_interaction(src_object)
diff --git a/code/modules/tgui/states/deep_inventory.dm b/code/modules/tgui/states/deep_inventory.dm
index 06bdb92f3..27c6892a8 100644
--- a/code/modules/tgui/states/deep_inventory.dm
+++ b/code/modules/tgui/states/deep_inventory.dm
@@ -4,9 +4,9 @@
* Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.
**/
-GLOBAL_DATUM_INIT(deep_inventory_state, /datum/ui_state/deep_inventory_state, new)
+GLOBAL_DATUM_INIT(tgui_deep_inventory_state, /datum/tgui_state/deep_inventory_state, new)
-/datum/ui_state/deep_inventory_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/deep_inventory_state/can_use_topic(src_object, mob/user)
if(!user.contains(src_object))
return UI_CLOSE
- return user.shared_ui_interaction(src_object)
+ return user.shared_tgui_interaction(src_object)
diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm
index c6741f20b..5fe29a862 100644
--- a/code/modules/tgui/states/default.dm
+++ b/code/modules/tgui/states/default.dm
@@ -4,39 +4,39 @@
* Checks a number of things -- mostly physical distance for humans and view for robots.
**/
-GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
+GLOBAL_DATUM_INIT(tgui_default_state, /datum/tgui_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.
+/datum/tgui_state/default/can_use_topic(src_object, mob/user)
+ return user.default_can_use_tgui_topic(src_object) // Call the individual mob-overridden procs.
-/mob/proc/default_can_use_topic(src_object)
+/mob/proc/default_can_use_tgui_topic(src_object)
return UI_CLOSE // Don't allow interaction by default.
-/mob/living/default_can_use_topic(src_object)
- . = shared_ui_interaction(src_object)
+/mob/living/default_can_use_tgui_topic(src_object)
+ . = shared_tgui_interaction(src_object)
if(. > UI_CLOSE && loc)
- . = min(., loc.contents_ui_distance(src_object, src)) // Check the distance...
+ . = min(., loc.contents_tgui_distance(src_object, src)) // Check the distance...
if(. == UI_INTERACTIVE) // Non-human living mobs can only look, not touch.
return UI_UPDATE
-/mob/living/carbon/human/default_can_use_topic(src_object)
- . = shared_ui_interaction(src_object)
+/mob/living/carbon/human/default_can_use_tgui_topic(src_object)
+ . = shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
- . = min(., shared_living_ui_distance(src_object)) // Check the distance...
+ . = min(., shared_living_tgui_distance(src_object)) // Check the distance...
-/mob/living/silicon/robot/default_can_use_topic(src_object)
- . = shared_ui_interaction(src_object)
+/mob/living/silicon/robot/default_can_use_tgui_topic(src_object)
+ . = shared_tgui_interaction(src_object)
if(. <= UI_DISABLED)
return
// Robots can interact with anything they can see.
var/list/clientviewlist = getviewsize(client.view)
- if(get_dist(src, src_object) <= min(clientviewlist[1],clientviewlist[2]))
+ if((src_object in view(src)) && (get_dist(src, src_object) <= min(clientviewlist[1],clientviewlist[2])))
return UI_INTERACTIVE
return UI_DISABLED // Otherwise they can keep the UI open.
-/mob/living/silicon/ai/default_can_use_topic(src_object)
- . = shared_ui_interaction(src_object)
+/mob/living/silicon/ai/default_can_use_tgui_topic(src_object)
+ . = shared_tgui_interaction(src_object)
if(. < UI_INTERACTIVE)
return
@@ -45,12 +45,12 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
return UI_INTERACTIVE
return UI_CLOSE
-/mob/living/simple_animal/default_can_use_topic(src_object)
- . = shared_ui_interaction(src_object)
+/mob/living/simple_animal/default_can_use_tgui_topic(src_object)
+ . = shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
- . = min(., shared_living_ui_distance(src_object)) //simple animals can only use things they're near.
+ . = min(., shared_living_tgui_distance(src_object)) //simple animals can only use things they're near.
-/mob/living/silicon/pai/default_can_use_topic(src_object)
+/mob/living/silicon/pai/default_can_use_tgui_topic(src_object)
// pAIs can only use themselves and the owner's radio.
if((src_object == src || src_object == radio) && !stat)
return UI_INTERACTIVE
diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm
index 5da0e5d50..f65462505 100644
--- a/code/modules/tgui/states/hands.dm
+++ b/code/modules/tgui/states/hands.dm
@@ -4,22 +4,22 @@
* Checks that the src_object is in the user's hands.
**/
-GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
+GLOBAL_DATUM_INIT(tgui_hands_state, /datum/tgui_state/hands_state, new)
-/datum/ui_state/hands_state/can_use_topic(src_object, mob/user)
- . = user.shared_ui_interaction(src_object)
+/datum/tgui_state/hands_state/can_use_topic(src_object, mob/user)
+ . = user.shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
- return min(., user.hands_can_use_topic(src_object))
+ return min(., user.hands_can_use_tgui_topic(src_object))
-/mob/proc/hands_can_use_topic(src_object)
+/mob/proc/hands_can_use_tgui_topic(src_object)
return UI_CLOSE
-/mob/living/hands_can_use_topic(src_object)
+/mob/living/hands_can_use_tgui_topic(src_object)
if(is_holding(src_object))
return UI_INTERACTIVE
return UI_CLOSE
-/mob/living/silicon/robot/hands_can_use_topic(src_object)
+/mob/living/silicon/robot/hands_can_use_tgui_topic(src_object)
if(activated(src_object))
return UI_INTERACTIVE
return UI_CLOSE
diff --git a/code/modules/tgui/states/human_adjacent.dm b/code/modules/tgui/states/human_adjacent.dm
index 0ab20b36f..3f8efa010 100644
--- a/code/modules/tgui/states/human_adjacent.dm
+++ b/code/modules/tgui/states/human_adjacent.dm
@@ -6,10 +6,10 @@
* human adjacent user.
**/
-GLOBAL_DATUM_INIT(human_adjacent_state, /datum/ui_state/human_adjacent_state, new)
+GLOBAL_DATUM_INIT(tgui_human_adjacent_state, /datum/tgui_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)
+/datum/tgui_state/human_adjacent_state/can_use_topic(src_object, mob/user)
+ . = user.default_can_use_tgui_topic(src_object)
var/dist = get_dist(src_object, user)
if((dist > 1) || (!ishuman(user)))
diff --git a/code/modules/tgui/states/inventory.dm b/code/modules/tgui/states/inventory.dm
index b8b1ad3b6..a89154537 100644
--- a/code/modules/tgui/states/inventory.dm
+++ b/code/modules/tgui/states/inventory.dm
@@ -4,9 +4,9 @@
* Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.
**/
-GLOBAL_DATUM_INIT(inventory_state, /datum/ui_state/inventory_state, new)
+GLOBAL_DATUM_INIT(tgui_inventory_state, /datum/tgui_state/inventory_state, new)
-/datum/ui_state/inventory_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/inventory_state/can_use_topic(src_object, mob/user)
if(!(src_object in user))
return UI_CLOSE
- return user.shared_ui_interaction(src_object)
+ return user.shared_tgui_interaction(src_object)
diff --git a/code/modules/tgui/states/language_menu.dm b/code/modules/tgui/states/language_menu.dm
index fedc4320e..736fef5c7 100644
--- a/code/modules/tgui/states/language_menu.dm
+++ b/code/modules/tgui/states/language_menu.dm
@@ -2,9 +2,9 @@
* tgui state: language_menu_state
*/
-GLOBAL_DATUM_INIT(language_menu_state, /datum/ui_state/language_menu, new)
+GLOBAL_DATUM_INIT(language_menu_state, /datum/tgui_state/language_menu, new)
-/datum/ui_state/language_menu/can_use_topic(src_object, mob/user)
+/datum/tgui_state/language_menu/can_use_topic(src_object, mob/user)
. = UI_CLOSE
if(check_rights_for(user.client, R_ADMIN))
. = UI_INTERACTIVE
diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm
index 12fe266bc..3f87a47db 100644
--- a/code/modules/tgui/states/not_incapacitated.dm
+++ b/code/modules/tgui/states/not_incapacitated.dm
@@ -4,7 +4,7 @@
* Checks that the user isn't incapacitated
**/
-GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_state, new)
+GLOBAL_DATUM_INIT(tgui_not_incapacitated_state, /datum/tgui_state/not_incapacitated_state, new)
/**
* tgui state: not_incapacitated_turf_state
@@ -12,18 +12,18 @@ GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_sta
* Checks that the user isn't incapacitated and that their loc is a turf
**/
-GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitated_state, new(no_turfs = TRUE))
+GLOBAL_DATUM_INIT(tgui_not_incapacitated_turf_state, /datum/tgui_state/not_incapacitated_state, new(no_turfs = TRUE))
-/datum/ui_state/not_incapacitated_state
+/datum/tgui_state/not_incapacitated_state
var/turf_check = FALSE
-/datum/ui_state/not_incapacitated_state/New(loc, no_turfs = FALSE)
+/datum/tgui_state/not_incapacitated_state/New(loc, no_turfs = FALSE)
..()
turf_check = no_turfs
-/datum/ui_state/not_incapacitated_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/not_incapacitated_state/can_use_topic(src_object, mob/user)
if(user.stat)
return UI_CLOSE
- if(user.incapacitated() || user.lying || (turf_check && !isturf(user.loc)))
+ if(user.incapacitated() || (turf_check && !isturf(user.loc)))
return UI_DISABLED
- return UI_INTERACTIVE
\ No newline at end of file
+ return UI_INTERACTIVE
diff --git a/code/modules/tgui/states/notcontained.dm b/code/modules/tgui/states/notcontained.dm
index 77a7fe01b..456bfbeac 100644
--- a/code/modules/tgui/states/notcontained.dm
+++ b/code/modules/tgui/states/notcontained.dm
@@ -4,23 +4,23 @@
* Checks that the user is not inside src_object, and then makes the default checks.
**/
-GLOBAL_DATUM_INIT(notcontained_state, /datum/ui_state/notcontained_state, new)
+GLOBAL_DATUM_INIT(tgui_notcontained_state, /datum/tgui_state/notcontained_state, new)
-/datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user)
- . = user.shared_ui_interaction(src_object)
+/datum/tgui_state/notcontained_state/can_use_topic(atom/src_object, mob/user)
+ . = user.shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
- return min(., user.notcontained_can_use_topic(src_object))
+ return min(., user.notcontained_can_use_tgui_topic(src_object))
-/mob/proc/notcontained_can_use_topic(src_object)
+/mob/proc/notcontained_can_use_tgui_topic(src_object)
return UI_CLOSE
-/mob/living/notcontained_can_use_topic(atom/src_object)
+/mob/living/notcontained_can_use_tgui_topic(atom/src_object)
if(src_object.contains(src))
return UI_CLOSE // Close if we're inside it.
- return default_can_use_topic(src_object)
+ return default_can_use_tgui_topic(src_object)
-/mob/living/silicon/notcontained_can_use_topic(src_object)
- return default_can_use_topic(src_object) // Silicons use default bevhavior.
+/mob/living/silicon/notcontained_can_use_tgui_topic(src_object)
+ return default_can_use_tgui_topic(src_object) // Silicons use default bevhavior.
-/mob/living/simple_animal/drone/notcontained_can_use_topic(src_object)
- return default_can_use_topic(src_object) // Drones use default bevhavior.
+/mob/living/simple_animal/drone/notcontained_can_use_tgui_topic(src_object)
+ return default_can_use_tgui_topic(src_object) // Drones use default bevhavior.
diff --git a/code/modules/tgui/states/observer.dm b/code/modules/tgui/states/observer.dm
index ade0ce66b..b17c3260c 100644
--- a/code/modules/tgui/states/observer.dm
+++ b/code/modules/tgui/states/observer.dm
@@ -4,9 +4,9 @@
* Checks that the user is an observer/ghost.
**/
-GLOBAL_DATUM_INIT(observer_state, /datum/ui_state/observer_state, new)
+GLOBAL_DATUM_INIT(tgui_observer_state, /datum/tgui_state/observer_state, new)
-/datum/ui_state/observer_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/observer_state/can_use_topic(src_object, mob/user)
if(isobserver(user))
return UI_INTERACTIVE
return UI_CLOSE
diff --git a/code/modules/tgui/states/physical.dm b/code/modules/tgui/states/physical.dm
index 3b13dc5b3..ef6faefeb 100644
--- a/code/modules/tgui/states/physical.dm
+++ b/code/modules/tgui/states/physical.dm
@@ -2,25 +2,25 @@
* tgui state: physical_state
*
* Short-circuits the default state to only check physical distance.
- */
+ **/
-GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
+GLOBAL_DATUM_INIT(tgui_physical_state, /datum/tgui_state/physical, new)
-/datum/ui_state/physical/can_use_topic(src_object, mob/user)
- . = user.shared_ui_interaction(src_object)
+/datum/tgui_state/physical/can_use_topic(src_object, mob/user)
+ . = user.shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
- return min(., user.physical_can_use_topic(src_object))
+ return min(., user.physical_can_use_tgui_topic(src_object))
-/mob/proc/physical_can_use_topic(src_object)
+/mob/proc/physical_can_use_tgui_topic(src_object)
return UI_CLOSE
-/mob/living/physical_can_use_topic(src_object)
- return shared_living_ui_distance(src_object)
+/mob/living/physical_can_use_tgui_topic(src_object)
+ return shared_living_tgui_distance(src_object)
-/mob/living/silicon/physical_can_use_topic(src_object)
- return max(UI_UPDATE, shared_living_ui_distance(src_object)) // Silicons can always see.
+/mob/living/silicon/physical_can_use_tgui_topic(src_object)
+ return max(UI_UPDATE, shared_living_tgui_distance(src_object)) // Silicons can always see.
-/mob/living/silicon/ai/physical_can_use_topic(src_object)
+/mob/living/silicon/ai/physical_can_use_tgui_topic(src_object)
return UI_UPDATE // AIs are not physical.
/**
@@ -29,10 +29,10 @@ GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new)
* Short-circuits the default state to only check physical distance, being in view doesn't matter
*/
-GLOBAL_DATUM_INIT(physical_obscured_state, /datum/ui_state/physical_obscured_state, new)
+GLOBAL_DATUM_INIT(tgui_physical_obscured_state, /datum/tgui_state/physical_obscured_state, new)
-/datum/ui_state/physical_obscured_state/can_use_topic(src_object, mob/user)
- . = user.shared_ui_interaction(src_object)
+/datum/tgui_state/physical_obscured_state/can_use_topic(src_object, mob/user)
+ . = user.shared_tgui_interaction(src_object)
if(. > UI_CLOSE)
return min(., user.physical_obscured_can_use_topic(src_object))
@@ -40,10 +40,10 @@ GLOBAL_DATUM_INIT(physical_obscured_state, /datum/ui_state/physical_obscured_sta
return UI_CLOSE
/mob/living/physical_obscured_can_use_topic(src_object)
- return shared_living_ui_distance(src_object)
+ return shared_living_tgui_distance(src_object)
/mob/living/silicon/physical_obscured_can_use_topic(src_object)
- return max(UI_UPDATE, shared_living_ui_distance(src_object)) // Silicons can always see.
+ return max(UI_UPDATE, shared_living_tgui_distance(src_object)) // Silicons can always see.
/mob/living/silicon/ai/physical_obscured_can_use_topic(src_object)
return UI_UPDATE // AIs are not physical.
\ No newline at end of file
diff --git a/code/modules/tgui/states/self.dm b/code/modules/tgui/states/self.dm
index 10849772c..fa7f6a2c3 100644
--- a/code/modules/tgui/states/self.dm
+++ b/code/modules/tgui/states/self.dm
@@ -4,9 +4,9 @@
* Only checks that the user and src_object are the same.
**/
-GLOBAL_DATUM_INIT(self_state, /datum/ui_state/self_state, new)
+GLOBAL_DATUM_INIT(tgui_self_state, /datum/tgui_state/self_state, new)
-/datum/ui_state/self_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/self_state/can_use_topic(src_object, mob/user)
if(src_object != user)
return UI_CLOSE
- return user.shared_ui_interaction(src_object)
+ return user.shared_tgui_interaction(src_object)
diff --git a/code/modules/tgui/states/zlevel.dm b/code/modules/tgui/states/zlevel.dm
index 6ccfd0fe7..5cff13ff3 100644
--- a/code/modules/tgui/states/zlevel.dm
+++ b/code/modules/tgui/states/zlevel.dm
@@ -4,9 +4,9 @@
* Only checks that the Z-level of the user and src_object are the same.
**/
-GLOBAL_DATUM_INIT(z_state, /datum/ui_state/z_state, new)
+GLOBAL_DATUM_INIT(tgui_z_state, /datum/tgui_state/z_state, new)
-/datum/ui_state/z_state/can_use_topic(src_object, mob/user)
+/datum/tgui_state/z_state/can_use_topic(src_object, mob/user)
var/turf/turf_obj = get_turf(src_object)
var/turf/turf_usr = get_turf(user)
if(turf_obj && turf_usr && turf_obj.z == turf_usr.z)
diff --git a/code/modules/tgui/subsystem.dm b/code/modules/tgui/subsystem.dm
index 90a00fb60..f91247b2f 100644
--- a/code/modules/tgui/subsystem.dm
+++ b/code/modules/tgui/subsystem.dm
@@ -128,11 +128,11 @@
* return int The number of UIs updated.
**/
/datum/controller/subsystem/tgui/proc/update_user_uis(mob/user, datum/src_object = null, ui_key = null)
- if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
+ if(isnull(user.open_tguis) || !istype(user.open_tguis, /list) || open_uis.len == 0)
return 0 // Couldn't find any UIs for this user.
var/update_count = 0
- for(var/datum/tgui/ui in user.open_uis)
+ for(var/datum/tgui/ui in user.open_tguis)
if((isnull(src_object) || !isnull(src_object) && ui.src_object == src_object) && (isnull(ui_key) || !isnull(ui_key) && ui.ui_key == ui_key))
ui.process(force = 1) // Update the UI.
update_count++ // Count each UI we upadte.
@@ -150,11 +150,11 @@
* return int The number of UIs closed.
**/
/datum/controller/subsystem/tgui/proc/close_user_uis(mob/user, datum/src_object = null, ui_key = null)
- if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
+ if(isnull(user.open_tguis) || !istype(user.open_tguis, /list) || open_uis.len == 0)
return 0 // Couldn't find any UIs for this user.
var/close_count = 0
- for(var/datum/tgui/ui in user.open_uis)
+ for(var/datum/tgui/ui in user.open_tguis)
if((isnull(src_object) || !isnull(src_object) && ui.src_object == src_object) && (isnull(ui_key) || !isnull(ui_key) && ui.ui_key == ui_key))
ui.close() // Close the UI.
close_count++ // Count each UI we close.
@@ -175,7 +175,7 @@
open_uis[src_object_key][ui.ui_key] = list() // Make a list for the ui_key.
// Append the UI to all the lists.
- ui.user.open_uis |= ui
+ ui.user.open_tguis |= ui
var/list/uis = open_uis[src_object_key][ui.ui_key]
uis |= ui
processing_uis |= ui
@@ -198,7 +198,7 @@
processing_uis.Remove(ui) // Remove it from the list of processing UIs.
if(ui.user) // If the user exists, remove it from them too.
- ui.user.open_uis.Remove(ui)
+ ui.user.open_tguis.Remove(ui)
var/Ukey = ui.ui_key
var/list/uis = open_uis[src_object_key][Ukey] // Remove it from the list of open UIs.
uis.Remove(ui)
@@ -233,15 +233,15 @@
* return bool If the UIs were transferred.
**/
/datum/controller/subsystem/tgui/proc/on_transfer(mob/source, mob/target)
- if(!source || isnull(source.open_uis) || !istype(source.open_uis, /list) || open_uis.len == 0)
+ if(!source || isnull(source.open_tguis) || !istype(source.open_tguis, /list) || open_uis.len == 0)
return 0 // The old mob had no open UIs.
- if(isnull(target.open_uis) || !istype(target.open_uis, /list))
- target.open_uis = list() // Create a list for the new mob if needed.
+ if(isnull(target.open_tguis) || !istype(target.open_tguis, /list))
+ target.open_tguis = list() // Create a list for the new mob if needed.
- for(var/datum/tgui/ui in source.open_uis)
+ for(var/datum/tgui/ui in source.open_tguis)
ui.user = target // Inform the UIs of their new owner.
- target.open_uis.Add(ui) // Transfer all the UIs.
+ target.open_tguis.Add(ui) // Transfer all the UIs.
- source.open_uis.Cut() // Clear the old list.
+ source.open_tguis.Cut() // Clear the old list.
return 1 // Let the caller know we did it.
diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm
index 55fe8f0bb..f564a8c0f 100644
--- a/code/modules/tgui/tgui.dm
+++ b/code/modules/tgui/tgui.dm
@@ -1,12 +1,12 @@
- /**
- * tgui
- *
- * /tg/station user interface library
- **/
+/**
+ * tgui
+ *
+ * /tg/station user interface library
+ */
- /**
- * tgui datum (represents a UI).
- **/
+/**
+ * tgui datum (represents a UI).
+ */
/datum/tgui
/// The mob who opened/is using the UI.
var/mob/user
@@ -22,8 +22,10 @@
var/width = 0
/// The window height
var/height = 0
- /// The style to be used for this UI.
- var/style = "nanotrasen"
+
+ // /// The style to be used for this UI.
+ // var/style = "nanotrasen"
+
/// The interface (template) to be used for this UI.
var/interface
/// Update the UI every MC tick.
@@ -34,42 +36,40 @@
var/list/initial_data
/// The static data used to initialize the UI.
var/list/initial_static_data
+ /// Holder for the json string, that is sent during the initial update
+ var/_initial_update
/// The status/visibility of the UI.
var/status = UI_INTERACTIVE
/// Topic state used to determine status/interactability.
- var/datum/ui_state/state = null
+ var/datum/tgui_state/state = null
/// The parent UI.
var/datum/tgui/master_ui
/// Children of this UI.
var/list/datum/tgui/children = list()
- var/custom_browser_id = FALSE
- var/ui_screen = "home"
- /**
- * public
- *
- * Create a new UI.
- *
- * required user mob The mob who opened/is using the UI.
- * required src_object datum The object or datum which owns the UI.
- * required ui_key string The ui_key of the UI.
- * required interface string The interface used to render the UI.
- * optional title string The title of the UI.
- * optional width int The window width.
- * optional height int The window height.
- * optional master_ui datum/tgui The parent UI.
- * optional state datum/ui_state The state used to determine status.
- *
- * return datum/tgui The requested UI.
- **/
-/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state, browser_id = null)
+/**
+ * public
+ *
+ * Create a new UI.
+ *
+ * required user mob The mob who opened/is using the UI.
+ * required src_object datum The object or datum which owns the UI.
+ * required ui_key string The ui_key of the UI.
+ * required interface string The interface used to render the UI.
+ * optional title string The title of the UI.
+ * optional width int The window width.
+ * optional height int The window height.
+ * optional master_ui datum/tgui The parent UI.
+ * optional state datum/tgui_state The state used to determine status.
+ *
+ * return datum/tgui The requested UI.
+ */
+/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
src.user = user
src.src_object = src_object
src.ui_key = ui_key
- src.window_id = browser_id ? browser_id : "[REF(src_object)]-[ui_key]" // DO NOT replace with \ref here. src_object could potentially be tagged
- src.custom_browser_id = browser_id ? TRUE : FALSE
-
- set_interface(interface)
+ src.window_id = "[src_object.UID()]-[ui_key]"
+ src.interface = interface
if(title)
src.title = sanitize(title)
@@ -83,14 +83,16 @@
master_ui.children += src
src.state = state
- var/datum/asset/assets = get_asset_datum(/datum/asset/group/tgui)
- assets.send(user)
+ var/datum/asset/tgui_assets = get_asset_datum(/datum/asset/simple/tgui)
+ var/datum/asset/fa = get_asset_datum(/datum/asset/simple/fontawesome)
+ tgui_assets.send(user)
+ fa.send(user)
- /**
- * public
- *
- * Open this UI (and initialize it with data).
- **/
+/**
+ * public
+ *
+ * Open this UI (and initialize it with data).
+ */
/datum/tgui/proc/open()
if(!user.client)
return // Bail if there is no client.
@@ -99,18 +101,19 @@
if(status < UI_UPDATE)
return // Bail if we're not supposed to open.
- var/window_size
- if(width && height) // If we have a width and height, use them.
- window_size = "size=[width]x[height];"
- else
- window_size = ""
+
+
+ // Build window options
+ var/window_options = "can_minimize=0;auto_format=0;"
+ // If we have a width and height, use them.
+ if(width && height)
+ window_options += "size=[width]x[height];"
// Remove titlebar and resize handles for a fancy window
- var/have_title_bar
if(user.client.prefs.tgui_fancy)
- have_title_bar = "titlebar=0;can_resize=0;"
+ window_options += "titlebar=0;can_resize=0;"
else
- have_title_bar = "titlebar=1;can_resize=1;"
+ window_options += "titlebar=1;can_resize=1;"
// Generate page html
var/html
@@ -118,52 +121,52 @@
// Allow the src object to override the html if needed
html = src_object.ui_base_html(html)
// Replace template tokens with important UI data
- // NOTE: Intentional \ref usage; tgui datums can't/shouldn't
- // be tagged, so this is an effective unwrap
- html = replacetextEx(html, "\[ref]", "\ref[src]")
- html = replacetextEx(html, "\[style]", style)
+ html = replacetextEx(html, "\[tgui:ref]", "[src.UID()]")
// Open the window.
- user << browse(html, "window=[window_id];can_minimize=0;auto_format=0;[window_size][have_title_bar]")
- if (!custom_browser_id)
- // Instruct the client to signal UI when the window is closed.
- // NOTE: Intentional \ref usage; tgui datums can't/shouldn't
- // be tagged, so this is an effective unwrap
- winset(user, window_id, "on-close=\"uiclose \ref[src]\"")
+ user << browse(html, "window=[window_id];[window_options]")
+ // Instruct the client to signal UI when the window is closed.
+ // NOTE: Intentional \ref usage; tgui datums can't/shouldn't
+ // be tagged, so this is an effective unwrap
+ winset(user, window_id, "on-close=\"uiclose [UID()]\"")
+
+ // Pre-fetch initial state while browser is still loading in
+ // another thread
if(!initial_data)
initial_data = src_object.ui_data(user)
if(!initial_static_data)
initial_static_data = src_object.ui_static_data(user)
+ _initial_update = url_encode(get_json(initial_data, initial_static_data))
SStgui.on_open(src)
- /**
- * public
- *
- * Reinitialize the UI.
- * (Possibly with a new interface and/or data).
- *
- * optional template string The name of the new interface.
- * optional data list The new initial data.
- **/
+/**
+ * public
+ *
+ * Reinitialize the UI.
+ * (Possibly with a new interface and/or data).
+ *
+ * optional template string The name of the new interface.
+ * optional data list The new initial data.
+ */
/datum/tgui/proc/reinitialize(interface, list/data, list/static_data)
if(interface)
- set_interface(interface) // Set a new interface.
+ src.interface = interface
if(data)
initial_data = data
if(static_data)
initial_static_data = static_data
open()
- /**
- * public
- *
- * Close the UI, and all its children.
- **/
+/**
+ * public
+ *
+ * Close the UI, and all its children.
+ */
/datum/tgui/proc/close()
user << browse(null, "window=[window_id]") // Close the window.
- src_object.ui_close()
+ src_object.ui_close(user)
SStgui.on_close(src)
for(var/datum/tgui/child in children) // Loop through and close all children.
child.close()
@@ -172,67 +175,68 @@
master_ui = null
qdel(src)
- /**
- * public
- *
- * Set the style for this UI.
- *
- * required style string The new UI style.
- **/
-/datum/tgui/proc/set_style(style)
- src.style = lowertext(style)
+// /**
+// * public
+// *
+// * Set the style for this UI.
+// *
+// * required style string The new UI style.
+// **/
+// /datum/tgui/proc/set_style(style)
+// src.style = lowertext(style)
- /**
- * public
- *
- * Set the interface (template) for this UI.
- *
- * required interface string The new UI interface.
- **/
-/datum/tgui/proc/set_interface(interface)
- src.interface = lowertext(interface)
+// /**
+// * public
+// *
+// * Set the interface (template) for this UI.
+// *
+// * required interface string The new UI interface.
+// **/
+// /datum/tgui/proc/set_interface(interface)
+// src.interface = lowertext(interface)
- /**
- * public
- *
- * Enable/disable auto-updating of the UI.
- *
- * required state bool Enable/disable auto-updating.
- **/
+/**
+ * public
+ *
+ * Enable/disable auto-updating of the UI.
+ *
+ * required state bool Enable/disable auto-updating.
+ */
/datum/tgui/proc/set_autoupdate(state = TRUE)
autoupdate = state
- /**
- * private
- *
- * Package the data to send to the UI, as JSON.
- * This includes the UI data and config_data.
- *
- * return string The packaged JSON.
- **/
+/**
+ * private
+ *
+ * Package the data to send to the UI, as JSON.
+ * This includes the UI data and config_data.
+ *
+ * return string The packaged JSON.
+ */
/datum/tgui/proc/get_json(list/data, list/static_data)
var/list/json_data = list()
json_data["config"] = list(
"title" = title,
"status" = status,
- "screen" = ui_screen,
- "style" = style,
+ // "style" = style,
"interface" = interface,
"fancy" = user.client.prefs.tgui_fancy,
- "locked" = user.client.prefs.tgui_lock && !custom_browser_id,
"observer" = isobserver(user),
"window" = window_id,
- // NOTE: Intentional \ref usage; tgui datums can't/shouldn't
- // be tagged, so this is an effective unwrap
- "ref" = "\ref[src]"
+ // "map" = (GLOB.using_map && GLOB.using_map.name) ? GLOB.using_map.name : "Unknown",
+ "ref" = "[src.UID()]"
)
-
+
if(!isnull(data))
json_data["data"] = data
if(!isnull(static_data))
json_data["static_data"] = static_data
+ // Send shared states
+ if(src_object.tgui_shared_states)
+ json_data["shared"] = src_object.tgui_shared_states
+
// Generate the JSON.
var/json = json_encode(json_data)
// Strip #255/improper.
@@ -240,13 +244,13 @@
json = replacetext(json, "\improper", "")
return json
- /**
- * private
- *
- * Handle clicks from the UI.
- * Call the src_object's ui_act() if status is UI_INTERACTIVE.
- * If the src_object's ui_act() returns 1, update all UIs attacked to it.
- **/
+/**
+ * private
+ *
+ * Handle clicks from the UI.
+ * Call the src_object's ui_act() if status is UI_INTERACTIVE.
+ * If the src_object's ui_act() returns 1, update all UIs attacked to it.
+ */
/datum/tgui/Topic(href, href_list)
if(user != usr)
return // Something is not right here.
@@ -256,35 +260,48 @@
switch(action)
if("tgui:initialize")
- user << output(url_encode(get_json(initial_data, initial_static_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:initialize")
+ user << output(_initial_update, "[window_id].browser:update")
initialized = TRUE
- if("tgui:view")
- if(params["screen"])
- ui_screen = params["screen"]
+ if("tgui:setSharedState")
+ // Update the window state.
+ update_status(push = FALSE)
+ // Bail if UI is not interactive or usr calling Topic
+ // is not the UI user.
+ if(status != UI_INTERACTIVE)
+ return
+ var/key = params["key"]
+ var/value = params["value"]
+ if(!src_object.tgui_shared_states)
+ src_object.tgui_shared_states = list()
+ src_object.tgui_shared_states[key] = value
SStgui.update_uis(src_object)
+ if("tgui:setFancy")
+ var/value = text2num(params["value"])
+ user.client.prefs.tgui_fancy = value
if("tgui:log")
// Force window to show frills on fatal errors
if(params["fatal"])
winset(user, window_id, "titlebar=1;can-resize=1;size=600x600")
+ log_message(params["log"])
if("tgui:link")
user << link(params["url"])
- if("tgui:fancy")
- user.client.prefs.tgui_fancy = TRUE
- if("tgui:nofrills")
- user.client.prefs.tgui_fancy = FALSE
- else
- update_status(push = FALSE) // Update the window state.
- if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object.
- SStgui.update_uis(src_object) // Update if the object requested it.
- /**
- * private
- *
- * Update the UI.
- * Only updates the data if update is true, otherwise only updates the status.
- *
- * optional force bool If the UI should be forced to update.
- **/
+ else
+ // Update the window state.
+ update_status(push = FALSE)
+ // Call ui_act() on the src_object.
+ if(src_object.ui_act(action, params, src, state))
+ // Update if the object requested it.
+ SStgui.update_uis(src_object)
+
+/**
+ * private
+ *
+ * Update the UI.
+ * Only updates the data if update is true, otherwise only updates the status.
+ *
+ * optional force bool If the UI should be forced to update.
+ */
/datum/tgui/process(force = FALSE)
var/datum/host = src_object.ui_host(user)
if(!src_object || !host || !user) // If the object or user died (or something else), abort.
@@ -296,69 +313,75 @@
else
update_status(push = TRUE) // Otherwise only update status.
- /**
- * private
- *
- * Push data to an already open UI.
- *
- * required data list The data to send.
- * optional force bool If the update should be sent regardless of state.
- **/
+/**
+ * private
+ *
+ * Push data to an already open UI.
+ *
+ * required data list The data to send.
+ * optional force bool If the update should be sent regardless of state.
+ */
/datum/tgui/proc/push_data(data, static_data, force = FALSE)
- update_status(push = FALSE) // Update the window state.
+ // Update the window state.
+ update_status(push = FALSE)
+ // Cannot update UI if it is not set up yet.
if(!initialized)
- return // Cannot update UI if it is not set up yet.
+ return
+ // Cannot update UI, we have no visibility.
if(status <= UI_DISABLED && !force)
- return // Cannot update UI, we have no visibility.
-
+ return
// Send the new JSON to the update() Javascript function.
- user << output(url_encode(get_json(data, static_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:update")
+ user << output(
+ url_encode(get_json(data, static_data)),
+ "[window_id].browser:update")
- /**
- * private
- *
- * Updates the UI by interacting with the src_object again, which will hopefully
- * call try_ui_update on it.
- *
- * optional force_open bool If force_open should be passed to ui_interact.
- **/
+/**
+ * private
+ *
+ * Updates the UI by interacting with the src_object again, which will hopefully
+ * call try_ui_update on it.
+ *
+ * optional force_open bool If force_open should be passed to ui_interact.
+ */
/datum/tgui/proc/update(force_open = FALSE)
src_object.ui_interact(user, ui_key, src, force_open, master_ui, state)
- /**
- * private
- *
- * Update the status/visibility of the UI for its user.
- *
- * optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
- **/
+/**
+ * private
+ *
+ * Update the status/visibility of the UI for its user.
+ *
+ * optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
+ */
/datum/tgui/proc/update_status(push = FALSE)
var/status = src_object.ui_status(user, state)
if(master_ui)
status = min(status, master_ui.status)
+
set_status(status, push)
if(status == UI_CLOSE)
close()
- /**
- * private
- *
- * Set the status/visibility of the UI.
- *
- * required status int The status to set (UI_CLOSE/UI_DISABLED/UI_UPDATE/UI_INTERACTIVE).
- * optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
- **/
+/**
+ * private
+ *
+ * Set the status/visibility of the UI.
+ *
+ * required status int The status to set (UI_CLOSE/UI_DISABLED/UI_UPDATE/UI_INTERACTIVE).
+ * optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
+ */
/datum/tgui/proc/set_status(status, push = FALSE)
- if(src.status != status) // Only update if status has changed.
+ // Only update if status has changed.
+ if(src.status != status)
if(src.status == UI_DISABLED)
src.status = status
if(push)
update()
else
src.status = status
- if(status == UI_DISABLED || push) // Update if the UI just because disabled, or a push is requested.
+ // Update if the UI just because disabled, or a push is requested.
+ if(status == UI_DISABLED || push)
push_data(null, force = TRUE)
/datum/tgui/proc/log_message(message)
log_tgui("[user] ([user.ckey]) using \"[title]\":\n[message]")
-
diff --git a/dependencies.sh b/dependencies.sh
index a75940088..5bfe5a738 100644
--- a/dependencies.sh
+++ b/dependencies.sh
@@ -16,5 +16,5 @@ export RUST_G_VERSION=0.4.2
#bsql git tag
export BSQL_VERSION=v1.4.0.0
-#node version
-export NODE_VERSION=8
+#node version (for tgui)
+export NODE_VERSION=12
diff --git a/hyperstation/code/modules/power/reactor/rbmk.dm b/hyperstation/code/modules/power/reactor/rbmk.dm
index 948a6598f..51f56b47a 100644
--- a/hyperstation/code/modules/power/reactor/rbmk.dm
+++ b/hyperstation/code/modules/power/reactor/rbmk.dm
@@ -607,10 +607,10 @@ The reactor CHEWS through moderator. It does not do this slowly. Be very careful
. = ..()
ui_interact(user)
-/obj/machinery/computer/reactor/control_rods/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
+/obj/machinery/computer/reactor/control_rods/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/tgui_state/state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "rbmkcontrolrods", name, 300, 300, master_ui, state)
+ ui = new(user, src, ui_key, "RbmkControlRods", name, 300, 300, master_ui, state)
ui.open()
/obj/machinery/computer/reactor/control_rods/ui_act(action, params)
@@ -648,7 +648,7 @@ The reactor CHEWS through moderator. It does not do this slowly. Be very careful
. = ..()
ui_interact(user)
-/obj/machinery/computer/reactor/stats/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/ui_state/state)
+/obj/machinery/computer/reactor/stats/ui_interact(mob/user, ui_key, datum/tgui/ui, force_open, datum/tgui/master_ui, datum/tgui_state/state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "RbmkStats", name, 350, 500, master_ui, state)
@@ -803,7 +803,7 @@ The reactor CHEWS through moderator. It does not do this slowly. Be very careful
transfer_access = ACCESS_CONSTRUCTION
network_destination = "rbmk monitoring system"
size = 2
- tgui_id = "ntosrbmkstats"
+ tgui_id = "NtosRbmkStats"
ui_x = 350
ui_y = 550
var/active = TRUE //Easy process throttle
diff --git a/tgstation.dme b/tgstation.dme
index 50cd554fb..f45b84457 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -154,6 +154,7 @@
#include "code\__HELPERS\type2type_vr.dm"
#include "code\__HELPERS\type_processing.dm"
#include "code\__HELPERS\typelists.dm"
+#include "code\__HELPERS\unique_ids.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\verbs.dm"
#include "code\__HELPERS\view.dm"
@@ -3010,6 +3011,7 @@
#include "code\modules\tgui\states.dm"
#include "code\modules\tgui\subsystem.dm"
#include "code\modules\tgui\tgui.dm"
+#include "code\modules\tgui\modules\_base.dm"
#include "code\modules\tgui\states\admin.dm"
#include "code\modules\tgui\states\always.dm"
#include "code\modules\tgui\states\conscious.dm"
diff --git a/tgui-next/.gitattributes b/tgui-next/.gitattributes
deleted file mode 100644
index 0016cc3bf..000000000
--- a/tgui-next/.gitattributes
+++ /dev/null
@@ -1,10 +0,0 @@
-* text=auto
-
-## Enforce text mode and LF line breaks
-*.js text eol=lf
-*.css text eol=lf
-*.html text eol=lf
-*.json text eol=lf
-
-## Treat bundles as binary and ignore them during conflicts
-*.bundle.* binary merge=tgui-merge-bundle
diff --git a/tgui-next/.gitignore b/tgui-next/.gitignore
deleted file mode 100644
index 416ca3768..000000000
--- a/tgui-next/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-node_modules
-*.log
-package-lock.json
-
-/packages/tgui/public/.tmp/**/*
-/packages/tgui/public/**/*.hot-update.*
-/packages/tgui/public/**/*.map
diff --git a/tgui-next/docs/tutorial-and-examples.md b/tgui-next/docs/tutorial-and-examples.md
deleted file mode 100644
index d038c1de6..000000000
--- a/tgui-next/docs/tutorial-and-examples.md
+++ /dev/null
@@ -1,245 +0,0 @@
-# Tutorial and Examples
-
-## Main concepts
-
-Basic tgui backend code consists of the following vars and procs:
-
-```
-ui_interact(mob/user, ui_key, datum/tgui/ui, force_open,
- datum/tgui/master_ui, datum/ui_state/state)
-ui_data(mob/user)
-ui_act(action, params)
-```
-
-- `src_object` - The atom, which UI corresponds to in the game world.
-- `ui_interact` - The proc where you will handle a request to open an
-interface. Typically, you would update an existing UI (if it exists),
-or set up a new instance of UI by calling the `SStgui` subsystem.
-- `ui_data` - In this proc you munges whatever complex data your `src_object`
-has into an associative list, which will then be sent to UI as a JSON string.
-- `ui_act` - This proc receives user actions and reacts to them by changing
-the state of the game.
-- `ui_state` (set in `ui_interact`) - This var dictates under what conditions
-a UI may be interacted with. This may be the standard checks that check if
-you are in range and conscious, or more.
-
-Once backend is complete, you create an new interface component on the
-frontend, which will receive this JSON data and render it on screen.
-
-States are easy to write and extend, and what make tgui interactions so
-powerful. Because states can be overridden from other procs, you can build
-powerful interactions for embedded objects or remote access.
-
-## Using It
-
-### Backend
-
-Let's start with a very basic hello world.
-
-```dm
-/obj/machinery/my_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state)
- ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "my_machine", name, 300, 300, master_ui, state)
- ui.open()
-```
-
-This is the proc that defines our interface. There's a bit going on here, so
-let's break it down. First, we override the ui_interact proc on our object. This
-will be called by `interact` for you, which is in turn called by `attack_hand`
-(or `attack_self` for items). `ui_interact` is also called to update a UI (hence
-the `try_update_ui`), so we accept an existing UI to update. The `state` is a
-default argument so that a caller can overload it with named arguments
-(`ui_interact(state = overloaded_state)`) if needed.
-
-Inside the `if(!ui)` block (which means we are creating a new UI), we choose our
-template, title, and size; we can also set various options like `style` (for
-themes), or autoupdate. These options will be elaborated on later (as will
-`ui_state`s).
-
-After `ui_interact`, we need to define `ui_data`. This just returns a list of
-data for our object to use. Let's imagine our object has a few vars:
-
-```dm
-/obj/machinery/my_machine/ui_data(mob/user)
- var/list/data = list()
- data["health"] = health
- data["color"] = color
-
- return data
-```
-
-The `ui_data` proc is what people often find the hardest about tgui, but its
-really quite simple! You just need to represent your object as numbers, strings,
-and lists, instead of atoms and datums.
-
-Finally, the `ui_act` proc is called by the interface whenever the user used an
-input. The input's `action` and `params` are passed to the proc.
-
-```dm
-/obj/machinery/my_machine/ui_act(action, params)
- if(..())
- return
- switch(action)
- if("change_color")
- var/new_color = params["color"]
- if(!(color in allowed_coors))
- return
- color = new_color
- . = TRUE
- update_icon()
-```
-
-The `..()` (parent call) is very important here, as it is how we check that the
-user is allowed to use this interface (to avoid so-called href exploits). It is
-also very important to clamp and sanitize all input here. Always assume the user
-is attempting to exploit the game.
-
-Also note the use of `. = TRUE` (or `FALSE`), which is used to notify the UI
-that this input caused an update. This is especially important for UIs that do
-not auto-update, as otherwise the user will never see their change.
-
-### Frontend
-
-Finally, you have to make a UI component. This is also a source of
-confusion for many new users. If you got some basic javascript and HTML
-knowledge, that should ease the learning process, although we recommend
-getting yourself introduced to
-[React and JSX](https://reactjs.org/docs/introducing-jsx.html).
-
-A component is not a regular HTML. A component is a pure function, which
-accepts a `props` object (it contains properties passed to a component),
-and outputs an HTML-like structure consisting of regular HTML elements and
-other UI components.
-
-Interface component will always receive 1 prop which is called `state`.
-This object contains a few special values:
-
-- `config` is always the same and is part of core tgui
-(it will be explained later),
-- `data` is the data returned from `ui_data`
-
-```jsx
-import { Section, LabeledList } from '../components';
-
-const SampleInterface = props => {
- const { state } = props;
- const { config, data } = state;
- const { ref } = config;
- return (
-
| - | min2 | -min1 | -max1 | -max2 | -
| {threshold.name} | - {threshold.settings.map(setting => ( -
- |
- ))}
-
| - {pack.name}: - | -
- {!!pack.small_item && (
- |
-
- {!!pack.access && (
- |
-
- |
-
| - #{request.id}: - | -- {request.object} - | -- By {request.orderer} - | -- {request.reason} - | -
- {request.cost} credits
- {' '}
- {!data.requestonly && (
- |
-
- {law} -- ))} -
-- ); -}; diff --git a/tgui-next/packages/tgui/interfaces/LaborClaimConsole.js b/tgui-next/packages/tgui/interfaces/LaborClaimConsole.js deleted file mode 100644 index 07a46b2cd..000000000 --- a/tgui-next/packages/tgui/interfaces/LaborClaimConsole.js +++ /dev/null @@ -1,69 +0,0 @@ -import { toTitleCase } from 'common/string'; -import { Fragment } from 'inferno'; -import { useBackend } from '../backend'; -import { Box, Button, LabeledList, Section, Table } from '../components'; - -export const LaborClaimConsole = props => { - const { act, data } = useBackend(props); - const { - can_go_home, - id_points, - ores, - status_info, - unclaimed_points, - } = data; - return ( --
- This machine only accepts ore.-
- Gibtonite and Slag are not accepted. -