mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 23:51:17 +01:00
VueUI Conversions and Style Tweaks (#11523)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
var/obj/machinery/atmospherics/portables_connector/port = locate() in loc
|
||||
if(port)
|
||||
connect(port)
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/Initialize()
|
||||
..()
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
air_contents.react()
|
||||
else
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
qdel(air_contents)
|
||||
@@ -113,6 +114,7 @@
|
||||
user.drop_from_inventory(T,src)
|
||||
src.holding = T
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
|
||||
else if (W.iswrench())
|
||||
@@ -120,6 +122,7 @@
|
||||
disconnect()
|
||||
to_chat(user, "<span class='notice'>You disconnect \the [src] from the port.</span>")
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
else
|
||||
var/obj/machinery/atmospherics/portables_connector/possible_port = locate(/obj/machinery/atmospherics/portables_connector/) in loc
|
||||
@@ -127,6 +130,7 @@
|
||||
if(connect(possible_port))
|
||||
to_chat(user, "<span class='notice'>You connect \the [src] to the port.</span>")
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] failed to connect to the port.</span>")
|
||||
@@ -170,6 +174,7 @@
|
||||
cell = C
|
||||
user.visible_message("<span class='notice'>[user] opens the panel on [src] and inserts [C].</span>", "<span class='notice'>You open the panel on [src] and insert [C].</span>")
|
||||
power_change()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
|
||||
if(I.isscrewdriver())
|
||||
@@ -182,6 +187,7 @@
|
||||
cell.forceMove(src.loc)
|
||||
cell = null
|
||||
power_change()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -206,4 +212,4 @@
|
||||
if(air_contents.gas.len == 0)
|
||||
return
|
||||
|
||||
message_admins("'[src.name]' was opened[cause ? " by [cause]" : ""], containing [english_list(air_contents.gas)]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
|
||||
message_admins("'[src.name]' was opened[cause ? " by [cause]" : ""], containing [english_list(air_contents.gas)]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
|
||||
target_pressure = rand(0,1300)
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
..(severity)
|
||||
|
||||
@@ -111,6 +112,7 @@
|
||||
update_icon()
|
||||
|
||||
src.updateDialog()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/return_air()
|
||||
return air_contents
|
||||
@@ -127,8 +129,8 @@
|
||||
/obj/machinery/portable_atmospherics/powered/pump/attack_hand(var/mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1)
|
||||
var/list/data[0]
|
||||
/obj/machinery/portable_atmospherics/powered/pump/vueui_data_change(list/data, mob/user, datum/vueui/ui)
|
||||
data = ..() || list()
|
||||
data["portConnected"] = connected_port ? 1 : 0
|
||||
data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
|
||||
data["targetpressure"] = round(target_pressure)
|
||||
@@ -143,13 +145,13 @@
|
||||
data["hasHoldingTank"] = holding ? 1 : 0
|
||||
if (holding)
|
||||
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
|
||||
return data
|
||||
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
/obj/machinery/portable_atmospherics/powered/pump/ui_interact(mob/user)
|
||||
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "portpump.tmpl", "Portable Pump", 480, 410, state = physical_state)
|
||||
ui.set_initial_data(data)
|
||||
ui = new(user, src, "machinery-atmospherics-portpump", 480, 410, "Portable Pump")
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/portable_atmospherics/powered/pump/Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -166,10 +168,10 @@
|
||||
holding.forceMove(loc)
|
||||
holding = null
|
||||
. = 1
|
||||
if (href_list["pressure_adj"])
|
||||
var/diff = text2num(href_list["pressure_adj"])
|
||||
target_pressure = min(10*ONE_ATMOSPHERE, max(0, target_pressure+diff))
|
||||
if (href_list["pressure_set"])
|
||||
target_pressure = between(pressuremin, text2num(href_list["pressure_set"]), pressuremax)
|
||||
. = 1
|
||||
|
||||
if(.)
|
||||
update_icon()
|
||||
SSvueui.check_uis_for_change(src)
|
||||
|
||||
Reference in New Issue
Block a user