Files
Bubberstation/code/modules/tgui/states/greyscale_menu.dm
SkyratBot e2f06f4d1d [MIRROR] Fix /datum/ui_state/greyscale_menu_state for non-atom datums (#26361)
* Fix `/datum/ui_state/greyscale_menu_state` for non-atom datums (#81310)

## About The Pull Request

`can_use_topic` returns a UI define like `UI_INTERACTIVE`, not `TRUE` /
`FALSE`

This line is intended to allow greyscale menus to be used when targeting
non-atoms, however it prevents that entirely. #77322

## Changelog

Not necessary since _we_ don't have any GAGS menu usage that targets a
datum... currently.

* Fix `/datum/ui_state/greyscale_menu_state` for non-atom datums

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-02-07 12:53:03 -05:00

15 lines
454 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 UI_INTERACTIVE
return GLOB.default_state.can_use_topic(menu.target, user)