mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 15:08:34 +01:00
Input Conversion Part 2
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("set_global_limit")
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0)
|
||||
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 = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
var/limit = clamp(newlim/100, 0, 1)
|
||||
|
||||
@@ -171,10 +171,10 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return TRUE
|
||||
var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
@@ -191,14 +191,14 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
|
||||
if("setcoord")
|
||||
if(params["setx"])
|
||||
var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
|
||||
if(params["sety"])
|
||||
var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newy)
|
||||
@@ -216,13 +216,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
. = TRUE
|
||||
|
||||
if("speedlimit")
|
||||
var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000)
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
. = TRUE
|
||||
|
||||
if("accellimit")
|
||||
var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000)
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
. = TRUE
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
if(sensors)
|
||||
switch(action)
|
||||
if("range")
|
||||
var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(nrange)
|
||||
|
||||
Reference in New Issue
Block a user