Skip to content

Commit

Permalink
Show all channels a headset has on examining it. (#7943)
Browse files Browse the repository at this point in the history
# About the pull request

Tl:DR: If you examine your headset the same ui will pop up that pops up
when you normally click it.

Shift click a headset to examine it. And it will have a pop up listing
it's frequencies open up.
The pop up shows you all frequencies it has and is always updated based
upon the keys inserted.

The first line I override the examine proc.
The second line we ensure you cannot remotely interact with it. Or get
the menu if you normally would not get the menu.
So a shift click cannot be used to bypass checks on the pop up. Such as
remote interaction from far away. Yautja and synths still/also get the
pop up.
Next we ensure we stop updating changes if the user closes the window. 
Then we open the window.
And last we make sure to always call the parent proc so that we also
display the description.
It also fixes "Fixes issue #7918 "

# Explain why it's good for the game

This is good because currently the channels are listed in the
description when clicking the headset.
Now, there is no need to manually add it to each headset it's
description. And it updates when keys are inserted or removed.
Currently, some descriptions are missing some channels. And some
headsets do not have any channels in their description.
This helps also helps newer players, because it's more obvious, always
correct/self updating.
Because it's a pop up it won't get lost in the chat log and is also
easier to see/write down.
 
# Testing Photographs and Procedure

Unless I also managed to tape my inputs you would not know what buttons
I was pressing.
But, I spawned in as Human and shift clicked a headset in my hand, one I
was wearing, one in a backpack and one on the floor twice. Once next to
me and once remotely. I got the expected result each time. I also did
the same as a synth, a yautja and a monkey. The results were as
expected. As a xeno I could not pick it up only slash it.

# Changelog

:cl:Awan
qol: If you examine a radio that is on your person it's menu listing all
frequencies will now pop up.
/:cl:
  • Loading branch information
Awantje authored Jan 2, 2025
1 parent 045b917 commit bbe2710
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@
user.set_interaction(src)
tgui_interact(user)

/obj/item/device/radio/headset/examine(mob/user as mob)
if(ishuman(user) && loc == user)
tgui_interact(user)
return ..()

/obj/item/device/radio/headset/MouseDrop(obj/over_object as obj)
if(!CAN_PICKUP(usr, src))
return ..()
Expand Down

0 comments on commit bbe2710

Please sign in to comment.