mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
The One Where I Port Modals
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
/obj/effect/overmap/bluespace_rift/attack_ghost(var/mob/observer/dead/user)
|
||||
if(!partner && user?.client?.holder)
|
||||
var/response = alert(user, "You appear to be staff. This rift has no exit point. If you want to make one, move to where you want it to go, and click 'Make Here', otherwise click 'Cancel'","Rift Exit","Cancel","Make Here")
|
||||
var/response = tgui_alert(user, "You appear to be staff. This rift has no exit point. If you want to make one, move to where you want it to go, and click 'Make Here', otherwise click 'Cancel'",list("Rift Exit","Cancel","Make Here"))
|
||||
if(response == "Make Here")
|
||||
new type(get_turf(user), src)
|
||||
else if(partner)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
return
|
||||
|
||||
user.visible_message("<span class='notice'>[user] lifts [src] bottle over [comp]!</span>")
|
||||
var/shuttle_name = input("Choose a name for the shuttle", "New Shuttle Name") as null|text
|
||||
var/shuttle_name = input(usr, "Choose a name for the shuttle", "New Shuttle Name") as null|text
|
||||
if(!shuttle_name || QDELETED(src) || QDELETED(comp) || comp.shuttle_tag || user.incapacitated())
|
||||
return // After input() safety re-checks
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("calibration")
|
||||
var/input = input("0-9", "disperser calibration", 0) as num|null
|
||||
var/input = input(usr, "0-9", "disperser calibration", 0) as num|null
|
||||
if(!isnull(input)) //can be zero so we explicitly check for null
|
||||
var/calnum = sanitize_integer(text2num(params["calibration"]), 0, caldigit)//sanitiiiiize
|
||||
calibration[calnum + 1] = sanitize_integer(input, 0, 9, 0)//must add 1 because js indexes from 0
|
||||
@@ -189,14 +189,14 @@
|
||||
. = TRUE
|
||||
|
||||
if("strength")
|
||||
var/input = input("1-5", "disperser strength", 1) as num|null
|
||||
var/input = input(usr, "1-5", "disperser strength", 1) as num|null
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
strength = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
. = TRUE
|
||||
|
||||
if("range")
|
||||
var/input = input("1-5", "disperser radius", 1) as num|null
|
||||
var/input = input(usr, "1-5", "disperser radius", 1) as num|null
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
range = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("set_global_limit")
|
||||
var/newlim = input("Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
if("set_limit")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
var/newlim = input("Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
var/limit = clamp(newlim/100, 0, 1)
|
||||
|
||||
@@ -149,7 +149,7 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
switch(action)
|
||||
if("add")
|
||||
var/datum/computer_file/data/waypoint/R = new()
|
||||
var/sec_name = input("Input navigation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
|
||||
var/sec_name = input(usr, "Input navigation entry name", "New navigation entry", "Sector #[known_sectors.len]") as text
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(!sec_name)
|
||||
@@ -163,10 +163,10 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input("Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return TRUE
|
||||
var/newy = input("Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
@@ -183,14 +183,14 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
|
||||
if("setcoord")
|
||||
if(params["setx"])
|
||||
var/newx = input("Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
|
||||
if(params["sety"])
|
||||
var/newy = input("Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newy)
|
||||
@@ -208,13 +208,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
. = TRUE
|
||||
|
||||
if("speedlimit")
|
||||
var/newlimit = input("Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
. = TRUE
|
||||
|
||||
if("accellimit")
|
||||
var/newlimit = input("Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
. = TRUE
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
if(sensors)
|
||||
switch(action)
|
||||
if("range")
|
||||
var/nrange = input("Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(nrange)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
var/list/possible_d = shuttle.get_possible_destinations()
|
||||
var/D
|
||||
if(possible_d.len)
|
||||
D = input("Choose shuttle destination", "Shuttle Destination") as null|anything in possible_d
|
||||
D = tgui_input_list(usr, "Choose shuttle destination", "Shuttle Destination", possible_d)
|
||||
else
|
||||
to_chat(usr,"<span class='warning'>No valid landing sites in range.</span>")
|
||||
possible_d = shuttle.get_possible_destinations()
|
||||
|
||||
Reference in New Issue
Block a user