Refactor wire datums

Finish wire port and refactor wire datums to use string keys; widen color
range to support more wires and more colors.
This commit is contained in:
Bjorn Neergaard
2016-01-22 19:22:09 -06:00
parent cda2f26d56
commit 87b0857b93
40 changed files with 945 additions and 1141 deletions
+9 -5
View File
@@ -1,9 +1,13 @@
/**
* tgui state: wire_state
*
* Checks specifically designed for wire datums.
**/
/var/global/datum/ui_state/wire_state/wire_state = new()
/datum/ui_state/wire_state/can_use_topic(src_object, mob/user)
var/datum/wires/W = src_object
if(!istype(W))
return UI_CLOSE
if(!user.Adjacent(W.holder))
return UI_CLOSE
return W.CanUse(user) ? UI_INTERACTIVE : UI_CLOSE
if(istype(W) && user.Adjacent(W.holder) && W.interactable(user))
return UI_INTERACTIVE
return UI_CLOSE