mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
[READY] TGUI Input Collection (#23891)
* List Input refresh * Modal Alerts * Text Input * Number Input * Split Button * Renaming * Alert converts * Text Input Conversion (Part 1) And TextArea Autofocus + maxLength * Text Input Conversion (Part 2) * AAAAAAAAAAAAAAAAAAAA * I'm FUCKED * @GDNgit review changes * "'" fixes * Revert TGUI Alert from admin delete * NumberInput Window size * CRASH if empty list * Update code/modules/tgui/tgui_input/list_input.dm * TGUI Rebuild * TGUI Rebuild * Update code/modules/paperwork/faxmachine.dm * _char * compile * Rebuild --------- Co-authored-by: Aylong <69762909+Aylong220@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
@@ -381,11 +381,13 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
O.show_message(text("[bicon(src)] *[ttone]*"))
|
||||
|
||||
/obj/item/pda/proc/set_ringtone(mob/user)
|
||||
var/new_tone = input("Please enter new ringtone", name, ttone) as text
|
||||
var/new_tone = tgui_input_text(user, "Please enter new ringtone", name, ttone)
|
||||
new_tone = trim(new_tone)
|
||||
|
||||
if(!in_range(src, user) || loc != user)
|
||||
close(user)
|
||||
return FALSE
|
||||
|
||||
if(!new_tone)
|
||||
return FALSE
|
||||
|
||||
@@ -393,6 +395,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
to_chat(user, "The PDA softly beeps.")
|
||||
close(user)
|
||||
return TRUE
|
||||
|
||||
ttone = sanitize(copytext(new_tone, 1, 20))
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -25,9 +25,13 @@
|
||||
if(params["msgnum"])
|
||||
switch(text2num(params["msgnum"]))
|
||||
if(1)
|
||||
message1 = clean_input("Line 1", "Enter Message Text", message1)
|
||||
message1 = tgui_input_text(usr, "Line 1", "Enter Message Text", message1, encode = FALSE)
|
||||
if(!message1)
|
||||
return
|
||||
if(2)
|
||||
message2 = clean_input("Line 2", "Enter Message Text", message2)
|
||||
message2 = tgui_input_text(usr, "Line 2", "Enter Message Text", message2, encode = FALSE)
|
||||
if(!message2)
|
||||
return
|
||||
|
||||
if("Status")
|
||||
switch(text2num(params["statdisp"]))
|
||||
|
||||
@@ -73,12 +73,12 @@
|
||||
|
||||
switch(action)
|
||||
if("Edit")
|
||||
var/n = input("Please enter message", name, note) as message
|
||||
var/n = tgui_input_text(usr, "Please enter message", name, note, multiline = TRUE, encode = FALSE)
|
||||
if(!n)
|
||||
return
|
||||
|
||||
if(pda.loc == usr)
|
||||
// TGUI will auto-reject supplied HTML
|
||||
// However, the admin var-edit window will not
|
||||
// SANITISATION IS IMPORTANT. DO NOT NEGLECT.
|
||||
note = adminscrub(n)
|
||||
note = n
|
||||
else
|
||||
pda.close(usr)
|
||||
|
||||
|
||||
@@ -121,10 +121,9 @@
|
||||
|
||||
|
||||
/datum/data/pda/app/messenger/proc/create_message(mob/living/U, obj/item/pda/P)
|
||||
var/t = input(U, "Please enter message", name, null) as text|null
|
||||
var/t = tgui_input_text(U, "Please enter your message", name)
|
||||
if(!t)
|
||||
return
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
if(!t || !istype(P))
|
||||
return
|
||||
if(!in_range(pda, U) && pda.loc != U)
|
||||
|
||||
@@ -127,12 +127,12 @@
|
||||
var/old_name = mob_info.mob_name
|
||||
if(mob_info.nickname)
|
||||
old_name = mob_info.nickname
|
||||
mob_info.nickname = input("Give a nickname to [old_name]?", "Nickname", old_name)
|
||||
mob_info.nickname = tgui_input_text(usr, "Give a nickname to [old_name]?", "Nickname", old_name)
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/release()
|
||||
if(!my_collection.len)
|
||||
return
|
||||
if(alert("Are you sure you want to release this mob back into the wild?", "Confirm Release", "Yes", "No") == "Yes")
|
||||
if(tgui_alert(usr, "Are you sure you want to release this mob back into the wild?", "Confirm Release", list("Yes", "No")) == "Yes")
|
||||
remove_mob()
|
||||
|
||||
/datum/data/pda/app/mob_hunter_game/proc/print_card()
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
error_message(user, "Incorrect Credentials")
|
||||
|
||||
/datum/data/pda/app/nanobank/proc/input_account_pin(mob/user)
|
||||
var/attempt_pin = input("Enter pin code", "NanoBank Account Auth") as num
|
||||
var/attempt_pin = tgui_input_number(user, "Enter pin code", "NanoBank Account Auth")
|
||||
if(!user_account || !attempt_pin)
|
||||
return
|
||||
return attempt_pin
|
||||
|
||||
Reference in New Issue
Block a user