TGUI input box conversions 2 (#63395)

More text inputs converted to tgui, TGUI text and number input now more sanely handles ENTER key being pressed, you can now press anywhere in the window to enter the input. TGUI text input now considers placeholder text for the default valid state. IE, if there is default text you can press enter immediately without having to rewrite it just to recheck validity. Fixes: useSharedState => useLocalState. not only was sharedstate not needed but it opened up the ui to vulnerabilities
This commit is contained in:
Jeremiah
2021-12-15 14:12:04 -08:00
committed by GitHub
parent 3e6607bb0e
commit d17a60fb53
36 changed files with 143 additions and 149 deletions
+1 -1
View File
@@ -353,7 +353,7 @@
trophy_message = W.desc //default value
var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque")
var/chosen_plaque = tgui_input_text(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque", trophy_message)
if(chosen_plaque)
if(user.Adjacent(src))
trophy_message = chosen_plaque
@@ -51,7 +51,7 @@
/obj/structure/door_assembly/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
var/t = tgui_input_text(user, "Enter the name for the door.", name, created_name, MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)