mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] Fixes sensor console (and other overmap consoles) not accepting decimal input when appropriate (#7878)
Co-authored-by: Runa Dacino <dacinoorder@gmail.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user