Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change behavior when using 2 UI dependent modsuit modules. #27828

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions code/modules/mod/modules/modules_medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,22 @@
toolspeed = 2
defib_cooldown = 2.5 SECONDS

///Crew Monitor - Deploys or retracts a built-in handheld crew monitor
/obj/item/mod/module/monitor
name = "MOD crew monitor module"
desc = "A module installed into the wrist of the suit, this presents a display of crew sensor data."
icon_state = "scanner"
module_type = MODULE_ACTIVE
module_type = MODULE_USABLE
complexity = 1
active_power_cost = DEFAULT_CHARGE_DRAIN * 0.3
device = /obj/item/sensor_device/mod
use_power_cost = DEFAULT_CHARGE_DRAIN * 0.3
incompatible_modules = list(/obj/item/mod/module/monitor)
cooldown_time = 0.5 SECONDS
allow_flags = MODULE_ALLOW_INACTIVE
var/datum/ui_module/crew_monitor/mod/crew_monitor

/obj/item/sensor_device/mod
name = "MOD crew monitor"
desc = "A miniature machine built into a modsuit that tracks suit sensors across the station."
flags = NODROP

/obj/item/mod/module/monitor/Initialize(mapload)
. = ..()
crew_monitor = new(src)

/obj/item/mod/module/monitor/on_use()
crew_monitor.ui_interact(mod.wearer)
12 changes: 10 additions & 2 deletions code/modules/mod/modules/modules_supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
down to the exact coordinates. This information is fed to a central database viewable from the device itself, \
though using it to help people is up to you."
icon_state = "gps"
module_type = MODULE_ACTIVE
module_type = MODULE_USABLE
complexity = 1
use_power_cost = DEFAULT_CHARGE_DRAIN * 0.2
incompatible_modules = list(/obj/item/mod/module/gps)
cooldown_time = 0.5 SECONDS
device = /obj/item/gps/mod
allow_flags = MODULE_ALLOW_INACTIVE
var/obj/item/gps/mod/gps

/obj/item/mod/module/gps/Initialize(mapload)
. = ..()
gps = new(src)

/obj/item/mod/module/gps/on_use()
gps.attack_self__legacy__attackchain(mod.wearer)

///Hydraulic Clamp - Lets you pick up and drop crates.
/obj/item/mod/module/clamp
Expand Down
13 changes: 8 additions & 5 deletions code/modules/telesci/gps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ GLOBAL_LIST_EMPTY(GPS_list)
update_icon(UPDATE_OVERLAYS)
addtimer(CALLBACK(src, PROC_REF(reboot)), EMP_DISABLE_TIME)

/obj/item/gps/AltClick(mob/user)
if(ui_status(user, GLOB.inventory_state) != UI_INTERACTIVE)
/obj/item/gps/AltClick(mob/user, state)
if(ui_status(user, state) != UI_INTERACTIVE)
return //user not valid to use gps
if(emped)
to_chat(user, "<span class='warning'>It's busted!</span>")
Expand Down Expand Up @@ -130,7 +130,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
ui = new(user, src, "GPS", "GPS")
ui.open()

/obj/item/gps/ui_act(action, list/params)
/obj/item/gps/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
if(..())
return

Expand All @@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
gpstag = newtag
name = "global positioning system ([gpstag])"
if("toggle")
AltClick(usr)
AltClick(usr, state)
return FALSE
if("same_z")
same_z = !same_z
Expand Down Expand Up @@ -181,7 +181,10 @@ GLOBAL_LIST_EMPTY(GPS_list)
icon_state = "gps-m"
gpstag = "MOD0"
desc = "A positioning system helpful for rescuing trapped or injured miners, after you have become lost from rolling around at the speed of sound."
flags = NODROP
tracking = FALSE

/obj/item/gps/mod/ui_state()
return GLOB.deep_inventory_state

/obj/item/gps/cyborg
icon_state = "gps-b"
Expand Down
6 changes: 6 additions & 0 deletions code/modules/tgui/modules/crew_monitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@

return data

/datum/ui_module/crew_monitor/mod
name = "Crew monitor (Modsuit)"

/datum/ui_module/crew_monitor/mod/ui_state(mob/user)
return GLOB.deep_inventory_state

/datum/ui_module/crew_monitor/ghost
name = "Crew monitor (Observer)"
is_advanced = TRUE
Expand Down
Loading