Files
Bubberstation/code/modules/tgui/states/greyscale_menu.dm
SkyratBot 306b828631 [MIRROR] Polishing the greyscale modify menu's lackluster support for non-atom targets. [MDB IGNORE] (#22965)
* 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.

* Polishing the greyscale modify menu's lackluster support for non-atom targets.

* I hope I won't have to get back and edit out the ability to modify the alpha on clothes for this

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2023-08-11 14:42:44 -04: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)