Ports Nano UI to Subsystems

This commit is contained in:
Fox McCloud
2018-03-26 23:59:52 -04:00
parent c13ce9099f
commit 5701ea7c75
122 changed files with 398 additions and 375 deletions
@@ -36,7 +36,7 @@
energy = min(energy + addenergy, max_energy)
if(energy != oldenergy)
use_power(1500) // This thing uses up alot of power (this is still low as shit for creating reagents from thin air)
nanomanager.update_uis(src) // update all UIs attached to src
SSnanoui.update_uis(src) // update all UIs attached to src
/obj/machinery/chem_dispenser/power_change()
if(powered())
@@ -44,7 +44,7 @@
else
spawn(rand(0, 15))
stat |= NOPOWER
nanomanager.update_uis(src) // update all UIs attached to src
SSnanoui.update_uis(src) // update all UIs attached to src
/obj/machinery/chem_dispenser/process()
@@ -113,7 +113,7 @@
return
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -224,7 +224,7 @@
return
B.forceMove(src)
to_chat(user, "<span class='notice'>You set [B] on the machine.</span>")
nanomanager.update_uis(src) // update all UIs attached to src
SSnanoui.update_uis(src) // update all UIs attached to src
if(!icon_beaker)
icon_beaker = image('icons/obj/chemical.dmi', src, "disp_beaker") //randomize beaker overlay position.
icon_beaker.pixel_x = rand(-10,5)
@@ -49,7 +49,7 @@
state_change = 1
if(state_change)
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
/obj/machinery/chem_heater/proc/eject_beaker()
if(beaker)
@@ -58,7 +58,7 @@
beaker = null
icon_state = "mixer0b"
on = FALSE
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
/obj/machinery/chem_heater/power_change()
if(powered())
@@ -66,7 +66,7 @@
else
spawn(rand(0, 15))
stat |= NOPOWER
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
/obj/machinery/chem_heater/attackby(obj/item/I, mob/user)
if(isrobot(user))
@@ -82,7 +82,7 @@
I.forceMove(src)
to_chat(user, "<span class='notice'>You add the beaker to the machine!</span>")
icon_state = "mixer1b"
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
if(default_deconstruction_screwdriver(user, "mixer0b", "mixer0b", I))
return
@@ -131,7 +131,7 @@
return
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui)
if(!ui)
ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270)
ui.open()
@@ -56,7 +56,7 @@
beaker = B
B.forceMove(src)
to_chat(user, "<span class='notice'>You add the beaker to the machine!</span>")
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
icon_state = "mixer1"
else if(istype(B, /obj/item/weapon/storage/pill_bottle))
@@ -71,7 +71,7 @@
loaded_pill_bottle = B
B.forceMove(src)
to_chat(user, "<span class='notice'>You add the pill bottle into the dispenser slot!</span>")
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
/obj/machinery/chem_master/Topic(href, href_list)
@@ -304,7 +304,7 @@
bottlesprite = href_list["bottle_sprite"]
usr << browse(null, "window=chem_master_iconsel")
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
/obj/machinery/chem_master/attack_ai(mob/user)
@@ -323,7 +323,7 @@
var/datum/asset/chem_master/assets = get_asset_datum(/datum/asset/chem_master)
assets.send(user)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400)
ui.open()