Files
Aurora.3/code/modules/nano/interaction/base.dm
Karolis 4065e29e86 Vue.js UI implementation (#4868)
This UI is going to be more integrated with BYOND host objects. It's update principal is very different from nanoui's. It is based around state that is being synchronized with server and client (browser). Such synchronization has it's problems, like it can't handle rapid changes, what could cause client and server to become out of sync and client state to be discard.
2018-08-04 20:19:29 +03:00

38 lines
1021 B
Plaintext

/datum/proc/ui_host()
return src
/datum/proc/nano_container()
return src
/datum/proc/CanUseTopic(var/mob/user, var/datum/topic_state/state = default_state)
var/datum/src_object = ui_host()
return state.can_use_topic(src_object, user)
/datum/topic_state/proc/href_list(var/mob/user)
return list()
/datum/topic_state/proc/can_use_topic(var/src_object, var/mob/user)
return STATUS_CLOSE
/mob/proc/shared_nano_interaction()
if (src.stat || !client)
return STATUS_CLOSE // no updates, close the interface
else if (incapacitated())
return STATUS_UPDATE // update only (orange visibility)
return STATUS_INTERACTIVE
/mob/living/silicon/ai/shared_nano_interaction()
if(!has_power())
return STATUS_CLOSE
if (check_unable(1, 0))
return STATUS_CLOSE
return ..()
/mob/living/silicon/robot/shared_nano_interaction()
. = STATUS_INTERACTIVE
if(!cell || (cell && cell.charge <= 0))
return STATUS_CLOSE
if(lockcharge)
. = STATUS_DISABLED
return min(., ..())