Files
Bubberstation/code/modules/tgui/states/greyscale_menu.dm
Ghom d1880d18fc Polishing the greyscale modify menu's lackluster support for non-atom targets. (#77322)
## About The Pull Request

So, I've been recently told that Skyrat uses the greyscale modify menu
for loadouts, and the new ui state kinda borked it. I honestly haven't
taken the possibility that the target could be anything but a subtype of
`/atom` (and still work) into account because much of the code assumes
the target is an atom. It's kinda crappy. Also I hadn't noticed we've an
`unlocked` variable, which makes `vv_mode` var superflous, so i'm going
to remove the latter.
2023-08-09 12:30:33 -05:00

15 lines
444 B
Plaintext

/**
* tgui state: greyscale menu
*
* Checks that the target var of the greyscale menu meets the default can_use_topic criteria
*/
GLOBAL_DATUM_INIT(greyscale_menu_state, /datum/ui_state/greyscale_menu_state, new)
/datum/ui_state/greyscale_menu_state/can_use_topic(src_object, mob/user)
var/datum/greyscale_modify_menu/menu = src_object
if(!isatom(menu.target))
return TRUE
return GLOB.default_state.can_use_topic(menu.target, user)