Optimize wire hacking QoL (#6835)

Keeps the same "bold if changed" functionality added in recent QoL improvements, but replaces the one-datum-instance per hint per device with a two number vars per device.
This commit is contained in:
Leshana
2020-03-16 05:27:29 -04:00
committed by VirgoBot
parent 4b8a6dc904
commit 4c7ad1c24e
16 changed files with 65 additions and 292 deletions

View File

@@ -2,23 +2,6 @@
random = 1
holder_type = /mob/living/silicon/robot
wire_count = 5
var/datum/wire_hint/lawsync_hint
var/datum/wire_hint/connected_ai_hint
var/datum/wire_hint/camera_hint
var/datum/wire_hint/lockdown_hint
/datum/wires/robot/make_wire_hints()
lawsync_hint = new("The LawSync light is on.", "The LawSync light is off.")
connected_ai_hint = new("The AI link light is on.", "The AI link light is off.")
camera_hint = new("The camera light is on.", "The camera light is off.")
lockdown_hint = new("The lockdown light is on.", "The lockdown light is off.")
/datum/wires/robot/Destroy()
lawsync_hint = null
connected_ai_hint = null
camera_hint = null
lockdown_hint = null
return ..()
var/const/BORG_WIRE_LAWCHECK = 1
var/const/BORG_WIRE_MAIN_POWER = 2 // The power wires do nothing whyyyyyyyyyyyyy
@@ -29,10 +12,10 @@ var/const/BORG_WIRE_CAMERA = 16
/datum/wires/robot/GetInteractWindow()
. = ..()
var/mob/living/silicon/robot/R = holder
. += lawsync_hint.show(R.lawupdate)
. += connected_ai_hint.show(R.connected_ai)
. += camera_hint.show((!isnull(R.camera) && R.camera.status == 1))
. += lockdown_hint.show(R.lockdown)
. += show_hint(0x1, R.lawupdate, "The LawSync light is on.", "The LawSync light is off.")
. += show_hint(0x2, R.connected_ai, "The AI link light is on.", "The AI link light is off.")
. += show_hint(0x4, (!isnull(R.camera) && R.camera.status == 1), "The camera light is on.", "The camera light is off.")
. += show_hint(0x8, R.lockdown, "The lockdown light is on.", "The lockdown light is off.")
return .
/datum/wires/robot/UpdateCut(var/index, var/mended)