Files
Bubberstation/code/modules/tgui_input/text.dm
SkyratBot e932d4d39a [MIRROR] Allows TGUI input datums to accept a ui_state as an argument [MDB IGNORE] (#20881)
* Allows TGUI input datums to accept a ui_state as an argument (#75029)

## About The Pull Request

Title. Adds a new argument to the factory proc, the New(), adds a
variable, and changes ui_state() to return that variable. The variable
is always_state by default.

## Why It's Good For The Game
It allows custom behavior to be injected into the ui_state logic of the
basic input datums. This is good because there are circumstances where
always_state isn't acceptable. Ex. you open tgui_input_list(mob/user),
and the mob dies or is deleted. The list stays open, the contents can be
picked, despite this not being what the author wants. With this PR, you
can make sure the list closes and inputs are invalid in circumstances of
your choosing without having to completely re-make the input procs via
copypasting.
## Changelog
🆑
code: TGUI input datums can now accept custom ui_states
/🆑

* Allows TGUI input datums to accept a ui_state as an argument

---------

Co-authored-by: nikothedude <59709059+nikothedude@users.noreply.github.com>
2023-05-01 23:52:17 +01:00

5.6 KiB