mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Fix unavailable button tint not clearing on stat change
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
Remove(owner)
|
||||
owner = M
|
||||
RegisterSignal(owner, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE)
|
||||
// Register some signals based on our check_flags
|
||||
// so that our button icon updates when relevant
|
||||
if(check_flags & AB_CHECK_CONSCIOUS)
|
||||
RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(update_status_on_signal))
|
||||
|
||||
GiveAction(M)
|
||||
|
||||
@@ -68,7 +72,10 @@
|
||||
viewers = list()
|
||||
|
||||
if(owner)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(owner, list(
|
||||
COMSIG_PARENT_QDELETING,
|
||||
COMSIG_MOB_STATCHANGE
|
||||
))
|
||||
if(target == owner)
|
||||
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref))
|
||||
owner = null
|
||||
@@ -218,6 +225,11 @@
|
||||
our_button.id = bitflag
|
||||
return
|
||||
|
||||
/// A general use signal proc that reacts to an event and updates JUST our button's status
|
||||
/datum/action/proc/update_status_on_signal(datum/source, new_stat, old_stat)
|
||||
SIGNAL_HANDLER
|
||||
UpdateButton(status_only = TRUE)
|
||||
|
||||
//Presets for item actions
|
||||
/datum/action/item_action
|
||||
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
/datum/action/cooldown/bloodsucker/proc/CheckCanDeactivate(display_error)
|
||||
return TRUE
|
||||
|
||||
/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, force = FALSE)
|
||||
/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
|
||||
background_icon_state = active? background_icon_state_on : background_icon_state_off
|
||||
..()//UpdateButton()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user