[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:
Aylong
2024-02-19 11:55:01 +00:00
committed by GitHub
co-authored by Aylong S34N
parent 0d5986fc5c
commit ac5add482f
168 changed files with 2310 additions and 1066 deletions
+3 -1
View File
@@ -201,7 +201,9 @@ GLOBAL_LIST_EMPTY(fax_blacklist)
. = FALSE
if("rename") // rename the item that is currently in the fax machine
if(copyitem)
var/n_name = sanitize(copytext(input(usr, "What would you like to label the fax?", "Fax Labelling", copyitem.name) as text, 1, MAX_MESSAGE_LEN))
var/n_name = tgui_input_text(usr, "What would you like to label the fax?", "Fax Labelling", copyitem.name)
if(!n_name)
return
if(copyitem && copyitem.loc == src && usr.stat == 0)
if(istype(copyitem, /obj/item/paper))
copyitem.name = "[(n_name ? "[n_name]" : initial(copyitem.name))]"
+1 -1
View File
@@ -40,7 +40,7 @@
if(mode)
to_chat(user, "<span class='notice'>You turn on \the [src].</span>")
//Now let them chose the text.
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = reject_bad_text(tgui_input_text(user,"Label text?", "Set label"))
if(!str || !length(str))
to_chat(user, "<span class='notice'>Invalid text.</span>")
return
+1 -1
View File
@@ -373,7 +373,7 @@
topic_href_write(id, input_element)
if(href_list["write"])
var/id = href_list["write"]
var/input_element = input("Enter what you want to write:", "Write", null, null) as message
var/input_element = tgui_input_text(usr, "Enter what you want to write:", "Write", multiline = TRUE, encode = FALSE)
topic_href_write(id, input_element)
/obj/item/paper/attackby(obj/item/P, mob/living/user, params)
+4 -4
View File
@@ -201,10 +201,10 @@
. = ..()
/obj/item/paper_bundle/proc/rename(mob/user)
var/n_name = sanitize(copytext(input(user, "What would you like to label the bundle?", "Bundle Labelling", name) as text, 1, MAX_MESSAGE_LEN))
if(loc == user && !user.stat)
name = "[(n_name ? "[n_name]" : "paper bundle")]"
var/n_name = tgui_input_text(user, "What would you like to label the bundle?", "Bundle Labelling", name)
if(!Adjacent(user) || !n_name || user.stat)
return
name = "[(n_name ? "[n_name]" : "paper bundle")]"
add_fingerprint(user)
/obj/item/paper_bundle/AltShiftClick(mob/user)
+1 -1
View File
@@ -435,7 +435,7 @@
return
if(stat & (BROKEN|NOPOWER))
return
var/text = input("Enter what you want to write:", "Write", null, null) as message
var/text = tgui_input_text(user, "Enter what you want to write:", "Write", multiline = TRUE, encode = FALSE)
if(!text)
return
if(toner < 1 || !user)
+8 -4
View File
@@ -41,7 +41,9 @@
/obj/item/photo/attackby(obj/item/P as obj, mob/user as mob, params)
if(is_pen(P) || istype(P, /obj/item/toy/crayon))
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
var/txt = tgui_input_text(user, "What would you like to write on the back?", "Photo Writing")
if(!txt)
return
txt = copytext(txt, 1, 128)
if(loc == user && user.stat == 0)
scribble = txt
@@ -106,9 +108,11 @@
onclose(usr, "Photo[UID()]")
/obj/item/photo/proc/rename(mob/user)
var/n_name = sanitize(copytext(input(user, "What would you like to label the photo?", "Photo Labelling", name) as text, 1, MAX_MESSAGE_LEN))
var/n_name = tgui_input_text(user, "What would you like to label the photo?", "Photo Labelling", name)
if(!n_name)
return
//loc.loc check is for making possible renaming photos in clipboards
if(( (loc == user || (loc.loc && loc.loc == user)) && !user.stat))
if(((loc == user || (loc.loc && loc.loc == user)) && !user.stat))
name = "[(n_name ? "[n_name]" : "photo")]"
add_fingerprint(user)
@@ -418,7 +422,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
var/datum/picture/P = new()
if(istype(src,/obj/item/camera/digital))
P.fields["name"] = input(user,"Name photo:","photo")
P.fields["name"] = tgui_input_text(user, "Name photo:", "Photo", encode = FALSE)
if(!P.fields["name"])
P.fields["name"] = "Photo [current_photo_num]"
current_photo_num++