mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +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
|
. = TRUE
|
||||||
|
|
||||||
if("set_global_limit")
|
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)
|
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||||
return FALSE
|
return FALSE
|
||||||
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
if("set_limit")
|
if("set_limit")
|
||||||
var/datum/ship_engine/E = locate(params["engine"])
|
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)
|
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||||
return FALSE
|
return FALSE
|
||||||
var/limit = clamp(newlim/100, 0, 1)
|
var/limit = clamp(newlim/100, 0, 1)
|
||||||
|
|||||||
@@ -217,13 +217,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
|||||||
. = TRUE
|
. = TRUE
|
||||||
|
|
||||||
if("speedlimit")
|
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)
|
if(newlimit)
|
||||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||||
. = TRUE
|
. = TRUE
|
||||||
|
|
||||||
if("accellimit")
|
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)
|
if(newlimit)
|
||||||
accellimit = max(newlimit/1000, 0)
|
accellimit = max(newlimit/1000, 0)
|
||||||
. = TRUE
|
. = TRUE
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
if(sensors)
|
if(sensors)
|
||||||
switch(action)
|
switch(action)
|
||||||
if("range")
|
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)
|
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||||
return FALSE
|
return FALSE
|
||||||
if(nrange)
|
if(nrange)
|
||||||
|
|||||||
Reference in New Issue
Block a user