mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Fix tgui machine interactions status checks
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* 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(atom/src_object, mob/user)
|
||||
var/datum/wires/W = src_object.wires
|
||||
if(istype(W) && user.Adjacent(W.holder) && W.interactable(user))
|
||||
return UI_INTERACTIVE
|
||||
return UI_CLOSE
|
||||
@@ -316,14 +316,13 @@
|
||||
/datum/tgui/proc/push_data(data, force = 0)
|
||||
update_status(push = 0) // Update the window state.
|
||||
if(!initialized)
|
||||
return // Cannot upadte UI if it is not set up yet.
|
||||
return // Cannot update UI if it is not set up yet.
|
||||
if(status <= UI_DISABLED && !force)
|
||||
return // Cannot update UI, we have no visibility.
|
||||
|
||||
// Send the new JSON to the update() Javascript function.
|
||||
user << output(url_encode(get_json(data)), "[window_id].browser:update")
|
||||
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
@@ -343,8 +342,7 @@
|
||||
* optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
|
||||
**/
|
||||
/datum/tgui/proc/update_status(push = 0)
|
||||
var/datum/host = src_object.ui_host()
|
||||
var/status = host.ui_status(user, state)
|
||||
var/status = src_object.ui_status(user, state)
|
||||
if(master_ui)
|
||||
status = min(status, master_ui.status)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user