mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user