[MIRROR] usr to user up to player effects (#9552)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-12-01 10:31:19 -07:00
committed by GitHub
parent a7e4ef7dad
commit 0180cc74c5
297 changed files with 1866 additions and 1893 deletions

View File

@@ -136,19 +136,19 @@
data["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS))
return data
/datum/tgui_input_number/tgui_act(action, list/params)
/datum/tgui_input_number/tgui_act(action, list/params, datum/tgui/ui)
. = ..()
if (.)
return
switch(action)
if("submit")
if(!isnum(params["entry"]))
CRASH("A non number was input into tgui input number by [usr]")
CRASH("A non number was input into tgui input number by [ui.user]")
var/choice = round_value ? round(params["entry"]) : params["entry"]
if(choice > max_value)
CRASH("A number greater than the max value was input into tgui input number by [usr]")
CRASH("A number greater than the max value was input into tgui input number by [ui.user]")
if(choice < min_value)
CRASH("A number less than the min value was input into tgui input number by [usr]")
CRASH("A number less than the min value was input into tgui input number by [ui.user]")
set_entry(choice)
closed = TRUE
SStgui.close_uis(src)

View File

@@ -130,7 +130,7 @@
data["timeout"] = clamp((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS), 0, 1)
return data
/datum/tgui_input_text/tgui_act(action, list/params)
/datum/tgui_input_text/tgui_act(action, list/params, datum/tgui/ui)
. = ..()
if (.)
return
@@ -138,9 +138,9 @@
if("submit")
if(max_length)
if(length(params["entry"]) > max_length)
CRASH("[usr] typed a text string longer than the max length")
CRASH("[ui.user] typed a text string longer than the max length")
if(encode && (length(html_encode(params["entry"])) > max_length))
to_chat(usr, span_notice("Your message was clipped due to special character usage."))
to_chat(ui.user, span_notice("Your message was clipped due to special character usage."))
set_entry(params["entry"])
closed = TRUE
SStgui.close_uis(src)