mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
More standard tgui input conversions (#63464)
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
to_chat(user, span_notice("You scribble illegibly on the cover of [src]!"))
|
||||
return
|
||||
|
||||
var/inputvalue = stripped_input(user, "What would you like to label the folder?", "Folder Labelling", "", MAX_NAME_LEN)
|
||||
var/inputvalue = tgui_input_text(user, "What would you like to label the folder?", "Folder Labelling", max_length = MAX_NAME_LEN)
|
||||
|
||||
if(!inputvalue)
|
||||
return
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
if(mode)
|
||||
to_chat(user, span_notice("You turn on [src]."))
|
||||
//Now let them chose the text.
|
||||
var/str = reject_bad_text(tgui_input_text(user, "Label text", "Set Label", max_length = 64))
|
||||
var/str = reject_bad_text(tgui_input_text(user, "Label text", "Set Label", label, MAX_NAME_LEN))
|
||||
if(!str)
|
||||
to_chat(user, span_warning("Invalid text!"))
|
||||
return
|
||||
|
||||
@@ -127,11 +127,12 @@
|
||||
if(.)
|
||||
return
|
||||
|
||||
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
|
||||
if(deg && (deg > 0 && deg <= 360))
|
||||
degrees = deg
|
||||
to_chat(user, span_notice("You rotate the top of the pen to [degrees] degrees."))
|
||||
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
|
||||
var/deg = tgui_input_number(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head", max_value = 360)
|
||||
if(isnull(deg))
|
||||
return
|
||||
degrees = round(deg)
|
||||
to_chat(user, span_notice("You rotate the top of the pen to [degrees] degrees."))
|
||||
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
|
||||
|
||||
/obj/item/pen/attack(mob/living/M, mob/user, params)
|
||||
if(force) // If the pen has a force value, call the normal attack procs. Used for e-daggers and captain's pen mostly.
|
||||
@@ -147,11 +148,11 @@
|
||||
. = ..()
|
||||
//Changing name/description of items. Only works if they have the UNIQUE_RENAME object flag set
|
||||
if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME))
|
||||
var/penchoice = tgui_input_list(user, "What would you like to edit?", "Pen Setting", list("Rename","Change description","Reset"))
|
||||
var/penchoice = tgui_alert(user, "What would you like to edit?", "Pen Setting", list("Rename","Description","Reset"))
|
||||
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
||||
return
|
||||
if(penchoice == "Rename")
|
||||
var/input = stripped_input(user,"What do you want to name [O]?", ,"[O.name]", MAX_NAME_LEN)
|
||||
var/input = tgui_input_text(user, "What do you want to name [O]?", "Object Name", "[O.name]", MAX_NAME_LEN)
|
||||
var/oldname = O.name
|
||||
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
||||
return
|
||||
@@ -167,7 +168,7 @@
|
||||
O.renamedByPlayer = TRUE
|
||||
|
||||
if(penchoice == "Change description")
|
||||
var/input = stripped_input(user,"Describe [O] here:", ,"[O.desc]", 140)
|
||||
var/input = tgui_input_text(user, "Describe [O]", "Description", "[O.desc]", 140)
|
||||
var/olddesc = O.desc
|
||||
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user