fix(overmap machines): Fixes number inputs not allowing decimals (#15801)

*Adds flag of round_value = FALSE to  sensor range on sensor console
*Adds flag of round_value = FALSE to acceleration limiter on helm console
*Adds flag of round_value = FALSE to global volume limiter on engine console
*Adds flag of round_value = FALSE on per-engine volume limiter on engine console
This commit is contained in:
Runa Dacino
2024-03-03 13:44:02 +01:00
committed by GitHub
parent 829bcd484a
commit 0d55fc9fb2
3 changed files with 6 additions and 6 deletions
@@ -62,7 +62,7 @@
. = TRUE
if("set_global_limit")
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0)
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0, round_value = FALSE)
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
return FALSE
linked.thrust_limit = clamp(newlim/100, 0, 1)
@@ -78,7 +78,7 @@
if("set_limit")
var/datum/ship_engine/E = locate(params["engine"])
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0)
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0, round_value = FALSE)
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
return FALSE
var/limit = clamp(newlim/100, 0, 1)
@@ -100,4 +100,4 @@
. = TRUE
if(. && !issilicon(usr))
playsound(src, "terminal_type", 50, 1)
playsound(src, "terminal_type", 50, 1)
+2 -2
View File
@@ -217,13 +217,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
. = TRUE
if("speedlimit")
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000, 100000)
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000, 100000, round_value = FALSE)
if(newlimit)
speedlimit = CLAMP(newlimit/1000, 0, 100)
. = TRUE
if("accellimit")
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000)
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000, round_value = FALSE)
if(newlimit)
accellimit = max(newlimit/1000, 0)
. = TRUE
@@ -106,7 +106,7 @@
if(sensors)
switch(action)
if("range")
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range, world.view)
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range, world.view, round_value = FALSE )
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
return FALSE
if(nrange)