Rock the UI Away - Removes VueUI and adds TGUI (#16509)

* tgui the beginning

* binaries and the like

* Bring in the last of it

* Example radio UI

* delete example

* NTOS Main Menu, start on manifest, tgui states

* tasks.json

* gunnery ui pt 1

* okay

* fix everything

* scss update

* oops

* manifest gigablast

* downloader part 1

* download prt 2

* NTOSDownloader final

* mfw committing to_worlds

* gunnery console pt2

* i cooked

* targeting (finished)

* one vueui down

* voting ui almost done

* MY MIND FEELS LIKE AN ARCH ENEMYYYY

* voting ui down

* photocopier

* ntos config + download fixes

* photocopier 2

* refactor define

* NTOS client manager + fixes

* fax machine final (it also uses toner now)

* marching forwards... left behind...

* ntnrc part 1

* canister

* add quotes

* portable pumps pt1 + more backgrounds

* oops

* finish the portable pump

* freezers

so I'll keep on pushing forward... you haven't seen the last of me... oooooooh...

* doors ui pt1

* finish doors UI (forgive me wildkins it's a bit of shitcode)

* vitals monitor, make things use labeled lists, new backgrounds

* mais j'envoyé aucun mayday...

* maglock pt1

* pour ça je me suis perdu...

* infrared

* fix that

* prox sensor pt1

* prox sensor

* signaler (this was actually pretty hard)

* atmos control pt1

* atmos control pt1.1

* atmos pt 2

* fuel injector

* multitool UI

* jammer

* list viewer

* APC

* portgen

* targeting console updates + SMES ui

* new themes, shield generator

* supermatter

* Add ore detector and (shitty) NTNet Relay

* orderterminal pt1

* orderterminal pt2

* smartfridge

* Add (air-)tank GUI update ore detector size

* Adds Transfer Valves

* Add AtmoScrubber

* analyzer pt1

* weapons analyzer pt2

* bodyscanner pt1

* bodyscanner pt2

* fix this shitcode

* seed storage

* appearance changer

* appearance changer final

* sleeper pt1

* sleeper

* gps

* vehicles

* chem dispenser

* lily request

* holopad

* tgui modules pt1

* ppanel

* damage menu

* fixes

* im here too now

* follow menu, search bars

* quikpay

* quikpay fixes

* circuit printer

* ppanel

* ppanel updates

* pai

* turret controls (i want to kill myself)

* tweak

* remove the boardgame

* guntracker

* implant tracker

* penal mechs

come close to me, come close to me

* chem codex

* pai radio

* doorjack

* pai directives

* signaler removal, sensors

* ghost spawner

* spawnpoint

* fixes

* teleporter

* one more to the chopping block

* account database

* remove divider

* scanner, atmos

* latejoin ui pt1

* latejoin

* records pt1

* RECORDS UI DONE

* delete interpreter & records

* CHAT FUCKING CLIENT

* data updates

* fix some things

* final UI, log

* basic nanoui fix

* antag panel

* remove vueui

* atm update

* vending update

* warrants, cameras

* ntmonitor

* time comes for all

* preserve this legacy

* bring that back (oops)

* rcon, ui auto update for computer UIs, remove rcon computers

* alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles)

* A LIKE SUPREME

* a

* power monitor

* lights on

* fuck this code, fuck nanoui modules, and fuck nanoui

* LEAVE IT OH SO FAR BEHIND

* fix alarm monitoring for synths

* I SAW IN YOU WHAT LIFE WAS MISSING

* comms console

* idcard and record updates

* turn the light on

* arcade

* pt2

* news browser

* static

* crusher

* f

* COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO

* codeowners & suit sensors

* html ui style removal

* make lint happy

* resist and disorder

* i slowly get up and turn off the noise, already fed up...

* pleaseeeeeeeeeeeeeee

* THE CREDIT LARP IS NECESSARY

* i hold the keys

* RISE UP

* fix that?

* harry's suggestions xoxo

* runtime fix pt2

* You are the only thing that I still care about

* adds build workflow

* Update update_tgui.yml

* adds some needed steps

* ATM

* misc fixes and tweaks

* fixes 2

* make newscasters usable and fix use power on freezers

* turret control is clearer

---------

Co-authored-by: John Wildkins <john.wildkins@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
Co-authored-by: Werner <Arrow768@users.noreply.github.com>
Co-authored-by: Geeves <ggrobler447@gmail.com>
Co-authored-by: harryob <me@harryob.live>
This commit is contained in:
Matt Atlas
2023-06-25 19:03:33 +02:00
committed by GitHub
co-authored by John Wildkins Matt Atlas harryob Werner Geeves harryob
parent 4ce7ba118b
commit 31956c7eb0
1117 changed files with 80951 additions and 44002 deletions
+37 -37
View File
@@ -5,9 +5,8 @@
item_state = "electronic"
w_class = ITEMSIZE_SMALL
slot_flags = SLOT_BELT
var/flush = null
origin_tech = list(TECH_DATA = 4, TECH_MATERIAL = 4)
var/flush = 0
var/mob/living/silicon/ai/carded_ai
/obj/item/aicard/examine(mob/user)
@@ -33,17 +32,14 @@
/obj/item/aicard/attack_self(mob/user)
ui_interact(user)
/obj/item/aicard/ui_interact(mob/user, datum/topic_state/state = inventory_state)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
/obj/item/aicard/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "AICard", "intelliCard", 600, 450)
ui.open()
if (!ui)
ui = new(user, src, "devices-aicard", 600, 400, "[name]", state = state)
ui.auto_update_content = TRUE
ui.open()
/obj/item/aicard/vueui_data_change(list/data, mob/user, datum/vueui/ui)
data = list(
/obj/item/aicard/ui_data(mob/user)
var/list/data = list(
"has_ai" = FALSE,
"name" = null,
"hardware_integrity" = null,
@@ -74,34 +70,38 @@
return data
/obj/item/aicard/Topic(href, href_list, state)
if (..())
return 1
/obj/item/aicard/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return TRUE
if (!carded_ai)
return 1
return TRUE
if (href_list["wipe"])
var/confirm = alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", "Yes", "No")
if(confirm == "Yes" && (CanUseTopic(usr, state) == STATUS_INTERACTIVE))
admin_attack_log(usr, carded_ai, "Wiped using \the [src.name]", "Was wiped with \the [src.name]", "used \the [src.name] to wipe")
flush = 1
to_chat(carded_ai, "Your core files are being wiped!")
while (carded_ai && carded_ai.stat != DEAD)
carded_ai.adjustOxyLoss(2)
carded_ai.updatehealth()
sleep(10)
flush = 0
if (!isnull(href_list["radio"]))
carded_ai.ai_radio.disabledAi = text2num(href_list["radio"])
to_chat(carded_ai, "<span class='warning'>Your Subspace Transceiver has been [carded_ai.ai_radio.disabledAi ? "disabled" : "enabled"]!</span>")
to_chat(usr, "<span class='notice'>You [carded_ai.ai_radio.disabledAi ? "disable" : "enable"] the AI's Subspace Transceiver.</span>")
if (!isnull(href_list["wireless"]))
carded_ai.control_disabled = text2num(href_list["wireless"])
to_chat(carded_ai, "<span class='warning'>Your wireless interface has been [carded_ai.control_disabled ? "disabled" : "enabled"]!</span>")
to_chat(usr, "<span class='notice'>You [carded_ai.control_disabled ? "disable" : "enable"] the AI's wireless interface.</span>")
update_icon()
return 1
switch(action)
if("wipe")
var/confirm = alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", "Yes", "No")
if(confirm == "Yes" && (CanUseTopic(usr, state) == STATUS_INTERACTIVE))
admin_attack_log(usr, carded_ai, "Wiped using \the [src.name]", "Was wiped with \the [src.name]", "used \the [src.name] to wipe")
flush = 1
to_chat(carded_ai, "Your core files are being wiped!")
while (carded_ai && carded_ai.stat != DEAD)
carded_ai.adjustOxyLoss(2)
carded_ai.updatehealth()
sleep(10)
flush = 0
. = TRUE
if ("radio")
carded_ai.ai_radio.disabledAi = text2num(params["radio"])
to_chat(carded_ai, "<span class='warning'>Your Subspace Transceiver has been [carded_ai.ai_radio.disabledAi ? "disabled" : "enabled"]!</span>")
to_chat(usr, "<span class='notice'>You [carded_ai.ai_radio.disabledAi ? "disable" : "enable"] the AI's Subspace Transceiver.</span>")
. = TRUE
if ("wireless")
carded_ai.control_disabled = text2num(params["wireless"])
to_chat(carded_ai, "<span class='warning'>Your wireless interface has been [carded_ai.control_disabled ? "disabled" : "enabled"]!</span>")
to_chat(usr, "<span class='notice'>You [carded_ai.control_disabled ? "disable" : "enable"] the AI's wireless interface.</span>")
update_icon()
. = TRUE
/obj/item/aicard/update_icon()
cut_overlays()
+5 -5
View File
@@ -5,7 +5,7 @@
var/list/current_hacks
var/list/known_targets
var/list/supported_types
var/datum/topic_state/default/must_hack/hack_state
var/datum/ui_state/default/must_hack/hack_state
var/hack_time = 10 SECONDS
var/max_known_targets = 7
@@ -137,18 +137,18 @@
host.drop_from_inventory(src)
QDEL_IN(src, 1)
/datum/topic_state/default/must_hack
/datum/ui_state/default/must_hack
var/obj/item/device/multitool/hacktool/hacktool
/datum/topic_state/default/must_hack/New(var/hacktool)
/datum/ui_state/default/must_hack/New(var/hacktool)
src.hacktool = hacktool
..()
/datum/topic_state/default/must_hack/Destroy()
/datum/ui_state/default/must_hack/Destroy()
hacktool = null
return ..()
/datum/topic_state/default/must_hack/can_use_topic(var/src_object, var/mob/user)
/datum/ui_state/default/must_hack/can_use_topic(var/src_object, var/mob/user)
if(!hacktool || !hacktool.in_hack_mode || !(src_object in hacktool.known_targets))
return STATUS_CLOSE
return ..()
@@ -471,55 +471,55 @@
if(istype(src, /obj/item/device/magnetic_lock/keypad))
add_overlay("overlay_keypad")
/obj/item/device/magnetic_lock/keypad/attack_self(mob/user as mob)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
/obj/item/device/magnetic_lock/keypad/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
if(locked)
ui = new(user, src, "misc-maglock", 300, 100, "Maglock", list())
else
ui = new(user, src, "misc-maglock-config", 300, 100, "Maglock configuration", list("passcode" = passcode))
ui.open()
ui = new(user, src, "Maglock", "Maglock", 300, 250)
ui.open()
/obj/item/device/magnetic_lock/keypad/attack_hand(var/mob/user)
. = ..()
if(. || !locked)
if(.)
return
ui_interact(user)
/obj/item/device/magnetic_lock/keypad/ui_data(mob/user)
var/list/data = list()
data["locked"] = locked
return data
/obj/item/device/magnetic_lock/keypad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
attack_self(user)
/obj/item/device/magnetic_lock/keypad/Topic(href, href_list)
var/datum/vueui/ui = href_list["vueui"]
if(!istype(ui))
return
if(href_list["passcode"])
if(lowertext(href_list["passcode"]) == passcode)
locked = !locked
playsound(src, 'sound/machines/ping.ogg', 30, 1)
var/msg = "buttons on \the [src] and it [locked ? "locks" : "unlocks"] with a beep."
var/pos_adj = "[usr.name] presses "
var/fp_adj = "You press "
usr.visible_message("<span class='warning'>[addtext(pos_adj, msg)]</span>", "<span class='notice'>[addtext(fp_adj, msg)]</span>")
update_icon()
ui.close()
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1)
to_chat(usr, SPAN_WARNING("\The [src] buzzes as you enter passcode."))
return
if(href_list["set_passcode"])
if(!locked)
passcode = lowertext(href_list["set_passcode"])
ui.data["passcode"] = passcode
to_chat(usr, "New passcode has been set.")
ui.push_change()
if(href_list["lock"])
if(!locked)
locked = !locked
playsound(src, 'sound/machines/ping.ogg', 30, 1)
to_chat(usr, "You have locked \the [src].")
ui.close()
update_icon()
switch(action)
if("passcode")
if(lowertext(params["passcode"]) == passcode)
locked = !locked
playsound(src, 'sound/machines/ping.ogg', 30, 1)
var/msg = "buttons on \the [src] and it [locked ? "locks" : "unlocks"] with a beep."
var/pos_adj = "[usr.name] presses "
var/fp_adj = "You press "
usr.visible_message("<span class='warning'>[addtext(pos_adj, msg)]</span>", "<span class='notice'>[addtext(fp_adj, msg)]</span>")
update_icon()
. = TRUE
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, 1)
to_chat(usr, SPAN_WARNING("\The [src] buzzes!"))
return
if("set_passcode")
if(!locked)
passcode = lowertext(params["set_passcode"])
to_chat(usr, SPAN_NOTICE("New passcode has been set."))
. = TRUE
if("lock")
if(!locked)
locked = !locked
playsound(src, 'sound/machines/ping.ogg', 30, 1)
to_chat(usr, SPAN_NOTICE("You have locked \the [src]."))
update_icon()
. = TRUE
#undef STATUS_INACTIVE
#undef STATUS_ACTIVE
@@ -1,20 +0,0 @@
/obj/item/device/handheld_medical
name = "hand-held suit sensor monitor"
desc = "A miniature machine that tracks suit sensors across the station."
icon = 'icons/obj/device.dmi'
icon_state = "scanner"
w_class = ITEMSIZE_SMALL
slot_flags = SLOT_BELT
var/datum/nano_module/crew_monitor/crew_monitor
/obj/item/device/handheld_medical/Initialize()
. = ..()
crew_monitor = new(src)
/obj/item/device/handheld_medical/Destroy()
qdel(crew_monitor)
crew_monitor = null
return ..()
/obj/item/device/handheld_medical/attack_self(mob/user)
crew_monitor.ui_interact(user)
+26 -24
View File
@@ -93,42 +93,45 @@
interact(user)
/obj/item/device/multitool/interact(mob/user)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
ui_interact(user)
/obj/item/device/multitool/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "devices-multitool", 300, 250, capitalize_first_letters(name), state = inventory_state)
ui.open()
ui = new(user, src, "Multitool", "Multitool", 300, 250)
ui.open()
/obj/item/device/multitool/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
if(!data)
data = list()
/obj/item/device/multitool/ui_data(mob/user)
var/list/data = list()
VUEUI_SET_CHECK(data["tracking_apc"], tracking_apc, ., data)
data["tracking_apc"] = tracking_apc
VUEUI_SET_CHECK(data["has_selected_io"], !isnull(selected_io), ., data)
if(selected_io)
VUEUI_SET_CHECK(data["selected_io_name"], selected_io.name, ., data)
VUEUI_SET_CHECK(data["selected_io_type"], selected_io.io_type, ., data)
data["selected_io"] = list("name" = selected_io.name, "type" = selected_io.io_type)
return data
/obj/item/device/multitool/Topic(href, href_list)
/obj/item/device/multitool/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return TRUE
if(href_list["track_apc"])
tracking_apc = !tracking_apc
if(tracking_apc)
START_PROCESSING(SSprocessing, src)
apc_indicator = mutable_appearance(icon, "lost")
add_overlay(apc_indicator)
else
STOP_PROCESSING(SSprocessing, src)
QDEL_NULL(apc_indicator)
switch(action)
if("track_apc")
tracking_apc = !tracking_apc
if(tracking_apc)
START_PROCESSING(SSprocessing, src)
apc_indicator = mutable_appearance(icon, "lost")
add_overlay(apc_indicator)
else
STOP_PROCESSING(SSprocessing, src)
QDEL_NULL(apc_indicator)
. = TRUE
if(href_list["clear_io"])
selected_io = null
if("clear_io")
selected_io = null
. = TRUE
update_icon()
SSvueui.check_uis_for_change(src)
/obj/item/device/multitool/update_icon()
if(tracking_apc)
@@ -196,7 +199,6 @@
to_chat(user, "<span class='notice'>You link \the multitool to \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
update_icon()
SSvueui.check_uis_for_change(src)
/obj/item/device/multitool/proc/unwire(datum/integrated_io/io1, datum/integrated_io/io2, mob/user)
if(!io1.linked.len || !io2.linked.len)
+19 -16
View File
@@ -40,26 +40,29 @@ var/list/active_radio_jammers = list()
return ..()
/obj/item/device/radiojammer/attack_self(mob/user)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
ui_interact(user)
/obj/item/device/radiojammer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "devices-jammer", 200, 200, capitalize_first_letters(name))
ui.open()
ui = new(user, src, "Jammer", "Radio Jammer", 200, 200)
ui.open()
/obj/item/device/radiojammer/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
if(!data)
data = list()
/obj/item/device/radiojammer/ui_data(mob/user)
var/list/data = list()
data["active"] = active
return data
VUEUI_SET_CHECK(data["active"], active, ., data)
/obj/item/device/radiojammer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return TRUE
/obj/item/device/radiojammer/Topic(href, href_list)
..()
if(href_list["set_active"])
active = text2num(href_list["set_active"])
update_icon()
var/datum/vueui/ui = SSvueui.get_open_ui(usr, src)
ui.check_for_change()
switch(action)
if("set_active")
active = text2num(params["set_active"])
update_icon()
. = TRUE
/obj/item/device/radiojammer/emp_act()
toggle()
@@ -35,7 +35,7 @@
log_game("[key_name_admin(user)] attached both tanks to a transfer valve.",ckey=key_name(user))
update_icon()
SSnanoui.update_uis(src) // update all UIs attached to src
update_static_data_for_all_viewers()
//TODO: Have this take an assemblyholder
else if(isassembly(item))
var/obj/item/device/assembly/A = item
@@ -56,12 +56,13 @@
message_admins("[key_name_admin(user)] attached a [item] to a transfer valve. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[location.x];Y=[location.y];Z=[location.z]'>JMP</a>)")
log_game("[key_name_admin(user)] attached a [item] to a transfer valve.",ckey=key_name(user))
attacher = user
SSnanoui.update_uis(src) // update all UIs attached to src
update_static_data_for_all_viewers()
return
/obj/item/device/transfer_valve/HasProximity(atom/movable/AM as mob|obj)
if(!attached_device) return
if(!attached_device)
return
attached_device.HasProximity(AM)
return
@@ -69,51 +70,46 @@
/obj/item/device/transfer_valve/attack_self(mob/user as mob)
ui_interact(user)
/obj/item/device/transfer_valve/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
/obj/item/device/transfer_valve/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "TransferVavle", ui_x=540, ui_y=165)
ui.open()
// this is the data which will be sent to the ui
var/data[0]
data["attachmentOne"] = tank_one ? tank_one.name : null
data["attachmentTwo"] = tank_two ? tank_two.name : null
/obj/item/device/transfer_valve/ui_data(mob/user)
var/list/data = list()
data["tankOne"] = tank_one ? tank_one.name : null
data["tankTwo"] = tank_two ? tank_two.name : null
data["valveAttachment"] = attached_device ? attached_device.name : null
data["valveOpen"] = valve_open ? 1 : 0
return data
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, 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
ui = new(user, src, ui_key, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
// auto update every Master Controller tick
//ui.set_auto_update(1)
/obj/item/device/transfer_valve/Topic(href, href_list)
..()
if ( usr.stat || usr.restrained() )
return 0
if (src.loc != usr)
return 0
if(tank_one && href_list["tankone"])
remove_tank(tank_one, usr)
else if(tank_two && href_list["tanktwo"])
remove_tank(tank_two, usr)
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
/obj/item/device/transfer_valve/ui_act(action,params)
. = ..()
if(.)
return
src.add_fingerprint(usr)
if(action=="remove")
if(params["object"]=="tankOne")
remove_tank(tank_one,usr)
if(params["object"]=="tankTwo")
remove_tank(tank_two,usr)
if(params["object"]=="device")
attached_device.forceMove(get_turf(src))
usr.put_in_hands(attached_device)
attached_device.holder = null
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
src.add_fingerprint(usr)
return 1 // Returning 1 sends an update to attached UIs
. = TRUE
update_icon()
if(action=="interact")
if(params["object"]=="tankOne")
tank_one.ui_interact(usr)
if(params["object"]=="tankTwo")
tank_two.ui_interact(usr)
if(params["object"]=="device")
attached_device.ui_interact(usr)
if(action=="open")
toggle_valve()
/obj/item/device/transfer_valve/process_activation(var/obj/item/device/D)
if(toggle)
+19 -16
View File
@@ -69,20 +69,21 @@
/obj/item/vitals_monitor/Click() // attack_hand doesn't work here because it's inside the rollerbed
if(bed && bed.Adjacent(usr))
interact(usr)
ui_interact(usr)
return
return ..()
/obj/item/vitals_monitor/interact(mob/user)
var/datum/vueui/ui = SSvueui.get_open_ui(user, src)
/obj/item/vitals_monitor/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "devices-vitalsmonitor", 480, 250, capitalize_first_letters(name), set_state_object = bed)
ui.auto_update_content = TRUE
ui.open()
ui = new(user, src, "VitalsMonitor", "Vitals Monitor", 480, 300)
ui.open()
/obj/item/vitals_monitor/vueui_data_change(var/list/data, var/mob/user, var/datum/vueui/ui)
if(!data)
data = list()
/obj/item/vitals_monitor/ui_status(mob/user, datum/ui_state/state)
return (bed && bed.Adjacent(user)) ? UI_INTERACTIVE : UI_UPDATE
/obj/item/vitals_monitor/ui_data(mob/user)
var/list/data = list()
var/mob/living/carbon/human/H
if(bed?.buckled)
@@ -92,7 +93,7 @@
H = locate() in bed.buckled.contents
var/has_occupant = !isnull(H)
VUEUI_SET_CHECK(data["has_occupant"], has_occupant, ., data)
data["has_occupant"] = has_occupant
if(has_occupant)
var/displayed_stat = H.stat
@@ -117,9 +118,11 @@
if(pulse_result == ">250")
pulse_result = -3
VUEUI_SET_CHECK(data["stat"], displayed_stat, ., data)
VUEUI_SET_CHECK(data["brain_activity"], H.get_brain_result(), ., data)
VUEUI_SET_CHECK(data["blood_pressure"], H.get_blood_pressure(), ., data)
VUEUI_SET_CHECK(data["blood_pressure_level"], H.get_blood_pressure_alert(), ., data)
VUEUI_SET_CHECK(data["blood_volume"], H.get_blood_volume(), ., data)
VUEUI_SET_CHECK(data["blood_o2"], blood_oxygenation, ., data)
data["stat"] = displayed_stat
data["brain_activity"] = H.get_brain_result()
data["blood_pressure"] = H.get_blood_pressure()
data["blood_pressure_level"] = H.get_blood_pressure_alert()
data["blood_volume"] = H.get_blood_volume()
data["blood_o2"] = blood_oxygenation
return data
@@ -133,7 +133,7 @@
QDEL_NULL(obfuscation_image)
update_icon()
/obj/item/card/id/syndicate/Topic(href, href_list, var/datum/topic_state/state)
/obj/item/card/id/syndicate/Topic(href, href_list, var/datum/ui_state/state)
if(..())
return 1
@@ -269,4 +269,4 @@
/datum/card_state
var/name
var/icon_state
var/item_state
var/item_state
@@ -64,10 +64,6 @@
build_path = /obj/machinery/power/solar_control
origin_tech = list(TECH_DATA = 2, TECH_POWER = 2)
/obj/item/circuitboard/powermonitor
name = T_BOARD("power monitoring console")
build_path = /obj/machinery/computer/power_monitor
/obj/item/circuitboard/olddoor
name = T_BOARD("DoorMex")
build_path = /obj/machinery/computer/pod/old
@@ -109,16 +105,6 @@
build_path = /obj/machinery/computer/area_atmos
origin_tech = list(TECH_DATA = 2)
/*/obj/item/circuitboard/prison_shuttle
name = T_BOARD("prison shuttle control console")
build_path = /obj/machinery/computer/prison_shuttle
origin_tech = list(TECH_DATA = 2)*/
/obj/item/circuitboard/rcon_console
name = T_BOARD("RCON remote control console")
build_path = /obj/machinery/computer/rcon
origin_tech = list(TECH_DATA = 4, TECH_ENGINEERING = 3, TECH_POWER = 5)
/obj/item/circuitboard/telesci_console
name = T_BOARD("Telescience Console")
build_path = /obj/machinery/computer/telescience
@@ -152,4 +138,4 @@
/obj/item/circuitboard/ship/targeting
name = T_BOARD("Ajax Targeting Systems Console")
origin_tech = list(TECH_ENGINEERING = 3)
build_path = /obj/machinery/computer/ship/targeting
build_path = /obj/machinery/computer/ship/targeting
@@ -1,28 +0,0 @@
/obj/item/circuitboard/stationalert
name = T_BOARD("station alert console")
build_path = /obj/machinery/computer/station_alert
var/list/alarm_handlers
/obj/item/circuitboard/stationalert/New()
alarm_handlers = new()
..()
/obj/item/circuitboard/stationalert/construct(var/obj/machinery/computer/station_alert/SA)
if(..(SA))
SA.unregister_monitor()
var/datum/nano_module/alarm_monitor/monitor = new(SA)
monitor.alarm_handlers.Cut()
for(var/alarm_handler in alarm_handlers)
monitor.alarm_handlers += alarm_handler
SA.register_monitor(monitor)
return 1
/obj/item/circuitboard/stationalert/deconstruct(var/obj/machinery/computer/station_alert/SA)
if(..(SA))
alarm_handlers.Cut()
if(SA.alarm_monitor)
for(var/alarm_handler in SA.alarm_monitor.alarm_handlers)
alarm_handlers += alarm_handler
return 1
@@ -91,8 +91,8 @@
if (!src.locked)
message = "*****"
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
send_theme_resources(user)
user << browse(enable_ui_theme(user, dat), "window=caselock;size=300x280")
user << browse(dat, "window=caselock;size=300x280")
/obj/item/storage/secure/Topic(href, href_list)
..()
+26 -38
View File
@@ -87,10 +87,21 @@
ui_interact(user)
/obj/item/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
/obj/item/tank/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Tank", ui_x=400, ui_y=180)
ui.open()
/obj/item/tank/ui_host(mob/user)
. = ..()
if(istype(loc,/obj/item/device/transfer_valve))
return loc
/obj/item/tank/ui_data(mob/user)
var/mob/living/carbon/location = null
if(istype(loc, /obj/item/rig)) // check for tanks in rigs
if(istype(loc, /obj/item/rig))
if(istype(loc.loc, /mob/living/carbon))
location = loc.loc
else if(istype(loc, /mob/living/carbon))
@@ -101,8 +112,8 @@
if(location.internal==src)
using_internal = 1
// this is the data which will be sent to the ui
var/data[0]
var/list/data = list()
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0)
data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE)
@@ -131,36 +142,13 @@
if(H.head && (H.head.item_flags & AIRTIGHT))
data["maskConnected"] = 1
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, 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
ui = new(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
// auto update every Master Controller tick
ui.set_auto_update(1)
return data
/obj/item/tank/Topic(href, href_list)
..()
if (usr.stat|| usr.restrained())
return 0
if (src.loc != usr)
return 0
if (href_list["dist_p"])
if (href_list["dist_p"] == "reset")
src.distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
else if (href_list["dist_p"] == "max")
src.distribute_pressure = TANK_MAX_RELEASE_PRESSURE
else
var/cp = text2num(href_list["dist_p"])
src.distribute_pressure += cp
src.distribute_pressure = min(max(round(src.distribute_pressure), 0), TANK_MAX_RELEASE_PRESSURE)
if (href_list["stat"])
/obj/item/tank/ui_act(action,params)
. = ..()
if(.)
return
if(action=="toggleReleaseValve")
if(istype(loc,/mob/living/carbon))
var/mob/living/carbon/location = loc
if(location.internal == src)
@@ -170,7 +158,6 @@
if (location.internals)
location.internals.icon_state = "internal0"
else
var/can_open_valve
if(location.wear_mask && (location.wear_mask.item_flags & AIRTIGHT))
can_open_valve = 1
@@ -186,10 +173,11 @@
location.internals.icon_state = "internal1"
else
to_chat(usr, "<span class='warning'>You need something to connect to \the [src].</span>")
src.add_fingerprint(usr)
return 1
. = TRUE
update_icon()
if(action=="setReleasePressure")
distribute_pressure = min(max(round(text2num(params["release_pressure"])), 0), TANK_MAX_RELEASE_PRESSURE)
. = TRUE
/obj/item/tank/remove_air(amount)
return air_contents.remove(amount)
+2 -2
View File
@@ -34,7 +34,7 @@
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/Topic(href, href_list, var/datum/topic_state/state = default_state)
/obj/Topic(href, href_list, var/datum/ui_state/state = default_state)
if(..())
return 1
@@ -47,7 +47,7 @@
CouldNotUseTopic(usr)
return 1
/obj/CanUseTopic(var/mob/user, var/datum/topic_state/state)
/obj/CanUseTopic(var/mob/user, var/datum/ui_state/state)
if(user.CanUseObjTopic(src))
return ..()
to_chat(user, "<span class='danger'>[icon2html(src, user)]Access Denied!</span>")