diff --git a/code/__DEFINES/actions.dm b/code/__DEFINES/actions.dm
index eb1edc8d623..971e3441577 100644
--- a/code/__DEFINES/actions.dm
+++ b/code/__DEFINES/actions.dm
@@ -25,3 +25,11 @@ DEFINE_BITFIELD(check_flags, list(
#define PANEL_DISPLAY_STATUS "status"
/// The name shown in the stat panel.
#define PANEL_DISPLAY_NAME "name"
+
+#define ACTION_BUTTON_DEFAULT_BACKGROUND "_use_ui_default_background"
+
+#define UPDATE_BUTTON_NAME (1<<0)
+#define UPDATE_BUTTON_ICON (1<<1)
+#define UPDATE_BUTTON_BACKGROUND (1<<2)
+#define UPDATE_BUTTON_OVERLAY (1<<3)
+#define UPDATE_BUTTON_STATUS (1<<4)
diff --git a/code/__DEFINES/dcs/signals/signals_action.dm b/code/__DEFINES/dcs/signals/signals_action.dm
index ee98b5a4eb9..7e1f7a19d0f 100644
--- a/code/__DEFINES/dcs/signals/signals_action.dm
+++ b/code/__DEFINES/dcs/signals/signals_action.dm
@@ -6,8 +6,14 @@
#define COMPONENT_ACTION_BLOCK_TRIGGER (1<<0)
/// From /datum/action/Grant(): (mob/grant_to)
#define COMSIG_ACTION_GRANTED "action_grant"
+/// From /datum/action/Grant(): (datum/action)
+#define COMSIG_MOB_GRANTED_ACTION "mob_action_grant"
/// From /datum/action/Remove(): (mob/removed_from)
#define COMSIG_ACTION_REMOVED "action_removed"
+/// From /datum/action/Remove(): (datum/action)
+#define COMSIG_MOB_REMOVED_ACTION "mob_action_removed"
+/// From /datum/action/apply_button_overlay()
+#define COMSIG_ACTION_OVERLAY_APPLY "action_overlay_applied"
// Cooldown action signals
diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm
index 81cf2a50678..25708399de0 100644
--- a/code/__DEFINES/is_helpers.dm
+++ b/code/__DEFINES/is_helpers.dm
@@ -81,7 +81,6 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list(
#define isflyperson(A) (is_species(A, /datum/species/fly))
#define isjellyperson(A) (is_species(A, /datum/species/jelly))
#define isslimeperson(A) (is_species(A, /datum/species/jelly/slime))
-#define isluminescent(A) (is_species(A, /datum/species/jelly/luminescent))
#define iszombie(A) (is_species(A, /datum/species/zombie))
#define isskeleton(A) (is_species(A, /datum/species/skeleton))
#define ismoth(A) (is_species(A, /datum/species/moth))
diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm
index 3afbada9a62..78ad25e6978 100644
--- a/code/__HELPERS/roundend.dm
+++ b/code/__HELPERS/roundend.dm
@@ -651,6 +651,7 @@
/datum/action/report
name = "Show roundend report"
button_icon_state = "round_end"
+ show_to_observers = FALSE
/datum/action/report/Trigger(trigger_flags)
if(owner && GLOB.common_report && SSticker.current_state == GAME_STATE_FINISHED)
diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm
index 04b5a02be29..7562721f678 100644
--- a/code/_onclick/hud/action_button.dm
+++ b/code/_onclick/hud/action_button.dm
@@ -1,14 +1,16 @@
-#define ACTION_BUTTON_DEFAULT_BACKGROUND "default"
-
/atom/movable/screen/movable/action_button
var/datum/action/linked_action
var/datum/hud/our_hud
var/actiontooltipstyle = ""
screen_loc = null
- var/button_icon_state
- var/appearance_cache
+ /// The icon state of our active overlay, used to prevent re-applying identical overlays
+ var/active_overlay_icon_state
+ /// The icon state of our active underlay, used to prevent re-applying identical underlays
+ var/active_underlay_icon_state
+ /// The overlay we have overtop our button
var/mutable_appearance/button_overlay
+
/// Where we are currently placed on the hud. SCRN_OBJ_DEFAULT asks the linked action what it thinks
var/location = SCRN_OBJ_DEFAULT
/// A unique bitflag, combined with the name of our linked action this lets us persistently remember any user changes to our position
@@ -29,15 +31,17 @@
return ..()
/atom/movable/screen/movable/action_button/proc/can_use(mob/user)
+ if(isobserver(user))
+ var/mob/dead/observer/dead_mob = user
+ if(dead_mob.observetarget) // Observers can only click on action buttons if they're not observing something
+ return FALSE
+
if(linked_action)
if(linked_action.viewers[user.hud_used])
return TRUE
return FALSE
- else if (isobserver(user))
- var/mob/dead/observer/O = user
- return !O.observetarget
- else
- return TRUE
+
+ return TRUE
/atom/movable/screen/movable/action_button/Click(location,control,params)
if (!can_use(usr))
@@ -145,20 +149,38 @@
return
user.client.prefs.action_buttons_screen_locs -= "[name]_[id]"
+/**
+ * This is a silly proc used in hud code code to determine what icon and icon state we should be using
+ * for hud elements (such as action buttons) that don't have their own icon and icon state set.
+ *
+ * It returns a list, which is pretty much just a struct of info
+ */
/datum/hud/proc/get_action_buttons_icons()
. = list()
.["bg_icon"] = ui_style
.["bg_state"] = "template"
+ .["bg_state_active"] = "template_active"
-//see human and alien hud for specific implementations.
+/**
+ * Updates all action buttons this mob has.
+ *
+ * Arguments:
+ * * update_flags - Which flags of the action should we update
+ * * force - Force buttons update even if the given button icon state has not changed
+ */
+/mob/proc/update_mob_action_buttons(update_flags = ALL, force = FALSE)
+ for(var/datum/action/current_action as anything in actions)
+ current_action.build_all_button_icons(update_flags, force)
-/mob/proc/update_action_buttons_icon(status_only = FALSE)
- for(var/X in actions)
- var/datum/action/A = X
- A.UpdateButtons(status_only)
-
-//This is the proc used to update all the action buttons.
-/mob/proc/update_action_buttons(reload_screen)
+/**
+ * This proc handles adding all of the mob's actions to their screen
+ *
+ * If you just need to update existing buttons, use [/mob/proc/update_mob_action_buttons]!
+ *
+ * Arguments:
+ * * update_flags - reload_screen - bool, if TRUE, this proc will add the button to the screen of the passed mob as well
+ */
+/mob/proc/update_action_buttons(reload_screen = FALSE)
if(!hud_used || !client)
return
@@ -167,7 +189,7 @@
for(var/datum/action/action as anything in actions)
var/atom/movable/screen/movable/action_button/button = action.viewers[hud_used]
- action.UpdateButtons()
+ action.build_all_button_icons()
if(reload_screen)
client.screen += button
@@ -176,6 +198,48 @@
// This holds the logic for the palette buttons
hud_used.palette_actions.refresh_actions()
+/**
+ * Show (most) of the another mob's action buttons to this mob
+ *
+ * Used for observers viewing another mob's screen
+ */
+/mob/proc/show_other_mob_action_buttons(mob/take_from)
+ if(!hud_used || !client)
+ return
+
+ for(var/datum/action/action as anything in take_from.actions)
+ if(!action.show_to_observers)
+ continue
+ action.GiveAction(src)
+ RegisterSignal(take_from, COMSIG_MOB_GRANTED_ACTION, PROC_REF(on_observing_action_granted))
+ RegisterSignal(take_from, COMSIG_MOB_REMOVED_ACTION, PROC_REF(on_observing_action_removed))
+
+/**
+ * Hide another mob's action buttons from this mob
+ *
+ * Used for observers viewing another mob's screen
+ */
+/mob/proc/hide_other_mob_action_buttons(mob/take_from)
+ for(var/datum/action/action as anything in take_from.actions)
+ action.HideFrom(src)
+ UnregisterSignal(take_from, list(COMSIG_MOB_GRANTED_ACTION, COMSIG_MOB_REMOVED_ACTION))
+
+/// Signal proc for [COMSIG_MOB_GRANTED_ACTION] - If we're viewing another mob's action buttons,
+/// we need to update with any newly added buttons granted to the mob.
+/mob/proc/on_observing_action_granted(mob/living/source, datum/action/action)
+ SIGNAL_HANDLER
+
+ if(!action.show_to_observers)
+ return
+ action.GiveAction(src)
+
+/// Signal proc for [COMSIG_MOB_REMOVED_ACTION] - If we're viewing another mob's action buttons,
+/// we need to update with any removed buttons from the mob.
+/mob/proc/on_observing_action_removed(mob/living/source, datum/action/action)
+ SIGNAL_HANDLER
+
+ action.HideFrom(src)
+
/atom/movable/screen/button_palette
desc = "Drag buttons to move them
Shift-click any button to reset it
Alt-click this to reset all buttons"
icon = 'icons/hud/64x16_actions.dmi'
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index c44a4d8096c..c8b422a1164 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -272,7 +272,13 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
hud_used = new_hud
new_hud.build_action_groups()
-//Version denotes which style should be displayed. blank or 0 means "next version"
+/**
+ * Shows this hud's hud to some mob
+ *
+ * Arguments
+ * * version - denotes which style should be displayed. blank or 0 means "next version"
+ * * viewmob - what mob to show the hud to. Can be this hud's mob, can be another mob, can be null (will use this hud's mob if so)
+ */
/datum/hud/proc/show_hud(version = 0, mob/viewmob)
if(!ismob(mymob))
return FALSE
@@ -341,7 +347,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
hud_version = display_hud_version
persistent_inventory_update(screenmob)
- screenmob.update_action_buttons(1)
+ // Gives all of the actions the screenmob owes to their hud
+ screenmob.update_action_buttons(TRUE)
+ // Handles alerts - the things on the right side of the screen
reorganize_alerts(screenmob)
screenmob.reload_fullscreen()
update_parallax_pref(screenmob)
@@ -353,6 +361,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
show_hud(hud_version, M)
else if (viewmob.hud_used)
viewmob.hud_used.plane_masters_update()
+ viewmob.show_other_mob_action_buttons(mymob)
SEND_SIGNAL(screenmob, COMSIG_MOB_HUD_REFRESHED, src)
return TRUE
diff --git a/code/controllers/subsystem/augury.dm b/code/controllers/subsystem/augury.dm
index 135b4a25dde..22d5003a7ec 100644
--- a/code/controllers/subsystem/augury.dm
+++ b/code/controllers/subsystem/augury.dm
@@ -59,9 +59,8 @@ SUBSYSTEM_DEF(augury)
/datum/action/innate/augury
name = "Auto Follow Debris"
- icon_icon = 'icons/obj/meteor.dmi'
+ button_icon = 'icons/obj/meteor.dmi'
button_icon_state = "flaming"
- background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND
/datum/action/innate/augury/Destroy()
if(owner)
@@ -72,17 +71,8 @@ SUBSYSTEM_DEF(augury)
SSaugury.watchers += owner
to_chat(owner, span_notice("You are now auto-following debris."))
active = TRUE
- UpdateButtons()
/datum/action/innate/augury/Deactivate()
SSaugury.watchers -= owner
to_chat(owner, span_notice("You are no longer auto-following debris."))
active = FALSE
- UpdateButtons()
-
-/datum/action/innate/augury/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
- ..()
- if(active)
- button.icon_state = "template_active"
- else
- button.icon_state = "template"
diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm
index edfd08cb36a..f0b9cd45a7b 100644
--- a/code/controllers/subsystem/vote.dm
+++ b/code/controllers/subsystem/vote.dm
@@ -310,6 +310,7 @@ SUBSYSTEM_DEF(vote)
/datum/action/vote
name = "Vote!"
button_icon_state = "vote"
+ show_to_observers = FALSE
/datum/action/vote/IsAvailable(feedback = FALSE)
return TRUE // Democracy is always available to the free people
diff --git a/code/datums/actions/action.dm b/code/datums/actions/action.dm
index 04e8a44a086..9f427ca4f7c 100644
--- a/code/datums/actions/action.dm
+++ b/code/datums/actions/action.dm
@@ -6,7 +6,7 @@
/datum/action
/// The name of the action
var/name = "Generic Action"
- /// The description of what the action does
+ /// The description of what the action does, shown in button tooltips
var/desc
/// The target the action is attached to. If the target datum is deleted, the action is as well.
/// Set in New() via the proc link_to(). PLEASE set a target if you're making an action
@@ -20,21 +20,32 @@
var/owner_has_control = TRUE
/// Flags that will determine of the owner / user of the action can... use the action
var/check_flags = NONE
- /// The style the button's tooltips appear to be
- var/buttontooltipstyle = ""
- /// Whether the button becomes transparent when it can't be used or just reddened
+ /// Whether the button becomes transparent when it can't be used, or just reddened
var/transparent_when_unavailable = TRUE
- /// This is the file for the BACKGROUND icon of the button
- var/button_icon = 'icons/mob/actions/backgrounds.dmi'
- /// This is the icon state state for the BACKGROUND icon of the button
- var/background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND
- /// This is the file for the icon that appears OVER the button background
- var/icon_icon = 'icons/hud/actions.dmi'
- /// This is the icon state for the icon that appears OVER the button background
- var/button_icon_state = "default"
- var/button_overlay_state
///List of all mobs that are viewing our action button -> A unique movable for them to view.
var/list/viewers = list()
+ /// If TRUE, this action button will be shown to observers / other mobs who view from this action's owner's eyes.
+ /// Used in [/mob/proc/show_other_mob_action_buttons]
+ var/show_to_observers = TRUE
+
+ /// The style the button's tooltips appear to be
+ var/buttontooltipstyle = ""
+
+ /// This is the file for the BACKGROUND underlay icon of the button
+ var/background_icon = 'icons/mob/actions/backgrounds.dmi'
+ /// This is the icon state state for the BACKGROUND underlay icon of the button
+ /// (If set to ACTION_BUTTON_DEFAULT_BACKGROUND, uses the hud's default background)
+ var/background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND
+
+ /// This is the file for the icon that appears on the button
+ var/button_icon = 'icons/hud/actions.dmi'
+ /// This is the icon state for the icon that appears on the button
+ var/button_icon_state = "default"
+
+ /// This is the file for any FOREGROUND overlay icons on the button (such as borders)
+ var/overlay_icon = 'icons/mob/actions/backgrounds.dmi'
+ /// This is the icon state for any FOREGROUND overlay icons on the button (such as borders)
+ var/overlay_icon_state
/datum/action/New(Target)
link_to(Target)
@@ -45,7 +56,7 @@
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE)
if(isatom(target))
- RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, PROC_REF(update_icon_on_signal))
+ RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, PROC_REF(on_target_icon_update))
if(istype(target, /datum/mind))
RegisterSignal(target, COMSIG_MIND_TRANSFERRED, PROC_REF(on_target_mind_swapped))
@@ -76,19 +87,20 @@
return
Remove(owner)
SEND_SIGNAL(src, COMSIG_ACTION_GRANTED, grant_to)
+ SEND_SIGNAL(grant_to, COMSIG_MOB_GRANTED_ACTION, src)
owner = grant_to
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_icon_on_signal))
+ RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(update_status_on_signal))
if(check_flags & AB_CHECK_IMMOBILE)
- RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(update_status_on_signal))
if(check_flags & AB_CHECK_HANDS_BLOCKED)
- RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(update_status_on_signal))
if(check_flags & AB_CHECK_LYING)
- RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(update_status_on_signal))
if(owner_has_control)
GiveAction(grant_to)
@@ -106,6 +118,7 @@
if(owner)
SEND_SIGNAL(src, COMSIG_ACTION_REMOVED, owner)
+ SEND_SIGNAL(owner, COMSIG_MOB_REMOVED_ACTION, src)
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
// Clean up our check_flag signals
@@ -156,49 +169,128 @@
return FALSE
return TRUE
-/datum/action/proc/UpdateButtons(status_only, force)
- for(var/datum/hud/hud in viewers)
- var/atom/movable/screen/movable/button = viewers[hud]
- UpdateButton(button, status_only, force)
+/// Builds / updates all buttons we have shared or given out
+/datum/action/proc/build_all_button_icons(update_flags = ALL, force)
+ for(var/datum/hud/hud as anything in viewers)
+ build_button_icon(viewers[hud], update_flags, force)
-/datum/action/proc/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
+/**
+ * Builds the icon of the button.
+ *
+ * Concept:
+ * - Underlay (Background icon)
+ * - Icon (button icon)
+ * - Maptext
+ * - Overlay (Background border)
+ *
+ * button - which button we are modifying the icon of
+ * force - whether we're forcing a full update
+ */
+/datum/action/proc/build_button_icon(atom/movable/screen/movable/action_button/button, update_flags = ALL, force = FALSE)
if(!button)
return
- if(!status_only)
- button.name = name
+
+ if(update_flags & UPDATE_BUTTON_NAME)
+ update_button_name(button, force)
+
+ if(update_flags & UPDATE_BUTTON_BACKGROUND)
+ apply_button_background(button, force)
+
+ if(update_flags & UPDATE_BUTTON_ICON)
+ apply_button_icon(button, force)
+
+ if(update_flags & UPDATE_BUTTON_OVERLAY)
+ apply_button_overlay(button, force)
+
+ if(update_flags & UPDATE_BUTTON_STATUS)
+ update_button_status(button, force)
+
+/**
+ * Updates the name and description of the button to match our action name and discription.
+ *
+ * current_button - what button are we editing?
+ * force - whether an update is forced regardless of existing status
+ */
+/datum/action/proc/update_button_name(atom/movable/screen/movable/action_button/button, force = FALSE)
+ button.name = name
+ if(desc)
button.desc = desc
- if(owner?.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND)
- var/list/settings = owner.hud_used.get_action_buttons_icons()
- if(button.icon != settings["bg_icon"])
- button.icon = settings["bg_icon"]
- if(button.icon_state != settings["bg_state"])
- button.icon_state = settings["bg_state"]
- else
- if(button.icon != button_icon)
- button.icon = button_icon
- if(button.icon_state != background_icon_state)
- button.icon_state = background_icon_state
- ApplyIcon(button, force)
+/**
+ * Creates the background underlay for the button
+ *
+ * current_button - what button are we editing?
+ * force - whether an update is forced regardless of existing status
+ */
+/datum/action/proc/apply_button_background(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+ if(!background_icon || !background_icon_state || (current_button.active_underlay_icon_state == background_icon_state && !force))
+ return
- if(button_overlay_state)
- button.cut_overlay(button.button_overlay)
- button.button_overlay = mutable_appearance(icon = 'icons/hud/actions.dmi', icon_state = button_overlay_state)
- button.add_overlay(button.button_overlay)
+ // What icons we use for our background
+ var/list/icon_settings = list(
+ // The icon file
+ "bg_icon" = background_icon,
+ // The icon state, if is_action_active() returns FALSE
+ "bg_state" = background_icon_state,
+ // The icon state, if is_action_active() returns TRUE
+ "bg_state_active" = background_icon_state,
+ )
- var/available = IsAvailable()
- if(available)
- button.color = rgb(255,255,255,255)
+ // If background_icon_state is ACTION_BUTTON_DEFAULT_BACKGROUND instead use our hud's action button scheme
+ if(background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND && owner?.hud_used)
+ icon_settings = owner.hud_used.get_action_buttons_icons()
+
+ // Determine which icon to use
+ var/used_icon_key = is_action_active(current_button) ? "bg_state_active" : "bg_state"
+
+ // Make the underlay
+ current_button.underlays.Cut()
+ current_button.underlays += image(icon = icon_settings["bg_icon"], icon_state = icon_settings[used_icon_key])
+ current_button.active_underlay_icon_state = icon_settings[used_icon_key]
+
+/**
+ * Applies our button icon and icon state to the button
+ *
+ * current_button - what button are we editing?
+ * force - whether an update is forced regardless of existing status
+ */
+/datum/action/proc/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+ if(!button_icon || !button_icon_state || (current_button.icon_state == button_icon_state && !force))
+ return
+
+ current_button.icon = button_icon
+ current_button.icon_state = button_icon_state
+
+/**
+ * Applies any overlays to our button
+ *
+ * current_button - what button are we editing?
+ * force - whether an update is forced regardless of existing status
+ */
+/datum/action/proc/apply_button_overlay(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+
+ SEND_SIGNAL(src, COMSIG_ACTION_OVERLAY_APPLY, current_button, force)
+
+ if(!overlay_icon || !overlay_icon_state || (current_button.active_overlay_icon_state == overlay_icon_state && !force))
+ return
+
+ current_button.cut_overlay(current_button.button_overlay)
+ current_button.button_overlay = mutable_appearance(icon = overlay_icon, icon_state = overlay_icon_state)
+ current_button.add_overlay(current_button.button_overlay)
+ current_button.active_overlay_icon_state = overlay_icon_state
+
+/**
+ * Any other miscellaneous "status" updates within the action button is handled here,
+ * such as redding out when unavailable or modifying maptext.
+ *
+ * current_button - what button are we editing?
+ * force - whether an update is forced regardless of existing status
+ */
+/datum/action/proc/update_button_status(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+ if(IsAvailable())
+ current_button.color = rgb(255,255,255,255)
else
- button.color = transparent_when_unavailable ? rgb(128,0,0,128) : rgb(128,0,0)
- return available
-
-/// Applies our button icon over top the background icon of the action
-/datum/action/proc/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force = FALSE)
- if(icon_icon && button_icon_state && ((current_button.button_icon_state != button_icon_state) || force))
- current_button.cut_overlays(TRUE)
- current_button.add_overlay(mutable_appearance(icon_icon, button_icon_state))
- current_button.button_icon_state = button_icon_state
+ current_button.color = transparent_when_unavailable ? rgb(128,0,0,128) : rgb(128,0,0)
/// Gives our action to the passed viewer.
/// Puts our action in their actions list and shows them the button.
@@ -216,7 +308,7 @@
if(!our_hud || viewers[our_hud]) // There's no point in this if you have no hud in the first place
return
- var/atom/movable/screen/movable/action_button/button = CreateButton()
+ var/atom/movable/screen/movable/action_button/button = create_button()
SetId(button, viewer)
button.our_hud = our_hud
@@ -236,13 +328,10 @@
qdel(button)
/// Creates an action button movable for the passed mob, and returns it.
-/datum/action/proc/CreateButton()
+/datum/action/proc/create_button()
var/atom/movable/screen/movable/action_button/button = new()
button.linked_action = src
- button.name = name
- button.actiontooltipstyle = buttontooltipstyle
- if(desc)
- button.desc = desc
+ build_button_icon(button, ALL, TRUE)
return button
/datum/action/proc/SetId(atom/movable/screen/movable/action_button/our_button, mob/owner)
@@ -262,11 +351,30 @@
our_button.id = bitflag
return
-/// A general use signal proc that reacts to an event and updates our button icon in accordance
-/datum/action/proc/update_icon_on_signal(datum/source)
+/// Updates our buttons if our target's icon was updated
+/datum/action/proc/on_target_icon_update(datum/source, updates, updated)
SIGNAL_HANDLER
- UpdateButtons()
+ var/update_flag = NONE
+ var/forced = FALSE
+ if(updates & UPDATE_ICON_STATE)
+ update_flag |= UPDATE_BUTTON_ICON
+ forced = TRUE
+ if(updates & UPDATE_OVERLAYS)
+ update_flag |= UPDATE_BUTTON_OVERLAY
+ forced = TRUE
+ if(updates & (UPDATE_NAME|UPDATE_DESC))
+ update_flag |= UPDATE_BUTTON_NAME
+ // Status is not relevant, and background is not relevant. Neither will change
+
+ // Force the update if an icon state or overlay change was done
+ build_all_button_icons(update_flag, forced)
+
+/// 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)
+ SIGNAL_HANDLER
+
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
/// Signal proc for COMSIG_MIND_TRANSFERRED - for minds, transfers our action to our new mob on mind transfer
/datum/action/proc/on_target_mind_swapped(datum/mind/source, mob/old_current)
@@ -274,3 +382,7 @@
// Grant() calls Remove() from the existing owner so we're covered on that
Grant(source.current)
+
+/// Checks if our action is actively selected. Used for selecting icons primarily.
+/datum/action/proc/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ return FALSE
diff --git a/code/datums/actions/cooldown_action.dm b/code/datums/actions/cooldown_action.dm
index 91abc2f7b07..f04000f64a7 100644
--- a/code/datums/actions/cooldown_action.dm
+++ b/code/datums/actions/cooldown_action.dm
@@ -17,14 +17,6 @@
var/next_melee_use_time = 0
/// Whether or not you want the cooldown for the ability to display in text form
var/text_cooldown = TRUE
- /// Setting for intercepting clicks before activating the ability
- var/click_to_activate = FALSE
- /// What icon to replace our mouse cursor with when active. Optional, Requires click_to_activate
- var/ranged_mousepointer
- /// The cooldown added onto the user's next click. Requires click_to_activate
- var/click_cd_override = CLICK_CD_CLICK_ABILITY
- /// If TRUE, we will unset after using our click intercept. Requires click_to_activate
- var/unset_after_click = TRUE
/// Shares cooldowns with other abiliies, bitflag
var/shared_cooldown
/// List of prerequisite actions that are used in this sequenced ability, you cannot put other sequenced abilities in this
@@ -32,22 +24,86 @@
/// List of prerequisite actions that have been initialized
var/list/initialized_actions
+ // These are only used for click_to_activate actions
+ /// Setting for intercepting clicks before activating the ability
+ var/click_to_activate = FALSE
+ /// The cooldown added onto the user's next click.
+ var/click_cd_override = CLICK_CD_CLICK_ABILITY
+ /// If TRUE, we will unset after using our click intercept.
+ var/unset_after_click = TRUE
+ /// What icon to replace our mouse cursor with when active. Optional
+ var/ranged_mousepointer
+ /// The base icon_state of this action's background
+ var/base_background_icon_state
+ /// The icon state the background uses when active
+ var/active_background_icon_state
+ /// The base icon_state of the overlay we apply
+ var/base_overlay_icon_state
+ /// The active icon_state of the overlay we apply
+ var/active_overlay_icon_state
+ /// The base icon state of the spell's button icon, used for editing the icon "off"
+ var/base_icon_state
+ /// The active icon state of the spell's button icon, used for editing the icon "on"
+ var/active_icon_state
+
/datum/action/cooldown/New(Target, original = TRUE)
- ..()
+ . = ..()
+ if(active_background_icon_state)
+ base_background_icon_state ||= background_icon_state
+ if(active_overlay_icon_state)
+ base_overlay_icon_state ||= overlay_icon_state
+ if(active_icon_state)
+ base_icon_state ||= button_icon_state
+
if(isnull(melee_cooldown_time))
melee_cooldown_time = cooldown_time
+
if(original)
create_sequence_actions()
-/datum/action/cooldown/CreateButton()
+/datum/action/cooldown/create_button()
var/atom/movable/screen/movable/action_button/button = ..()
button.maptext = ""
- button.maptext_x = 8
- button.maptext_y = 0
+ button.maptext_x = 6
+ button.maptext_y = 2
button.maptext_width = 24
button.maptext_height = 12
return button
+/datum/action/cooldown/update_button_status(atom/movable/screen/movable/action_button/button, force = FALSE)
+ . = ..()
+ var/time_left = max(next_use_time - world.time, 0)
+ if(!text_cooldown || !owner || time_left == 0 || time_left >= COOLDOWN_NO_DISPLAY_TIME)
+ button.maptext = ""
+ else
+ button.maptext = MAPTEXT("[round(time_left/10, 0.1)]")
+
+ if(!IsAvailable() || !is_action_active(button))
+ return
+ // If we don't change the icon state, or don't apply a special overlay,
+ if(active_background_icon_state || active_icon_state || active_overlay_icon_state)
+ return
+ // ...we need to show it's active somehow. So, make it greeeen
+ button.color = COLOR_GREEN
+
+/datum/action/cooldown/apply_button_background(atom/movable/screen/movable/action_button/current_button, force)
+ if(active_background_icon_state)
+ background_icon_state = is_action_active(current_button) ? active_background_icon_state : base_background_icon_state
+ return ..()
+
+/datum/action/cooldown/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
+ if(active_icon_state)
+ button_icon_state = is_action_active(current_button) ? active_icon_state : base_icon_state
+ return ..()
+
+/datum/action/cooldown/apply_button_overlay(atom/movable/screen/movable/action_button/current_button, force)
+ if(active_overlay_icon_state)
+ overlay_icon_state = is_action_active(current_button) ? active_overlay_icon_state : base_overlay_icon_state
+ return ..()
+
+/datum/action/cooldown/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ return click_to_activate && current_button.our_hud?.mymob?.click_intercept == src
+
/datum/action/cooldown/Destroy()
QDEL_LIST(initialized_actions)
return ..()
@@ -56,7 +112,7 @@
. = ..()
if(!owner)
return
- UpdateButtons()
+ build_all_button_icons()
if(next_use_time > world.time)
START_PROCESSING(SSfastprocess, src)
RegisterSignal(granted_to, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(handle_melee_attack))
@@ -110,7 +166,7 @@
next_use_time = world.time + override_cooldown_time
else
next_use_time = world.time + cooldown_time
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
START_PROCESSING(SSfastprocess, src)
/// Starts a cooldown time for other abilities that share a cooldown with this. Has some niche usage with more complicated attack ai!
@@ -196,18 +252,6 @@
total_delay += initialized_actions[ability]
StartCooldown()
-/datum/action/cooldown/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
- . = ..()
- if(!button)
- return
- var/time_left = max(next_use_time - world.time, 0)
- if(text_cooldown && time_left < COOLDOWN_NO_DISPLAY_TIME)
- button.maptext = MAPTEXT("[round(time_left/10, 0.1)]")
- if(!owner || time_left == 0 || time_left >= COOLDOWN_NO_DISPLAY_TIME)
- button.maptext = ""
- if(IsAvailable() && (button.our_hud.mymob.click_intercept == src))
- button.color = COLOR_GREEN
-
/// Cancels melee attacks if they are on cooldown.
/datum/action/cooldown/proc/handle_melee_attack(mob/source, mob/target)
SIGNAL_HANDLER
@@ -216,11 +260,11 @@
/datum/action/cooldown/process()
if(!owner || (next_use_time - world.time) <= 0)
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
STOP_PROCESSING(SSfastprocess, src)
return
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
/**
* Set our action as the click override on the passed mob.
@@ -232,7 +276,7 @@
if(ranged_mousepointer)
on_who.client?.mouse_override_icon = ranged_mousepointer
on_who.update_mouse_pointer()
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
return TRUE
/**
@@ -248,7 +292,7 @@
if(ranged_mousepointer)
on_who.client?.mouse_override_icon = initial(on_who.client?.mouse_override_icon)
on_who.update_mouse_pointer()
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
return TRUE
/// Formats the action to be returned to the stat panel.
diff --git a/code/datums/actions/innate_action.dm b/code/datums/actions/innate_action.dm
index 08e67678857..c5271033bc6 100644
--- a/code/datums/actions/innate_action.dm
+++ b/code/datums/actions/innate_action.dm
@@ -21,17 +21,28 @@
unset_ranged_ability(owner, disable_text)
else
set_ranged_ability(owner, enable_text)
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
return TRUE
// We're not a click action (we're a toggle or otherwise)
else
- if(active)
+ var/active_status = active
+ if(active_status)
Deactivate()
else
Activate()
+ if(active != active_status)
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
+
return TRUE
+/datum/action/innate/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ if(click_action)
+ return current_button.our_hud?.mymob?.click_intercept == src
+ else
+ return active
+
/datum/action/innate/proc/Activate()
return
diff --git a/code/datums/actions/item_action.dm b/code/datums/actions/item_action.dm
index c2f69d00a19..6d7beec65e2 100644
--- a/code/datums/actions/item_action.dm
+++ b/code/datums/actions/item_action.dm
@@ -3,34 +3,31 @@
name = "Item Action"
check_flags = AB_CHECK_HANDS_BLOCKED|AB_CHECK_CONSCIOUS
button_icon_state = null
- // If you want to override the normal icon being the item
- // then change this to an icon state
+
+/datum/action/item_action/New(Target)
+ . = ..()
+
+ // If our button state is null, use the target's icon instead
+ if(target && isnull(button_icon_state))
+ AddComponent(/datum/component/action_item_overlay, target)
+
+/datum/action/item_action/vv_edit_var(var_name, var_value)
+ . = ..()
+ if(!. || !target)
+ return
+
+ if(var_name == NAMEOF(src, button_icon_state))
+ // If someone vv's our icon either add or remove the component
+ if(isnull(var_name))
+ AddComponent(/datum/component/action_item_overlay, target)
+ else
+ qdel(GetComponent(/datum/component/action_item_overlay))
/datum/action/item_action/Trigger(trigger_flags)
. = ..()
if(!.)
return FALSE
if(target)
- var/obj/item/I = target
- I.ui_action_click(owner, src)
+ var/obj/item/item_target = target
+ item_target.ui_action_click(owner, src)
return TRUE
-
-/datum/action/item_action/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
- var/obj/item/item_target = target
- if(button_icon && button_icon_state)
- // If set, use the custom icon that we set instead
- // of the item appearance
- ..()
- else if((target && current_button.appearance_cache != item_target.appearance) || force) //replace with /ref comparison if this is not valid.
- var/old_layer = item_target.layer
- var/old_plane = item_target.plane
- // reset the x & y offset so that item is aligned center
- item_target.pixel_x = 0
- item_target.pixel_y = 0
- item_target.layer = FLOAT_LAYER //AAAH
- item_target.plane = FLOAT_PLANE //^ what that guy said
- current_button.cut_overlays()
- current_button.add_overlay(item_target)
- item_target.layer = old_layer
- item_target.plane = old_plane
- current_button.appearance_cache = item_target.appearance
diff --git a/code/datums/actions/items/beam_rifle.dm b/code/datums/actions/items/beam_rifle.dm
index 3af5d13690d..f0b23ed9608 100644
--- a/code/datums/actions/items/beam_rifle.dm
+++ b/code/datums/actions/items/beam_rifle.dm
@@ -1,12 +1,14 @@
/datum/action/item_action/zoom_speed_action
name = "Toggle Zooming Speed"
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "projectile"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/item_action/zoom_lock_action
name = "Switch Zoom Mode"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "zoom_mode"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
diff --git a/code/datums/actions/items/beserk.dm b/code/datums/actions/items/beserk.dm
index 9f8519906a0..a3d89d5f239 100644
--- a/code/datums/actions/items/beserk.dm
+++ b/code/datums/actions/items/beserk.dm
@@ -1,9 +1,10 @@
/datum/action/item_action/berserk_mode
name = "Berserk"
desc = "Increase your movement and melee speed while also increasing your melee armor for a short amount of time."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "berserk_mode"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
/datum/action/item_action/berserk_mode/Trigger(trigger_flags)
if(istype(target, /obj/item/clothing/head/hooded/berserker))
diff --git a/code/datums/actions/items/boot_dash.dm b/code/datums/actions/items/boot_dash.dm
index 5768a79db63..be206aec599 100644
--- a/code/datums/actions/items/boot_dash.dm
+++ b/code/datums/actions/items/boot_dash.dm
@@ -2,7 +2,7 @@
/datum/action/item_action/bhop
name = "Activate Jump Boots"
desc = "Activates the jump boot's internal propulsion system, allowing the user to dash over 4-wide gaps."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "jetboot"
/datum/action/item_action/bhop/brocket
diff --git a/code/datums/actions/items/cult_dagger.dm b/code/datums/actions/items/cult_dagger.dm
index 73deb6185f3..76e92c7b231 100644
--- a/code/datums/actions/items/cult_dagger.dm
+++ b/code/datums/actions/items/cult_dagger.dm
@@ -2,10 +2,12 @@
/datum/action/item_action/cult_dagger
name = "Draw Blood Rune"
desc = "Use the ritual dagger to create a powerful blood rune"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "draw"
buttontooltipstyle = "cult"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
default_button_position = "6:157,4:-2"
/datum/action/item_action/cult_dagger/Grant(mob/grant_to)
diff --git a/code/datums/actions/items/set_internals.dm b/code/datums/actions/items/set_internals.dm
index b811a010079..dd1395a6e51 100644
--- a/code/datums/actions/items/set_internals.dm
+++ b/code/datums/actions/items/set_internals.dm
@@ -1,14 +1,8 @@
/datum/action/item_action/set_internals
name = "Set Internals"
default_button_position = SCRN_OBJ_INSERT_FIRST
- button_overlay_state = "ab_goldborder"
+ overlay_icon_state = "ab_goldborder"
-/datum/action/item_action/set_internals/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
- . = ..()
- if(!. || !button) // no button available
- return
- if(!iscarbon(owner))
- return
+/datum/action/item_action/set_internals/is_action_active(atom/movable/screen/movable/action_button/current_button)
var/mob/living/carbon/carbon_owner = owner
- if(target == carbon_owner.internal)
- button.icon_state = "template_active"
+ return istype(carbon_owner) && target == carbon_owner.internal
diff --git a/code/datums/actions/items/stealth_box.dm b/code/datums/actions/items/stealth_box.dm
index 99a685728c1..9d1c6276511 100644
--- a/code/datums/actions/items/stealth_box.dm
+++ b/code/datums/actions/items/stealth_box.dm
@@ -4,7 +4,8 @@
desc = "Find inner peace, here, in the box."
check_flags = AB_CHECK_HANDS_BLOCKED|AB_CHECK_IMMOBILE|AB_CHECK_CONSCIOUS
background_icon_state = "bg_agent"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ overlay_icon_state = "bg_agent_border"
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "deploy_box"
///The type of closet this action spawns.
var/boxtype = /obj/structure/closet/cardboard/agent
diff --git a/code/datums/actions/items/summon_stickmen.dm b/code/datums/actions/items/summon_stickmen.dm
index c825c72dc51..e3189f9675e 100644
--- a/code/datums/actions/items/summon_stickmen.dm
+++ b/code/datums/actions/items/summon_stickmen.dm
@@ -2,5 +2,5 @@
/datum/action/item_action/stickmen
name = "Summon Stick Minions"
desc = "Allows you to summon faithful stickmen allies to aide you in battle."
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "art_summon"
diff --git a/code/datums/actions/items/toggles.dm b/code/datums/actions/items/toggles.dm
index 92804adedf6..956238ae166 100644
--- a/code/datums/actions/items/toggles.dm
+++ b/code/datums/actions/items/toggles.dm
@@ -40,10 +40,10 @@
/datum/action/item_action/toggle_spacesuit
name = "Toggle Suit Thermal Regulator"
- icon_icon = 'icons/mob/actions/actions_spacesuit.dmi'
+ button_icon = 'icons/mob/actions/actions_spacesuit.dmi'
button_icon_state = "thermal_off"
-/datum/action/item_action/toggle_spacesuit/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
+/datum/action/item_action/toggle_spacesuit/apply_button_icon(atom/movable/screen/movable/action_button/button, force)
var/obj/item/clothing/suit/space/suit = target
if(istype(suit))
button_icon_state = "thermal_[suit.thermal_on ? "on" : "off"]"
@@ -83,30 +83,18 @@
/datum/action/item_action/wheelys
name = "Toggle Wheels"
desc = "Pops out or in your shoes' wheels."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "wheelys"
/datum/action/item_action/kindle_kicks
name = "Activate Kindle Kicks"
desc = "Kick you feet together, activating the lights in your Kindle Kicks."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "kindleKicks"
/datum/action/item_action/storage_gather_mode
name = "Switch gathering mode"
desc = "Switches the gathering mode of a storage object."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
- button_icon_state = "storage_gather_switch"
-
-/datum/action/item_action/storage_gather_mode/ApplyIcon(atom/movable/screen/movable/action_button/current_button)
- . = ..()
- var/obj/item/item_target = target
- var/old_layer = item_target.layer
- var/old_plane = item_target.plane
- item_target.layer = FLOAT_LAYER //AAAH
- item_target.plane = FLOAT_PLANE //^ what that guy said
- current_button.cut_overlays()
- current_button.add_overlay(target)
- item_target.layer = old_layer
- item_target.plane = old_plane
- current_button.appearance_cache = item_target.appearance
+ background_icon = 'icons/mob/actions/actions_items.dmi'
+ background_icon_state = "storage_gather_switch"
+ overlay_icon_state = "bg_tech_border"
diff --git a/code/datums/actions/items/vortex_recall.dm b/code/datums/actions/items/vortex_recall.dm
index 625c04a4199..50702933f1d 100644
--- a/code/datums/actions/items/vortex_recall.dm
+++ b/code/datums/actions/items/vortex_recall.dm
@@ -1,7 +1,7 @@
/datum/action/item_action/vortex_recall
name = "Vortex Recall"
desc = "Recall yourself, and anyone nearby, to an attuned hierophant beacon at any time.
If the beacon is still attached, will detach it."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "vortex_recall"
/datum/action/item_action/vortex_recall/IsAvailable(feedback = FALSE)
diff --git a/code/datums/actions/mobs/adjust_vision.dm b/code/datums/actions/mobs/adjust_vision.dm
index ed9f32296c1..a54688a2eb9 100644
--- a/code/datums/actions/mobs/adjust_vision.dm
+++ b/code/datums/actions/mobs/adjust_vision.dm
@@ -2,9 +2,10 @@
/datum/action/adjust_vision
name = "Adjust Vision"
desc = "See better in the dark. Or don't. Your advanced vision allows either."
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = "adjust_vision"
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/adjust_vision/Grant(mob/living/grant_to)
. = ..()
diff --git a/code/datums/actions/mobs/blood_warp.dm b/code/datums/actions/mobs/blood_warp.dm
index c4b2fc25c94..823f756d7af 100644
--- a/code/datums/actions/mobs/blood_warp.dm
+++ b/code/datums/actions/mobs/blood_warp.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/blood_warp
name = "Blood Warp"
- icon_icon = 'icons/effects/blood.dmi'
+ button_icon = 'icons/effects/blood.dmi'
button_icon_state = "floor1"
desc = "Allows you to teleport to blood at a clicked position."
cooldown_time = 0
diff --git a/code/datums/actions/mobs/charge.dm b/code/datums/actions/mobs/charge.dm
index beb9ab63d26..2d42b50958b 100644
--- a/code/datums/actions/mobs/charge.dm
+++ b/code/datums/actions/mobs/charge.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/charge
name = "Charge"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Allows you to charge at a chosen position."
cooldown_time = 1.5 SECONDS
@@ -214,7 +214,7 @@
/datum/action/cooldown/mob_cooldown/charge/hallucination_charge
name = "Hallucination Charge"
- icon_icon = 'icons/effects/bubblegum.dmi'
+ button_icon = 'icons/effects/bubblegum.dmi'
button_icon_state = "smack ya one"
desc = "Allows you to create hallucinations that charge around your target."
cooldown_time = 2 SECONDS
@@ -273,7 +273,7 @@
/datum/action/cooldown/mob_cooldown/charge/hallucination_charge/hallucination_surround
name = "Surround Target"
- icon_icon = 'icons/turf/walls/wall.dmi'
+ button_icon = 'icons/turf/walls/wall.dmi'
button_icon_state = "wall-0"
desc = "Allows you to create hallucinations that charge around your target."
charge_delay = 0.6 SECONDS
diff --git a/code/datums/actions/mobs/dash.dm b/code/datums/actions/mobs/dash.dm
index 21ac04aa9c3..ddb814eb24f 100644
--- a/code/datums/actions/mobs/dash.dm
+++ b/code/datums/actions/mobs/dash.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/dash
name = "Dash"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Allows you to dash towards a position."
cooldown_time = 1.5 SECONDS
diff --git a/code/datums/actions/mobs/fire_breath.dm b/code/datums/actions/mobs/fire_breath.dm
index 34398473de4..57962035a24 100644
--- a/code/datums/actions/mobs/fire_breath.dm
+++ b/code/datums/actions/mobs/fire_breath.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/fire_breath
name = "Fire Breath"
- icon_icon = 'icons/obj/wizard.dmi'
+ button_icon = 'icons/obj/wizard.dmi'
button_icon_state = "fireball"
desc = "Allows you to shoot fire towards a target."
cooldown_time = 3 SECONDS
@@ -45,7 +45,7 @@
/datum/action/cooldown/mob_cooldown/fire_breath/mass_fire
name = "Mass Fire"
- icon_icon = 'icons/effects/fire.dmi'
+ button_icon = 'icons/effects/fire.dmi'
button_icon_state = "1"
desc = "Allows you to shoot fire in all directions."
cooldown_time = 3 SECONDS
diff --git a/code/datums/actions/mobs/lava_swoop.dm b/code/datums/actions/mobs/lava_swoop.dm
index af1cafa29e9..6a769a56758 100644
--- a/code/datums/actions/mobs/lava_swoop.dm
+++ b/code/datums/actions/mobs/lava_swoop.dm
@@ -3,7 +3,7 @@
/datum/action/cooldown/mob_cooldown/lava_swoop
name = "Lava Swoop"
- icon_icon = 'icons/effects/effects.dmi'
+ button_icon = 'icons/effects/effects.dmi'
button_icon_state = "lavastaff_warn"
desc = "Allows you to chase a target while raining lava down."
cooldown_time = 4 SECONDS
diff --git a/code/datums/actions/mobs/meteors.dm b/code/datums/actions/mobs/meteors.dm
index c730335600e..0c95b6c8e17 100644
--- a/code/datums/actions/mobs/meteors.dm
+++ b/code/datums/actions/mobs/meteors.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/meteors
name = "Meteors"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Allows you to rain meteors down around yourself."
cooldown_time = 3 SECONDS
diff --git a/code/datums/actions/mobs/mobcooldown.dm b/code/datums/actions/mobs/mobcooldown.dm
index dc59def0e2d..17561f2f45a 100644
--- a/code/datums/actions/mobs/mobcooldown.dm
+++ b/code/datums/actions/mobs/mobcooldown.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown
name = "Standard Mob Cooldown Ability"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Click this ability to attack."
check_flags = AB_CHECK_CONSCIOUS
diff --git a/code/datums/actions/mobs/projectileattack.dm b/code/datums/actions/mobs/projectileattack.dm
index 45ee1dff6b0..468e498e959 100644
--- a/code/datums/actions/mobs/projectileattack.dm
+++ b/code/datums/actions/mobs/projectileattack.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/projectile_attack
name = "Projectile Attack"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Fires a set of projectiles at a selected target."
cooldown_time = 1.5 SECONDS
@@ -54,7 +54,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/rapid_fire
name = "Rapid Fire"
- icon_icon = 'icons/obj/weapons/guns/energy.dmi'
+ button_icon = 'icons/obj/weapons/guns/energy.dmi'
button_icon_state = "kineticgun"
desc = "Fires projectiles repeatedly at a given target."
cooldown_time = 1.5 SECONDS
@@ -76,7 +76,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/rapid_fire/shrapnel
name = "Shrapnel Fire"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Fires projectiles that will split into shrapnel after a period of time."
cooldown_time = 6 SECONDS
@@ -111,7 +111,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/spiral_shots
name = "Spiral Shots"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Fires projectiles in a spiral pattern."
cooldown_time = 3 SECONDS
@@ -152,7 +152,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/random_aoe
name = "All Directions"
- icon_icon = 'icons/effects/effects.dmi'
+ button_icon = 'icons/effects/effects.dmi'
button_icon_state = "at_shield2"
desc = "Fires projectiles in all directions."
cooldown_time = 3 SECONDS
@@ -174,7 +174,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/shotgun_blast
name = "Shotgun Fire"
- icon_icon = 'icons/obj/weapons/guns/ballistic.dmi'
+ button_icon = 'icons/obj/weapons/guns/ballistic.dmi'
button_icon_state = "shotgun"
desc = "Fires projectiles in a shotgun pattern."
cooldown_time = 2 SECONDS
@@ -222,7 +222,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/dir_shots
name = "Directional Shots"
- icon_icon = 'icons/obj/weapons/guns/ballistic.dmi'
+ button_icon = 'icons/obj/weapons/guns/ballistic.dmi'
button_icon_state = "pistol"
desc = "Fires projectiles in specific directions."
cooldown_time = 4 SECONDS
@@ -267,7 +267,7 @@
/datum/action/cooldown/mob_cooldown/projectile_attack/kinetic_accelerator
name = "Fire Kinetic Accelerator"
- icon_icon = 'icons/obj/weapons/guns/energy.dmi'
+ button_icon = 'icons/obj/weapons/guns/energy.dmi'
button_icon_state = "kineticgun"
desc = "Fires a kinetic accelerator projectile at the target."
cooldown_time = 1.5 SECONDS
diff --git a/code/datums/actions/mobs/sequences/dash_attack.dm b/code/datums/actions/mobs/sequences/dash_attack.dm
index 8d0a2cc3444..b5fff4cb492 100644
--- a/code/datums/actions/mobs/sequences/dash_attack.dm
+++ b/code/datums/actions/mobs/sequences/dash_attack.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/dash_attack
name = "Dashing And Attacking"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Allows you to dash and fire at a target simultaneously."
cooldown_time = 3 SECONDS
diff --git a/code/datums/actions/mobs/sequences/projectile.dm b/code/datums/actions/mobs/sequences/projectile.dm
index 670ee2417ff..221639d5ace 100644
--- a/code/datums/actions/mobs/sequences/projectile.dm
+++ b/code/datums/actions/mobs/sequences/projectile.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/direct_and_aoe
name = "Direct And AoE Firing"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
desc = "Allows you to shoot directly at a target while also firing around you."
cooldown_time = 12 SECONDS
diff --git a/code/datums/actions/mobs/sign_language.dm b/code/datums/actions/mobs/sign_language.dm
index 1a8446ffea4..982a43c4d39 100644
--- a/code/datums/actions/mobs/sign_language.dm
+++ b/code/datums/actions/mobs/sign_language.dm
@@ -11,22 +11,19 @@
*/
/datum/action/innate/sign_language
name = "Sign Language"
- icon_icon = 'icons/hud/actions.dmi'
+ button_icon = 'icons/hud/actions.dmi'
button_icon_state = "sign_language"
desc = "Allows you to communicate via sign language."
owner_has_control = FALSE
-/datum/action/innate/sign_language/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force)
- . = ..()
- if(!. || !button)
- return
- if(HAS_TRAIT(owner, TRAIT_SIGN_LANG))
- button.icon_state = "template_active"
- else
- button.icon_state = "template"
+/datum/action/innate/sign_language/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ return HAS_TRAIT(owner, TRAIT_SIGN_LANG)
/datum/action/innate/sign_language/Grant(mob/living/carbon/grant_to)
- ..()
+ . = ..()
+ if(!owner)
+ return
+
if (HAS_TRAIT(grant_to, TRAIT_MUTE))
RegisterSignal(grant_to, SIGNAL_REMOVETRAIT(TRAIT_MUTE), PROC_REF(on_unmuted))
// Convenience. Mute Carbons can only speak with sign language.
@@ -38,7 +35,7 @@
show_action()
/datum/action/innate/sign_language/Remove(mob/living/carbon/grant_to)
- ..()
+ . = ..()
UnregisterSignal(grant_to, list(
SIGNAL_ADDTRAIT(TRAIT_SIGN_LANG),
SIGNAL_REMOVETRAIT(TRAIT_SIGN_LANG),
@@ -60,8 +57,8 @@
/// Shows the linked action to the owner Carbon.
/datum/action/innate/sign_language/proc/show_action()
owner_has_control = TRUE
- RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SIGN_LANG), PROC_REF(update_icon_on_signal))
- RegisterSignal(owner, SIGNAL_REMOVETRAIT(TRAIT_SIGN_LANG), PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SIGN_LANG), PROC_REF(update_status_on_signal))
+ RegisterSignal(owner, SIGNAL_REMOVETRAIT(TRAIT_SIGN_LANG), PROC_REF(update_status_on_signal))
GiveAction(owner)
/// Hides the linked action from the owner Carbon.
diff --git a/code/datums/actions/mobs/small_sprite.dm b/code/datums/actions/mobs/small_sprite.dm
index 21a2c920ee5..b53b46fe43a 100644
--- a/code/datums/actions/mobs/small_sprite.dm
+++ b/code/datums/actions/mobs/small_sprite.dm
@@ -2,9 +2,10 @@
/datum/action/small_sprite
name = "Toggle Giant Sprite"
desc = "Others will always see you as giant."
- icon_icon = 'icons/mob/actions/actions_xeno.dmi'
+ button_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "smallqueen"
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
var/small = FALSE
var/small_icon
var/small_icon_state
@@ -14,7 +15,7 @@
small_icon_state = "alienq"
/datum/action/small_sprite/megafauna
- icon_icon = 'icons/mob/actions/actions_xeno.dmi'
+ button_icon = 'icons/mob/actions/actions_xeno.dmi'
small_icon = 'icons/mob/simple/lavaland/lavaland_monsters.dmi'
/datum/action/small_sprite/megafauna/drake
@@ -33,11 +34,13 @@
small_icon = 'icons/mob/simple/jungle/arachnid.dmi'
small_icon_state = "arachnid_mini"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
/datum/action/small_sprite/space_dragon
small_icon = 'icons/mob/simple/carp.dmi'
small_icon_state = "carp"
- icon_icon = 'icons/mob/simple/carp.dmi'
+ button_icon = 'icons/mob/simple/carp.dmi'
button_icon_state = "carp"
/datum/action/small_sprite/Trigger(trigger_flags)
diff --git a/code/datums/actions/mobs/transform_weapon.dm b/code/datums/actions/mobs/transform_weapon.dm
index d2fd99e5610..884f4fa36dc 100644
--- a/code/datums/actions/mobs/transform_weapon.dm
+++ b/code/datums/actions/mobs/transform_weapon.dm
@@ -1,6 +1,6 @@
/datum/action/cooldown/mob_cooldown/transform_weapon
name = "Transform Weapon"
- icon_icon = 'icons/obj/lavaland/artefacts.dmi'
+ button_icon = 'icons/obj/lavaland/artefacts.dmi'
button_icon_state = "cleaving_saw"
desc = "Transform weapon into a different state."
cooldown_time = 5 SECONDS
diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm
index 4de566d7a18..4223fd471ff 100644
--- a/code/datums/brain_damage/imaginary_friend.dm
+++ b/code/datums/brain_damage/imaginary_friend.dm
@@ -430,8 +430,9 @@
/datum/action/innate/imaginary_join
name = "Join"
desc = "Join your owner, following them from inside their mind."
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
background_icon_state = "bg_revenant"
+ overlay_icon_state = "bg_revenant_border"
button_icon_state = "join"
/datum/action/innate/imaginary_join/Activate()
@@ -441,8 +442,9 @@
/datum/action/innate/imaginary_hide
name = "Hide"
desc = "Hide yourself from your owner's sight."
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
background_icon_state = "bg_revenant"
+ overlay_icon_state = "bg_revenant_border"
button_icon_state = "hide"
/datum/action/innate/imaginary_hide/proc/update_status()
@@ -455,13 +457,32 @@
name = "Hide"
desc = "Hide yourself from your owner's sight."
button_icon_state = "hide"
- UpdateButtons()
+ build_all_button_icons()
/datum/action/innate/imaginary_hide/Activate()
- var/mob/camera/imaginary_friend/I = owner
- I.hidden = !I.hidden
- I.Show()
- update_status()
+ var/mob/camera/imaginary_friend/fake_friend = owner
+ fake_friend.hidden = !fake_friend.hidden
+ fake_friend.Show()
+ build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
+
+/datum/action/innate/imaginary_hide/update_button_name(atom/movable/screen/movable/action_button/button, force)
+ var/mob/camera/imaginary_friend/fake_friend = owner
+ if(fake_friend.hidden)
+ name = "Show"
+ desc = "Become visible to your owner."
+ else
+ name = "Hide"
+ desc = "Hide yourself from your owner's sight."
+ return ..()
+
+/datum/action/innate/imaginary_hide/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+ var/mob/camera/imaginary_friend/fake_friend = owner
+ if(fake_friend.hidden)
+ button_icon_state = "unhide"
+ else
+ button_icon_state = "hide"
+
+ return ..()
//down here is the trapped mind
//like imaginary friend but a lot less imagination and more like mind prison//
diff --git a/code/datums/components/action_item_overlay.dm b/code/datums/components/action_item_overlay.dm
new file mode 100644
index 00000000000..66d2ec012fb
--- /dev/null
+++ b/code/datums/components/action_item_overlay.dm
@@ -0,0 +1,73 @@
+/**
+ * Apply to an action to allow it to take an item
+ * and apply it as an overlay of the action button
+ */
+/datum/component/action_item_overlay
+ /// Weakref to what item the component uses to apply as an overlay.
+ var/datum/weakref/item_ref
+ /// Callback that dictates what item the component uses to apply as an overlay.
+ var/datum/callback/item_callback
+
+ /// The appearance of the item we've applied
+ var/mutable_appearance/item_appearance
+
+/datum/component/action_item_overlay/Initialize(atom/movable/item, datum/callback/item_callback)
+ if(!istype(parent, /datum/action))
+ return COMPONENT_INCOMPATIBLE
+
+ if(!item && !item_callback)
+ stack_trace("[type] created without a reference item or an item callback - one or the other is required.")
+ return COMPONENT_INCOMPATIBLE
+
+ src.item_ref = WEAKREF(item)
+ src.item_callback = item_callback
+
+/datum/component/action_item_overlay/Destroy(force, silent)
+ item_ref = null
+ QDEL_NULL(item_callback)
+ item_appearance = null
+ return ..()
+
+/datum/component/action_item_overlay/RegisterWithParent()
+ RegisterSignal(parent, COMSIG_ACTION_OVERLAY_APPLY, PROC_REF(on_overlays_applied))
+
+ var/datum/action/parent_action = parent
+ parent_action.build_all_button_icons(UPDATE_BUTTON_OVERLAY)
+
+/datum/component/action_item_overlay/UnregisterFromParent()
+ UnregisterSignal(parent, COMSIG_ACTION_OVERLAY_APPLY)
+
+ // If we're being unregistered / deleted but our parent is sticking around,
+ // force an overlay update to get rid of our item appearance
+ if(!QDELING(parent))
+ var/datum/action/parent_action = parent
+ parent_action.build_all_button_icons(UPDATE_BUTTON_OVERLAY)
+
+/// Signal proc for [COMSIG_ACTION_OVERLAY_APPLY], applies the item appearance if possible.
+/datum/component/action_item_overlay/proc/on_overlays_applied(datum/action/source, atom/movable/screen/movable/action_button/current_button, force)
+ SIGNAL_HANDLER
+
+ // We're in the middle of being removed / deleted, remove our associated overlay
+ if(QDELING(src) && item_appearance)
+ current_button.cut_overlay(item_appearance)
+ item_appearance = null
+ return
+
+ var/atom/movable/muse = item_callback?.Invoke() || item_ref?.resolve()
+ if(!istype(muse))
+ return
+
+ if(item_appearance)
+ // For caching purposes, we will try not to update if we don't need to
+ if(!force && item_appearance.icon == muse.icon && item_appearance.icon_state == muse.icon_state)
+ return
+ current_button.cut_overlay(item_appearance)
+
+ var/mutable_appearance/muse_appearance = new(muse.appearance)
+ muse_appearance.plane = FLOAT_PLANE
+ muse_appearance.layer = FLOAT_LAYER
+ muse_appearance.pixel_x = 0
+ muse_appearance.pixel_y = 0
+
+ current_button.add_overlay(muse_appearance)
+ item_appearance = muse_appearance
diff --git a/code/datums/components/anti_magic.dm b/code/datums/components/anti_magic.dm
index 13ec8725aa2..47cc5fa24cc 100644
--- a/code/datums/components/anti_magic.dm
+++ b/code/datums/components/anti_magic.dm
@@ -67,11 +67,9 @@
if(!(inventory_flags & slot)) //Check that the slot is valid for antimagic
UnregisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC)
UnregisterSignal(equipper, COMSIG_MOB_RESTRICT_MAGIC)
- equipper.update_action_buttons()
return
RegisterSignal(equipper, COMSIG_MOB_RECEIVE_MAGIC, PROC_REF(block_receiving_magic), override = TRUE)
RegisterSignal(equipper, COMSIG_MOB_RESTRICT_MAGIC, PROC_REF(restrict_casting_magic), override = TRUE)
- equipper.update_action_buttons()
if(!casting_restriction_alert)
// Check to see if we have any spells that are blocked due to antimagic
@@ -89,7 +87,6 @@
UnregisterSignal(user, COMSIG_MOB_RECEIVE_MAGIC)
UnregisterSignal(user, COMSIG_MOB_RESTRICT_MAGIC)
- user.update_action_buttons()
casting_restriction_alert = FALSE
/datum/component/anti_magic/proc/block_receiving_magic(mob/living/carbon/user, casted_magic_flags, charge_cost, list/protection_was_used)
diff --git a/code/datums/components/mind_linker.dm b/code/datums/components/mind_linker.dm
index c507d7478cb..2a6c20b2160 100644
--- a/code/datums/components/mind_linker.dm
+++ b/code/datums/components/mind_linker.dm
@@ -168,8 +168,9 @@
name = "Mind Link Speech"
desc = "Send a psychic message to everyone connected to your Link."
button_icon_state = "link_speech"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/linked_speech/New(Target)
. = ..()
@@ -181,7 +182,7 @@
var/datum/component/mind_linker/linker = Target
name = "[linker.network_name] Speech"
desc = "Send a psychic message to everyone connected to your [linker.network_name]."
- icon_icon = linker.speech_action_icon
+ button_icon = linker.speech_action_icon
button_icon_state = linker.speech_action_icon_state
background_icon_state = linker.speech_action_background_icon_state
diff --git a/code/datums/components/seclight_attachable.dm b/code/datums/components/seclight_attachable.dm
index adc1b8ce934..24681be3726 100644
--- a/code/datums/components/seclight_attachable.dm
+++ b/code/datums/components/seclight_attachable.dm
@@ -170,7 +170,7 @@
/datum/component/seclite_attachable/proc/update_light()
var/obj/item/item_parent = parent
item_parent.update_appearance()
- item_parent.update_action_buttons()
+ item_parent.update_item_action_buttons()
/// Signal proc for [COMSIG_ATOM_EXITED] that handles our light being removed or deleted from our parent.
/datum/component/seclite_attachable/proc/on_light_exit(obj/item/source, atom/movable/gone, direction)
diff --git a/code/datums/components/sign_language.dm b/code/datums/components/sign_language.dm
index be06dc460be..cc278f255c4 100644
--- a/code/datums/components/sign_language.dm
+++ b/code/datums/components/sign_language.dm
@@ -52,7 +52,6 @@
RegisterSignal(parent, SIGNAL_ADDTRAIT(TRAIT_SIGN_LANG), PROC_REF(enable_sign_language))
RegisterSignal(parent, SIGNAL_REMOVETRAIT(TRAIT_SIGN_LANG), PROC_REF(disable_sign_language))
linked_action.Grant(parent)
- linked_action.UpdateButtons()
/datum/component/sign_language/UnregisterFromParent()
disable_sign_language()
diff --git a/code/datums/dash_weapon.dm b/code/datums/dash_weapon.dm
index 1dfa0b6bff0..00437a2cdd8 100644
--- a/code/datums/dash_weapon.dm
+++ b/code/datums/dash_weapon.dm
@@ -2,7 +2,7 @@
/datum/action/innate/dash
name = "Dash"
desc = "Teleport to the targeted location."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "jetboot"
/// How many dash charges do we have?
var/current_charges = 1
@@ -65,7 +65,7 @@
playsound(target_turf, dash_sound, 25, TRUE)
current_charges--
addtimer(CALLBACK(src, PROC_REF(charge)), charge_rate)
- owner?.update_action_buttons_icon()
+ owner?.update_mob_action_buttons()
return TRUE
@@ -82,5 +82,5 @@
if(!owner)
return
- owner.update_action_buttons_icon()
+ owner.update_mob_action_buttons()
dashing_item.balloon_alert(owner, "[current_charges]/[max_charges] dash charges")
diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm
index dc8abc62a56..4200236fcbd 100644
--- a/code/datums/holocall.dm
+++ b/code/datums/holocall.dm
@@ -203,7 +203,7 @@
/datum/action/innate/end_holocall
name = "End Holocall"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "camera_off"
var/datum/holocall/hcall
diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm
index 5cc58615c66..2d8a19b96cf 100644
--- a/code/datums/martial/krav_maga.dm
+++ b/code/datums/martial/krav_maga.dm
@@ -7,7 +7,7 @@
/datum/action/neck_chop
name = "Neck Chop - Injures the neck, stopping the victim from speaking for a while."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "neckchop"
/datum/action/neck_chop/Trigger(trigger_flags)
@@ -23,7 +23,7 @@
/datum/action/leg_sweep
name = "Leg Sweep - Trips the victim, knocking them down for a brief moment."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "legsweep"
/datum/action/leg_sweep/Trigger(trigger_flags)
@@ -39,7 +39,7 @@
/datum/action/lung_punch//referred to internally as 'quick choke'
name = "Lung Punch - Delivers a strong punch just above the victim's abdomen, constraining the lungs. The victim will be unable to breathe for a short time."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "lungpunch"
/datum/action/lung_punch/Trigger(trigger_flags)
diff --git a/code/datums/mutations/_mutations.dm b/code/datums/mutations/_mutations.dm
index a73aea59f0c..2fd033c71d9 100644
--- a/code/datums/mutations/_mutations.dm
+++ b/code/datums/mutations/_mutations.dm
@@ -214,7 +214,11 @@
return FALSE
var/datum/action/cooldown/spell/new_power = new power_path(src)
- new_power.background_icon_state = "bg_tech_blue_on"
+ new_power.background_icon_state = "bg_tech_blue"
+ new_power.base_background_icon_state = new_power.background_icon_state
+ new_power.active_background_icon_state = "[new_power.base_background_icon_state]_active"
+ new_power.overlay_icon_state = "bg_tech_blue_border"
+ new_power.active_overlay_icon_state = null
new_power.panel = "Genetic"
new_power.Grant(owner)
diff --git a/code/datums/mutations/cold.dm b/code/datums/mutations/cold.dm
index 7c891b3f211..f999eed421d 100644
--- a/code/datums/mutations/cold.dm
+++ b/code/datums/mutations/cold.dm
@@ -33,12 +33,13 @@
/datum/action/cooldown/spell/pointed/projectile/cryo
name = "Cryobeam"
desc = "This power fires a frozen bolt at a target."
- button_icon_state = "icebeam0"
+ button_icon_state = "icebeam"
+ base_icon_state = "icebeam"
+ active_overlay_icon_state = "bg_spell_border_active_blue"
cooldown_time = 16 SECONDS
spell_requirements = NONE
antimagic_flags = NONE
- base_icon_state = "icebeam"
active_msg = "You focus your cryokinesis!"
deactive_msg = "You relax."
projectile_type = /obj/projectile/temp/cryo
diff --git a/code/datums/mutations/sight.dm b/code/datums/mutations/sight.dm
index 303ddb84dbb..cfe2b71f6d5 100644
--- a/code/datums/mutations/sight.dm
+++ b/code/datums/mutations/sight.dm
@@ -67,7 +67,7 @@
/datum/action/cooldown/spell/thermal_vision
name = "Activate Thermal Vision"
desc = "You can see thermal signatures, at the cost of your eyesight."
- icon_icon = 'icons/mob/actions/actions_changeling.dmi'
+ button_icon = 'icons/mob/actions/actions_changeling.dmi'
button_icon_state = "augmented_eyesight"
cooldown_time = 25 SECONDS
diff --git a/code/datums/mutations/tongue_spike.dm b/code/datums/mutations/tongue_spike.dm
index ecfc037931b..ed41a9804c9 100644
--- a/code/datums/mutations/tongue_spike.dm
+++ b/code/datums/mutations/tongue_spike.dm
@@ -12,7 +12,7 @@
/datum/action/cooldown/spell/tongue_spike
name = "Launch spike"
desc = "Shoot your tongue out in the direction you're facing, embedding it and dealing damage until they remove it."
- icon_icon = 'icons/mob/actions/actions_genetic.dmi'
+ button_icon = 'icons/mob/actions/actions_genetic.dmi'
button_icon_state = "spike"
cooldown_time = 10 SECONDS
@@ -146,7 +146,7 @@
name = "Transfer Chemicals"
desc = "Send all of your reagents into whomever the chem spike is embedded in. One use."
background_icon_state = "bg_spell"
- icon_icon = 'icons/mob/actions/actions_genetic.dmi'
+ button_icon = 'icons/mob/actions/actions_genetic.dmi'
button_icon_state = "spikechemswap"
check_flags = AB_CHECK_CONSCIOUS
diff --git a/code/datums/mutations/webbing.dm b/code/datums/mutations/webbing.dm
index fb152772db1..cf7b62aa9f2 100644
--- a/code/datums/mutations/webbing.dm
+++ b/code/datums/mutations/webbing.dm
@@ -34,7 +34,7 @@
/datum/action/cooldown/spell/lay_genetic_web
name = "Lay Web"
desc = "Drops a web. Only you will be able to traverse your web easily, making it pretty good for keeping you safe."
- icon_icon = 'icons/mob/actions/actions_genetic.dmi'
+ button_icon = 'icons/mob/actions/actions_genetic.dmi'
button_icon_state = "lay_web"
cooldown_time = 4 SECONDS //the same time to lay a web
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index c3f2e431116..13e6a48755b 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1634,7 +1634,7 @@
/obj/item/update_filters()
. = ..()
- update_action_buttons()
+ update_item_action_buttons()
/atom/proc/get_filter(name)
if(filter_data && filter_data[name])
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index e3f871eac9d..0c3f903e0c9 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -169,7 +169,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list
/datum/action/special_equipment_fallback
name = "Request Objective-specific Equipment"
desc = "Call down a supply pod containing the equipment required for specific objectives."
- icon_icon = 'icons/obj/device.dmi'
+ button_icon = 'icons/obj/device.dmi'
button_icon_state = "beacon"
/datum/action/special_equipment_fallback/Trigger(trigger_flags)
diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm
index 4e5fda9b1db..923fe652796 100644
--- a/code/game/machinery/computer/camera_advanced.dm
+++ b/code/game/machinery/computer/camera_advanced.dm
@@ -254,7 +254,7 @@
/datum/action/innate/camera_off
name = "End Camera View"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "camera_off"
/datum/action/innate/camera_off/Activate()
@@ -266,7 +266,7 @@
/datum/action/innate/camera_jump
name = "Jump To Camera"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "camera_jump"
/datum/action/innate/camera_jump/Activate()
@@ -311,7 +311,7 @@
/datum/action/innate/camera_multiz_up
name = "Move up a floor"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "move_up"
/datum/action/innate/camera_multiz_up/Activate()
@@ -325,7 +325,7 @@
/datum/action/innate/camera_multiz_down
name = "Move down a floor"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "move_down"
/datum/action/innate/camera_multiz_down/Activate()
diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm
index da988395bd0..c8ed058ffbe 100644
--- a/code/game/machinery/porta_turret/portable_turret.dm
+++ b/code/game/machinery/porta_turret/portable_turret.dm
@@ -644,7 +644,7 @@ DEFINE_BITFIELD(turret_flags, list(
/datum/action/turret_toggle
name = "Toggle Mode"
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
button_icon_state = "mech_cycle_equip_off"
/datum/action/turret_toggle/Trigger(trigger_flags)
@@ -655,7 +655,7 @@ DEFINE_BITFIELD(turret_flags, list(
/datum/action/turret_quit
name = "Release Control"
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
button_icon_state = "mech_eject"
/datum/action/turret_quit/Trigger(trigger_flags)
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 1c557cc1a02..bfb2b93a3e8 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -108,7 +108,7 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e
var/min_cold_protection_temperature
///list of /datum/action's that this item has.
- var/list/actions
+ var/list/datum/action/actions
///list of paths of action datums to give to the item on New().
var/list/actions_types
@@ -1305,12 +1305,12 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e
* Updates all action buttons associated with this item
*
* Arguments:
- * * status_only - Update only current availability status of the buttons to show if they are ready or not to use
+ * * update_flags - Which flags of the action should we update
* * force - Force buttons update even if the given button icon state has not changed
*/
-/obj/item/proc/update_action_buttons(status_only = FALSE, force = FALSE)
+/obj/item/proc/update_item_action_buttons(update_flags = ALL, force = FALSE)
for(var/datum/action/current_action as anything in actions)
- current_action.UpdateButtons(status_only, force)
+ current_action.build_all_button_icons(update_flags, force)
// Update icons if this is being carried by a mob
/obj/item/wash(clean_types)
diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm
index 9544e24c28e..4a14966df06 100644
--- a/code/game/objects/items/RCL.dm
+++ b/code/game/objects/items/RCL.dm
@@ -344,10 +344,10 @@
/datum/action/item_action/rcl_col
name = "Change Cable Color"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "rcl_rainbow"
/datum/action/item_action/rcl_gui
name = "Toggle Fast Wiring Gui"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "rcl_gui"
diff --git a/code/game/objects/items/chainsaw.dm b/code/game/objects/items/chainsaw.dm
index 9999e0030ea..95e52f27b64 100644
--- a/code/game/objects/items/chainsaw.dm
+++ b/code/game/objects/items/chainsaw.dm
@@ -64,7 +64,7 @@
toolspeed = on ? 0.5 : initial(toolspeed) //Turning it on halves the speed
if(src == user.get_active_held_item()) //update inhands
user.update_held_items()
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/chainsaw/doomslayer
name = "THE GREAT COMMUNICATOR"
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index fc0c8c10d27..cacefb444bb 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -217,7 +217,7 @@
remove_paddles(user)
update_power()
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/defibrillator/equipped(mob/user, slot)
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index d6c24cdbc26..c8671740ead 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -58,7 +58,7 @@
on = !on
playsound(user, on ? sound_on : sound_off, 40, TRUE)
update_brightness(user)
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/flashlight/attack_self(mob/user)
toggle_light(user)
diff --git a/code/game/objects/items/granters/_granters.dm b/code/game/objects/items/granters/_granters.dm
index fed49582d4f..8cb63925f24 100644
--- a/code/game/objects/items/granters/_granters.dm
+++ b/code/game/objects/items/granters/_granters.dm
@@ -103,4 +103,3 @@
// Action goes on the mind as the user actually learns the thing in your brain
var/datum/action/new_action = new granted_action(user.mind || user)
new_action.Grant(user)
- new_action.UpdateButtons()
diff --git a/code/game/objects/items/granters/oragami.dm b/code/game/objects/items/granters/oragami.dm
index b048c67ed72..0b7d6d92615 100644
--- a/code/game/objects/items/granters/oragami.dm
+++ b/code/game/objects/items/granters/oragami.dm
@@ -22,12 +22,14 @@
/datum/action/innate/origami/Activate()
to_chat(owner, span_notice("You will now fold origami planes."))
- button_icon_state = "origami_on"
active = TRUE
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_ICON)
/datum/action/innate/origami/Deactivate()
to_chat(owner, span_notice("You will no longer fold origami planes."))
- button_icon_state = "origami_off"
active = FALSE
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_ICON)
+
+/datum/action/innate/origami/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
+ button_icon_state = "origami_[active ? "on":"off"]"
+ return ..()
diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm
index 9f615569f64..d6b4567cd83 100644
--- a/code/game/objects/items/scrolls.dm
+++ b/code/game/objects/items/scrolls.dm
@@ -19,7 +19,7 @@
var/datum/action/cooldown/spell/teleport/area_teleport/wizard/scroll/teleport = locate() in actions
if(teleport)
teleport.name = name
- teleport.icon_icon = icon
+ teleport.button_icon = icon
teleport.button_icon_state = icon_state
/obj/item/teleportation_scroll/item_action_slot_check(slot, mob/user)
diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm
index ecb15a3f0bb..670b7d5980a 100644
--- a/code/game/objects/items/tanks/jetpack.dm
+++ b/code/game/objects/items/tanks/jetpack.dm
@@ -72,7 +72,7 @@
else
turn_off(user)
to_chat(user, span_notice("You turn the jetpack off."))
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/tank/jetpack/proc/set_stabilizers(new_stabilizers)
if(new_stabilizers == stabilizers)
diff --git a/code/game/objects/structures/construction_console/construction_actions.dm b/code/game/objects/structures/construction_console/construction_actions.dm
index 71f4b1019a3..462a0df5e1a 100644
--- a/code/game/objects/structures/construction_console/construction_actions.dm
+++ b/code/game/objects/structures/construction_console/construction_actions.dm
@@ -3,7 +3,7 @@
///Generic construction action for base [construction consoles][/obj/machinery/computer/camera_advanced/base_construction].
/datum/action/innate/construction
- icon_icon = 'icons/mob/actions/actions_construction.dmi'
+ button_icon = 'icons/mob/actions/actions_construction.dmi'
///Console's eye mob
var/mob/camera/ai_eye/remote/base_construction/remote_eye
///Console itself
diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm
index 58a4be0269e..f41e98b611b 100644
--- a/code/modules/antagonists/_common/antag_datum.dm
+++ b/code/modules/antagonists/_common/antag_datum.dm
@@ -488,6 +488,7 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/action/antag_info
name = "Open Antag Information:"
button_icon_state = "round_end"
+ show_to_observers = FALSE
/datum/action/antag_info/New(Target)
. = ..()
diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
index e632dc73391..3383bd3e627 100644
--- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm
+++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
@@ -56,7 +56,7 @@
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_worn_oversuit()
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/suit/armor/abductor/vest/item_action_slot_check(slot, mob/user)
if(slot & ITEM_SLOT_OCLOTHING) //we only give the mob the ability to activate the vest if he's actually wearing it.
diff --git a/code/modules/antagonists/abductor/machinery/camera.dm b/code/modules/antagonists/abductor/machinery/camera.dm
index 604fe94b471..5dd6bed04a3 100644
--- a/code/modules/antagonists/abductor/machinery/camera.dm
+++ b/code/modules/antagonists/abductor/machinery/camera.dm
@@ -46,7 +46,7 @@
///Is used to compare to world.time in order to determine if the action should early return
var/use_delay
name = "Send To"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_down"
/datum/action/innate/teleport_in/Activate()
@@ -71,7 +71,7 @@
/datum/action/innate/teleport_out
name = "Retrieve"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_up"
/datum/action/innate/teleport_out/Activate()
@@ -86,7 +86,7 @@
var/teleport_self_cooldown = 9 SECONDS
var/use_delay
name = "Send Self"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "beam_down"
/datum/action/innate/teleport_self/Activate()
@@ -111,7 +111,7 @@
/datum/action/innate/vest_mode_swap
name = "Switch Vest Mode"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "vest_mode"
/datum/action/innate/vest_mode_swap/Activate()
@@ -123,7 +123,7 @@
/datum/action/innate/vest_disguise_swap
name = "Switch Vest Disguise"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "vest_disguise"
/datum/action/innate/vest_disguise_swap/Activate()
@@ -134,7 +134,7 @@
/datum/action/innate/set_droppoint
name = "Set Experiment Release Point"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "set_drop"
/datum/action/innate/set_droppoint/Activate()
diff --git a/code/modules/antagonists/blob/blob.dm b/code/modules/antagonists/blob/blob.dm
index 72f5318ab6b..94590ba5248 100644
--- a/code/modules/antagonists/blob/blob.dm
+++ b/code/modules/antagonists/blob/blob.dm
@@ -62,7 +62,7 @@
/datum/action/innate/blobpop
name = "Pop"
desc = "Unleash the blob"
- icon_icon = 'icons/mob/nonhuman-player/blob.dmi'
+ button_icon = 'icons/mob/nonhuman-player/blob.dmi'
button_icon_state = "blob"
/// The time taken before this ability is automatically activated.
diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm
index 84aae218a10..a8d6800531a 100644
--- a/code/modules/antagonists/changeling/cellular_emporium.dm
+++ b/code/modules/antagonists/changeling/cellular_emporium.dm
@@ -87,9 +87,10 @@
/datum/action/innate/cellular_emporium
name = "Cellular Emporium"
- icon_icon = 'icons/obj/drinks.dmi'
+ button_icon = 'icons/obj/drinks.dmi'
button_icon_state = "changelingsting"
background_icon_state = "bg_changeling"
+ overlay_icon_state = "bg_changeling_border"
/// The cell emporium we open.
var/datum/cellular_emporium/cellular_emporium
diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm
index c9c69615657..3c16ae3ebe2 100644
--- a/code/modules/antagonists/changeling/changeling_power.dm
+++ b/code/modules/antagonists/changeling/changeling_power.dm
@@ -5,7 +5,8 @@
/datum/action/changeling
name = "Prototype Sting - Debug button, ahelp this"
background_icon_state = "bg_changeling"
- icon_icon = 'icons/mob/actions/actions_changeling.dmi'
+ overlay_icon_state = "bg_changeling_border"
+ button_icon = 'icons/mob/actions/actions_changeling.dmi'
var/needs_button = TRUE//for passive abilities like hivemind that dont need a button
var/helptext = "" // Details
var/chemical_cost = 0 // negative chemical cost is for passive abilities (chemical glands)
diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm
index 7a4ef35d9f9..c83345ffdd9 100644
--- a/code/modules/antagonists/changeling/powers/fakedeath.dm
+++ b/code/modules/antagonists/changeling/powers/fakedeath.dm
@@ -15,12 +15,9 @@
if(revive_ready)
INVOKE_ASYNC(src, PROC_REF(revive), user)
revive_ready = FALSE
- name = "Reviving Stasis"
- desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
- button_icon_state = "fake_death"
- UpdateButtons()
chemical_cost = 15
to_chat(user, span_notice("We have revived ourselves."))
+ build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
else
to_chat(user, span_notice("We begin our stasis, preparing energy to arise once more."))
user.fakedeath("changeling") //play dead
@@ -60,10 +57,7 @@
return
to_chat(user, span_notice("We are ready to revive."))
- name = "Revive"
- desc = "We arise once more."
- button_icon_state = "revive"
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
chemical_cost = 0
revive_ready = TRUE
@@ -76,3 +70,16 @@
if("No")
return
return ..()
+
+/datum/action/changeling/fakedeath/update_button_name(atom/movable/screen/movable/action_button/button, force)
+ if(revive_ready)
+ name = "Revive"
+ desc = "We arise once more."
+ else
+ name = "Reviving Stasis"
+ desc = "We fall into a stasis, allowing us to regenerate and trick our enemies."
+ return ..()
+
+/datum/action/changeling/fakedeath/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
+ button_icon_state = revive_ready ? "revive" : "fake_death"
+ return ..()
diff --git a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm
index 3e1f0a7d20f..f0024618d1b 100644
--- a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm
+++ b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm
@@ -7,7 +7,7 @@
name = "Pheromone Receptors"
desc = "We attune our senses to track other changelings by scent. The closer they are, the easier we can find them."
helptext = "We will know the general direction of nearby changelings, with closer scents being stronger. Our chemical generation is slowed while this is active."
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "nose"
chemical_cost = 0 //Reduces regain rate while active.
dna_cost = 2
diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm
index 542b7ab0157..abdac4384c7 100644
--- a/code/modules/antagonists/cult/blood_magic.dm
+++ b/code/modules/antagonists/cult/blood_magic.dm
@@ -251,7 +251,7 @@
charges--
desc = base_desc
desc += "
Has [charges] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
if(charges <= 0)
to_chat(caller, span_cult("You have exhausted the spell's power!"))
qdel(src)
@@ -309,7 +309,7 @@
qdel(src)
desc = base_desc
desc += "
Has [charges] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
/datum/action/innate/cult/blood_spell/manipulation
name = "Blood Rites"
@@ -358,7 +358,7 @@
source.charges = uses
source.desc = source.base_desc
source.desc += "
Has [uses] use\s remaining."
- source.UpdateButtons()
+ source.build_all_button_icons()
return ..()
/obj/item/melee/blood_magic/attack_self(mob/living/user)
@@ -387,7 +387,7 @@
else if(source)
source.desc = source.base_desc
source.desc += "
Has [uses] use\s remaining."
- source.UpdateButtons()
+ source.build_all_button_icons()
//Stun
/obj/item/melee/blood_magic/stun
diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm
index 57653a2f903..bc158ec0b8d 100644
--- a/code/modules/antagonists/cult/cult.dm
+++ b/code/modules/antagonists/cult/cult.dm
@@ -229,7 +229,7 @@
reckoning.Grant(current)
bloodmark.Grant(current)
throwing.Grant(current)
- current.update_action_buttons_icon()
+ current.update_mob_action_buttons()
current.apply_status_effect(/datum/status_effect/cult_master)
if(cult_team.cult_risen)
current.AddElement(/datum/element/cult_eyes, initial_delay = 0 SECONDS)
@@ -245,7 +245,7 @@
reckoning.Remove(current)
bloodmark.Remove(current)
throwing.Remove(current)
- current.update_action_buttons_icon()
+ current.update_mob_action_buttons()
current.remove_status_effect(/datum/status_effect/cult_master)
/datum/team/cult
diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm
index 89ec611e098..44820711141 100644
--- a/code/modules/antagonists/cult/cult_comms.dm
+++ b/code/modules/antagonists/cult/cult_comms.dm
@@ -1,8 +1,10 @@
// Contains cult communion, guide, and cult master abilities
/datum/action/innate/cult
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
buttontooltipstyle = "cult"
check_flags = AB_CHECK_HANDS_BLOCKED|AB_CHECK_IMMOBILE|AB_CHECK_CONSCIOUS
ranged_mousepointer = 'icons/effects/mouse_pointers/cult_target.dmi'
@@ -108,7 +110,7 @@
team.cult_vote_called = TRUE //somebody's trying to be a master, make sure we don't let anyone else try
for(var/datum/mind/B in team.members)
if(B.current)
- B.current.update_action_buttons_icon()
+ B.current.update_mob_action_buttons()
if(!B.current.incapacitated())
SEND_SOUND(B.current, 'sound/hallucinations/im_here1.ogg')
to_chat(B.current, span_cultlarge("Acolyte [Nominee] has asserted that [Nominee.p_theyre()] worthy of leading the cult. A vote will be called shortly."))
@@ -123,7 +125,7 @@
team.cult_vote_called = FALSE
for(var/datum/mind/B in team.members)
if(B.current)
- B.current.update_action_buttons_icon()
+ B.current.update_mob_action_buttons()
if(!B.current.incapacitated())
to_chat(B.current,span_cultlarge("[Nominee] has died in the process of attempting to win the cult's support!"))
return FALSE
@@ -131,7 +133,7 @@
team.cult_vote_called = FALSE
for(var/datum/mind/B in team.members)
if(B.current)
- B.current.update_action_buttons_icon()
+ B.current.update_mob_action_buttons()
if(!B.current.incapacitated())
to_chat(B.current,span_cultlarge("[Nominee] has gone catatonic in the process of attempting to win the cult's support!"))
return FALSE
@@ -139,7 +141,7 @@
team.cult_vote_called = FALSE
for(var/datum/mind/B in team.members)
if(B.current)
- B.current.update_action_buttons_icon()
+ B.current.update_mob_action_buttons()
if(!B.current.incapacitated())
to_chat(B.current, span_cultlarge("[Nominee] could not win the cult's support and shall continue to serve as an acolyte."))
return FALSE
@@ -275,8 +277,8 @@
if(cult_team.set_blood_target(clicked_on, caller, cult_mark_duration))
unset_ranged_ability(caller, span_cult("The marking rite is complete! It will last for [DisplayTimeText(cult_mark_duration)] seconds."))
COOLDOWN_START(src, cult_mark_cooldown, cult_mark_cooldown_duration)
- UpdateButtons()
- addtimer(CALLBACK(src, PROC_REF(UpdateButtons)), cult_mark_cooldown_duration + 1)
+ build_all_button_icons()
+ addtimer(CALLBACK(src, PROC_REF(build_all_button_icons)), cult_mark_cooldown_duration + 1)
return TRUE
unset_ranged_ability(caller, span_cult("The marking rite failed!"))
@@ -325,27 +327,30 @@
if(cult_team.set_blood_target(mark_target, owner, 60 SECONDS))
to_chat(owner, span_cultbold("You have marked [mark_target] for the cult! It will last for [DisplayTimeText(cult_mark_duration)]."))
COOLDOWN_START(src, cult_mark_cooldown, cult_mark_cooldown_duration)
- update_button_status()
+ build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
addtimer(CALLBACK(src, PROC_REF(reset_button)), cult_mark_cooldown_duration + 1)
return TRUE
to_chat(owner, span_cult("The marking failed!"))
return FALSE
-/datum/action/innate/cult/ghostmark/proc/update_button_status()
- if(!owner)
- return
-
+/datum/action/innate/cult/ghostmark/update_button_name(atom/movable/screen/movable/action_button/current_button, force = FALSE)
if(COOLDOWN_FINISHED(src, cult_mark_duration))
name = initial(name)
desc = initial(desc)
- button_icon_state = initial(button_icon_state)
else
name = "Clear the Blood Mark"
desc = "Remove the Blood Mark you previously set."
+
+ return ..()
+
+/datum/action/innate/cult/ghostmark/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force = FALSE)
+ if(COOLDOWN_FINISHED(src, cult_mark_duration))
+ button_icon_state = initial(button_icon_state)
+ else
button_icon_state = "emp"
- UpdateButtons()
+ return ..()
/datum/action/innate/cult/ghostmark/proc/reset_button()
if(QDELETED(owner) || QDELETED(src))
@@ -353,14 +358,14 @@
SEND_SOUND(owner, 'sound/magic/enter_blood.ogg')
to_chat(owner, span_cultbold("Your previous mark is gone - you are now ready to create a new blood mark."))
- update_button_status()
+ build_all_button_icons(UPDATE_BUTTON_NAME|UPDATE_BUTTON_ICON)
//////// ELDRITCH PULSE /////////
/datum/action/innate/cult/master/pulse
name = "Eldritch Pulse"
desc = "Seize upon a fellow cultist or cult structure and teleport it to a nearby location."
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "arcane_barrage"
click_action = TRUE
enable_text = span_cult("You prepare to tear through the fabric of reality... Click a target to sieze them!")
@@ -430,8 +435,8 @@
to_chat(caller, span_cult("A pulse of blood magic surges through you as you shift [throwee] through time and space."))
caller.click_intercept = null
throwee_ref = null
- UpdateButtons()
- addtimer(CALLBACK(src, PROC_REF(UpdateButtons)), pulse_cooldown_duration + 1)
+ build_all_button_icons()
+ addtimer(CALLBACK(src, PROC_REF(build_all_button_icons)), pulse_cooldown_duration + 1)
return TRUE
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index 70c585447f5..8e9471a98fb 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -125,7 +125,7 @@ Striking a noncultist, however, will tear their flesh."}
/datum/action/innate/dash/cult
name = "Rend the Veil"
desc = "Use the sword to shear open the flimsy fabric of this reality and teleport to your target."
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "phaseshift"
dash_sound = 'sound/magic/enter_blood.ogg'
recharge_sound = 'sound/magic/exit_blood.ogg'
@@ -649,6 +649,8 @@ Striking a noncultist, however, will tear their flesh."}
name = "Bloody Bond"
desc = "Call the bloody halberd back to your hand!"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
button_icon_state = "bloodspear"
default_button_position = "6:157,4:-2"
var/obj/item/melee/cultblade/halberd/halberd
diff --git a/code/modules/antagonists/cult/rune_spawn_action.dm b/code/modules/antagonists/cult/rune_spawn_action.dm
index 6846307db70..af4350427b5 100644
--- a/code/modules/antagonists/cult/rune_spawn_action.dm
+++ b/code/modules/antagonists/cult/rune_spawn_action.dm
@@ -3,6 +3,8 @@
name = "Summon Rune"
desc = "Summons a rune"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
var/obj/effect/rune/rune_type
var/cooldown = 0
var/base_cooldown = 1800
@@ -56,8 +58,8 @@
R4 = new rune_center_type(T, scribe_time, rune_color)
cooldown = base_cooldown + world.time
- owner.update_action_buttons_icon()
- addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob, update_action_buttons_icon)), base_cooldown)
+ owner.update_mob_action_buttons()
+ addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob, update_mob_action_buttons)), base_cooldown + 1)
var/list/health
if(damage_interrupt && isliving(owner))
var/mob/living/L = owner
@@ -77,7 +79,7 @@
if(R4)
qdel(R4)
cooldown = 0
- owner.update_action_buttons_icon()
+ owner.update_mob_action_buttons()
//teleport rune
/datum/action/innate/cult/create_rune/tele
diff --git a/code/modules/antagonists/disease/disease_abilities.dm b/code/modules/antagonists/disease/disease_abilities.dm
index ac99b593842..08d5160e141 100644
--- a/code/modules/antagonists/disease/disease_abilities.dm
+++ b/code/modules/antagonists/disease/disease_abilities.dm
@@ -165,7 +165,7 @@ new /datum/disease_ability/symptom/powerful/youth
/datum/action/cooldown/disease_cough
name = "Cough"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "cough"
desc = "Force the host you are following to cough with extra force, spreading your infection to those within two meters of your host even if your transmissibility is low.
Cooldown: 10 seconds"
cooldown_time = 100
@@ -204,7 +204,7 @@ new /datum/disease_ability/symptom/powerful/youth
/datum/action/cooldown/disease_sneeze
name = "Sneeze"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "sneeze"
desc = "Force the host you are following to sneeze with extra force, spreading your infection to any victims in a 4 meter cone in front of your host even if your transmissibility is low.
Cooldown: 20 seconds"
cooldown_time = 200
@@ -249,7 +249,7 @@ new /datum/disease_ability/symptom/powerful/youth
/datum/action/cooldown/disease_infect
name = "Secrete Infection"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "infect"
desc = "Cause the host you are following to excrete an infective substance from their pores, causing all objects touching their skin to transmit your infection to anyone who touches them for the next 30 seconds.
Cooldown: 40 seconds"
cooldown_time = 400
diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm
index 3fe1b37734e..3765adf5309 100644
--- a/code/modules/antagonists/disease/disease_mob.dm
+++ b/code/modules/antagonists/disease/disease_mob.dm
@@ -426,7 +426,7 @@ the new instance inside the host to be updated to the template's stats.
/datum/action/innate/disease_adapt
name = "Adaptation Menu"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "disease_menu"
/datum/action/innate/disease_adapt/Activate()
diff --git a/code/modules/antagonists/heretic/heretic_living_heart.dm b/code/modules/antagonists/heretic/heretic_living_heart.dm
index e8b95eeebe2..4dda1a2f73a 100644
--- a/code/modules/antagonists/heretic/heretic_living_heart.dm
+++ b/code/modules/antagonists/heretic/heretic_living_heart.dm
@@ -69,8 +69,8 @@
name = "Living Heartbeat"
desc = "LMB: Chose one of your sacrifice targets to track. RMB: Repeats last target you chose to track."
check_flags = AB_CHECK_CONSCIOUS
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/obj/eldritch.dmi'
+ background_icon_state = "bg_heretic"
+ button_icon = 'icons/obj/eldritch.dmi'
button_icon_state = "living_heart"
cooldown_time = 4 SECONDS
diff --git a/code/modules/antagonists/heretic/knowledge/ash_lore.dm b/code/modules/antagonists/heretic/knowledge/ash_lore.dm
index b83c7d43b58..8b1415e2b5f 100644
--- a/code/modules/antagonists/heretic/knowledge/ash_lore.dm
+++ b/code/modules/antagonists/heretic/knowledge/ash_lore.dm
@@ -103,7 +103,7 @@
var/datum/action/cooldown/spell/touch/mansus_grasp/grasp = locate() in source.actions
if(grasp)
grasp.next_use_time = min(round(grasp.next_use_time - grasp.cooldown_time * 0.75, 0), 0)
- grasp.UpdateButtons()
+ grasp.build_all_button_icons()
/datum/heretic_knowledge/knowledge_ritual/ash
next_knowledge = list(/datum/heretic_knowledge/spell/fire_blast)
diff --git a/code/modules/antagonists/heretic/magic/aggressive_spread.dm b/code/modules/antagonists/heretic/magic/aggressive_spread.dm
index 01eca69edbd..c15ae041a47 100644
--- a/code/modules/antagonists/heretic/magic/aggressive_spread.dm
+++ b/code/modules/antagonists/heretic/magic/aggressive_spread.dm
@@ -1,8 +1,9 @@
/datum/action/cooldown/spell/aoe/rust_conversion
name = "Aggressive Spread"
desc = "Spreads rust onto nearby surfaces."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "corrode"
sound = 'sound/items/welder.ogg'
diff --git a/code/modules/antagonists/heretic/magic/ash_ascension.dm b/code/modules/antagonists/heretic/magic/ash_ascension.dm
index a4017ff6d12..2615e332a72 100644
--- a/code/modules/antagonists/heretic/magic/ash_ascension.dm
+++ b/code/modules/antagonists/heretic/magic/ash_ascension.dm
@@ -2,8 +2,9 @@
/datum/action/cooldown/spell/fire_sworn
name = "Oath of Flame"
desc = "For a minute, you will passively create a ring of fire around you."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "fire_ring"
school = SCHOOL_FORBIDDEN
@@ -61,8 +62,9 @@
/datum/action/cooldown/spell/fire_cascade
name = "Lesser Fire Cascade"
desc = "Heats the air around you."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "fire_ring"
sound = 'sound/items/welder.ogg'
@@ -99,8 +101,9 @@
/datum/action/cooldown/spell/pointed/ash_beams
name = "Nightwatcher's Rite"
desc = "A powerful spell that releases five streams of eldritch fire towards the target."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "flames"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
diff --git a/code/modules/antagonists/heretic/magic/ash_jaunt.dm b/code/modules/antagonists/heretic/magic/ash_jaunt.dm
index f3f3dee8a0b..41242063a90 100644
--- a/code/modules/antagonists/heretic/magic/ash_jaunt.dm
+++ b/code/modules/antagonists/heretic/magic/ash_jaunt.dm
@@ -1,8 +1,9 @@
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/ash
name = "Ashen Passage"
desc = "A short range spell that allows you to pass unimpeded through walls."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "ash_shift"
sound = null
diff --git a/code/modules/antagonists/heretic/magic/blood_cleave.dm b/code/modules/antagonists/heretic/magic/blood_cleave.dm
index 085e207c833..eca27e55566 100644
--- a/code/modules/antagonists/heretic/magic/blood_cleave.dm
+++ b/code/modules/antagonists/heretic/magic/blood_cleave.dm
@@ -1,8 +1,9 @@
/datum/action/cooldown/spell/pointed/cleave
name = "Cleave"
desc = "Causes severe bleeding on a target and several targets around them."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "cleave"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
diff --git a/code/modules/antagonists/heretic/magic/blood_siphon.dm b/code/modules/antagonists/heretic/magic/blood_siphon.dm
index 0482ed1f332..1e3d6258826 100644
--- a/code/modules/antagonists/heretic/magic/blood_siphon.dm
+++ b/code/modules/antagonists/heretic/magic/blood_siphon.dm
@@ -2,8 +2,9 @@
name = "Blood Siphon"
desc = "A targeted spell that heals your wounds while damaging the enemy. \
It has a chance to transfer wounds between you and your enemy."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "blood_siphon"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
diff --git a/code/modules/antagonists/heretic/magic/eldritch_blind.dm b/code/modules/antagonists/heretic/magic/eldritch_blind.dm
index 593e56a4d43..8df20503821 100644
--- a/code/modules/antagonists/heretic/magic/eldritch_blind.dm
+++ b/code/modules/antagonists/heretic/magic/eldritch_blind.dm
@@ -1,7 +1,8 @@
// Given to heretic monsters.
/datum/action/cooldown/spell/pointed/blind/eldritch
name = "Eldritch Blind"
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
school = SCHOOL_FORBIDDEN
invocation = "E'E'S"
diff --git a/code/modules/antagonists/heretic/magic/eldritch_emplosion.dm b/code/modules/antagonists/heretic/magic/eldritch_emplosion.dm
index 308c305c821..c68ed07c81f 100644
--- a/code/modules/antagonists/heretic/magic/eldritch_emplosion.dm
+++ b/code/modules/antagonists/heretic/magic/eldritch_emplosion.dm
@@ -2,7 +2,8 @@
/datum/action/cooldown/spell/emp/eldritch
name = "Energetic Pulse"
desc = "A spell that causes a large EMP around you, disabling electronics."
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
school = SCHOOL_FORBIDDEN
cooldown_time = 30 SECONDS
diff --git a/code/modules/antagonists/heretic/magic/eldritch_shapeshift.dm b/code/modules/antagonists/heretic/magic/eldritch_shapeshift.dm
index f723b8e788c..2275fa9f413 100644
--- a/code/modules/antagonists/heretic/magic/eldritch_shapeshift.dm
+++ b/code/modules/antagonists/heretic/magic/eldritch_shapeshift.dm
@@ -3,7 +3,8 @@
name = "Shapechange"
desc = "A spell that allows you to take on the form of another creature, gaining their abilities. \
After making your choice, you will be unable to change to another."
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
school = SCHOOL_FORBIDDEN
invocation = "SH'PE"
diff --git a/code/modules/antagonists/heretic/magic/eldritch_telepathy.dm b/code/modules/antagonists/heretic/magic/eldritch_telepathy.dm
index d4a70d81cc0..ee0d4f73421 100644
--- a/code/modules/antagonists/heretic/magic/eldritch_telepathy.dm
+++ b/code/modules/antagonists/heretic/magic/eldritch_telepathy.dm
@@ -2,6 +2,7 @@
/datum/action/cooldown/spell/list_target/telepathy/eldritch
name = "Eldritch Telepathy"
school = SCHOOL_FORBIDDEN
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
invocation_type = INVOCATION_NONE
antimagic_flags = MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND
diff --git a/code/modules/antagonists/heretic/magic/expand_sight.dm b/code/modules/antagonists/heretic/magic/expand_sight.dm
index 6c2782be276..e9715c9a779 100644
--- a/code/modules/antagonists/heretic/magic/expand_sight.dm
+++ b/code/modules/antagonists/heretic/magic/expand_sight.dm
@@ -2,9 +2,10 @@
/datum/action/innate/expand_sight
name = "Expand Sight"
desc = "Boosts your sight range considerably, allowing you to see enemies from much further away."
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "eye"
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
/// How far we expand the range to.
var/boost_to = 5
/// A cooldown for the last time we toggled it, to prevent spam.
diff --git a/code/modules/antagonists/heretic/magic/fire_blast.dm b/code/modules/antagonists/heretic/magic/fire_blast.dm
index e6c70203d87..2f0f3013991 100644
--- a/code/modules/antagonists/heretic/magic/fire_blast.dm
+++ b/code/modules/antagonists/heretic/magic/fire_blast.dm
@@ -3,8 +3,9 @@
desc = "Charge up a blast of fire that chains between nearby targets, setting them ablaze. \
Targets already on fire will take priority. If the target fails to catch ablaze, or \
extinguishes themselves before it bounces, the chain will stop."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "flames"
sound = 'sound/magic/fireball.ogg'
diff --git a/code/modules/antagonists/heretic/magic/flesh_ascension.dm b/code/modules/antagonists/heretic/magic/flesh_ascension.dm
index 33370d0b5a2..cb9ab63e031 100644
--- a/code/modules/antagonists/heretic/magic/flesh_ascension.dm
+++ b/code/modules/antagonists/heretic/magic/flesh_ascension.dm
@@ -2,8 +2,9 @@
name = "Shed form"
desc = "Shed your fragile form, become one with the arms, become one with the emperor. \
Causes heavy amounts of brain damage and sanity loss to nearby mortals."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "worm_ascend"
school = SCHOOL_FORBIDDEN
@@ -46,8 +47,9 @@
/datum/action/cooldown/spell/worm_contract
name = "Force Contract"
desc = "Forces your body to contract onto a single tile."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "worm_contract"
school = SCHOOL_FORBIDDEN
diff --git a/code/modules/antagonists/heretic/magic/flesh_surgery.dm b/code/modules/antagonists/heretic/magic/flesh_surgery.dm
index 44f97365bc1..9f09ee7636c 100644
--- a/code/modules/antagonists/heretic/magic/flesh_surgery.dm
+++ b/code/modules/antagonists/heretic/magic/flesh_surgery.dm
@@ -3,8 +3,9 @@
desc = "A touch spell that allows you to either harvest or restore flesh of target. \
Left-clicking will extract the organs of a victim without needing to complete surgery or disembowel. \
Right-clicking, if done on summons or minions, will restore health. Can also be used to heal damaged organs."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "mad_touch"
sound = null
diff --git a/code/modules/antagonists/heretic/magic/furious_steel.dm b/code/modules/antagonists/heretic/magic/furious_steel.dm
index 9d1f6413040..f4e8596fbba 100644
--- a/code/modules/antagonists/heretic/magic/furious_steel.dm
+++ b/code/modules/antagonists/heretic/magic/furious_steel.dm
@@ -3,9 +3,10 @@
desc = "Summon three silver blades which orbit you. \
While orbiting you, these blades will protect you from from attacks, but will be consumed on use. \
Additionally, you can click to fire the blades at a target, dealing damage and causing bleeding."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
- button_icon_state = "furious_steel0"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
+ button_icon_state = "furious_steel"
sound = 'sound/weapons/guillotine.ogg'
school = SCHOOL_FORBIDDEN
@@ -15,7 +16,6 @@
spell_requirements = NONE
- base_icon_state = "furious_steel"
active_msg = "You summon forth three blades of furious silver."
deactive_msg = "You conceal the blades of furious silver."
cast_range = 20
diff --git a/code/modules/antagonists/heretic/magic/madness_touch.dm b/code/modules/antagonists/heretic/magic/madness_touch.dm
index 632643becd7..06db9f2464e 100644
--- a/code/modules/antagonists/heretic/magic/madness_touch.dm
+++ b/code/modules/antagonists/heretic/magic/madness_touch.dm
@@ -2,8 +2,9 @@
/datum/action/cooldown/spell/touch/mad_touch
name = "Touch of Madness"
desc = "A touch spell that drains your enemy's sanity."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "mad_touch"
school = SCHOOL_FORBIDDEN
diff --git a/code/modules/antagonists/heretic/magic/manse_link.dm b/code/modules/antagonists/heretic/magic/manse_link.dm
index b8775d334dd..565e7e683eb 100644
--- a/code/modules/antagonists/heretic/magic/manse_link.dm
+++ b/code/modules/antagonists/heretic/magic/manse_link.dm
@@ -2,8 +2,9 @@
name = "Manse Link"
desc = "This spell allows you to pierce through reality and connect minds to one another \
via your Mansus Link. All minds connected to your Mansus Link will be able to communicate discreetly across great distances."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "mansus_link"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
diff --git a/code/modules/antagonists/heretic/magic/mansus_grasp.dm b/code/modules/antagonists/heretic/magic/mansus_grasp.dm
index 37743b6945c..c7065bcebd2 100644
--- a/code/modules/antagonists/heretic/magic/mansus_grasp.dm
+++ b/code/modules/antagonists/heretic/magic/mansus_grasp.dm
@@ -1,8 +1,9 @@
/datum/action/cooldown/spell/touch/mansus_grasp
name = "Mansus Grasp"
desc = "A touch spell that lets you channel the power of the Old Gods through your grip."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "mansus_grasp"
sound = 'sound/items/welder.ogg'
diff --git a/code/modules/antagonists/heretic/magic/mirror_walk.dm b/code/modules/antagonists/heretic/magic/mirror_walk.dm
index 14713635aa0..0bc9b059020 100644
--- a/code/modules/antagonists/heretic/magic/mirror_walk.dm
+++ b/code/modules/antagonists/heretic/magic/mirror_walk.dm
@@ -3,8 +3,9 @@
desc = "Allows you to traverse invisibly and freely across the station within the realm of the mirror. \
You can only enter and exit the realm of mirrors when nearby reflective surfaces and items, \
such as windows, mirrors, and reflective walls or equipment."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "ninja_cloak"
cooldown_time = 6 SECONDS
@@ -23,7 +24,7 @@
/datum/action/cooldown/spell/jaunt/mirror_walk/Grant(mob/grant_to)
. = ..()
- RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_status_on_signal))
/datum/action/cooldown/spell/jaunt/mirror_walk/Remove(mob/remove_from)
. = ..()
@@ -77,7 +78,7 @@
var/obj/effect/dummy/phased_mob/jaunt = ..(jaunter, get_turf(nearby_reflection))
if (!jaunt)
return FALSE
- RegisterSignal(jaunt, COMSIG_MOVABLE_MOVED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(jaunt, COMSIG_MOVABLE_MOVED, PROC_REF(update_status_on_signal))
return jaunt
/datum/action/cooldown/spell/jaunt/mirror_walk/exit_jaunt(mob/living/unjaunter, turf/loc_override)
diff --git a/code/modules/antagonists/heretic/magic/nightwatcher_rebirth.dm b/code/modules/antagonists/heretic/magic/nightwatcher_rebirth.dm
index 9d0a93f6bc5..1e65ef88951 100644
--- a/code/modules/antagonists/heretic/magic/nightwatcher_rebirth.dm
+++ b/code/modules/antagonists/heretic/magic/nightwatcher_rebirth.dm
@@ -3,8 +3,9 @@
desc = "A spell that extinguishes you drains nearby heathens engulfed in flames of their life force, \
healing you for each victim drained. Those in critical condition \
will have the last of their vitality drained, killing them."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "smoke"
school = SCHOOL_FORBIDDEN
diff --git a/code/modules/antagonists/heretic/magic/realignment.dm b/code/modules/antagonists/heretic/magic/realignment.dm
index 7ba184ed4d8..56187a76dcf 100644
--- a/code/modules/antagonists/heretic/magic/realignment.dm
+++ b/code/modules/antagonists/heretic/magic/realignment.dm
@@ -3,8 +3,9 @@
name = "Realignment"
desc = "Realign yourself, rapidly regenerating stamina and reducing any stuns or knockdowns. \
You cannot attack while realigning. Can be casted multiple times in short succession, but each cast lengthens the cooldown."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/obj/implants.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/obj/implants.dmi'
button_icon_state = "adrenal"
// sound = 'sound/magic/whistlereset.ogg'
@@ -33,20 +34,18 @@
var/reduction_timer = max(cooldown_time * spell_max_level * 0.5, 1.5 MINUTES)
addtimer(CALLBACK(src, PROC_REF(delevel_spell)), reduction_timer)
-/datum/action/cooldown/spell/realignment/update_spell_name()
- var/spell_title = ""
+/datum/action/cooldown/spell/realignment/get_spell_title()
switch(spell_level)
if(1, 2)
- spell_title = "Hasty " // Hasty Realignment
+ return "Hasty " // Hasty Realignment
if(3, 4)
- spell_title = "" // Realignment
+ return "" // Realignment
if(5, 6, 7)
- spell_title = "Slowed " // Slowed Realignment
+ return "Slowed " // Slowed Realignment
if(8, 9, 10)
- spell_title = "Laborious " // Laborious Realignment (don't reach here)
+ return "Laborious " // Laborious Realignment (don't reach here)
- name = "[spell_title][initial(name)]"
- UpdateButtons()
+ return ""
/datum/status_effect/realignment
id = "realigment"
diff --git a/code/modules/antagonists/heretic/magic/rust_construction.dm b/code/modules/antagonists/heretic/magic/rust_construction.dm
index dbbe084c589..3556689baa3 100644
--- a/code/modules/antagonists/heretic/magic/rust_construction.dm
+++ b/code/modules/antagonists/heretic/magic/rust_construction.dm
@@ -1,7 +1,8 @@
/datum/action/cooldown/spell/pointed/rust_construction
name = "Rust Formation"
desc = "Transforms a rusted floor into a full wall of rust. Creating a wall underneath a mob will harm it."
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
button_icon_state = "shield"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
diff --git a/code/modules/antagonists/heretic/magic/rust_wave.dm b/code/modules/antagonists/heretic/magic/rust_wave.dm
index baf7fce7d89..5ca4b7da07e 100644
--- a/code/modules/antagonists/heretic/magic/rust_wave.dm
+++ b/code/modules/antagonists/heretic/magic/rust_wave.dm
@@ -4,8 +4,9 @@
desc = "Spews forth a disorienting plume that causes enemies to strike each other, \
briefly blinds them (increasing with range) and poisons them (decreasing with range). \
Also spreads rust in the path of the plume."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "entropic_plume"
sound = 'sound/magic/forcewall.ogg'
@@ -66,8 +67,9 @@
/datum/action/cooldown/spell/basic_projectile/rust_wave
name = "Patron's Reach"
desc = "Channels energy into your hands to release a wave of rust."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "rust_wave"
school = SCHOOL_FORBIDDEN
diff --git a/code/modules/antagonists/heretic/magic/shadow_cloak.dm b/code/modules/antagonists/heretic/magic/shadow_cloak.dm
index b295d52a3aa..7be96ed5e54 100644
--- a/code/modules/antagonists/heretic/magic/shadow_cloak.dm
+++ b/code/modules/antagonists/heretic/magic/shadow_cloak.dm
@@ -3,8 +3,9 @@
desc = "Completely conceals your identity, but does not make you invisible. Can be activated early to disable it. \
While cloaked, you move faster, but undergo actions much slower. \
Taking damage while cloaked may cause it to lift suddenly, causing negative effects. "
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "ninja_cloak"
sound = 'sound/effects/curse2.ogg'
diff --git a/code/modules/antagonists/heretic/magic/void_cold_cone.dm b/code/modules/antagonists/heretic/magic/void_cold_cone.dm
index 426bc11c565..92c45dc10b0 100644
--- a/code/modules/antagonists/heretic/magic/void_cold_cone.dm
+++ b/code/modules/antagonists/heretic/magic/void_cold_cone.dm
@@ -4,7 +4,8 @@
Enemies in the cone of the blast will be damaged slightly, slowed, and chilled overtime. \
Additionally, objects hit will be frozen and can shatter, and ground hit will be iced over and slippery - \
though they may thaw shortly if used in room temperature."
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
button_icon_state = "icebeam"
school = SCHOOL_FORBIDDEN
diff --git a/code/modules/antagonists/heretic/magic/void_phase.dm b/code/modules/antagonists/heretic/magic/void_phase.dm
index 61316d430a9..a3f16a2aeaf 100644
--- a/code/modules/antagonists/heretic/magic/void_phase.dm
+++ b/code/modules/antagonists/heretic/magic/void_phase.dm
@@ -3,8 +3,9 @@
desc = "Let's you blink to your pointed destination, causes 3x3 aoe damage bubble \
around your pointed destination and your current location. \
It has a minimum range of 3 tiles and a maximum range of 9 tiles."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "voidblink"
ranged_mousepointer = 'icons/effects/mouse_pointers/throw_target.dmi'
diff --git a/code/modules/antagonists/heretic/magic/void_pull.dm b/code/modules/antagonists/heretic/magic/void_pull.dm
index f310bd0538c..2021bf8a04e 100644
--- a/code/modules/antagonists/heretic/magic/void_pull.dm
+++ b/code/modules/antagonists/heretic/magic/void_pull.dm
@@ -2,8 +2,9 @@
name = "Void Pull"
desc = "Calls the void, damaging, knocking down, and stunning people nearby. \
Distant foes are also pulled closer to you (but not damaged)."
- background_icon_state = "bg_ecult"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
button_icon_state = "voidpull"
sound = 'sound/magic/voidblink.ogg'
diff --git a/code/modules/antagonists/heretic/structures/carving_knife.dm b/code/modules/antagonists/heretic/structures/carving_knife.dm
index f98d8ef8ed4..00096d4c002 100644
--- a/code/modules/antagonists/heretic/structures/carving_knife.dm
+++ b/code/modules/antagonists/heretic/structures/carving_knife.dm
@@ -126,9 +126,10 @@
/datum/action/item_action/rune_shatter
name = "Rune Break"
desc = "Destroys all runes carved by this blade."
- background_icon_state = "bg_ecult"
+ background_icon_state = "bg_heretic"
+ overlay_icon_state = "bg_heretic_border"
button_icon_state = "rune_break"
- icon_icon = 'icons/mob/actions/actions_ecult.dmi'
+ button_icon = 'icons/mob/actions/actions_ecult.dmi'
/datum/action/item_action/rune_shatter/New(Target)
. = ..()
diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm
index b493cb483e3..7fc9a10642a 100644
--- a/code/modules/antagonists/revenant/revenant.dm
+++ b/code/modules/antagonists/revenant/revenant.dm
@@ -145,7 +145,7 @@
to_chat(src, span_revenboldnotice("You can move again!"))
if(essence_regenerating && !inhibited && essence < essence_regen_cap) //While inhibited, essence will not regenerate
essence = min(essence + (essence_regen_amount * delta_time), essence_regen_cap)
- update_action_buttons_icon() //because we update something required by our spells in life, we need to update our buttons
+ update_mob_action_buttons() //because we update something required by our spells in life, we need to update our buttons
update_spooky_icon()
update_health_hud()
..()
@@ -213,12 +213,12 @@
visible_message(span_warning("[src] violently flinches!"), \
span_revendanger("As [weapon] passes through you, you feel your essence draining away!"))
inhibited = TRUE
- update_action_buttons_icon()
+ update_mob_action_buttons()
addtimer(CALLBACK(src, PROC_REF(reset_inhibit)), 3 SECONDS)
/mob/living/simple_animal/revenant/proc/reset_inhibit()
inhibited = FALSE
- update_action_buttons_icon()
+ update_mob_action_buttons()
/mob/living/simple_animal/revenant/adjustHealth(amount, updating_health = TRUE, forced = FALSE)
if(!forced && !revealed)
@@ -329,7 +329,7 @@
if(essence_excess < essence_cost)
return FALSE
essence_excess -= essence_cost
- update_action_buttons_icon()
+ update_mob_action_buttons()
return TRUE
/mob/living/simple_animal/revenant/proc/change_essence_amount(essence_amt, silent = FALSE, source = null)
@@ -342,7 +342,7 @@
if(essence_amt > 0)
essence_accumulated = max(0, essence_accumulated+essence_amt)
essence_excess = max(0, essence_excess+essence_amt)
- update_action_buttons_icon()
+ update_mob_action_buttons()
if(!silent)
if(essence_amt > 0)
to_chat(src, span_revennotice("Gained [essence_amt]E[source ? " from [source]":""]."))
diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm
index 9232435515f..8d2bc888478 100644
--- a/code/modules/antagonists/revenant/revenant_abilities.dm
+++ b/code/modules/antagonists/revenant/revenant_abilities.dm
@@ -122,7 +122,8 @@
name = "Toggle Darkvision"
panel = "Revenant Abilities"
background_icon_state = "bg_revenant"
- icon_icon = 'icons/mob/actions/actions_revenant.dmi'
+ overlay_icon_state = "bg_revenant_border"
+ button_icon = 'icons/mob/actions/actions_revenant.dmi'
button_icon_state = "r_nightvision"
toggle_span = "revennotice"
@@ -131,6 +132,7 @@
name = "Revenant Transmit"
panel = "Revenant Abilities"
background_icon_state = "bg_revenant"
+ overlay_icon_state = "bg_revenant_border"
telepathy_span = "revennotice"
bold_telepathy_span = "revenboldnotice"
@@ -140,7 +142,8 @@
/datum/action/cooldown/spell/aoe/revenant
panel = "Revenant Abilities (Locked)"
background_icon_state = "bg_revenant"
- icon_icon = 'icons/mob/actions/actions_revenant.dmi'
+ overlay_icon_state = "bg_revenant_border"
+ button_icon = 'icons/mob/actions/actions_revenant.dmi'
antimagic_flags = MAGIC_RESISTANCE_HOLY
spell_requirements = NONE
@@ -410,7 +413,6 @@
name = "Haunt Object"
desc = "Empower nearby objects to you with ghostly energy, causing them to attack nearby mortals. \
Items closer to you are more likely to be haunted."
- icon_icon = 'icons/mob/actions/actions_revenant.dmi'
button_icon_state = "r_haunt"
max_targets = 7
aoe_radius = 5
diff --git a/code/modules/antagonists/space_dragon/carp_rift.dm b/code/modules/antagonists/space_dragon/carp_rift.dm
index 3aeadfd0db5..4838850cc49 100644
--- a/code/modules/antagonists/space_dragon/carp_rift.dm
+++ b/code/modules/antagonists/space_dragon/carp_rift.dm
@@ -9,7 +9,8 @@
name = "Summon Rift"
desc = "Summon a rift to bring forth a horde of space carp."
background_icon_state = "bg_default"
- icon_icon = 'icons/mob/actions/actions_space_dragon.dmi'
+ overlay_icon_state = "bg_default_border"
+ button_icon = 'icons/mob/actions/actions_space_dragon.dmi'
button_icon_state = "carp_rift"
/datum/action/innate/summon_rift/Activate()
diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
index 31bf889fca1..9d00fe4e34b 100644
--- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
+++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm
@@ -47,7 +47,8 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
name = "AI Action"
desc = "You aren't entirely sure what this does, but it's very beepy and boopy."
background_icon_state = "bg_tech_blue"
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ overlay_icon_state = "bg_tech_blue_border"
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
/// The owner AI, so we don't have to typecast every time
var/mob/living/silicon/ai/owner_AI
/// If we have multiple uses of the same power
@@ -415,7 +416,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
if(uses)
desc = "[initial(desc)] It has [uses] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
clicked_machine.audible_message(span_userdanger("You hear a loud electrical buzzing sound coming from [clicked_machine]!"))
addtimer(CALLBACK(src, PROC_REF(animate_machine), caller, clicked_machine), 5 SECONDS) //kabeep!
@@ -502,7 +503,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
adjust_uses(-1)
if(uses)
desc = "[initial(desc)] It has [uses] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
clicked_machine.audible_message(span_userdanger("You hear a loud electrical buzzing sound coming from [clicked_machine]!"))
addtimer(CALLBACK(src, PROC_REF(detonate_machine), caller, clicked_machine), 5 SECONDS) //kaboom!
@@ -541,7 +542,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
if(QDELETED(src) || uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
return
desc = "[initial(desc)] It has [uses] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
/// HIGH IMPACT HONKING
/datum/ai_module/destructive/megahonk
@@ -764,7 +765,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module))
if(QDELETED(src) || !uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
return
desc = "[initial(desc)] It has [uses] use\s remaining."
- UpdateButtons()
+ build_all_button_icons()
/// Upgrade Camera Network: EMP-proofs all cameras, in addition to giving them X-ray vision.
/datum/ai_module/upgrade/upgrade_cameras
diff --git a/code/modules/antagonists/traitor/equipment/module_picker.dm b/code/modules/antagonists/traitor/equipment/module_picker.dm
index bca07f537ec..51058f82ac0 100644
--- a/code/modules/antagonists/traitor/equipment/module_picker.dm
+++ b/code/modules/antagonists/traitor/equipment/module_picker.dm
@@ -120,7 +120,7 @@
else //Adding uses to an existing module
action.uses += initial(action.uses)
action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining."
- action.UpdateButtons()
+ action.build_all_button_icons()
processing_time -= AM.cost
log_malf_upgrades("[key_name(AI)] purchased [AM.name]")
SSblackbox.record_feedback("nested tally", "malfunction_modules_bought", 1, list("[initial(AM.name)]", "[AM.cost]"))
diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm
index efac3a3bb39..2588a8ab757 100644
--- a/code/modules/clothing/chameleon.dm
+++ b/code/modules/clothing/chameleon.dm
@@ -2,7 +2,7 @@
/datum/action/item_action/chameleon/drone/randomise
name = "Randomise Headgear"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "random"
/datum/action/item_action/chameleon/drone/randomise/Trigger(trigger_flags)
@@ -22,7 +22,7 @@
/datum/action/item_action/chameleon/drone/togglehatmask
name = "Toggle Headgear Mode"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
/datum/action/item_action/chameleon/drone/togglehatmask/New()
..()
@@ -165,7 +165,7 @@
/datum/action/item_action/chameleon/change/proc/initialize_disguises()
name = "Change [chameleon_name] Appearance"
- UpdateButtons()
+ build_all_button_icons()
chameleon_blacklist |= typecacheof(target.type)
for(var/V in typesof(chameleon_type))
@@ -213,7 +213,7 @@
update_item(picked_item)
var/obj/item/thing = target
thing.update_slot_icon()
- UpdateButtons()
+ build_all_button_icons()
/datum/action/item_action/chameleon/change/proc/update_item(obj/item/picked_item)
var/atom/atom_target = target
@@ -330,7 +330,7 @@
/datum/action/item_action/chameleon/change/id_trim/initialize_disguises()
name = "Change [chameleon_name] Appearance"
- UpdateButtons()
+ build_all_button_icons()
chameleon_blacklist |= typecacheof(target.type)
for(var/trim_path in typesof(chameleon_type))
@@ -535,9 +535,9 @@
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
chameleon_action.random_look()
var/datum/action/item_action/chameleon/drone/togglehatmask/togglehatmask_action = new(src)
- togglehatmask_action.UpdateButtons()
+ togglehatmask_action.build_all_button_icons()
var/datum/action/item_action/chameleon/drone/randomise/randomise_action = new(src)
- randomise_action.UpdateButtons()
+ randomise_action.build_all_button_icons()
/obj/item/clothing/mask/chameleon
name = "gas mask"
@@ -590,9 +590,9 @@
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
chameleon_action.random_look()
var/datum/action/item_action/chameleon/drone/togglehatmask/togglehatmask_action = new(src)
- togglehatmask_action.UpdateButtons()
+ togglehatmask_action.build_all_button_icons()
var/datum/action/item_action/chameleon/drone/randomise/randomise_action = new(src)
- randomise_action.UpdateButtons()
+ randomise_action.build_all_button_icons()
/obj/item/clothing/mask/chameleon/drone/attack_self(mob/user)
to_chat(user, span_notice("[src] does not have a voice changer."))
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 1cac3ea9cfa..34d02700862 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -411,7 +411,7 @@ BLIND // can't see anything
if(iscarbon(user))
var/mob/living/carbon/C = user
C.head_update(src, forced = 1)
- update_action_buttons()
+ update_item_action_buttons()
return TRUE
/obj/item/clothing/proc/visor_toggling() //handles all the actual toggling of flags
diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm
index 67bd598075d..f1bc00e8be7 100644
--- a/code/modules/clothing/glasses/engine_goggles.dm
+++ b/code/modules/clothing/glasses/engine_goggles.dm
@@ -72,7 +72,7 @@
H.update_sight()
update_appearance()
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/glasses/meson/engine/attack_self(mob/user)
toggle_mode(user, TRUE)
diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm
index 60cc8a64f3f..dfcc3060c9f 100644
--- a/code/modules/clothing/masks/_masks.dm
+++ b/code/modules/clothing/masks/_masks.dm
@@ -88,7 +88,7 @@
user.wear_mask_update(src, toggle_off = mask_adjusted)
if(loc == user)
// Update action button icon for adjusted mask, if someone is holding it.
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
/**
* Proc called in lungs.dm to act if wearing a mask with filters, used to reduce the filters durability, return a changed gas mixture depending on the filter status
diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm
index ff3934fa48a..ddab575da49 100644
--- a/code/modules/clothing/masks/gasmask.dm
+++ b/code/modules/clothing/masks/gasmask.dm
@@ -218,7 +218,7 @@
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
user.update_worn_mask()
- update_action_buttons()
+ update_item_action_buttons()
to_chat(user, span_notice("Your Clown Mask has now morphed into [choice], all praise the Honkmother!"))
return TRUE
@@ -278,7 +278,7 @@
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
user.update_worn_mask()
- update_action_buttons()
+ update_item_action_buttons()
to_chat(user, span_notice("Your Mime Mask has now morphed into [choice]!"))
return TRUE
@@ -368,7 +368,7 @@
if(src && choice && !M.stat && in_range(M,src))
icon_state = options[choice]
user.update_worn_mask()
- update_action_buttons()
+ update_item_action_buttons()
to_chat(M, span_notice("The Tiki Mask has now changed into the [choice] Mask!"))
return 1
diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm
index 282ca61861a..fa0137fbc8d 100644
--- a/code/modules/clothing/shoes/magboots.dm
+++ b/code/modules/clothing/shoes/magboots.dm
@@ -45,7 +45,7 @@
user.update_worn_shoes() //so our mob-overlays update
user.update_gravity(user.has_gravity())
user.update_equipment_speed_mods() //we want to update our speed so we arent running at max speed in regular magboots
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/shoes/magboots/examine(mob/user)
. = ..()
diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm
index d18e830b606..34fa23f3669 100644
--- a/code/modules/clothing/spacesuits/_spacesuits.dm
+++ b/code/modules/clothing/spacesuits/_spacesuits.dm
@@ -218,7 +218,7 @@
if(toggler)
to_chat(toggler, span_notice("You turn [thermal_on ? "on" : "off"] [src]'s thermal regulator."))
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/suit/space/ui_action_click(mob/user, actiontype)
toggle_spacesuit(user)
diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm
index 749ff1fe148..c1e9078ca18 100644
--- a/code/modules/clothing/spacesuits/plasmamen.dm
+++ b/code/modules/clothing/spacesuits/plasmamen.dm
@@ -162,7 +162,7 @@
else
set_light_on(FALSE)
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/head/helmet/space/plasmaman/attack_hand_secondary(mob/user)
..()
diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm
index ddfd117771e..75466c69716 100644
--- a/code/modules/clothing/suits/toggles.dm
+++ b/code/modules/clothing/suits/toggles.dm
@@ -51,7 +51,7 @@
if(alternative_mode)
QDEL_NULL(hood)
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/clothing/suit/hooded/dropped()
..()
@@ -78,7 +78,7 @@
hood_up = TRUE
icon_state = "[initial(icon_state)]_t"
H.update_worn_oversuit()
- update_action_buttons()
+ H.update_mob_action_buttons()
else
RemoveHood()
diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm
index 70020d7368f..8b8abc3a3ff 100644
--- a/code/modules/mafia/controller.dm
+++ b/code/modules/mafia/controller.dm
@@ -967,7 +967,7 @@
/datum/action/innate/mafia_panel
name = "Mafia Panel"
desc = "Use this to play."
- icon_icon = 'icons/obj/mafia.dmi'
+ button_icon = 'icons/obj/mafia.dmi'
button_icon_state = "board"
var/datum/mafia_controller/parent
diff --git a/code/modules/mining/equipment/monster_organs/monster_organ.dm b/code/modules/mining/equipment/monster_organs/monster_organ.dm
index 8ced22edc23..0f3e97d6754 100644
--- a/code/modules/mining/equipment/monster_organs/monster_organ.dm
+++ b/code/modules/mining/equipment/monster_organs/monster_organ.dm
@@ -197,7 +197,7 @@
*/
/datum/action/cooldown/monster_core_action
check_flags = AB_CHECK_CONSCIOUS
- icon_icon = 'icons/obj/medical/organs/mining_organs.dmi'
+ button_icon = 'icons/obj/medical/organs/mining_organs.dmi'
button_icon_state = "hivelord_core_2"
text_cooldown = FALSE //Looks really bad when you have minutes long cooldowns
diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm
index b4b8dec2186..523d306acbc 100644
--- a/code/modules/mining/lavaland/megafauna_loot.dm
+++ b/code/modules/mining/lavaland/megafauna_loot.dm
@@ -124,7 +124,7 @@
playsound(T,'sound/magic/blind.ogg', 200, TRUE, -4)
new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, user)
beacon = new/obj/effect/hierophant(T)
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
user.visible_message(span_hierophant_warning("[user] places a strange machine beneath [user.p_their()] feet!"), \
"[span_hierophant("You detach the hierophant beacon, allowing you to teleport yourself and any allies to it at any time!")]\n\
[span_notice("You can remove the beacon to place it again by striking it with the club.")]")
@@ -142,7 +142,7 @@
to_chat(user, span_warning("You don't have enough space to teleport from here!"))
return
teleporting = TRUE //start channel
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
user.visible_message(span_hierophant_warning("[user] starts to glow faintly..."))
beacon.icon_state = "hierophant_tele_on"
var/obj/effect/temp_visual/hierophant/telegraph/edge/TE1 = new /obj/effect/temp_visual/hierophant/telegraph/edge(user.loc)
@@ -153,7 +153,7 @@
if(T.is_blocked_turf(TRUE))
teleporting = FALSE
to_chat(user, span_warning("The beacon is blocked by something, preventing teleportation!"))
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
beacon.icon_state = "hierophant_tele_off"
return
new /obj/effect/temp_visual/hierophant/telegraph(T, user)
@@ -163,14 +163,14 @@
if(!do_after(user, 3, target = user) || !user || !beacon || QDELETED(beacon)) //no walking away shitlord
teleporting = FALSE
if(user)
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
if(beacon)
beacon.icon_state = "hierophant_tele_off"
return
if(T.is_blocked_turf(TRUE))
teleporting = FALSE
to_chat(user, span_warning("The beacon is blocked by something, preventing teleportation!"))
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
beacon.icon_state = "hierophant_tele_off"
return
user.log_message("teleported self from [AREACOORD(source)] to [beacon].", LOG_GAME)
@@ -192,7 +192,7 @@
beacon.icon_state = "hierophant_tele_off"
teleporting = FALSE
if(user)
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
/obj/item/hierophant_club/proc/teleport_mob(turf/source, mob/teleporting, turf/target, mob/user)
var/turf/turf_to_teleport_to = get_step(target, get_dir(source, teleporting)) //get position relative to caster
diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm
index b7baaeb2814..a9c38110f42 100644
--- a/code/modules/mining/lavaland/tendril_loot.dm
+++ b/code/modules/mining/lavaland/tendril_loot.dm
@@ -814,7 +814,8 @@
name = "Scan"
desc = "Scan an enemy, to get their location and stagger them, increasing their time between attacks."
background_icon_state = "bg_clock"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ overlay_icon_state = "bg_clock_border"
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "scan"
click_to_activate = TRUE
diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm
index 6a1b836135f..9e18de9f5f8 100644
--- a/code/modules/mining/minebot.dm
+++ b/code/modules/mining/minebot.dm
@@ -228,8 +228,9 @@
/datum/action/innate/minedrone
check_flags = AB_CHECK_CONSCIOUS
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/innate/minedrone/toggle_light
name = "Toggle Light"
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index f47b9cd4a6b..9be6f378bd3 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -883,6 +883,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set_sight(initial(sight))
if(target)
UnregisterSignal(target, COMSIG_MOVABLE_Z_CHANGED)
+ hide_other_mob_action_buttons(target)
LAZYREMOVE(target.observers, src)
/mob/dead/observer/verb/observe()
diff --git a/code/modules/mob/living/carbon/alien/adult/alien_powers.dm b/code/modules/mob/living/carbon/alien/adult/alien_powers.dm
index 4f1e711adba..0e944bc038b 100644
--- a/code/modules/mob/living/carbon/alien/adult/alien_powers.dm
+++ b/code/modules/mob/living/carbon/alien/adult/alien_powers.dm
@@ -10,7 +10,8 @@ Doesn't work on other aliens/AI.*/
name = "Alien Power"
panel = "Alien"
background_icon_state = "bg_alien"
- icon_icon = 'icons/mob/actions/actions_xeno.dmi'
+ overlay_icon_state = "bg_alien_border"
+ button_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "spell_default"
check_flags = AB_CHECK_IMMOBILE|AB_CHECK_CONSCIOUS
melee_cooldown_time = 0 SECONDS
@@ -258,7 +259,7 @@ Doesn't work on other aliens/AI.*/
to_chat(on_who, span_notice("You prepare your neurotoxin gland. Left-click to fire at a target!"))
button_icon_state = "alien_neurotoxin_1"
- UpdateButtons()
+ build_all_button_icons()
on_who.update_icons()
/datum/action/cooldown/alien/acid/neurotoxin/unset_click_ability(mob/on_who, refund_cooldown = TRUE)
@@ -270,7 +271,7 @@ Doesn't work on other aliens/AI.*/
to_chat(on_who, span_notice("You empty your neurotoxin gland."))
button_icon_state = "alien_neurotoxin_0"
- UpdateButtons()
+ build_all_button_icons()
on_who.update_icons()
/datum/action/cooldown/alien/acid/neurotoxin/InterceptClickOn(mob/living/caller, params, atom/target)
@@ -413,7 +414,7 @@ Doesn't work on other aliens/AI.*/
vessel.stored_plasma = max(vessel.stored_plasma + amount,0)
vessel.stored_plasma = min(vessel.stored_plasma, vessel.max_plasma) //upper limit of max_plasma, lower limit of 0
for(var/datum/action/cooldown/alien/ability in actions)
- ability.UpdateButtons()
+ ability.build_all_button_icons()
return TRUE
/mob/living/carbon/alien/adjustPlasma(amount)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 0a62ef512eb..ecd2bed559d 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -850,7 +850,7 @@
else
clear_alert(ALERT_HANDCUFFED)
clear_mood_event("handcuffed")
- update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
+ update_mob_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
update_worn_handcuffs()
update_hud_handcuffed()
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 0ce04a2d71d..146fe994a83 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -163,7 +163,7 @@
if(wear_suit.breakouttime) //when equipping a straightjacket
ADD_TRAIT(src, TRAIT_RESTRAINED, SUIT_TRAIT)
stop_pulling() //can't pull if restrained
- update_action_buttons_icon() //certain action buttons will no longer be usable.
+ update_mob_action_buttons() //certain action buttons will no longer be usable.
update_worn_oversuit()
if(ITEM_SLOT_ICLOTHING)
if(w_uniform)
@@ -214,7 +214,7 @@
if(wear_suit.breakouttime) //when unequipping a straightjacket
REMOVE_TRAIT(src, TRAIT_RESTRAINED, SUIT_TRAIT)
drop_all_held_items() //suit is restraining
- update_action_buttons_icon() //certain action buttons may be usable again.
+ update_mob_action_buttons() //certain action buttons may be usable again.
wear_suit = null
if(!QDELETED(src)) //no need to update we're getting deleted anyway
if(I.flags_inv & HIDEJUMPSUIT)
diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm
index 1c8e819639b..684883d386a 100644
--- a/code/modules/mob/living/carbon/human/species_types/golems.dm
+++ b/code/modules/mob/living/carbon/human/species_types/golems.dm
@@ -482,7 +482,7 @@
special_names = list("Crystal", "Polycrystal")
examine_limb_id = SPECIES_GOLEM
- var/datum/action/innate/unstable_teleport/unstable_teleport
+ var/datum/action/cooldown/unstable_teleport/unstable_teleport
var/teleport_cooldown = 100
var/last_teleport = 0
@@ -530,43 +530,27 @@
unstable_teleport.Remove(C)
..()
-/datum/action/innate/unstable_teleport
+/datum/action/cooldown/unstable_teleport
name = "Unstable Teleport"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "jaunt"
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
- var/cooldown = 150
- var/last_teleport = 0
- ///Set to true upon action activation to prevent spamming teleport callbacks while the first is still occurring.
- var/is_charging = FALSE
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
+ cooldown_time = 17.5 SECONDS
-/datum/action/innate/unstable_teleport/IsAvailable(feedback = FALSE)
- . = ..()
- if(!.)
- return
- if(world.time > last_teleport + cooldown && !is_charging)
- return TRUE
- return FALSE
-
-/datum/action/innate/unstable_teleport/Activate()
+/datum/action/cooldown/unstable_teleport/Activate()
var/mob/living/carbon/human/H = owner
H.visible_message(span_warning("[H] starts vibrating!"), span_danger("You start charging your bluespace core..."))
- is_charging = TRUE
- UpdateButtons() //action icon looks unavailable
playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, TRUE)
- addtimer(CALLBACK(src, PROC_REF(teleport), H), 15)
+ addtimer(CALLBACK(src, PROC_REF(teleport), H), 1.5 SECONDS)
+ return TRUE
-/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H)
+/datum/action/cooldown/unstable_teleport/proc/teleport(mob/living/carbon/human/H)
H.visible_message(span_warning("[H] disappears in a shower of sparks!"), span_danger("You teleport!"))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
spark_system.set_up(10, 0, src)
spark_system.attach(H)
spark_system.start()
do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
- last_teleport = world.time
- is_charging = FALSE
- addtimer(CALLBACK(src, PROC_REF(UpdateButtons)), cooldown + 5) //action icon looks available again
-
//honk
/datum/species/golem/bananium
@@ -1230,7 +1214,7 @@
name = "Bone Chill"
desc = "Rattle your bones and strike fear into your enemies!"
check_flags = AB_CHECK_CONSCIOUS
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "bonechill"
var/cooldown = 600
var/last_use
diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
index 1e51a199dda..28403fcc056 100644
--- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
@@ -67,7 +67,7 @@
Cannibalize_Body(H)
if(regenerate_limbs)
- regenerate_limbs.UpdateButtons()
+ regenerate_limbs.build_all_button_icons()
/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H)
var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs()
@@ -102,8 +102,9 @@
name = "Regenerate Limbs"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeheal"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/regenerate_limbs/IsAvailable(feedback = FALSE)
. = ..()
@@ -221,8 +222,9 @@
name = "Split Body"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimesplit"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/split_body/IsAvailable(feedback = FALSE)
. = ..()
@@ -292,8 +294,9 @@
name = "Swap Body"
check_flags = NONE
button_icon_state = "slimeswap"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/swap_body/Activate()
if(!isslimeperson(owner))
@@ -449,52 +452,53 @@
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/luminescent,
BODY_ZONE_CHEST = /obj/item/bodypart/chest/luminescent,
)
+ /// How strong is our glow
var/glow_intensity = LUMINESCENT_DEFAULT_GLOW
+ /// Internal dummy used to glow (very cool)
var/obj/effect/dummy/luminescent_glow/glow
+ /// The slime extract we currently have integrated
var/obj/item/slime_extract/current_extract
- var/datum/action/innate/integrate_extract/integrate_extract
- var/datum/action/innate/use_extract/extract_minor
- var/datum/action/innate/use_extract/major/extract_major
- var/extract_cooldown = 0
-
+ /// A list of all luminescent related actions we have
+ var/list/luminescent_actions
+ /// The cooldown of us using exteracts
+ COOLDOWN_DECLARE(extract_cooldown)
//Species datums don't normally implement destroy, but JELLIES SUCK ASS OUT OF A STEEL STRAW
/datum/species/jelly/luminescent/Destroy(force, ...)
current_extract = null
QDEL_NULL(glow)
- QDEL_NULL(integrate_extract)
- QDEL_NULL(extract_major)
- QDEL_NULL(extract_minor)
+ QDEL_LIST(luminescent_actions)
return ..()
/datum/species/jelly/luminescent/on_species_loss(mob/living/carbon/C)
- ..()
+ . = ..()
if(current_extract)
current_extract.forceMove(C.drop_location())
current_extract = null
QDEL_NULL(glow)
- QDEL_NULL(integrate_extract)
- QDEL_NULL(extract_major)
- QDEL_NULL(extract_minor)
+ QDEL_LIST(luminescent_actions)
-/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/C, datum/species/old_species)
- ..()
- glow = new(C)
- update_glow(C)
- integrate_extract = new(src)
- integrate_extract.Grant(C)
- extract_minor = new(src)
- extract_minor.Grant(C)
- extract_major = new(src)
- extract_major.Grant(C)
+/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/new_jellyperson, datum/species/old_species)
+ . = ..()
+ glow = new(new_jellyperson)
+ update_glow(new_jellyperson)
-/datum/species/jelly/luminescent/proc/update_slime_actions()
- integrate_extract.update_name()
- integrate_extract.UpdateButtons()
- extract_minor.UpdateButtons()
- extract_major.UpdateButtons()
+ luminescent_actions = list()
+ var/datum/action/innate/integrate_extract/integrate_extract = new(src)
+ integrate_extract.Grant(new_jellyperson)
+ luminescent_actions += integrate_extract
+
+ var/datum/action/innate/use_extract/extract_minor = new(src)
+ extract_minor.Grant(new_jellyperson)
+ luminescent_actions += extract_minor
+
+ var/datum/action/innate/use_extract/major/extract_major = new(src)
+ extract_major.Grant(new_jellyperson)
+ luminescent_actions += integrate_extract
+
+/// Updates the glow of our internal glow thing.
/datum/species/jelly/luminescent/proc/update_glow(mob/living/carbon/C, intensity)
if(intensity)
glow_intensity = intensity
@@ -520,104 +524,111 @@
desc = "Eat a slime extract to use its properties."
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeconsume"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
-/datum/action/innate/integrate_extract/proc/update_name()
+/datum/action/innate/integrate_extract/New(Target)
+ . = ..()
+ AddComponent(/datum/component/action_item_overlay, CALLBACK(src, PROC_REF(locate_extract)))
+
+/// Callback for /datum/component/action_item_overlay to find the slime extract from within the species
+/datum/action/innate/integrate_extract/proc/locate_extract()
var/datum/species/jelly/luminescent/species = target
- if(!species || !species.current_extract)
+ if(!istype(species))
+ return null
+
+ return species.current_extract
+
+/datum/action/innate/integrate_extract/update_button_name(atom/movable/screen/movable/action_button/button, force = FALSE)
+ var/datum/species/jelly/luminescent/species = target
+ if(!istype(species) || !species.current_extract)
name = "Integrate Extract"
desc = "Eat a slime extract to use its properties."
else
name = "Eject Extract"
desc = "Eject your current slime extract."
-/datum/action/innate/integrate_extract/UpdateButtons(status_only, force)
+ return ..()
+
+/datum/action/innate/integrate_extract/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
var/datum/species/jelly/luminescent/species = target
- if(!species || !species.current_extract)
+ if(!istype(species) || !species.current_extract)
button_icon_state = "slimeconsume"
else
button_icon_state = "slimeeject"
- ..()
-/datum/action/innate/integrate_extract/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
- ..(current_button, TRUE)
- var/datum/species/jelly/luminescent/species = target
- if(species?.current_extract)
- current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state))
+ return ..()
/datum/action/innate/integrate_extract/Activate()
- var/mob/living/carbon/human/H = owner
+ var/mob/living/carbon/human/human_owner = owner
var/datum/species/jelly/luminescent/species = target
- if(!isluminescent(H) || !species)
+ if(!istype(species))
return
- CHECK_DNA_AND_SPECIES(H)
if(species.current_extract)
- var/obj/item/slime_extract/S = species.current_extract
- if(!H.put_in_active_hand(S))
- S.forceMove(H.drop_location())
+ var/obj/item/slime_extract/to_remove = species.current_extract
+ if(!human_owner.put_in_active_hand(to_remove))
+ to_remove.forceMove(human_owner.drop_location())
+
species.current_extract = null
- to_chat(H, span_notice("You eject [S]."))
- species.update_slime_actions()
+ human_owner.balloon_alert(human_owner, "[to_remove.name] ejected")
+
else
- var/obj/item/I = H.get_active_held_item()
- if(istype(I, /obj/item/slime_extract))
- var/obj/item/slime_extract/S = I
- if(!S.Uses)
- to_chat(H, span_warning("[I] is spent! You cannot integrate it."))
- return
- if(!H.temporarilyRemoveItemFromInventory(S))
- return
- S.forceMove(H)
- species.current_extract = S
- to_chat(H, span_notice("You consume [I], and you feel it pulse within you..."))
- species.update_slime_actions()
- else
- to_chat(H, span_warning("You need to hold an unused slime extract in your active hand!"))
+ var/obj/item/slime_extract/to_integrate = human_owner.get_active_held_item()
+ if(!istype(to_integrate) || to_integrate.Uses <= 0)
+ human_owner.balloon_alert(human_owner, "need an unused slime extract!")
+ return
+ if(!human_owner.temporarilyRemoveItemFromInventory(to_integrate))
+ return
+ to_integrate.forceMove(human_owner)
+ species.current_extract = to_integrate
+ human_owner.balloon_alert(human_owner, "[to_integrate.name] consumed")
+
+ for(var/datum/action/to_update as anything in species.luminescent_actions)
+ to_update.build_all_button_icons()
/datum/action/innate/use_extract
name = "Extract Minor Activation"
desc = "Pulse the slime extract with energized jelly to activate it."
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeuse1"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
var/activation_type = SLIME_ACTIVATE_MINOR
+/datum/action/innate/use_extract/New(Target)
+ . = ..()
+ AddComponent(/datum/component/action_item_overlay, CALLBACK(src, PROC_REF(locate_extract)))
+
+/// Callback for /datum/component/action_item_overlay to find the slime extract from within the species
+/datum/action/innate/use_extract/proc/locate_extract()
+ var/datum/species/jelly/luminescent/species = target
+ if(!istype(species))
+ return null
+
+ return species.current_extract
+
/datum/action/innate/use_extract/IsAvailable(feedback = FALSE)
- if(..())
- var/datum/species/jelly/luminescent/species = target
- if(species && species.current_extract && (world.time > species.extract_cooldown))
- return TRUE
- return FALSE
-
-/datum/action/innate/use_extract/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
- ..(current_button, TRUE)
-
- if(!ishuman(owner))
+ . = ..()
+ if(!.)
return
- var/mob/living/carbon/human/gazer = owner
- var/datum/species/jelly/luminescent/species = gazer?.dna?.species
-
- if(!istype(species, /datum/species/jelly/luminescent))
- return
-
- if(species.current_extract)
- current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state))
+ var/datum/species/jelly/luminescent/species = target
+ if(istype(species) && species.current_extract && (COOLDOWN_FINISHED(species, extract_cooldown)))
+ return TRUE
+ return FALSE
/datum/action/innate/use_extract/Activate()
- var/mob/living/carbon/human/H = owner
- var/datum/species/jelly/luminescent/species = H.dna.species
- if(!isluminescent(H) || !species)
+ var/mob/living/carbon/human/human_owner = owner
+ var/datum/species/jelly/luminescent/species = human_owner.dna?.species
+ if(!istype(species) || !species.current_extract)
return
- CHECK_DNA_AND_SPECIES(H)
- if(species.current_extract)
- species.extract_cooldown = world.time + 100
- var/cooldown = species.current_extract.activate(H, species, activation_type)
- species.extract_cooldown = world.time + cooldown
+ COOLDOWN_START(species, extract_cooldown, 10 SECONDS)
+ var/after_use_cooldown = species.current_extract.activate(human_owner, species, activation_type)
+ COOLDOWN_START(species, extract_cooldown, after_use_cooldown)
/datum/action/innate/use_extract/major
name = "Extract Major Activation"
@@ -661,8 +672,9 @@
name = "Send Thought"
desc = "Send a private psychic message to someone you can see."
button_icon_state = "send_mind"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/project_thought/Activate()
var/mob/living/carbon/human/telepath = owner
@@ -699,8 +711,9 @@
name = "Link Minds"
desc = "Link someone's mind to your Slime Link, allowing them to communicate telepathically with other linked minds."
button_icon_state = "mindlink"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/// The species required to use this ability. Typepath.
var/req_species = /datum/species/jelly/stargazer
/// Whether we're currently linking to someone.
diff --git a/code/modules/mob/living/carbon/human/species_types/monkeys.dm b/code/modules/mob/living/carbon/human/species_types/monkeys.dm
index 3ab8f011650..19fc6944b87 100644
--- a/code/modules/mob/living/carbon/human/species_types/monkeys.dm
+++ b/code/modules/mob/living/carbon/human/species_types/monkeys.dm
@@ -212,14 +212,18 @@
/datum/action/item_action/organ_action/toggle_trip
name = "Toggle Tripping"
- icon_icon = 'icons/mob/actions/actions_changeling.dmi'
+ button_icon = 'icons/mob/actions/actions_changeling.dmi'
button_icon_state = "lesser_form"
background_icon_state = "bg_default_on"
+ overlay_icon_state = "bg_default_border"
/datum/action/item_action/organ_action/toggle_trip/Trigger(trigger_flags)
. = ..()
+ if(!.)
+ return
+
var/obj/item/organ/internal/brain/primate/monkey_brain = target
- if(monkey_brain.tripping == TRUE)
+ if(monkey_brain.tripping)
monkey_brain.tripping = FALSE
background_icon_state = "bg_default"
to_chat(monkey_brain.owner, span_notice("You will now avoid stumbling while colliding with people who are in combat mode."))
@@ -227,7 +231,7 @@
monkey_brain.tripping = TRUE
background_icon_state = "bg_default_on"
to_chat(monkey_brain.owner, span_notice("You will now stumble while while colliding with people who are in combat mode."))
- UpdateButtons()
+ build_all_button_icons()
/obj/item/organ/internal/brain/primate/Insert(mob/living/carbon/primate, special = FALSE, drop_if_replaced = FALSE, no_id_transfer = FALSE)
diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm
index 372ba2584e7..38683f0fdc8 100644
--- a/code/modules/mob/living/carbon/inventory.dm
+++ b/code/modules/mob/living/carbon/inventory.dm
@@ -170,7 +170,7 @@
if(I == internal && (QDELETED(src) || QDELETED(I) || I.loc != src))
cutoff_internals()
if(!QDELETED(src))
- update_action_buttons_icon(status_only = TRUE)
+ update_mob_action_buttons(UPDATE_BUTTON_STATUS)
update_equipment_speed_mods()
@@ -215,7 +215,7 @@
else
internal = target_tank
target_tank.after_internals_opened(src)
- update_action_buttons_icon()
+ update_mob_action_buttons()
return TRUE
/**
@@ -247,7 +247,7 @@
else
internal = null
target_tank.after_internals_closed(src)
- update_action_buttons_icon()
+ update_mob_action_buttons()
return TRUE
/// Close the the currently open external (that's EX-ternal) air tank. Returns TREUE if successful.
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index 91748a817d9..7a2ac852b01 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -91,7 +91,7 @@
SetSleeping(0, 0)
reset_perspective(null)
reload_fullscreen()
- update_action_buttons_icon()
+ update_mob_action_buttons()
update_damage_hud()
update_health_hud()
med_hud_set_health()
diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm
index d3f813f76f2..50fd7b890cd 100644
--- a/code/modules/mob/living/init_signals.dm
+++ b/code/modules/mob/living/init_signals.dm
@@ -133,13 +133,13 @@
SIGNAL_HANDLER
mobility_flags &= ~(MOBILITY_UI)
unset_machine()
- update_action_buttons_icon()
+ update_mob_action_buttons()
/// Called when [TRAIT_UI_BLOCKED] is removed from the mob.
/mob/living/proc/on_ui_blocked_trait_loss(datum/source)
SIGNAL_HANDLER
mobility_flags |= MOBILITY_UI
- update_action_buttons_icon()
+ update_mob_action_buttons()
/// Called when [TRAIT_PULL_BLOCKED] is added to the mob.
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 46251fd5f30..dea7583ddf9 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -748,7 +748,7 @@
/datum/action/innate/core_return
name = "Return to Main Core"
desc = "Leave the APC and resume normal core operations."
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
button_icon_state = "ai_malf_core"
/datum/action/innate/core_return/Activate()
@@ -900,7 +900,7 @@
/datum/action/innate/choose_modules
name = "Malfunction Modules"
desc = "Choose from a variety of insidious modules to aid you."
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
button_icon_state = "modules_menu"
var/datum/module_picker/module_picker
@@ -1028,7 +1028,7 @@
/datum/action/innate/deploy_shell
name = "Deploy to AI Shell"
desc = "Wirelessly control a specialized cyborg shell."
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
button_icon_state = "ai_shell"
/datum/action/innate/deploy_shell/Trigger(trigger_flags)
@@ -1040,7 +1040,7 @@
/datum/action/innate/deploy_last_shell
name = "Reconnect to shell"
desc = "Reconnect to the most recently used AI shell."
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
button_icon_state = "ai_last_shell"
var/mob/living/silicon/robot/last_used_shell
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 1825a33fef0..d66d1732157 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -884,7 +884,7 @@
/datum/action/innate/undeployment
name = "Disconnect from shell"
desc = "Stop controlling your shell and resume normal core operations."
- icon_icon = 'icons/mob/actions/actions_AI.dmi'
+ button_icon = 'icons/mob/actions/actions_AI.dmi'
button_icon_state = "ai_core"
/datum/action/innate/undeployment/Trigger(trigger_flags)
diff --git a/code/modules/mob/living/silicon/robot/robot_model.dm b/code/modules/mob/living/silicon/robot/robot_model.dm
index f0fd1acc4a8..528d5acc993 100644
--- a/code/modules/mob/living/silicon/robot/robot_model.dm
+++ b/code/modules/mob/living/silicon/robot/robot_model.dm
@@ -382,7 +382,7 @@
/datum/action/toggle_buffer
name = "Activate Auto-Wash"
desc = "Trade speed and water for a clean floor."
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "activate_wash"
var/static/datum/callback/allow_buffer_activate
var/block_buffer_change = FALSE
@@ -487,7 +487,7 @@
if(!wash_audio.is_active())
wash_audio.start()
clean()
- UpdateButtons()
+ build_all_button_icons()
/// Start the process of disabling the buffer. Plays some effects, waits a bit, then finishes
/datum/action/toggle_buffer/proc/deactivate_wash()
@@ -517,7 +517,7 @@
var/mob/living/silicon/robot/robot_owner = owner
buffer_on = FALSE
robot_owner.remove_movespeed_modifier(/datum/movespeed_modifier/auto_wash)
- UpdateButtons()
+ build_all_button_icons()
/// Should we keep trying to activate our buffer, or did you fuck it up somehow
/datum/action/toggle_buffer/proc/allow_buffer_activate()
@@ -554,14 +554,18 @@
// We use more water doing this then mopping
reagents.remove_any(2) //reaction() doesn't use up the reagents
-/datum/action/toggle_buffer/UpdateButtons(status_only = FALSE, force = FALSE)
+/datum/action/toggle_buffer/update_button_name(atom/movable/screen/movable/action_button/current_button, force)
if(buffer_on)
name = "De-Activate Auto-Wash"
- button_icon_state = "deactivate_wash"
else
name = "Activate Auto-Wash"
- button_icon_state = "activate_wash"
+ return ..()
+/datum/action/toggle_buffer/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
+ if(buffer_on)
+ button_icon_state = "deactivate_wash"
+ else
+ button_icon_state = "activate_wash"
return ..()
/obj/item/reagent_containers/spray/cyborg_drying
diff --git a/code/modules/mob/living/simple_animal/bot/vibebot.dm b/code/modules/mob/living/simple_animal/bot/vibebot.dm
index 59b01b1399a..4a83803157b 100644
--- a/code/modules/mob/living/simple_animal/bot/vibebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/vibebot.dm
@@ -61,7 +61,7 @@
/datum/action/innate/vibe
name = "Vibe"
desc = "LMB: Change vibe color. RMB: Reset vibe color."
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "funk"
/datum/action/innate/vibe/IsAvailable(feedback = FALSE)
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index 4c90edae049..0128e6ec73b 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -56,7 +56,7 @@
var/spellnum = 1
for(var/datum/action/spell as anything in actions)
- if(!(type in construct_spells))
+ if(!(spell.type in construct_spells))
continue
var/pos = 2 + spellnum * 31
@@ -254,7 +254,7 @@
total_refund += attack_refund
jaunt.next_use_time -= total_refund
- jaunt.UpdateButtons()
+ jaunt.build_all_button_icons()
/mob/living/simple_animal/hostile/construct/wraith/hostile //actually hostile, will move around, hit things
AIStatus = AI_ON
@@ -470,6 +470,8 @@
name = "Seek your Master"
desc = "You and your master share a soul-link that informs you of their location"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
buttontooltipstyle = "cult"
button_icon_state = "cult_mark"
var/tracking = FALSE
@@ -507,8 +509,10 @@
/datum/action/innate/seek_prey
name = "Seek the Harvest"
desc = "None can hide from Nar'Sie, activate to track a survivor attempting to flee the red harvest!"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
buttontooltipstyle = "cult"
button_icon_state = "cult_mark"
diff --git a/code/modules/mob/living/simple_animal/heretic_monsters.dm b/code/modules/mob/living/simple_animal/heretic_monsters.dm
index bad34d93798..5c36fcc7506 100644
--- a/code/modules/mob/living/simple_animal/heretic_monsters.dm
+++ b/code/modules/mob/living/simple_animal/heretic_monsters.dm
@@ -78,7 +78,7 @@
link_message = on_link_message, \
unlink_message = on_unlink_message, \
post_unlink_callback = CALLBACK(src, PROC_REF(after_unlink)), \
- speech_action_background_icon_state = "bg_ecult", \
+ speech_action_background_icon_state = "bg_heretic", \
)
/mob/living/simple_animal/hostile/heretic_summon/raw_prophet/attack_animal(mob/living/simple_animal/user, list/modifiers)
diff --git a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm
index 50045ec90cb..713120b84a7 100644
--- a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm
@@ -33,7 +33,7 @@
//Lets the wizard summon his art to fight for him
/datum/action/boss/wizard_summon_minions
name = "Summon Minions"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "art_summon"
usage_probability = 40
boss_cost = 30
@@ -84,7 +84,7 @@
//Hitting the wizard himself destroys all decoys
/datum/action/boss/wizard_mimic
name = "Craft Mimicry"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "mimic_summon"
usage_probability = 30
boss_cost = 40
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index 4e6d9a72b35..4b2b92bda6f 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -301,8 +301,9 @@
not_hivemind_talk.Grant(src)
/datum/action/innate/spider
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
/datum/action/innate/spider/lay_web // Todo: Unify this with the genetics power
name = "Spin Web"
@@ -314,7 +315,7 @@
. = ..()
if (!owner)
return
- RegisterSignals(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_status_on_signal))
/datum/action/innate/spider/lay_web/Remove(mob/removed_from)
. = ..()
@@ -361,7 +362,7 @@
qdel(web)
new /obj/structure/spider/stickyweb/sealed(spider_turf)
new /obj/structure/spider/stickyweb(spider_turf)
- UpdateButtons()
+ build_all_button_icons()
spider.stop_automated_movement = FALSE
@@ -371,7 +372,8 @@
you'll also consume them, allowing you to lay enriched eggs. \
Activate this ability and then click on an adjacent target to begin wrapping them."
background_icon_state = "bg_alien"
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ overlay_icon_state = "bg_alien_border"
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = "wrap_0"
check_flags = AB_CHECK_CONSCIOUS
click_to_activate = TRUE
@@ -383,7 +385,7 @@
. = ..()
if (!owner)
return
- RegisterSignals(owner, list(COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_status_on_signal))
/datum/action/cooldown/wrap/Remove(mob/removed_from)
. = ..()
@@ -406,7 +408,7 @@
on_who.balloon_alert(on_who, "prepared to wrap")
button_icon_state = "wrap_1"
- UpdateButtons()
+ build_all_button_icons()
/datum/action/cooldown/wrap/unset_click_ability(mob/on_who, refund_cooldown = TRUE)
. = ..()
@@ -416,7 +418,7 @@
if (refund_cooldown)
on_who.balloon_alert(on_who, "wrap cancelled")
button_icon_state = "wrap_0"
- UpdateButtons()
+ build_all_button_icons()
/datum/action/cooldown/wrap/Activate(atom/to_wrap)
if(!owner.Adjacent(to_wrap))
@@ -466,7 +468,7 @@
var/datum/action/innate/spider/lay_eggs/enriched/egg_power = locate() in owner.actions
if(egg_power)
egg_power.charges++
- egg_power.UpdateButtons()
+ egg_power.build_all_button_icons()
owner.visible_message(
span_danger("[owner] sticks a proboscis into [living_wrapped] and sucks a viscous substance out."),
span_notice("You suck the nutriment out of [living_wrapped], feeding you enough to lay a cluster of enriched eggs."),
@@ -496,7 +498,7 @@
. = ..()
if (!owner)
return
- RegisterSignals(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_DO_AFTER_BEGAN, COMSIG_DO_AFTER_ENDED), PROC_REF(update_status_on_signal))
/datum/action/innate/spider/lay_eggs/Remove(mob/removed_from)
. = ..()
@@ -532,7 +534,7 @@
owner.balloon_alert(owner, "already eggs here!")
else
lay_egg()
- UpdateButtons(TRUE)
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
spider.stop_automated_movement = FALSE
/datum/action/innate/spider/lay_eggs/proc/lay_egg()
diff --git a/code/modules/mob/living/simple_animal/hostile/goose.dm b/code/modules/mob/living/simple_animal/hostile/goose.dm
index b19cc323f42..2715e10cefb 100644
--- a/code/modules/mob/living/simple_animal/hostile/goose.dm
+++ b/code/modules/mob/living/simple_animal/hostile/goose.dm
@@ -248,7 +248,7 @@
name = "Vomit"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "vomit"
- icon_icon = 'icons/mob/simple/animal.dmi'
+ button_icon = 'icons/mob/simple/animal.dmi'
cooldown_time = 250
/datum/action/cooldown/vomit/Activate(atom/target)
diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm
index a32669f34fc..2aef469a55d 100644
--- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm
+++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm
@@ -140,6 +140,7 @@
/datum/action/innate/hivebot
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/innate/hivebot/foamwall
name = "Foam Wall"
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm
index 610a394a5ea..136b749d75b 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm
@@ -192,7 +192,7 @@
/datum/action/innate/megafauna_attack
name = "Megafauna Attack"
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = ""
var/chosen_message
var/chosen_attack_num = 0
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index 7660a491ee3..2b294a62835 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -555,7 +555,7 @@
/datum/action/exit_possession
name = "Exit Possession"
desc = "Exits the body you are possessing. They will explode violently when this occurs."
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "exit_possession"
/datum/action/exit_possession/IsAvailable(feedback = FALSE)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
index 5e61fc7ad26..ec8736ec33f 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
@@ -97,28 +97,28 @@ Difficulty: Hard
/datum/action/innate/megafauna_attack/blink
name = "Blink To Target"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
chosen_message = "You are now blinking to your target."
chosen_attack_num = 1
/datum/action/innate/megafauna_attack/chaser_swarm
name = "Chaser Swarm"
- icon_icon = 'icons/effects/effects.dmi'
+ button_icon = 'icons/effects/effects.dmi'
button_icon_state = "hierophant_squares_indefinite"
chosen_message = "You are firing a chaser swarm at your target."
chosen_attack_num = 2
/datum/action/innate/megafauna_attack/cross_blasts
name = "Cross Blasts"
- icon_icon = 'icons/effects/effects.dmi'
+ button_icon = 'icons/effects/effects.dmi'
button_icon_state = "hierophant_blast_indefinite"
chosen_message = "You are now firing cross blasts at your target."
chosen_attack_num = 3
/datum/action/innate/megafauna_attack/blink_spam
name = "Blink Chase"
- icon_icon = 'icons/obj/lavaland/artefacts.dmi'
+ button_icon = 'icons/obj/lavaland/artefacts.dmi'
button_icon_state = "hierophant_club_ready_beacon"
chosen_message = "You are now repeatedly blinking at your target."
chosen_attack_num = 4
@@ -761,7 +761,7 @@ Difficulty: Hard
to_chat(user, span_hierophant_warning("You collect [src], reattaching it to the club!"))
H.beacon = null
H.update_appearance()
- user.update_action_buttons_icon()
+ user.update_mob_action_buttons()
qdel(src)
else
to_chat(user, span_hierophant_warning("You touch the beacon with the club, but nothing happens."))
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm
index 43dfa0d3e79..ebd8e255d3d 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm
@@ -99,21 +99,21 @@
/datum/action/innate/megafauna_attack/create_skull
name = "Create Legion Skull"
- icon_icon = 'icons/mob/simple/lavaland/lavaland_monsters.dmi'
+ button_icon = 'icons/mob/simple/lavaland/lavaland_monsters.dmi'
button_icon_state = "legion_head"
chosen_message = "You are now creating legion skulls."
chosen_attack_num = 1
/datum/action/innate/megafauna_attack/charge_target
name = "Charge Target"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
chosen_message = "You are now charging at your target."
chosen_attack_num = 2
/datum/action/innate/megafauna_attack/create_turrets
name = "Create Sentinels"
- icon_icon = 'icons/mob/simple/lavaland/lavaland_monsters.dmi'
+ button_icon = 'icons/mob/simple/lavaland/lavaland_monsters.dmi'
button_icon_state = "legion_turret"
chosen_message = "You are now creating legion sentinels."
chosen_attack_num = 3
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
index a2c3f4a9445..7545f7d0cc0 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
@@ -75,21 +75,21 @@ Difficulty: Hard
/datum/action/innate/megafauna_attack/heavy_stomp
name = "Heavy Stomp"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
chosen_message = "You are now stomping the ground around you."
chosen_attack_num = 1
/datum/action/innate/megafauna_attack/teleport
name = "Teleport"
- icon_icon = 'icons/effects/bubblegum.dmi'
+ button_icon = 'icons/effects/bubblegum.dmi'
button_icon_state = "smack ya one"
chosen_message = "You are now teleporting at the target you click on."
chosen_attack_num = 2
/datum/action/innate/megafauna_attack/shockwave_scream
name = "Shockwave Scream"
- icon_icon = 'icons/turf/walls/wall.dmi'
+ button_icon = 'icons/turf/walls/wall.dmi'
button_icon_state = "wall-0"
chosen_message = "You are now screeching, disorienting targets around you."
chosen_attack_num = 3
diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm
index dca1f2a98b9..633f6d7c23d 100644
--- a/code/modules/mob/living/simple_animal/hostile/mimic.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm
@@ -398,6 +398,7 @@ GLOBAL_LIST_INIT(mimic_blacklist, list(/obj/structure/table, /obj/structure/cabl
/datum/action/innate/mimic
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/innate/mimic/lock
name = "Lock/Unlock"
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
index c7bcfaef68e..32edc82a4d1 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
@@ -69,42 +69,43 @@ While using this makes the system rely on OnFire, it still gives options for tim
/datum/action/innate/elite_attack
name = "Elite Attack"
- icon_icon = 'icons/mob/actions/actions_elites.dmi'
+ button_icon = 'icons/mob/actions/actions_elites.dmi'
button_icon_state = ""
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
///The displayed message into chat when this attack is selected
var/chosen_message
///The internal attack ID for the elite's OpenFire() proc to use
var/chosen_attack_num = 0
-/datum/action/innate/elite_attack/CreateButton()
+/datum/action/innate/elite_attack/create_button()
var/atom/movable/screen/movable/action_button/button = ..()
button.maptext = ""
- button.maptext_x = 8
- button.maptext_y = 0
+ button.maptext_x = 6
+ button.maptext_y = 2
button.maptext_width = 24
button.maptext_height = 12
return button
/datum/action/innate/elite_attack/process()
- if(owner == null)
+ if(isnull(owner))
STOP_PROCESSING(SSfastprocess, src)
qdel(src)
return
- UpdateButtons()
-/datum/action/innate/elite_attack/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
- . = ..()
- if(!.)
- return
- if(status_only)
- return
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
+
+/datum/action/innate/elite_attack/update_button_status(atom/movable/screen/movable/action_button/button, force = FALSE)
var/mob/living/simple_animal/hostile/asteroid/elite/elite_owner = owner
+ if(!istype(owner))
+ button.maptext = ""
+ return
+
var/timeleft = max(elite_owner.ranged_cooldown - world.time, 0)
if(timeleft == 0)
button.maptext = ""
else
- button.maptext = "[round(timeleft/10, 0.1)]"
+ button.maptext = MAPTEXT("[round(timeleft/10, 0.1)]")
/datum/action/innate/elite_attack/Grant(mob/living/L)
if(istype(L, /mob/living/simple_animal/hostile/asteroid/elite))
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
index dc6e70f2fee..c2608930161 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
@@ -51,6 +51,7 @@
/datum/action/innate/goldgrub
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/innate/goldgrub/spitore
name = "Spit Ore"
diff --git a/code/modules/mob/living/simple_animal/hostile/netherworld.dm b/code/modules/mob/living/simple_animal/hostile/netherworld.dm
index c62230ebbaf..1addafe2e14 100644
--- a/code/modules/mob/living/simple_animal/hostile/netherworld.dm
+++ b/code/modules/mob/living/simple_animal/hostile/netherworld.dm
@@ -34,6 +34,7 @@
/datum/action/innate/creature
background_icon_state = "bg_default"
+ overlay_icon_state = "bg_default_border"
/datum/action/innate/creature/teleport
name = "Teleport"
diff --git a/code/modules/mob/living/simple_animal/hostile/ooze.dm b/code/modules/mob/living/simple_animal/hostile/ooze.dm
index 2445428195e..a33fe4e2560 100644
--- a/code/modules/mob/living/simple_animal/hostile/ooze.dm
+++ b/code/modules/mob/living/simple_animal/hostile/ooze.dm
@@ -136,7 +136,8 @@
name = "Metabolic boost"
desc = "Gain a temporary speed boost. Costs 10 nutrition and slowly raises your temperature"
background_icon_state = "bg_hive"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ overlay_icon_state = "bg_hive_border"
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
button_icon_state = "metabolic_boost"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
cooldown_time = 24 SECONDS
@@ -191,7 +192,8 @@
name = "Consume"
desc = "Consume a mob that you are dragging to gain nutrition from them"
background_icon_state = "bg_hive"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ overlay_icon_state = "bg_hive_border"
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
button_icon_state = "consume"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
///The mob thats being consumed by this creature
@@ -298,7 +300,8 @@
name = "Fire Mending globule"
desc = "Fires a mending globule at someone, healing a specific limb of theirs."
background_icon_state = "bg_hive"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ overlay_icon_state = "bg_hive_border"
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
button_icon_state = "globules"
check_flags = AB_CHECK_CONSCIOUS
cooldown_time = 5 SECONDS
@@ -411,7 +414,8 @@
name = "Gel Cocoon"
desc = "Puts a mob inside of a cocoon, allowing it to slowly heal."
background_icon_state = "bg_hive"
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ overlay_icon_state = "bg_hive_border"
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
button_icon_state = "gel_cocoon"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
cooldown_time = 10 SECONDS
diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm
index 6c80e782eb4..ba3f5282702 100644
--- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm
+++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm
@@ -212,8 +212,9 @@
check_flags = AB_CHECK_CONSCIOUS
cooldown_time = 6 SECONDS
melee_cooldown_time = 0 SECONDS
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
background_icon_state = "bg_clock"
+ overlay_icon_state = "bg_clock_border"
button_icon_state = "coffer"
/datum/action/cooldown/domain/proc/domain()
@@ -243,9 +244,10 @@
name = "Raise Army"
desc = "Raise an army out of the hordes of mice and pests crawling around the maintenance shafts."
check_flags = AB_CHECK_CONSCIOUS
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = "riot"
background_icon_state = "bg_clock"
+ overlay_icon_state = "bg_clock_border"
cooldown_time = 8 SECONDS
melee_cooldown_time = 0 SECONDS
diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm
index 55cf97c4a7a..9597dff77b6 100644
--- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm
+++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm
@@ -111,8 +111,9 @@
desc = "Shake loose a few banana peels."
cooldown_time = 8 SECONDS
button_icon_state = "rustle"
- icon_icon = 'icons/mob/actions/actions_clown.dmi'
+ button_icon = 'icons/mob/actions/actions_clown.dmi'
background_icon_state = "bg_nature"
+ overlay_icon_state = "bg_nature_border"
///which type of peel to spawn
var/banana_type = /obj/item/grown/bananapeel
///How many peels to spawn
@@ -139,10 +140,11 @@
/datum/action/cooldown/exquisite_bunch
name = "Exquisite Bunch"
desc = "Pluck your finest bunch of bananas from your head. This bunch is especially nutrious to monkeykind. A gentle tap will trigger an explosive ripening process."
- icon_icon = 'icons/obj/hydroponics/harvest.dmi'
+ button_icon = 'icons/obj/hydroponics/harvest.dmi'
cooldown_time = 60 SECONDS
button_icon_state = "banana_bunch"
background_icon_state = "bg_nature"
+ overlay_icon_state = "bg_nature_border"
///If we are currently activating our ability.
var/activating = FALSE
@@ -475,7 +477,8 @@
name = "Regurgitate"
desc = "Regurgitates a single item from the depths of your pouch."
background_icon_state = "bg_changeling"
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ overlay_icon_state = "bg_changeling_border"
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = "regurgitate"
check_flags = AB_CHECK_CONSCIOUS
melee_cooldown_time = 0 SECONDS
diff --git a/code/modules/mob/living/simple_animal/hostile/vatbeast.dm b/code/modules/mob/living/simple_animal/hostile/vatbeast.dm
index c8eb1e505c6..a663b63217e 100644
--- a/code/modules/mob/living/simple_animal/hostile/vatbeast.dm
+++ b/code/modules/mob/living/simple_animal/hostile/vatbeast.dm
@@ -45,7 +45,8 @@
name = "Tentacle slap"
desc = "Slap a creature with your tentacles."
background_icon_state = "bg_revenant"
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ overlay_icon_state = "bg_revenant_border"
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
button_icon_state = "tentacle_slap"
check_flags = AB_CHECK_CONSCIOUS
cooldown_time = 12 SECONDS
@@ -53,13 +54,14 @@
click_to_activate = TRUE
ranged_mousepointer = 'icons/effects/mouse_pointers/supplypod_target.dmi'
-/datum/action/cooldown/tentacle_slap/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force)
- . = ..()
- if(!button)
- return
- if(!status_only && button.our_hud.mymob != owner)
+/datum/action/cooldown/tentacle_slap/update_button_name(atom/movable/screen/movable/action_button/button, force)
+ if(button.our_hud.mymob != owner)
+ // For buttons given to mobs which are not our owner, give it this alt name
button.name = "Command Tentacle Slap"
button.desc = "Command your steed to slap a creature with its tentacles."
+ return
+
+ return ..()
/datum/action/cooldown/tentacle_slap/set_click_ability(mob/on_who)
. = ..()
diff --git a/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm b/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm
index 8e74d8b97d0..754346e8cfa 100644
--- a/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm
+++ b/code/modules/mob/living/simple_animal/hostile/wumborian_fugu.dm
@@ -75,8 +75,9 @@
E.Activate()
/datum/action/innate/fugu
- icon_icon = 'icons/mob/actions/actions_animal.dmi'
+ button_icon = 'icons/mob/actions/actions_animal.dmi'
background_icon_state = "bg_fugu"
+ overlay_icon_state = "bg_fugu_border"
/datum/action/innate/fugu/expand
name = "Inflate"
diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm
index 67ef8c592ce..894d376c48c 100644
--- a/code/modules/mob/living/simple_animal/slime/life.dm
+++ b/code/modules/mob/living/simple_animal/slime/life.dm
@@ -246,7 +246,7 @@
else if (nutrition >= get_grow_nutrition() && amount_grown < SLIME_EVOLUTION_THRESHOLD)
adjust_nutrition(-10 * delta_time)
amount_grown++
- update_action_buttons_icon()
+ update_mob_action_buttons()
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD && !buckled && !Target && !ckey)
if(is_adult && loc.AllowDrop())
diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm
index cbf17702b43..572201d336b 100644
--- a/code/modules/mob/living/simple_animal/slime/powers.dm
+++ b/code/modules/mob/living/simple_animal/slime/powers.dm
@@ -7,8 +7,9 @@
/datum/action/innate/slime
check_flags = AB_CHECK_CONSCIOUS
- icon_icon = 'icons/mob/actions/actions_slime.dmi'
+ button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ overlay_icon_state = "bg_alien_border"
var/needs_growth = NO_GROWTH_NEEDED
/datum/action/innate/slime/IsAvailable(feedback = FALSE)
diff --git a/code/modules/mod/mod_actions.dm b/code/modules/mod/mod_actions.dm
index b966b45c380..48cbf96e021 100644
--- a/code/modules/mod/mod_actions.dm
+++ b/code/modules/mod/mod_actions.dm
@@ -1,6 +1,7 @@
/datum/action/item_action/mod
background_icon_state = "bg_mod"
- icon_icon = 'icons/mob/actions/actions_mod.dmi'
+ overlay_icon_state = "bg_mod_border"
+ button_icon = 'icons/mob/actions/actions_mod.dmi'
check_flags = AB_CHECK_CONSCIOUS
/// Whether this action is intended for the AI. Stuff breaks a lot if this is done differently.
var/ai_action = FALSE
@@ -70,7 +71,7 @@
if(!(trigger_flags & TRIGGER_SECONDARY_ACTION) && !ready)
ready = TRUE
button_icon_state = "activate-ready"
- UpdateButtons()
+ build_all_button_icons()
addtimer(CALLBACK(src, PROC_REF(reset_ready)), 3 SECONDS)
return
var/obj/item/mod/control/mod = target
@@ -81,7 +82,7 @@
/datum/action/item_action/mod/activate/proc/reset_ready()
ready = FALSE
button_icon_state = initial(button_icon_state)
- UpdateButtons()
+ build_all_button_icons()
/datum/action/item_action/mod/activate/ai
ai_action = TRUE
@@ -132,7 +133,7 @@
module = linked_module
name = "Activate [capitalize(linked_module.name)]"
desc = "Quickly activate [linked_module]."
- icon_icon = linked_module.icon
+ button_icon = linked_module.icon
button_icon_state = linked_module.icon_state
RegisterSignal(linked_module, COMSIG_MODULE_ACTIVATED, PROC_REF(on_module_activate))
RegisterSignal(linked_module, COMSIG_MODULE_DEACTIVATED, PROC_REF(on_module_deactivate))
@@ -158,8 +159,8 @@
return
module.on_select()
-/datum/action/item_action/mod/pinned_module/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force)
- . = ..(current_button, force = TRUE)
+/datum/action/item_action/mod/pinned_module/apply_button_overlay(atom/movable/screen/movable/action_button/current_button, force)
+ . = ..()
if(override)
return
var/obj/item/mod/control/mod = target
@@ -175,14 +176,14 @@
/datum/action/item_action/mod/pinned_module/proc/on_module_activate(datum/source)
SIGNAL_HANDLER
- UpdateButtons()
+ build_all_button_icons()
/datum/action/item_action/mod/pinned_module/proc/on_module_deactivate(datum/source)
SIGNAL_HANDLER
- UpdateButtons()
+ build_all_button_icons()
/datum/action/item_action/mod/pinned_module/proc/on_module_use(datum/source)
SIGNAL_HANDLER
- UpdateButtons()
+ build_all_button_icons()
diff --git a/code/modules/mod/modules/module_pathfinder.dm b/code/modules/mod/modules/module_pathfinder.dm
index 3863fb2f176..e194dac7664 100644
--- a/code/modules/mod/modules/module_pathfinder.dm
+++ b/code/modules/mod/modules/module_pathfinder.dm
@@ -146,7 +146,8 @@
desc = "Recall a MODsuit anyplace, anytime."
check_flags = AB_CHECK_CONSCIOUS
background_icon_state = "bg_mod"
- icon_icon = 'icons/mob/actions/actions_mod.dmi'
+ overlay_icon_state = "bg_mod_border"
+ button_icon = 'icons/mob/actions/actions_mod.dmi'
button_icon_state = "recall"
/// The cooldown for the recall.
COOLDOWN_DECLARE(recall_cooldown)
diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm
index e758aaee903..ad646454cae 100644
--- a/code/modules/modular_computers/computers/item/computer.dm
+++ b/code/modules/modular_computers/computers/item/computer.dm
@@ -683,7 +683,7 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
return FALSE
set_light_on(!light_on)
update_appearance()
- update_action_buttons(force = TRUE) //force it because we added an overlay, not changed its icon
+ update_item_action_buttons(force = TRUE) //force it because we added an overlay, not changed its icon
return TRUE
/**
diff --git a/code/modules/pai/actions.dm b/code/modules/pai/actions.dm
index cd1015d2506..0d22d828382 100644
--- a/code/modules/pai/actions.dm
+++ b/code/modules/pai/actions.dm
@@ -1,6 +1,6 @@
/datum/action/innate/pai
name = "PAI Action"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
var/mob/living/silicon/pai/pai_owner
/datum/action/innate/pai/Trigger(trigger_flags)
@@ -12,6 +12,7 @@
name = "Software Interface"
button_icon_state = "pai"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/software/Trigger(trigger_flags)
..()
@@ -21,6 +22,7 @@
name = "Toggle Holoform"
button_icon_state = "pai_holoform"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/shell/Trigger(trigger_flags)
..()
@@ -33,6 +35,7 @@
name = "Holochassis Appearance Composite"
button_icon_state = "pai_chassis"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/chassis/Trigger(trigger_flags)
..()
@@ -42,6 +45,7 @@
name = "Rest"
button_icon_state = "pai_rest"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/rest/Trigger(trigger_flags)
..()
@@ -49,9 +53,10 @@
/datum/action/innate/pai/light
name = "Toggle Integrated Lights"
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "emp"
background_icon_state = "bg_tech"
+ overlay_icon_state = "bg_tech_border"
/datum/action/innate/pai/light/Trigger(trigger_flags)
..()
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 436af7d97f0..4a7f9274ba0 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -457,7 +457,7 @@
for(var/obj/item/item in buckled_mob.held_items)
if(istype(item, /obj/item/turret_control))
qdel(item)
- UpdateButtons()
+ build_all_button_icons()
return
playsound(proto_emitter,'sound/mecha/mechmove01.ogg', 50, TRUE)
name = "Switch to Automatic Firing"
@@ -474,7 +474,7 @@
else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand
var/obj/item/turret_control/turret_control = new /obj/item/turret_control()
buckled_mob.put_in_hands(turret_control)
- UpdateButtons()
+ build_all_button_icons()
/obj/item/turret_control
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 3d8331ce561..dd5d08cdac6 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -43,7 +43,7 @@
playsound(user, 'sound/weapons/empty.ogg', 100, TRUE)
update_appearance()
- update_action_buttons()
+ update_item_action_buttons()
/obj/item/gun/ballistic/automatic/proto
name = "\improper Nanotrasen Saber SMG"
diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
index 309c1a27562..8358b883906 100644
--- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
@@ -340,10 +340,10 @@
shock_timer = 0 //immune to shocks
M.AdjustAllImmobility(-40 *REM * delta_time)
M.adjustStaminaLoss(-2 * REM * delta_time, 0)
- if(isluminescent(M))
+ if(is_species(M, /datum/species/jelly/luminescent))
var/mob/living/carbon/human/H = M
var/datum/species/jelly/luminescent/L = H.dna.species
- L.extract_cooldown = max(L.extract_cooldown - (20 * REM * delta_time), 0)
+ L.extract_cooldown = max(L.extract_cooldown - (2 SECONDS * REM * delta_time), 0)
..()
/datum/reagent/firefighting_foam
diff --git a/code/modules/research/xenobiology/crossbreeding/_clothing.dm b/code/modules/research/xenobiology/crossbreeding/_clothing.dm
index 76fca921f12..501a60d402a 100644
--- a/code/modules/research/xenobiology/crossbreeding/_clothing.dm
+++ b/code/modules/research/xenobiology/crossbreeding/_clothing.dm
@@ -61,7 +61,7 @@ Slimecrossing Armor
/datum/action/item_action/change_prism_colour
name = "Adjust Prismatic Lens"
- icon_icon = 'icons/obj/xenobiology/slimecrossing.dmi'
+ button_icon = 'icons/obj/xenobiology/slimecrossing.dmi'
button_icon_state = "prismcolor"
/datum/action/item_action/change_prism_colour/Trigger(trigger_flags)
@@ -75,7 +75,7 @@ Slimecrossing Armor
/datum/action/item_action/place_light_prism
name = "Fabricate Light Prism"
- icon_icon = 'icons/obj/xenobiology/slimecrossing.dmi'
+ button_icon = 'icons/obj/xenobiology/slimecrossing.dmi'
button_icon_state = "lightprism"
/datum/action/item_action/place_light_prism/Trigger(trigger_flags)
diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm
index 8e5e419a10e..c741743118f 100644
--- a/code/modules/research/xenobiology/xenobio_camera.dm
+++ b/code/modules/research/xenobiology/xenobio_camera.dm
@@ -147,7 +147,7 @@
/datum/action/innate/slime_place
name = "Place Slimes"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_down"
/datum/action/innate/slime_place/Activate()
@@ -167,7 +167,7 @@
/datum/action/innate/slime_pick_up
name = "Pick up Slime"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_up"
/datum/action/innate/slime_pick_up/Activate()
@@ -193,7 +193,7 @@
/datum/action/innate/feed_slime
name = "Feed Slimes"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "monkey_down"
/datum/action/innate/feed_slime/Activate()
@@ -219,7 +219,7 @@
/datum/action/innate/monkey_recycle
name = "Recycle Monkeys"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "monkey_up"
/datum/action/innate/monkey_recycle/Activate()
@@ -249,7 +249,7 @@
/datum/action/innate/slime_scan
name = "Scan Slime"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_scan"
/datum/action/innate/slime_scan/Activate()
@@ -266,7 +266,7 @@
/datum/action/innate/feed_potion
name = "Apply Potion"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_potion"
/datum/action/innate/feed_potion/Activate()
@@ -290,7 +290,7 @@
/datum/action/innate/hotkey_help
name = "Hotkey Help"
- icon_icon = 'icons/mob/actions/actions_silicon.dmi'
+ button_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "hotkey_help"
/datum/action/innate/hotkey_help/Activate()
diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm
index 20cfadabfa0..b05a40e88da 100644
--- a/code/modules/shuttle/navigation_computer.dm
+++ b/code/modules/shuttle/navigation_computer.dm
@@ -327,7 +327,7 @@
/datum/action/innate/shuttledocker_rotate
name = "Rotate"
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
button_icon_state = "mech_cycle_equip_off"
/datum/action/innate/shuttledocker_rotate/Activate()
@@ -339,7 +339,7 @@
/datum/action/innate/shuttledocker_place
name = "Place"
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
button_icon_state = "mech_zoom_off"
/datum/action/innate/shuttledocker_place/Activate()
diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm
index 221596c5ae5..a6af8d0e5ba 100644
--- a/code/modules/spells/spell.dm
+++ b/code/modules/spells/spell.dm
@@ -37,14 +37,17 @@
* this can be extended if you wish to add unique effects on level up for wizards.
* - [delevel_spell][/datum/action/cooldown/spell/delevel_spell] is where the process of removing a spell level is handled.
* this can be extended if you wish to undo unique effects on level up for wizards.
- * - [update_spell_name][/datum/action/cooldown/spell/update_spell_name] updates the prefix of the spell name based on its level.
+ * - [get_spell_title][/datum/action/cooldown/spell/get_spell_title] returns the prefix of the spell name based on its level,
+ * for use in updating the button name / spell name.
*/
/datum/action/cooldown/spell
name = "Spell"
desc = "A wizard spell."
background_icon_state = "bg_spell"
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "spell_default"
+ overlay_icon_state = "bg_spell_border"
+ active_overlay_icon_state = "bg_spell_border_active_red"
check_flags = AB_CHECK_CONSCIOUS
panel = "Spells"
melee_cooldown_time = 0 SECONDS
@@ -96,15 +99,15 @@
// Register some signals so our button's icon stays up to date
if(spell_requirements & SPELL_REQUIRES_OFF_CENTCOM)
- RegisterSignal(owner, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(update_status_on_signal))
if(spell_requirements & (SPELL_REQUIRES_NO_ANTIMAGIC|SPELL_REQUIRES_WIZARD_GARB))
- RegisterSignal(owner, COMSIG_MOB_EQUIPPED_ITEM, PROC_REF(update_icon_on_signal))
+ RegisterSignal(owner, COMSIG_MOB_EQUIPPED_ITEM, PROC_REF(update_status_on_signal))
if(invocation_type == INVOCATION_EMOTE)
- RegisterSignals(owner, list(SIGNAL_ADDTRAIT(TRAIT_EMOTEMUTE), SIGNAL_REMOVETRAIT(TRAIT_EMOTEMUTE)), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(SIGNAL_ADDTRAIT(TRAIT_EMOTEMUTE), SIGNAL_REMOVETRAIT(TRAIT_EMOTEMUTE)), PROC_REF(update_status_on_signal))
if(invocation_type == INVOCATION_SHOUT || invocation_type == INVOCATION_WHISPER)
- RegisterSignals(owner, list(SIGNAL_ADDTRAIT(TRAIT_MUTE), SIGNAL_REMOVETRAIT(TRAIT_MUTE)), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(SIGNAL_ADDTRAIT(TRAIT_MUTE), SIGNAL_REMOVETRAIT(TRAIT_MUTE)), PROC_REF(update_status_on_signal))
- RegisterSignals(owner, list(COMSIG_MOB_ENTER_JAUNT, COMSIG_MOB_AFTER_EXIT_JAUNT), PROC_REF(update_icon_on_signal))
+ RegisterSignals(owner, list(COMSIG_MOB_ENTER_JAUNT, COMSIG_MOB_AFTER_EXIT_JAUNT), PROC_REF(update_status_on_signal))
owner.client?.stat_panel.send_message("check_spells")
/datum/action/cooldown/spell/Remove(mob/living/remove_from)
@@ -246,7 +249,7 @@
// And then proceed with the aftermath of the cast
// Final effects that happen after all the casting is done can go here
after_cast(cast_on)
- UpdateButtons()
+ build_all_button_icons()
return TRUE
@@ -371,7 +374,7 @@
/datum/action/cooldown/spell/proc/reset_spell_cooldown()
SEND_SIGNAL(src, COMSIG_SPELL_CAST_RESET)
next_use_time -= cooldown_time // Basically, ensures that the ability can be used now
- UpdateButtons()
+ build_all_button_icons()
/**
* Levels the spell up a single level, reducing the cooldown.
@@ -388,7 +391,7 @@
spell_level++
cooldown_time = max(cooldown_time - cooldown_reduction_per_rank, 0.25 SECONDS) // 0 second CD starts to break things.
- update_spell_name()
+ build_all_button_icons(UPDATE_BUTTON_NAME)
return TRUE
/**
@@ -408,25 +411,25 @@
else
cooldown_time = max(cooldown_time + cooldown_reduction_per_rank, initial(cooldown_time))
- update_spell_name()
+ build_all_button_icons(UPDATE_BUTTON_NAME)
return TRUE
-/**
- * Updates the spell's name based on its level.
- */
-/datum/action/cooldown/spell/proc/update_spell_name()
- var/spell_title = ""
+/datum/action/cooldown/spell/update_button_name(atom/movable/screen/movable/action_button/button, force)
+ name = "[get_spell_title()][initial(name)]"
+ return ..()
+
+/// Gets the title of the spell based on its level.
+/datum/action/cooldown/spell/proc/get_spell_title()
switch(spell_level)
if(2)
- spell_title = "Efficient "
+ return "Efficient "
if(3)
- spell_title = "Quickened "
+ return "Quickened "
if(4)
- spell_title = "Free "
+ return "Free "
if(5)
- spell_title = "Instant "
+ return "Instant "
if(6)
- spell_title = "Ludicrous "
+ return "Ludicrous "
- name = "[spell_title][initial(name)]"
- UpdateButtons()
+ return ""
diff --git a/code/modules/spells/spell_types/aoe_spell/area_conversion.dm b/code/modules/spells/spell_types/aoe_spell/area_conversion.dm
index bde25b77933..f75c3958685 100644
--- a/code/modules/spells/spell_types/aoe_spell/area_conversion.dm
+++ b/code/modules/spells/spell_types/aoe_spell/area_conversion.dm
@@ -2,7 +2,9 @@
name = "Area Conversion"
desc = "This spell instantly converts a small area around you."
background_icon_state = "bg_cult"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_cult_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "areaconvert"
school = SCHOOL_TRANSMUTATION
diff --git a/code/modules/spells/spell_types/aoe_spell/magic_missile.dm b/code/modules/spells/spell_types/aoe_spell/magic_missile.dm
index be8878403e0..18278fb593a 100644
--- a/code/modules/spells/spell_types/aoe_spell/magic_missile.dm
+++ b/code/modules/spells/spell_types/aoe_spell/magic_missile.dm
@@ -39,6 +39,8 @@
name = "Lesser Magic Missile"
desc = "This spell fires several, slow moving, magic projectiles at nearby targets."
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
cooldown_time = 40 SECONDS
invocation_type = INVOCATION_NONE
diff --git a/code/modules/spells/spell_types/aoe_spell/repulse.dm b/code/modules/spells/spell_types/aoe_spell/repulse.dm
index 9e24ccde61a..2e20e724988 100644
--- a/code/modules/spells/spell_types/aoe_spell/repulse.dm
+++ b/code/modules/spells/spell_types/aoe_spell/repulse.dm
@@ -64,7 +64,8 @@
name = "Tail Sweep"
desc = "Throw back attackers with a sweep of your tail."
background_icon_state = "bg_alien"
- icon_icon = 'icons/mob/actions/actions_xeno.dmi'
+ overlay_icon_state = "bg_alien_border"
+ button_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "tailsweep"
panel = "Alien"
sound = 'sound/magic/tail_swing.ogg'
diff --git a/code/modules/spells/spell_types/charged/_charged.dm b/code/modules/spells/spell_types/charged/_charged.dm
index 9cd81c0a834..47e5666116e 100644
--- a/code/modules/spells/spell_types/charged/_charged.dm
+++ b/code/modules/spells/spell_types/charged/_charged.dm
@@ -5,6 +5,8 @@
* To use this template, all that's needed is for cast() to be implemented.
*/
/datum/action/cooldown/spell/charged
+ active_overlay_icon_state = "bg_spell_border_active_yellow"
+
/// What message do we display when we start chanelling?
var/channel_message
/// Whether we're currently channelling / charging the spell
@@ -51,6 +53,9 @@
stop_channel_effect(remove_from)
return ..()
+/datum/action/cooldown/spell/charged/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ return currently_channeling
+
/datum/action/cooldown/spell/charged/can_cast_spell(feedback = TRUE)
. = ..()
if(!.)
@@ -76,7 +81,7 @@
cast_on.add_overlay(charge_overlay_instance)
currently_channeling = TRUE
- UpdateButtons(status_only = TRUE)
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
if(!do_after(cast_on, channel_time, timed_action_flags = channel_flags))
stop_channel_effect(cast_on)
return . | SPELL_CANCEL_CAST
@@ -104,7 +109,7 @@
playsound(for_who, sound(null, repeat = 0, channel = CHANNEL_CHARGED_SPELL), 50, FALSE)
currently_channeling = FALSE
- UpdateButtons(status_only = TRUE)
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
/**
* ### Channelled "Beam" spells
diff --git a/code/modules/spells/spell_types/conjure/constructs.dm b/code/modules/spells/spell_types/conjure/constructs.dm
index 50124ce1319..2af3034f078 100644
--- a/code/modules/spells/spell_types/conjure/constructs.dm
+++ b/code/modules/spells/spell_types/conjure/constructs.dm
@@ -1,7 +1,7 @@
/datum/action/cooldown/spell/conjure/construct
name = "Summon Construct Shell"
desc = "This spell conjures a construct which may be controlled by Shades."
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "artificer"
sound = 'sound/magic/summonitems_generic.ogg'
@@ -17,4 +17,6 @@
/datum/action/cooldown/spell/conjure/construct/lesser // Used by artificers.
name = "Create Construct Shell"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
cooldown_time = 3 MINUTES
diff --git a/code/modules/spells/spell_types/conjure/cult_turfs.dm b/code/modules/spells/spell_types/conjure/cult_turfs.dm
index 7fec43aa8d4..faaac472840 100644
--- a/code/modules/spells/spell_types/conjure/cult_turfs.dm
+++ b/code/modules/spells/spell_types/conjure/cult_turfs.dm
@@ -2,7 +2,9 @@
name = "Summon Cult Floor"
desc = "This spell constructs a cult floor."
background_icon_state = "bg_cult"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_cult_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "floorconstruct"
school = SCHOOL_CONJURATION
@@ -17,7 +19,9 @@
name = "Summon Cult Wall"
desc = "This spell constructs a cult wall."
background_icon_state = "bg_cult"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_cult_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "lesserconstruct"
school = SCHOOL_CONJURATION
diff --git a/code/modules/spells/spell_types/conjure/invisible_chair.dm b/code/modules/spells/spell_types/conjure/invisible_chair.dm
index 1fa727a68a5..6a987be0fea 100644
--- a/code/modules/spells/spell_types/conjure/invisible_chair.dm
+++ b/code/modules/spells/spell_types/conjure/invisible_chair.dm
@@ -2,7 +2,8 @@
name = "Invisible Chair"
desc = "The mime's performance transmutates a chair into physical reality."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "invisible_chair"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
panel = "Mime"
diff --git a/code/modules/spells/spell_types/conjure/invisible_wall.dm b/code/modules/spells/spell_types/conjure/invisible_wall.dm
index 3124277453f..f081ef1021b 100644
--- a/code/modules/spells/spell_types/conjure/invisible_wall.dm
+++ b/code/modules/spells/spell_types/conjure/invisible_wall.dm
@@ -2,7 +2,8 @@
name = "Invisible Wall"
desc = "The mime's performance transmutates a wall into physical reality."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "invisible_wall"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
panel = "Mime"
diff --git a/code/modules/spells/spell_types/conjure/soulstone.dm b/code/modules/spells/spell_types/conjure/soulstone.dm
index cce5d1ab797..f8fad042cbb 100644
--- a/code/modules/spells/spell_types/conjure/soulstone.dm
+++ b/code/modules/spells/spell_types/conjure/soulstone.dm
@@ -2,7 +2,9 @@
name = "Summon Soulstone"
desc = "This spell reaches into Nar'Sie's realm, summoning one of the legendary fragments across time and space."
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "summonsoulstone"
school = SCHOOL_CONJURATION
diff --git a/code/modules/spells/spell_types/conjure_item/invisible_box.dm b/code/modules/spells/spell_types/conjure_item/invisible_box.dm
index adc66994bd8..3ff8abdded9 100644
--- a/code/modules/spells/spell_types/conjure_item/invisible_box.dm
+++ b/code/modules/spells/spell_types/conjure_item/invisible_box.dm
@@ -4,7 +4,8 @@
name = "Invisible Box"
desc = "The mime's performance transmutates a box into physical reality."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "invisible_box"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
panel = "Mime"
diff --git a/code/modules/spells/spell_types/conjure_item/snowball.dm b/code/modules/spells/spell_types/conjure_item/snowball.dm
index 79439b55017..ffd6d8d5e54 100644
--- a/code/modules/spells/spell_types/conjure_item/snowball.dm
+++ b/code/modules/spells/spell_types/conjure_item/snowball.dm
@@ -1,7 +1,7 @@
/datum/action/cooldown/spell/conjure_item/snowball
name = "Snowball"
desc = "Concentrates cryokinetic forces to create snowballs, useful for throwing at people."
- icon_icon = 'icons/obj/toys/toy.dmi'
+ button_icon = 'icons/obj/toys/toy.dmi'
button_icon_state = "snowball"
spell_requirements = NONE
diff --git a/code/modules/spells/spell_types/jaunt/bloodcrawl.dm b/code/modules/spells/spell_types/jaunt/bloodcrawl.dm
index bf9b0f2876f..ce514b004a5 100644
--- a/code/modules/spells/spell_types/jaunt/bloodcrawl.dm
+++ b/code/modules/spells/spell_types/jaunt/bloodcrawl.dm
@@ -7,7 +7,9 @@
name = "Blood Crawl"
desc = "Allows you to phase in and out of existance via pools of blood."
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "bloodcrawl"
spell_requirements = NONE
@@ -23,7 +25,7 @@
/datum/action/cooldown/spell/jaunt/bloodcrawl/Grant(mob/grant_to)
. = ..()
- RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_status_on_signal))
/datum/action/cooldown/spell/jaunt/bloodcrawl/Remove(mob/remove_from)
. = ..()
@@ -87,7 +89,7 @@
jaunter.notransform = FALSE
return FALSE
- RegisterSignal(holder, COMSIG_MOVABLE_MOVED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(holder, COMSIG_MOVABLE_MOVED, PROC_REF(update_status_on_signal))
if(equip_blood_hands && iscarbon(jaunter))
jaunter.drop_all_held_items()
// Give them some bloody hands to prevent them from doing things
diff --git a/code/modules/spells/spell_types/jaunt/ethereal_jaunt.dm b/code/modules/spells/spell_types/jaunt/ethereal_jaunt.dm
index bbcc6300717..b4414c99796 100644
--- a/code/modules/spells/spell_types/jaunt/ethereal_jaunt.dm
+++ b/code/modules/spells/spell_types/jaunt/ethereal_jaunt.dm
@@ -207,7 +207,9 @@
name = "Phase Shift"
desc = "This spell allows you to pass through walls."
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "phaseshift"
cooldown_time = 25 SECONDS
diff --git a/code/modules/spells/spell_types/jaunt/shadow_walk.dm b/code/modules/spells/spell_types/jaunt/shadow_walk.dm
index 9f72f953e19..c68b69005ab 100644
--- a/code/modules/spells/spell_types/jaunt/shadow_walk.dm
+++ b/code/modules/spells/spell_types/jaunt/shadow_walk.dm
@@ -2,7 +2,8 @@
name = "Shadow Walk"
desc = "Grants unlimited movement in darkness."
background_icon_state = "bg_alien"
- icon_icon = 'icons/mob/actions/actions_minor_antag.dmi'
+ overlay_icon_state = "bg_alien_border"
+ button_icon = 'icons/mob/actions/actions_minor_antag.dmi'
button_icon_state = "ninja_cloak"
spell_requirements = NONE
@@ -10,7 +11,7 @@
/datum/action/cooldown/spell/jaunt/shadow_walk/Grant(mob/grant_to)
. = ..()
- RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_icon_on_signal))
+ RegisterSignal(grant_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_status_on_signal))
/datum/action/cooldown/spell/jaunt/shadow_walk/Remove(mob/remove_from)
. = ..()
diff --git a/code/modules/spells/spell_types/list_target/telepathy.dm b/code/modules/spells/spell_types/list_target/telepathy.dm
index e67fd723342..1b00ed0f4be 100644
--- a/code/modules/spells/spell_types/list_target/telepathy.dm
+++ b/code/modules/spells/spell_types/list_target/telepathy.dm
@@ -2,7 +2,7 @@
/datum/action/cooldown/spell/list_target/telepathy
name = "Telepathy"
desc = "Telepathically transmits a message to the target."
- icon_icon = 'icons/mob/actions/actions_revenant.dmi'
+ button_icon = 'icons/mob/actions/actions_revenant.dmi'
button_icon_state = "r_transmit"
spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC
diff --git a/code/modules/spells/spell_types/pointed/_pointed.dm b/code/modules/spells/spell_types/pointed/_pointed.dm
index 8ddbd8f4fc9..b18669d6f9e 100644
--- a/code/modules/spells/spell_types/pointed/_pointed.dm
+++ b/code/modules/spells/spell_types/pointed/_pointed.dm
@@ -10,8 +10,6 @@
/datum/action/cooldown/spell/pointed
click_to_activate = TRUE
- /// The base icon state of the spell's button icon, used for editing the icon "on" and "off"
- var/base_icon_state
/// Message showing to the spell owner upon activating pointed spell.
var/active_msg
/// Message showing to the spell owner upon deactivating pointed spell.
@@ -53,9 +51,7 @@
SHOULD_CALL_PARENT(TRUE)
to_chat(on_who, span_notice("[active_msg] Left-click to cast the spell on a target!"))
- if(base_icon_state)
- button_icon_state = "[base_icon_state]1"
- UpdateButtons()
+ build_all_button_icons()
return TRUE
/// Called when the spell is deactivated / the click ability is unset from our spell
@@ -65,9 +61,7 @@
if(refund_cooldown)
// Only send the "deactivation" message if they're willingly disabling the ability
to_chat(on_who, span_notice("[deactive_msg]"))
- if(base_icon_state)
- button_icon_state = "[base_icon_state]0"
- UpdateButtons()
+ build_all_button_icons()
return TRUE
/datum/action/cooldown/spell/pointed/InterceptClickOn(mob/living/caller, params, atom/click_target)
diff --git a/code/modules/spells/spell_types/pointed/abyssal_gaze.dm b/code/modules/spells/spell_types/pointed/abyssal_gaze.dm
index 1a7243fce52..cfa6ea5dbcb 100644
--- a/code/modules/spells/spell_types/pointed/abyssal_gaze.dm
+++ b/code/modules/spells/spell_types/pointed/abyssal_gaze.dm
@@ -4,7 +4,9 @@
desc = "This spell instills a deep terror in your target, temporarily chilling and blinding it."
ranged_mousepointer = 'icons/effects/mouse_pointers/cult_target.dmi'
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "abyssal_gaze"
school = SCHOOL_EVOCATION
diff --git a/code/modules/spells/spell_types/pointed/dominate.dm b/code/modules/spells/spell_types/pointed/dominate.dm
index f5b8aaa9c8c..7d2c587a222 100644
--- a/code/modules/spells/spell_types/pointed/dominate.dm
+++ b/code/modules/spells/spell_types/pointed/dominate.dm
@@ -3,7 +3,9 @@
desc = "This spell dominates the mind of a lesser creature to the will of Nar'Sie, \
allying it only to her direct followers."
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "dominate"
ranged_mousepointer = 'icons/effects/mouse_pointers/cult_target.dmi'
diff --git a/code/modules/spells/spell_types/pointed/finger_guns.dm b/code/modules/spells/spell_types/pointed/finger_guns.dm
index 3f53e7d6242..5f1271b7b81 100644
--- a/code/modules/spells/spell_types/pointed/finger_guns.dm
+++ b/code/modules/spells/spell_types/pointed/finger_guns.dm
@@ -3,7 +3,8 @@
desc = "Shoot up to three mimed bullets from your fingers that damage and mute their targets. \
Can't be used if you have something in your hands."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "finger_guns0"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
panel = "Mime"
@@ -20,7 +21,6 @@
antimagic_flags = NONE
spell_max_level = 1
- base_icon_state = "finger_guns"
active_msg = "You draw your fingers!"
deactive_msg = "You put your fingers at ease. Another time."
cast_range = 20
diff --git a/code/modules/spells/spell_types/pointed/fireball.dm b/code/modules/spells/spell_types/pointed/fireball.dm
index 47fd05c0f46..e818de97501 100644
--- a/code/modules/spells/spell_types/pointed/fireball.dm
+++ b/code/modules/spells/spell_types/pointed/fireball.dm
@@ -12,7 +12,6 @@
invocation_type = INVOCATION_SHOUT
spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC
- base_icon_state = "fireball"
active_msg = "You prepare to cast your fireball spell!"
deactive_msg = "You extinguish your fireball... for now."
cast_range = 8
diff --git a/code/modules/spells/spell_types/pointed/lightning_bolt.dm b/code/modules/spells/spell_types/pointed/lightning_bolt.dm
index e88e3523571..76d9665e711 100644
--- a/code/modules/spells/spell_types/pointed/lightning_bolt.dm
+++ b/code/modules/spells/spell_types/pointed/lightning_bolt.dm
@@ -1,7 +1,8 @@
/datum/action/cooldown/spell/pointed/projectile/lightningbolt
name = "Lightning Bolt"
desc = "Fire a lightning bolt at your foes! It will jump between targets, but can't knock them down."
- button_icon_state = "lightning0"
+ button_icon_state = "lightning"
+ active_overlay_icon_state = "bg_spell_border_active_yellow"
sound = 'sound/magic/lightningbolt.ogg'
school = SCHOOL_EVOCATION
@@ -12,7 +13,6 @@
invocation_type = INVOCATION_SHOUT
spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC
- base_icon_state = "lightning"
active_msg = "You energize your hands with arcane lightning!"
deactive_msg = "You let the energy flow out of your hands back into yourself..."
projectile_type = /obj/projectile/magic/aoe/lightning
diff --git a/code/modules/spells/spell_types/pointed/spell_cards.dm b/code/modules/spells/spell_types/pointed/spell_cards.dm
index 6f44f72afdf..eb471e6eec4 100644
--- a/code/modules/spells/spell_types/pointed/spell_cards.dm
+++ b/code/modules/spells/spell_types/pointed/spell_cards.dm
@@ -13,7 +13,6 @@
invocation_type = INVOCATION_SHOUT
spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC
- base_icon_state = "spellcard"
cast_range = 40
projectile_type = /obj/projectile/magic/spellcard
projectile_amount = 5
diff --git a/code/modules/spells/spell_types/pointed/swap.dm b/code/modules/spells/spell_types/pointed/swap.dm
index 65344df99a6..965bf51af91 100644
--- a/code/modules/spells/spell_types/pointed/swap.dm
+++ b/code/modules/spells/spell_types/pointed/swap.dm
@@ -5,6 +5,7 @@
or else you can click yourself with the RMB to discard your secondary target."
button_icon_state = "swap"
ranged_mousepointer = 'icons/effects/mouse_pointers/swap_target.dmi'
+ active_overlay_icon_state = "bg_spell_border_active_blue"
school = SCHOOL_TRANSLOCATION
cooldown_time = 30 SECONDS
@@ -17,9 +18,14 @@
smoke_type = /datum/effect_system/fluid_spread/smoke
smoke_amt = 0
+
/// A variable for holding the second selected target with right click.
var/mob/living/second_target
+/datum/action/cooldown/spell/pointed/swap/Destroy()
+ second_target = null
+ return ..()
+
/datum/action/cooldown/spell/pointed/swap/is_valid_target(atom/cast_on)
. = ..()
if(!.)
diff --git a/code/modules/spells/spell_types/projectile/juggernaut.dm b/code/modules/spells/spell_types/projectile/juggernaut.dm
index 443c9cf62e5..11a2cbb9a15 100644
--- a/code/modules/spells/spell_types/projectile/juggernaut.dm
+++ b/code/modules/spells/spell_types/projectile/juggernaut.dm
@@ -1,9 +1,11 @@
/datum/action/cooldown/spell/basic_projectile/juggernaut
name = "Gauntlet Echo"
desc = "Channels energy into your gauntlet - firing its essence forward in a slow moving, yet devastating, attack."
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "cultfist"
background_icon_state = "bg_demon"
+ overlay_icon_state = "bg_demon_border"
+
sound = 'sound/weapons/resonator_blast.ogg'
cooldown_time = 35 SECONDS
diff --git a/code/modules/spells/spell_types/self/forcewall.dm b/code/modules/spells/spell_types/self/forcewall.dm
index 7a718949845..feab8f305c0 100644
--- a/code/modules/spells/spell_types/self/forcewall.dm
+++ b/code/modules/spells/spell_types/self/forcewall.dm
@@ -32,7 +32,9 @@
name = "Shield"
desc = "This spell creates a temporary forcefield to shield yourself and allies from incoming fire."
background_icon_state = "bg_demon"
- icon_icon = 'icons/mob/actions/actions_cult.dmi'
+ overlay_icon_state = "bg_demon_border"
+
+ button_icon = 'icons/mob/actions/actions_cult.dmi'
button_icon_state = "cultforcewall"
cooldown_time = 40 SECONDS
@@ -44,7 +46,8 @@
name = "Invisible Blockade"
desc = "Form an invisible three tile wide blockade."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "invisible_blockade"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED
panel = "Mime"
diff --git a/code/modules/spells/spell_types/self/lichdom.dm b/code/modules/spells/spell_types/self/lichdom.dm
index 69325f9df97..cf5e3d0893a 100644
--- a/code/modules/spells/spell_types/self/lichdom.dm
+++ b/code/modules/spells/spell_types/self/lichdom.dm
@@ -4,7 +4,7 @@
Binding your soul to an item will turn you into an immortal Lich. \
So long as the item remains intact, you will revive from death, \
no matter the circumstances."
- icon_icon = 'icons/mob/actions/actions_spells.dmi'
+ button_icon = 'icons/mob/actions/actions_spells.dmi'
button_icon_state = "skeleton"
school = SCHOOL_NECROMANCY
diff --git a/code/modules/spells/spell_types/self/mime_vow.dm b/code/modules/spells/spell_types/self/mime_vow.dm
index 9db6b92dd35..f901ab37ac7 100644
--- a/code/modules/spells/spell_types/self/mime_vow.dm
+++ b/code/modules/spells/spell_types/self/mime_vow.dm
@@ -2,7 +2,8 @@
name = "Speech"
desc = "Make (or break) a vow of silence."
background_icon_state = "bg_mime"
- icon_icon = 'icons/mob/actions/actions_mime.dmi'
+ overlay_icon_state = "bg_mime_border"
+ button_icon = 'icons/mob/actions/actions_mime.dmi'
button_icon_state = "mime_speech"
panel = "Mime"
@@ -21,4 +22,4 @@
else
to_chat(cast_on, span_notice("You break your vow of silence."))
cast_on.add_mood_event("vow", /datum/mood_event/broken_vow)
- cast_on.update_action_buttons_icon()
+ cast_on.update_mob_action_buttons()
diff --git a/code/modules/spells/spell_types/self/smoke.dm b/code/modules/spells/spell_types/self/smoke.dm
index b2c7e924f19..516b697e4d6 100644
--- a/code/modules/spells/spell_types/self/smoke.dm
+++ b/code/modules/spells/spell_types/self/smoke.dm
@@ -31,6 +31,8 @@
name = "Paralysing Smoke"
desc = "This spell spawns a cloud of paralysing smoke."
background_icon_state = "bg_cult"
+ overlay_icon_state = "bg_cult_border"
+
cooldown_time = 20 SECONDS
diff --git a/code/modules/spells/spell_types/self/voice_of_god.dm b/code/modules/spells/spell_types/self/voice_of_god.dm
index ae4c46a3bb7..7320022fc30 100644
--- a/code/modules/spells/spell_types/self/voice_of_god.dm
+++ b/code/modules/spells/spell_types/self/voice_of_god.dm
@@ -1,7 +1,7 @@
/datum/action/cooldown/spell/voice_of_god
name = "Voice of God"
desc = "Speak with an incredibly compelling voice, forcing listeners to obey your commands."
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "voice_of_god"
sound = 'sound/magic/clockwork/invoke_general.ogg'
diff --git a/code/modules/spells/spell_types/touch/_touch.dm b/code/modules/spells/spell_types/touch/_touch.dm
index 384d722bf2c..ce7fced2ce4 100644
--- a/code/modules/spells/spell_types/touch/_touch.dm
+++ b/code/modules/spells/spell_types/touch/_touch.dm
@@ -49,12 +49,8 @@
/datum/action/cooldown/spell/touch/PreActivate(atom/target)
return Activate(target)
-/datum/action/cooldown/spell/touch/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
- . = ..()
- if(!button)
- return
- if(attached_hand)
- button.color = COLOR_GREEN
+/datum/action/cooldown/spell/touch/is_action_active(atom/movable/screen/movable/action_button/current_button)
+ return !!attached_hand
/datum/action/cooldown/spell/touch/set_statpanel_format()
. = ..()
@@ -125,6 +121,7 @@
reset_spell_cooldown()
else
StartCooldown()
+ build_all_button_icons()
/// Registers all signal procs for the hand.
/datum/action/cooldown/spell/touch/proc/register_hand_signals()
diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm
index 29904c00264..230b2b038b8 100644
--- a/code/modules/surgery/dental_implant.dm
+++ b/code/modules/surgery/dental_implant.dm
@@ -29,7 +29,7 @@
var/datum/action/item_action/hands_free/activate_pill/pill_action = new(tool)
pill_action.name = "Activate [tool.name]"
- pill_action.UpdateButtons()
+ pill_action.build_all_button_icons()
pill_action.target = tool
pill_action.Grant(target) //The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it
diff --git a/code/modules/surgery/organs/external/wings/functional_wings.dm b/code/modules/surgery/organs/external/wings/functional_wings.dm
index 21151197a57..a4ca3a8a6e0 100644
--- a/code/modules/surgery/organs/external/wings/functional_wings.dm
+++ b/code/modules/surgery/organs/external/wings/functional_wings.dm
@@ -2,7 +2,7 @@
/datum/action/innate/flight
name = "Toggle Flight"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_IMMOBILE
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "flight"
/datum/action/innate/flight/Activate()
diff --git a/code/modules/vehicles/mecha/combat/durand.dm b/code/modules/vehicles/mecha/combat/durand.dm
index 267f40e5355..69054550632 100644
--- a/code/modules/vehicles/mecha/combat/durand.dm
+++ b/code/modules/vehicles/mecha/combat/durand.dm
@@ -217,7 +217,7 @@ own integrity back to max. Shield is automatically dropped if we run out of powe
for(var/occupant in chassis.occupants)
var/datum/action/button = chassis.occupant_actions[occupant][/datum/action/vehicle/sealed/mecha/mech_defense_mode]
button.button_icon_state = "mech_defense_mode_[chassis.defense_mode ? "on" : "off"]"
- button.UpdateButtons()
+ button.build_all_button_icons()
set_light_on(chassis.defense_mode)
diff --git a/code/modules/vehicles/mecha/combat/gygax.dm b/code/modules/vehicles/mecha/combat/gygax.dm
index cc8cc517ab9..89c9a1bb131 100644
--- a/code/modules/vehicles/mecha/combat/gygax.dm
+++ b/code/modules/vehicles/mecha/combat/gygax.dm
@@ -45,7 +45,7 @@
chassis.movedelay += chassis.speed_mod
chassis.step_energy_drain = chassis.normal_step_energy_drain
chassis.balloon_alert(owner, "you disable the overload")
- UpdateButtons()
+ build_all_button_icons()
/obj/vehicle/sealed/mecha/combat/gygax/dark
desc = "A lightweight exosuit, painted in a dark scheme. This model appears to have some modifications."
diff --git a/code/modules/vehicles/mecha/combat/marauder.dm b/code/modules/vehicles/mecha/combat/marauder.dm
index 3870aebe9ff..771ef6646f1 100644
--- a/code/modules/vehicles/mecha/combat/marauder.dm
+++ b/code/modules/vehicles/mecha/combat/marauder.dm
@@ -70,7 +70,7 @@
SEND_SOUND(owner, sound('sound/mecha/imag_enh.ogg', volume=50))
else
owner.client.view_size.resetToDefault()
- UpdateButtons()
+ build_all_button_icons()
/obj/vehicle/sealed/mecha/combat/marauder/seraph
desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel."
@@ -126,4 +126,3 @@
MECHA_POWER = list(),
MECHA_ARMOR = list(/obj/item/mecha_parts/mecha_equipment/armor/antiproj_armor_booster),
)
-
diff --git a/code/modules/vehicles/mecha/combat/phazon.dm b/code/modules/vehicles/mecha/combat/phazon.dm
index 804142bfd3a..b8c6091face 100644
--- a/code/modules/vehicles/mecha/combat/phazon.dm
+++ b/code/modules/vehicles/mecha/combat/phazon.dm
@@ -44,7 +44,7 @@
chassis.damtype = new_damtype
button_icon_state = "mech_damtype_[new_damtype]"
playsound(chassis, 'sound/mecha/mechmove01.ogg', 50, TRUE)
- UpdateButtons()
+ build_all_button_icons()
/datum/action/vehicle/sealed/mecha/mech_toggle_phasing
name = "Toggle Phasing"
@@ -56,4 +56,4 @@
chassis.phasing = chassis.phasing ? "" : "phasing"
button_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]"
chassis.balloon_alert(owner, "[chassis.phasing ? "enabled" : "disabled"] phasing")
- UpdateButtons()
+ build_all_button_icons()
diff --git a/code/modules/vehicles/mecha/combat/savannah_ivanov.dm b/code/modules/vehicles/mecha/combat/savannah_ivanov.dm
index 0a81b429e12..4670186c34f 100644
--- a/code/modules/vehicles/mecha/combat/savannah_ivanov.dm
+++ b/code/modules/vehicles/mecha/combat/savannah_ivanov.dm
@@ -118,7 +118,7 @@
return
S_TIMER_COOLDOWN_START(chassis, COOLDOWN_MECHA_SKYFALL, skyfall_cooldown_time)
button_icon_state = "mech_savannah_cooldown"
- UpdateButtons()
+ build_all_button_icons()
addtimer(CALLBACK(src, PROC_REF(reset_button_icon)), skyfall_cooldown_time)
for(var/mob/living/shaken in range(7, chassis))
shake_camera(shaken, 3, 3)
@@ -221,7 +221,7 @@
*/
/datum/action/vehicle/sealed/mecha/skyfall/proc/reset_button_icon()
button_icon_state = "mech_savannah"
- UpdateButtons()
+ build_all_button_icons()
/datum/action/vehicle/sealed/mecha/ivanov_strike
name = "Ivanov Strike"
@@ -256,7 +256,7 @@
*/
/datum/action/vehicle/sealed/mecha/ivanov_strike/proc/reset_button_icon()
button_icon_state = "mech_ivanov"
- UpdateButtons()
+ build_all_button_icons()
/**
* ## start_missile_targeting
@@ -324,7 +324,7 @@
"explosionSize" = list(0,0,1,2)
))
button_icon_state = "mech_ivanov_cooldown"
- UpdateButtons()
+ build_all_button_icons()
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/action/vehicle/sealed/mecha/ivanov_strike, reset_button_icon)), strike_cooldown_time)
//misc effects
diff --git a/code/modules/vehicles/mecha/mecha_actions.dm b/code/modules/vehicles/mecha/mecha_actions.dm
index c7458d6e648..06e66e3be46 100644
--- a/code/modules/vehicles/mecha/mecha_actions.dm
+++ b/code/modules/vehicles/mecha/mecha_actions.dm
@@ -7,7 +7,7 @@
mecha.chassis = src
/datum/action/vehicle/sealed/mecha
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
var/obj/vehicle/sealed/mecha/chassis
/datum/action/vehicle/sealed/mecha/Destroy()
@@ -43,7 +43,7 @@
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]"
chassis.balloon_alert(owner, "taking air from [chassis.use_internal_tank ? "internal airtank" : "environment"]")
chassis.log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].", LOG_MECHA)
- UpdateButtons()
+ build_all_button_icons()
/datum/action/vehicle/sealed/mecha/mech_toggle_lights
name = "Toggle Lights"
@@ -65,7 +65,7 @@
chassis.balloon_alert(owner, "toggled lights [chassis.mecha_flags & LIGHTS_ON ? "on":"off"]")
playsound(chassis,'sound/machines/clockcult/brass_skewer.ogg', 40, TRUE)
chassis.log_message("Toggled lights [(chassis.mecha_flags & LIGHTS_ON)?"on":"off"].", LOG_MECHA)
- UpdateButtons()
+ build_all_button_icons()
/datum/action/vehicle/sealed/mecha/mech_view_stats
name = "View Stats"
@@ -109,7 +109,7 @@
for(var/occupant in occupants)
var/datum/action/action = LAZYACCESSASSOC(occupant_actions, occupant, /datum/action/vehicle/sealed/mecha/strafe)
- action?.UpdateButtons()
+ action?.build_all_button_icons()
///swap seats, for two person mecha
/datum/action/vehicle/sealed/mecha/swap_seat
diff --git a/code/modules/vehicles/mecha/working/clarke.dm b/code/modules/vehicles/mecha/working/clarke.dm
index abf5db7b286..886e7abe43a 100644
--- a/code/modules/vehicles/mecha/working/clarke.dm
+++ b/code/modules/vehicles/mecha/working/clarke.dm
@@ -86,10 +86,10 @@
return
var/mob/living/living_owner = owner
button_icon_state = "mech_search_ruins_cooldown"
- UpdateButtons()
+ build_all_button_icons()
COOLDOWN_START(src, search_cooldown, SEARCH_COOLDOWN)
addtimer(VARSET_CALLBACK(src, button_icon_state, "mech_search_ruins"), SEARCH_COOLDOWN)
- addtimer(CALLBACK(src, PROC_REF(UpdateButtons)), SEARCH_COOLDOWN)
+ addtimer(CALLBACK(src, PROC_REF(build_all_button_icons)), SEARCH_COOLDOWN)
var/obj/pinpointed_ruin
for(var/obj/effect/landmark/ruin/ruin_landmark as anything in GLOB.ruin_landmarks)
if(ruin_landmark.z != chassis.z)
diff --git a/code/modules/vehicles/vehicle_actions.dm b/code/modules/vehicles/vehicle_actions.dm
index 3b4224b3eed..59eb28c3867 100644
--- a/code/modules/vehicles/vehicle_actions.dm
+++ b/code/modules/vehicles/vehicle_actions.dm
@@ -188,7 +188,7 @@
/datum/action/vehicle
check_flags = AB_CHECK_HANDS_BLOCKED | AB_CHECK_IMMOBILE | AB_CHECK_CONSCIOUS
- icon_icon = 'icons/mob/actions/actions_vehicle.dmi'
+ button_icon = 'icons/mob/actions/actions_vehicle.dmi'
button_icon_state = "vehicle_eject"
var/obj/vehicle/vehicle_target
@@ -310,7 +310,7 @@
/datum/action/vehicle/ridden/wheelchair/bell
name = "Bell Ring"
desc = "Ring the bell."
- icon_icon = 'icons/obj/bureaucracy.dmi'
+ button_icon = 'icons/obj/bureaucracy.dmi'
button_icon_state = "desk_bell"
check_flags = AB_CHECK_CONSCIOUS
var/bell_cooldown
@@ -410,7 +410,7 @@
/datum/action/vehicle/sealed/climb_out/vim
name = "Eject From Mech"
- icon_icon = 'icons/mob/actions/actions_mecha.dmi'
+ button_icon = 'icons/mob/actions/actions_mecha.dmi'
button_icon_state = "mech_eject"
/datum/action/vehicle/sealed/noise
diff --git a/code/modules/wiremod/shell/brain_computer_interface.dm b/code/modules/wiremod/shell/brain_computer_interface.dm
index c221dc00ffe..62dd75c293b 100644
--- a/code/modules/wiremod/shell/brain_computer_interface.dm
+++ b/code/modules/wiremod/shell/brain_computer_interface.dm
@@ -72,7 +72,7 @@
/datum/action/innate/bci_action
name = "Action"
- icon_icon = 'icons/mob/actions/actions_items.dmi'
+ button_icon = 'icons/mob/actions/actions_items.dmi'
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "bci_power"
@@ -238,7 +238,7 @@
/datum/action/innate/bci_charge_action
name = "Check BCI Charge"
check_flags = NONE
- icon_icon = 'icons/obj/power.dmi'
+ button_icon = 'icons/obj/power.dmi'
button_icon_state = "cell"
var/obj/item/circuit_component/bci_core/circuit_component
@@ -248,11 +248,11 @@
src.circuit_component = circuit_component
- UpdateButtons()
+ build_all_button_icons()
START_PROCESSING(SSobj, src)
-/datum/action/innate/bci_charge_action/CreateButton()
+/datum/action/innate/bci_charge_action/create_button()
var/atom/movable/screen/movable/action_button/button = ..()
button.maptext_x = 2
button.maptext_y = 0
@@ -276,14 +276,10 @@
to_chat(owner, span_info("You can recharge it by using a cyborg recharging station."))
/datum/action/innate/bci_charge_action/process(delta_time)
- UpdateButtons()
+ build_all_button_icons(UPDATE_BUTTON_STATUS)
-/datum/action/innate/bci_charge_action/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
+/datum/action/innate/bci_charge_action/update_button_status(atom/movable/screen/movable/action_button/button, force = FALSE)
. = ..()
- if(!.)
- return
- if(status_only)
- return
var/obj/item/stock_parts/cell/cell = circuit_component.parent.cell
button.maptext = cell ? MAPTEXT("[cell.percent()]%") : ""
diff --git a/icons/hud/actions.dmi b/icons/hud/actions.dmi
index d6c46d880f2..19f8a470dde 100644
Binary files a/icons/hud/actions.dmi and b/icons/hud/actions.dmi differ
diff --git a/icons/mob/actions/actions_cult.dmi b/icons/mob/actions/actions_cult.dmi
index 7cc31703f19..f73f5bb6367 100644
Binary files a/icons/mob/actions/actions_cult.dmi and b/icons/mob/actions/actions_cult.dmi differ
diff --git a/icons/mob/actions/actions_ecult.dmi b/icons/mob/actions/actions_ecult.dmi
index 5c022fb79c8..a5890f65d50 100644
Binary files a/icons/mob/actions/actions_ecult.dmi and b/icons/mob/actions/actions_ecult.dmi differ
diff --git a/icons/mob/actions/actions_mime.dmi b/icons/mob/actions/actions_mime.dmi
index 7d731a29cce..33383dc5600 100644
Binary files a/icons/mob/actions/actions_mime.dmi and b/icons/mob/actions/actions_mime.dmi differ
diff --git a/icons/mob/actions/actions_spells.dmi b/icons/mob/actions/actions_spells.dmi
index 31f8b905fda..eae3f152a06 100644
Binary files a/icons/mob/actions/actions_spells.dmi and b/icons/mob/actions/actions_spells.dmi differ
diff --git a/icons/mob/actions/backgrounds.dmi b/icons/mob/actions/backgrounds.dmi
index aa534ad2606..558045a0656 100644
Binary files a/icons/mob/actions/backgrounds.dmi and b/icons/mob/actions/backgrounds.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index 09c61bb8d2d..289afab4fbd 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -779,6 +779,7 @@
#include "code\datums\cinematics\nuke_cinematics.dm"
#include "code\datums\components\_component.dm"
#include "code\datums\components\acid.dm"
+#include "code\datums\components\action_item_overlay.dm"
#include "code\datums\components\admin_popup.dm"
#include "code\datums\components\anti_magic.dm"
#include "code\datums\components\aquarium.dm"