From 0181187c03d15c7a2b701b6fdc6ea0e9647c4cb7 Mon Sep 17 00:00:00 2001 From: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Date: Sat, 22 Apr 2023 18:22:01 -0700 Subject: [PATCH] Adds mobility_ui bypass flag (#72934) A flag that lets you use an interactive TGUI screen while laying down. Adds this flag to the PDA. You're relaxing on a bed or something and it's annoying having to stand up just to reply to a PDA message and then lay back down. We know how to text without dropping the PDA on our face. (Usually) The flag can be applied to anything else you should be able to interact with while laying down. --- code/__DEFINES/interaction_flags.dm | 2 ++ code/_globalvars/bitfields.dm | 1 + code/modules/modular_computers/computers/item/pda.dm | 2 +- code/modules/tgui/states.dm | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm index 30381f5ebb6..0b4e9588729 100644 --- a/code/__DEFINES/interaction_flags.dm +++ b/code/__DEFINES/interaction_flags.dm @@ -18,6 +18,8 @@ #define INTERACT_ATOM_NO_FINGERPRINT_INTERACT (1<<8) /// allows this atom to skip the adjacency check #define INTERACT_ATOM_ALLOW_USER_LOCATION (1<<9) +/// ignores mobility check +#define INTERACT_ATOM_IGNORE_MOBILITY (1<<10) /// attempt pickup on attack_hand for items #define INTERACT_ITEM_ATTACK_HAND_PICKUP (1<<0) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 6a41a3443e3..87c90470198 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -152,6 +152,7 @@ DEFINE_BITFIELD(interaction_flags_atom, list( "INTERACT_ATOM_REQUIRES_DEXTERITY" = INTERACT_ATOM_REQUIRES_DEXTERITY, "INTERACT_ATOM_UI_INTERACT" = INTERACT_ATOM_UI_INTERACT, "INTERACT_ATOM_ALLOW_USER_LOCATION" = INTERACT_ATOM_ALLOW_USER_LOCATION, + "INTERACT_ATOM_IGNORE_MOBILITY" = INTERACT_ATOM_IGNORE_MOBILITY, )) DEFINE_BITFIELD(interaction_flags_machine, list( diff --git a/code/modules/modular_computers/computers/item/pda.dm b/code/modules/modular_computers/computers/item/pda.dm index 6b877c35942..026aad34842 100644 --- a/code/modules/modular_computers/computers/item/pda.dm +++ b/code/modules/modular_computers/computers/item/pda.dm @@ -13,7 +13,7 @@ steel_sheet_cost = 2 custom_materials = list(/datum/material/iron=300, /datum/material/glass=100, /datum/material/plastic=100) - interaction_flags_atom = INTERACT_ATOM_ALLOW_USER_LOCATION + interaction_flags_atom = INTERACT_ATOM_ALLOW_USER_LOCATION | INTERACT_ATOM_IGNORE_MOBILITY icon_state_menu = "menu" max_capacity = 64 diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm index e43deb373a0..16fa83445c5 100644 --- a/code/modules/tgui/states.dm +++ b/code/modules/tgui/states.dm @@ -73,7 +73,8 @@ /mob/living/shared_ui_interaction(src_object) . = ..() - if(!(mobility_flags & MOBILITY_UI) && . == UI_INTERACTIVE) + var/obj/item/object = src_object + if(!(mobility_flags & MOBILITY_UI) && !(object.interaction_flags_atom & INTERACT_ATOM_IGNORE_MOBILITY) && . == UI_INTERACTIVE) return UI_UPDATE /mob/living/silicon/ai/shared_ui_interaction(src_object)