diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm
index 96d55e05518..2f647c435f2 100644
--- a/code/datums/wires/airlock.dm
+++ b/code/datums/wires/airlock.dm
@@ -31,16 +31,16 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
return 1
return 0
-/datum/wires/airlock/GetInteractWindow()
+/datum/wires/airlock/getStatus()
var/obj/machinery/door/airlock/A = holder
- . += ..()
- . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
- (A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"),
- ((A.hasPower()) ? "The test light is on." : "The test light is off!"),
- ((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
- (A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
- (A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
- (A.emergency==0 ? "The emergency lights are off." : "The emergency lights are on."))
+ var/list/status = list()
+ status.Add(A.locked ? "The door bolts have fallen!" : "The door bolts look up.")
+ status.Add(A.hasPower() ? "The test light is on." : "The test light is off!")
+ status.Add((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off.")
+ status.Add(A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off.")
+ status.Add(A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off.")
+ status.Add(A.emergency==0 ? "The emergency lights are off." : "The emergency lights are on.")
+ return status
/datum/wires/airlock/UpdateCut(var/index, var/mended)
diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm
index 32290d20bb0..3d8446299bd 100644
--- a/code/datums/wires/alarm.dm
+++ b/code/datums/wires/alarm.dm
@@ -15,10 +15,13 @@ var/const/AALARM_WIRE_AALARM = 16
return 1
return 0
-/datum/wires/alarm/GetInteractWindow()
+/datum/wires/alarm/getStatus()
var/obj/machinery/alarm/A = holder
- . += ..()
- . += text("
\n[(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((A.shorted || (A.stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
+ var/list/status = list()
+ status.Add(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")
+ status.Add((A.shorted || (A.stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")
+ status.Add(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")
+ return status
/datum/wires/alarm/UpdateCut(index, mended)
var/obj/machinery/alarm/A = holder
diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm
index e37ad8241d3..02a50e3716e 100644
--- a/code/datums/wires/apc.dm
+++ b/code/datums/wires/apc.dm
@@ -7,11 +7,14 @@ var/const/APC_WIRE_MAIN_POWER1 = 2
var/const/APC_WIRE_MAIN_POWER2 = 4
var/const/APC_WIRE_AI_CONTROL = 8
-/datum/wires/apc/GetInteractWindow()
- var/obj/machinery/power/apc/A = holder
- . += ..()
- . += text("
\n[(A.locked ? "The APC is locked." : "The APC is unlocked.")]
\n[(A.shorted ? "The APCs power has been shorted." : "The APC is working properly!")]
\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
+/datum/wires/apc/getStatus()
+ var/obj/machinery/power/apc/A = holder
+ var/list/status = list()
+ status.Add(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")
+ status.Add(A.shorted ? "The APCs power has been shorted." : "The APC is working properly!")
+ status.Add(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")
+ return status
/datum/wires/apc/CanUse(mob/living/L)
var/obj/machinery/power/apc/A = holder
diff --git a/code/datums/wires/autolathe.dm b/code/datums/wires/autolathe.dm
index c6487f4cefb..91e28015930 100644
--- a/code/datums/wires/autolathe.dm
+++ b/code/datums/wires/autolathe.dm
@@ -7,10 +7,13 @@ var/const/AUTOLATHE_HACK_WIRE = 1
var/const/AUTOLATHE_SHOCK_WIRE = 2
var/const/AUTOLATHE_DISABLE_WIRE = 4
-/datum/wires/autolathe/GetInteractWindow()
+
+/datum/wires/autolathe/getStatus()
var/obj/machinery/autolathe/A = holder
- . += ..()
- . += text("
The red light is [A.disabled ? "off" : "on"].
The green light is [A.shocked ? "off" : "on"].
The blue light is [A.hacked ? "off" : "on"].
")
+ var/list/status = list()
+ status.Add("The red light is [A.disabled ? "off" : "on"].")
+ status.Add("The blue light is [A.hacked ? "off" : "on"].")
+ return status
/datum/wires/autolathe/CanUse()
var/obj/machinery/autolathe/A = holder
@@ -18,11 +21,6 @@ var/const/AUTOLATHE_DISABLE_WIRE = 4
return 1
return 0
-/datum/wires/autolathe/Interact(mob/living/user)
- if(CanUse(user))
- var/obj/machinery/autolathe/V = holder
- V.attack_hand(user)
-
/datum/wires/autolathe/UpdateCut(index, mended)
var/obj/machinery/autolathe/A = holder
switch(index)
diff --git a/code/datums/wires/pizza_bomb.dm b/code/datums/wires/pizza_bomb.dm
index d3c64225e54..415f7c5ba23 100644
--- a/code/datums/wires/pizza_bomb.dm
+++ b/code/datums/wires/pizza_bomb.dm
@@ -38,9 +38,9 @@ var/const/PIZZA_WIRE_DISARM = 1 // No boom
log_game("a pizza bomb ([P.loc.x],[P.loc.y],[P.loc.z]) armed by [key_name(P.armer)] has exploded via wire pulsing.")
P.go_boom()
-
-/datum/wires/pizza_bomb/GetInteractWindow()
- . = ..()
+/datum/wires/pizza_bomb/getStatus()
var/obj/item/device/pizza_bomb/P = holder
- . += text("
The red light is [P.primed ? "on" : "off"].
")
- . += text("The green light is [P.disarmed ? "on": "off"].
")
+ var/list/status = list()
+ status.Add("The red light is [P.primed ? "on" : "off"].")
+ status.Add("The green light is [P.disarmed ? "on": "off"].")
+ return status
diff --git a/code/datums/wires/r_n_d.dm b/code/datums/wires/r_n_d.dm
index 3f91c08da62..7e071258903 100644
--- a/code/datums/wires/r_n_d.dm
+++ b/code/datums/wires/r_n_d.dm
@@ -41,11 +41,11 @@ var/const/RD_WIRE_DISABLE = 4 // Disables the machine
if(RD_WIRE_SHOCK)
R.shocked = !mended
-
-/datum/wires/r_n_d/GetInteractWindow()
- . = ..()
+/datum/wires/r_n_d/getStatus()
var/obj/machinery/r_n_d/R = holder
- . += text("
The red light is [R.disabled ? "off" : "on"].
")
- . += text("The green light is [R.shocked ? "off" : "on"].
")
- . += text("The blue light is [R.hacked ? "off" : "on"].
")
+ var/list/status = list()
+ status.Add("The red light is [R.disabled ? "off" : "on"].")
+ status.Add("The green light is [R.shocked ? "off" : "on"].")
+ status.Add("The blue light is [R.hacked ? "off" : "on"].")
+ return status
diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm
index a01efe58d21..79a418f01d5 100644
--- a/code/datums/wires/robot.dm
+++ b/code/datums/wires/robot.dm
@@ -9,14 +9,15 @@ var/const/BORG_WIRE_LOCKED_DOWN = 4
var/const/BORG_WIRE_AI_CONTROL = 8
var/const/BORG_WIRE_CAMERA = 16
-/datum/wires/robot/GetInteractWindow()
- . = ..()
+/datum/wires/robot/getStatus()
var/mob/living/silicon/robot/R = holder
- . += text("
\n[(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]
\n[(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
- . += text("
\n[((!isnull(R.camera) && R.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")]
\n")
- . += text("
\n[(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]")
- return .
+ var/list/status = list()
+ status.Add(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")
+ status.Add(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")
+ status.Add((!isnull(R.camera) && R.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")
+ status.Add(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")
+ return status
/datum/wires/robot/UpdateCut(index, mended)
diff --git a/code/datums/wires/vending.dm b/code/datums/wires/vending.dm
index 505b99b3cf1..9f898f8ede1 100644
--- a/code/datums/wires/vending.dm
+++ b/code/datums/wires/vending.dm
@@ -1,11 +1,12 @@
/datum/wires/vending
holder_type = /obj/machinery/vending
- wire_count = 4
+ wire_count = 5
var/const/VENDING_WIRE_THROW = 1
var/const/VENDING_WIRE_CONTRABAND = 2
var/const/VENDING_WIRE_ELECTRIFY = 4
var/const/VENDING_WIRE_IDSCAN = 8
+var/const/VENDING_WIRE_SPEAKER = 16
/datum/wires/vending/CanUse(mob/living/L)
var/obj/machinery/vending/V = holder
@@ -17,18 +18,15 @@ var/const/VENDING_WIRE_IDSCAN = 8
return 1
return 0
-/datum/wires/vending/Interact(mob/living/user)
- if(CanUse(user))
- var/obj/machinery/vending/V = holder
- V.attack_hand(user)
-
-/datum/wires/vending/GetInteractWindow()
+/datum/wires/vending/getStatus()
var/obj/machinery/vending/V = holder
- . += ..()
- . += "
The orange light is [V.seconds_electrified ? "on" : "off"].
"
- . += "The red light is [V.shoot_inventory ? "off" : "blinking"].
"
- . += "The green light is [V.extended_inventory ? "on" : "off"].
"
- . += "A [V.scan_id ? "purple" : "yellow"] light is on.
"
+ var/list/status = list()
+ status.Add("The orange light is [V.seconds_electrified ? "on" : "off"].")
+ status.Add("The red light is [V.shoot_inventory ? "off" : "blinking"].")
+ status.Add("The green light is [V.extended_inventory ? "on" : "off"].")
+ status.Add("A [V.scan_id ? "purple" : "yellow"] light is on.")
+ status.Add("The speaker light is [V.shut_up ? "off" : "on"].")
+ return status
/datum/wires/vending/UpdatePulsed(index)
var/obj/machinery/vending/V = holder
@@ -41,6 +39,8 @@ var/const/VENDING_WIRE_IDSCAN = 8
V.seconds_electrified = 30
if(VENDING_WIRE_IDSCAN)
V.scan_id = !V.scan_id
+ if(VENDING_WIRE_SPEAKER)
+ V.shut_up = !V.shut_up
/datum/wires/vending/UpdateCut(index, mended)
var/obj/machinery/vending/V = holder
@@ -55,4 +55,6 @@ var/const/VENDING_WIRE_IDSCAN = 8
else
V.seconds_electrified = -1
if(VENDING_WIRE_IDSCAN)
- V.scan_id = 1
\ No newline at end of file
+ V.scan_id = 1
+ if(VENDING_WIRE_SPEAKER)
+ V.shut_up = mended
\ No newline at end of file
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index d8f3cefe45c..90bb4a0a21c 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -82,97 +82,26 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
return 0
+/datum/wires/ui_interact(mob/user, ui_key = "wires", datum/tgui/ui = null, force_open = 0, \
+ datum/tgui/master_ui = null, datum/ui_state/state = wire_state)
+
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if (!ui)
+ ui = new(user, src, ui_key, "wires", holder.name, 200 + wire_count*50, 470, master_ui, state)
+ ui.open()
/datum/wires/proc/Interact(mob/living/user)
- var/html = null
- if(holder && CanUse(user))
- html = GetInteractWindow()
- if(html)
- if(user.machine != holder)
- for(var/A in signallers)
- if(istype(signallers[A], /obj/item))
- var/obj/item/I = signallers[A]
- if(I.on_found(user))
- return
+ if(holder && CanUse(user)) //remove this
+ ui_interact(user)
+ //Active prox sensors and similar on wires
+ for(var/A in signallers)
+ if(istype(signallers[A], /obj/item))
+ var/obj/item/I = signallers[A]
+ if(I.on_found(user))
+ return
- user.set_machine(holder)
- else
- user.unset_machine()
- // No content means no window.
- user << browse(null, "window=wires")
- return
-
- var/datum/browser/popup = new(user, "wires", holder.name, window_x, window_y)
- popup.set_content(html)
- popup.set_title_image(user.browse_rsc_icon(holder.icon, holder.icon_state))
- popup.open()
-
-/datum/wires/proc/GetInteractWindow()
- var/html = "
| [capitalize(colour)] | " - html += "" - html += "[IsColourCut(colour) ? "Mend" : "Cut"]" - html += " Pulse" - html += " [IsAttached(colour) ? "Detach" : "Attach"] Signaller |