From c421782aa2dfb92adbdc5f3d490db7ab8e42d6f7 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Fri, 2 Oct 2020 18:22:16 -0700 Subject: [PATCH 1/8] Mobs don't get lost in space (#7713) --- code/modules/overmap/spacetravel.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index 658ae729a41..8bae95434ad 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -73,8 +73,9 @@ proc/get_deepspace(x,y) /mob/lost_in_space() return isnull(client) -/mob/living/carbon/human/lost_in_space() - return isnull(client) && !key && stat == DEAD +/mob/living/lost_in_space() + return FALSE + // return isnull(client) && !key && stat == DEAD // Allows bodies that players have ghosted from to be deleted - Ater proc/overmap_spacetravel(var/turf/space/T, var/atom/movable/A) if (!T || !A) From 83da5313f6d862adb2a6fbe3630c2561d60777da Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Fri, 2 Oct 2020 21:56:57 -0700 Subject: [PATCH 3/8] Fix PDA access to use regular tgui inventory rules --- code/modules/pda/ai.dm | 2 +- code/modules/pda/messenger.dm | 4 ++-- code/modules/pda/pda.dm | 14 +++----------- code/modules/pda/pda_tgui.dm | 11 ----------- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/code/modules/pda/ai.dm b/code/modules/pda/ai.dm index 9072eef96ee..10a04effb3a 100644 --- a/code/modules/pda/ai.dm +++ b/code/modules/pda/ai.dm @@ -26,7 +26,7 @@ set name = "Use PDA" set src in usr - if(!can_use()) + if(!can_use(usr)) return tgui_interact(usr) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 38360e127a7..a902bec3aa4 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -109,7 +109,7 @@ // Specifically here for the chat message. /datum/data/pda/app/messenger/Topic(href, href_list) - if(!pda.can_use()) + if(!pda.can_use(usr)) return unnotify() @@ -140,7 +140,7 @@ if(last_text && world.time < last_text + 5) return - if(!pda.can_use()) + if(!pda.can_use(usr)) return last_text = world.time diff --git a/code/modules/pda/pda.dm b/code/modules/pda/pda.dm index 3c9b03ce1ed..2c3b3687304 100644 --- a/code/modules/pda/pda.dm +++ b/code/modules/pda/pda.dm @@ -147,16 +147,8 @@ var/global/list/obj/item/device/pda/PDAs = list() log_debug("Invalid switch for PDA, defaulting to old PDA icons. [pdachoice] chosen.") start_program(find_program(/datum/data/pda/app/main_menu)) -/obj/item/device/pda/proc/can_use() - if(!ismob(loc)) - return FALSE - - var/mob/M = loc - if(M.incapacitated(INCAPACITATION_ALL)) - return FALSE - if(src in M.contents) - return TRUE - return FALSE +/obj/item/device/pda/proc/can_use(mob/user) + return (tgui_status(user, GLOB.tgui_inventory_state) == STATUS_INTERACTIVE) /obj/item/device/pda/GetAccess() if(id) @@ -169,7 +161,7 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/MouseDrop(obj/over_object as obj, src_location, over_location) var/mob/M = usr - if((!istype(over_object, /obj/screen)) && can_use()) + if((!istype(over_object, /obj/screen)) && can_use(usr)) return attack_self(M) return diff --git a/code/modules/pda/pda_tgui.dm b/code/modules/pda/pda_tgui.dm index 0d70b6db02d..cbc4813b297 100644 --- a/code/modules/pda/pda_tgui.dm +++ b/code/modules/pda/pda_tgui.dm @@ -2,11 +2,6 @@ /obj/item/device/pda/tgui_state(mob/user) return GLOB.tgui_inventory_state -/obj/item/device/pda/tgui_status(mob/user, datum/tgui_state/state) - . = ..() - if(!can_use()) - . = min(., STATUS_UPDATE) - /obj/item/device/pda/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) @@ -68,12 +63,6 @@ if(..()) return TRUE - if(!can_use()) - usr.unset_machine() - if(ui) - ui.close() - return FALSE - add_fingerprint(usr) usr.set_machine(src) From 37b1850baeb9e94138fd0be2aff74f877efd105f Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Fri, 2 Oct 2020 22:06:32 -0700 Subject: [PATCH 4/8] Readd ability to silence touch sounds --- code/modules/pda/pda_tgui.dm | 3 +++ tgui/packages/tgui/interfaces/Pda.js | 8 ++++++++ tgui/packages/tgui/public/tgui.bundle.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/modules/pda/pda_tgui.dm b/code/modules/pda/pda_tgui.dm index cbc4813b297..6d57a6c25eb 100644 --- a/code/modules/pda/pda_tgui.dm +++ b/code/modules/pda/pda_tgui.dm @@ -45,6 +45,7 @@ data["idLink"] = (id ? text("[id.registered_name], [id.assignment]") : "--------") data["useRetro"] = retro_mode + data["touch_silent"] = touch_silent data["cartridge_name"] = cartridge ? cartridge.name : "" data["stationTime"] = stationtime2text() //worldtime2stationtime(world.time) // Aaa which fucking one is canonical there's SO MANY @@ -102,6 +103,8 @@ id_check(usr, 1) if("Retro") retro_mode = !retro_mode + if("TouchSounds") + touch_silent = !touch_silent if("Ringtone") return set_ringtone() else diff --git a/tgui/packages/tgui/interfaces/Pda.js b/tgui/packages/tgui/interfaces/Pda.js index a1f52b283ac..6c4428c05b4 100644 --- a/tgui/packages/tgui/interfaces/Pda.js +++ b/tgui/packages/tgui/interfaces/Pda.js @@ -127,6 +127,7 @@ const PDASettings = (props, context) => { idInserted, idLink, cartridge_name, + touch_silent, } = data; return ( @@ -138,6 +139,13 @@ const PDASettings = (props, context) => { content={"Retro Theme"} onClick={() => act("Retro")} /> + +