mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-24 00:21:52 +00:00
* 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>
15 lines
454 B
Plaintext
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)
|