Multiple Bugfixes

This commit is contained in:
ItsSelis
2022-06-20 17:35:04 +02:00
parent 080ce72154
commit d60e0655a2
8 changed files with 29 additions and 21 deletions
+7 -3
View File
@@ -15,7 +15,7 @@
* * encode - Toggling this determines if input is filtered via html_encode. Setting this to FALSE gives raw input.
* * timeout - The timeout of the textbox, after which the modal will close and qdel itself. Set to zero for no timeout.
*/
/proc/tgui_input_text(mob/user, message = "", title = "Text Input", default, max_length = MAX_MESSAGE_LEN, multiline = FALSE, encode = FALSE, timeout = 0)
/proc/tgui_input_text(mob/user, message = "", title = "Text Input", default, max_length = MAX_MESSAGE_LEN, multiline = FALSE, encode = FALSE, timeout = 0, enter_submit = FALSE)
if (istext(user))
stack_trace("tgui_input_text() received text for user instead of mob")
return
@@ -39,7 +39,7 @@
return input(user, message, title, default) as message|null
else
return input(user, message, title, default) as text|null
var/datum/tgui_input_text/text_input = new(user, message, title, default, max_length, multiline, encode, timeout)
var/datum/tgui_input_text/text_input = new(user, message, title, default, max_length, multiline, encode, timeout, enter_submit)
text_input.tgui_interact(user)
text_input.wait()
if (text_input)
@@ -74,7 +74,9 @@
/// The title of the TGUI window
var/title
/datum/tgui_input_text/New(mob/user, message, title, default, max_length, multiline, encode, timeout)
var/enter_submit
/datum/tgui_input_text/New(mob/user, message, title, default, max_length, multiline, encode, timeout, enter_submit)
src.default = default
src.encode = encode
src.max_length = max_length
@@ -85,6 +87,7 @@
src.timeout = timeout
start_time = world.time
QDEL_IN(src, timeout)
src.enter_submit = enter_submit
/datum/tgui_input_text/Destroy(force, ...)
SStgui.close_uis(src)
@@ -120,6 +123,7 @@
data["placeholder"] = default // Default is a reserved keyword
data["swapped_buttons"] = !usr.client.prefs.tgui_swapped_buttons
data["title"] = title
data["enter_submit"] = enter_submit
return data
/datum/tgui_input_text/tgui_data(mob/user)