TGUI list input conversions (#63315)

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com>
This commit is contained in:
Jeremiah
2021-12-10 02:20:01 -08:00
committed by GitHub
co-authored by tralezab Sealed101
parent 78cc356987
commit 60922e7cfc
30 changed files with 49 additions and 46 deletions
+4 -1
View File
@@ -9,7 +9,7 @@
* * buttons - The options that can be chosen by the user, each string is assigned a button on the UI.
* * timeout - The timeout of the input box, after which the input box will close and qdel itself. Set to zero for no timeout.
*/
/proc/tgui_input_list(mob/user, message, title, list/buttons, timeout = 0)
/proc/tgui_input_list(mob/user, message, title = "Select", list/buttons, timeout = 0)
if (!user)
user = usr
if(!length(buttons))
@@ -20,6 +20,9 @@
user = client.mob
else
return
/// Client does NOT have tgui_input on: Returns regular input
if(!user.client.prefs.read_preference(/datum/preference/toggle/tgui_input))
return input(user, message, title) as null|anything in buttons
var/datum/tgui_list_input/input = new(user, message, title, buttons, timeout)
input.ui_interact(user)
input.wait()