diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9d02092d31..c280eeecc04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: - name: Run Linters run: | find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/ci/json_verifier.py - tools/ci/build_nanoui.sh tools/ci/build_tgui.sh tools/ci/check_grep.sh python3 tools/ci/check_line_endings.py diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 00f86330adc..4a2cbf8ce4f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -2043,3 +2043,12 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /// Waits at a line of code until X is true #define UNTIL(X) while(!(X)) stoplag() + +// Check if the source atom contains another atom +/atom/proc/contains(atom/location) + if(!location) + return FALSE + if(location == src) + return TRUE + + return contains(location.loc) diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index 98dae1850e5..5c66a88eaf4 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -233,9 +233,9 @@ SUBSYSTEM_DEF(tgui) /datum/controller/subsystem/tgui/proc/on_close(datum/tgui/ui) var/src_object_key = "[ui.src_object.UID()]" if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list)) - return 0 // It wasn't open. + return FALSE // It wasn't open. else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list)) - return 0 // It wasn't open. + return FALSE // It wasn't open. processing_uis.Remove(ui) // Remove it from the list of processing UIs. if(ui.user) // If the user exists, remove it from them too. @@ -249,7 +249,7 @@ SUBSYSTEM_DEF(tgui) if(!uiobj.len) open_uis.Remove(src_object_key) - return 1 // Let the caller know we did it. + return TRUE // Let the caller know we did it. /** * private @@ -275,7 +275,7 @@ SUBSYSTEM_DEF(tgui) */ /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) - return 0 // The old mob had no open UIs. + return FALSE // 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. @@ -285,4 +285,4 @@ SUBSYSTEM_DEF(tgui) target.open_uis.Add(ui) // Transfer all the UIs. source.open_uis.Cut() // Clear the old list. - return 1 // Let the caller know we did it. + return TRUE // Let the caller know we did it. diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index 6e000a8fd9c..2a366535832 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -79,7 +79,7 @@ /datum/proc/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) // If UI is not interactive or usr calling Topic is not the UI user, bail. if(!ui || ui.status != STATUS_INTERACTIVE) - return 1 + return TRUE /** * public @@ -135,15 +135,15 @@ * Called by UIs when they are closed. * Must be a verb so winset() can call it. * - * required uiref ref The UI that was closed. + * required uiref uid The UI that was closed. */ -/client/verb/uiclose(ref as text) +/client/verb/uiclose(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 = locateUID(ref) + // Get the UI based on the UID. + var/datum/tgui/ui = locateUID(uid) // If we found the UI, close it. if(istype(ui)) diff --git a/code/modules/tgui/states/contained.dm b/code/modules/tgui/states/contained.dm index 07225d79fb1..3fe0cfc6b79 100644 --- a/code/modules/tgui/states/contained.dm +++ b/code/modules/tgui/states/contained.dm @@ -10,11 +10,3 @@ GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new) if(!src_object.contains(user)) return STATUS_CLOSE return user.shared_ui_interaction(src_object) - -/atom/proc/contains(atom/location) - if(!location) - return FALSE - if(location == src) - return TRUE - - return contains(location.loc) diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm index c72d7f826c2..fe7385c33b7 100644 --- a/code/modules/tgui/states/default.dm +++ b/code/modules/tgui/states/default.dm @@ -45,6 +45,9 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new) return STATUS_INTERACTIVE return STATUS_CLOSE +/mob/living/simple_animal/revenant/default_can_use_topic(src_object) + return STATUS_UPDATE + /mob/living/simple_animal/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) if(. > STATUS_CLOSE) @@ -56,3 +59,8 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new) return STATUS_INTERACTIVE else return ..() + +/mob/dead/observer/default_can_use_topic() + if(can_admin_interact()) + return STATUS_INTERACTIVE // Admins are more equal + return STATUS_UPDATE // Ghosts can view updates diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm index 1a5d67c3a50..fa3692a2ff7 100644 --- a/code/modules/tgui/states/hands.dm +++ b/code/modules/tgui/states/hands.dm @@ -19,6 +19,9 @@ GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new) return STATUS_INTERACTIVE return STATUS_CLOSE +/mob/living/simple_animal/revenant/hands_can_use_topic(src_object) + return STATUS_UPDATE + /mob/living/silicon/robot/hands_can_use_topic(src_object) if(activated(src_object)) return STATUS_INTERACTIVE diff --git a/code/modules/tgui/states/physical.dm b/code/modules/tgui/states/physical.dm index 49a3844d0be..c663cf4cd5d 100644 --- a/code/modules/tgui/states/physical.dm +++ b/code/modules/tgui/states/physical.dm @@ -14,6 +14,9 @@ GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new) /mob/proc/physical_can_use_topic(src_object) return STATUS_CLOSE +/mob/living/simple_animal/revenant/physical_can_use_topic(src_object) + return STATUS_UPDATE + /mob/living/physical_can_use_topic(src_object) return shared_living_ui_distance(src_object)