mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
TGUI number input clamps values to match old behavior (#30767)
* Works for non-tgui. * Removed a round by accident
This commit is contained in:
@@ -153,11 +153,7 @@
|
||||
if("submit")
|
||||
if(!isnum(params["entry"]))
|
||||
CRASH("A non number was input into TGUI Input Number by [usr]")
|
||||
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]")
|
||||
if(choice < min_value)
|
||||
CRASH("A number less than the min value was input into TGUI Input Number by [usr]")
|
||||
var/choice = clamp(round_value ? round(params["entry"]) : params["entry"], min_value, max_value)
|
||||
set_entry(choice)
|
||||
closed = TRUE
|
||||
SStgui.close_uis(src)
|
||||
|
||||
Reference in New Issue
Block a user