From 0d55fc9fb2a346761565b3b65b1fcc19f646233c Mon Sep 17 00:00:00 2001 From: Runa Dacino Date: Sun, 3 Mar 2024 13:44:02 +0100 Subject: [PATCH] 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 --- code/modules/overmap/ships/computers/engine_control.dm | 6 +++--- code/modules/overmap/ships/computers/helm.dm | 4 ++-- code/modules/overmap/ships/computers/sensors.dm | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/overmap/ships/computers/engine_control.dm b/code/modules/overmap/ships/computers/engine_control.dm index ab1bb61b746..e2b2defea8a 100644 --- a/code/modules/overmap/ships/computers/engine_control.dm +++ b/code/modules/overmap/ships/computers/engine_control.dm @@ -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) \ No newline at end of file + playsound(src, "terminal_type", 50, 1) diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 95657cb43c2..518d3955a54 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -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 diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 5990c6f1463..33fb4219f8a 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -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)