diff --git a/code/__DEFINES/action_defines.dm b/code/__DEFINES/action_defines.dm index 726148081d9..e291940a436 100644 --- a/code/__DEFINES/action_defines.dm +++ b/code/__DEFINES/action_defines.dm @@ -4,3 +4,12 @@ #define UPDATE_BUTTON_BACKGROUND (1<<2) #define UPDATE_BUTTON_OVERLAY (1<<3) #define UPDATE_BUTTON_STATUS (1<<4) + +// Defines for formatting cooldown actions for the stat panel. +/// The stat panel the action is displayed in. +#define PANEL_DISPLAY_PANEL "panel" +/// The status shown in the stat panel. +/// Can be stuff like "ready", "on cooldown", "active", "charges", "charge cost", etc. +#define PANEL_DISPLAY_STATUS "status" +/// The name shown in the stat panel. +#define PANEL_DISPLAY_NAME "name" diff --git a/code/__DEFINES/dcs/datum_signals.dm b/code/__DEFINES/dcs/datum_signals.dm index 381204c413c..fdf51c9c793 100644 --- a/code/__DEFINES/dcs/datum_signals.dm +++ b/code/__DEFINES/dcs/datum_signals.dm @@ -85,7 +85,8 @@ #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" // /datum/objective diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 085a5152631..d4ee835fe28 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -10,6 +10,13 @@ /// The HUD this action button belongs to var/datum/hud/our_hud + /// The overlay we have overtop our button + var/mutable_appearance/button_overlay + /// 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 + /// 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 @@ -212,10 +219,9 @@ closeToolTip(usr) return ..() -/mob/proc/update_action_buttons_icon(status_only = FALSE) - for(var/X in actions) - var/datum/action/A = X - A.UpdateButtons(status_only) +/mob/proc/update_action_buttons_icon(update_flags = ALL, force = FALSE) + for(var/datum/action/current_action as anything in actions) + current_action.build_all_button_icons(update_flags, force) //This is the proc used to update all the action buttons. /mob/proc/update_action_buttons(reload_screen) @@ -227,7 +233,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 client.update_active_keybindings() diff --git a/code/datums/actions/action.dm b/code/datums/actions/action.dm index d5f28797bb8..09290724b73 100644 --- a/code/datums/actions/action.dm +++ b/code/datums/actions/action.dm @@ -3,14 +3,22 @@ var/desc = null var/obj/target = null var/check_flags = 0 - /// Icon that our button screen object overlay and background - var/button_overlay_icon = 'icons/mob/actions/actions.dmi' - /// Icon state of screen object overlay - var/button_overlay_icon_state = ACTION_BUTTON_DEFAULT_OVERLAY - /// Icon that our button screen object background will have - var/button_background_icon = 'icons/mob/actions/actions.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 = 'icons/mob/actions/actions.dmi' /// Icon state of screen object background - var/button_background_icon_state = ACTION_BUTTON_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/mob/actions/actions.dmi' + /// This is the icon state for the icon that appears on the button + var/button_icon_state = ACTION_BUTTON_DEFAULT_OVERLAY + + /// This is the file for any FOREGROUND overlay icons on the button (such as borders) + var/overlay_icon = 'icons/mob/actions/actions.dmi' + /// This is the icon state for any FOREGROUND overlay icons on the button (such as borders) + var/overlay_icon_state var/buttontooltipstyle = "" var/transparent_when_unavailable = TRUE var/mob/owner @@ -20,10 +28,21 @@ var/list/viewers = list() /// Whether or not this will be shown to observers var/show_to_observers = TRUE + /// Toggles whether this action is usable or not + var/action_disabled = FALSE + /// The appearance used as an overlay for when the action is unavailable + var/mutable_appearance/unavailable_effect +/datum/action/New(target) + link_to(target) -/datum/action/New(Target) - target = Target +/// Links the passed target to our action, registering any relevant signals +/datum/action/proc/link_to(target_) + target = target_ + RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(clear_ref), override = TRUE) + + if(isatom(target)) + RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, PROC_REF(on_target_icon_update)) /datum/action/proc/should_draw_cooldown() return !IsAvailable() @@ -79,10 +98,10 @@ UnregisterSignal(owner, COMSIG_PARENT_QDELETING) owner = null -/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/Trigger(left_click = TRUE) if(!IsAvailable()) @@ -123,31 +142,60 @@ return FALSE return TRUE -/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(desc) - button.desc = "[desc] [initial(button.desc)]" - if(owner?.hud_used && button_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_background_icon) - button.icon = button_background_icon - if(button.icon_state != button_background_icon_state) - button.icon_state = button_background_icon_state + 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. + * + * 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 + +/** + * Any other miscellaneous "status" updates within the action button is handled here, + * such as redding out when unavailable or modifying maptext. + * + * 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/button, force = FALSE) + button.overlays -= unavailable_effect + button.maptext = "" if(should_draw_cooldown()) apply_unavailable_effect(button) - else - return TRUE //Give our action button to the player /datum/action/proc/GiveAction(mob/viewer) @@ -164,7 +212,7 @@ 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 @@ -186,10 +234,11 @@ qdel(button) -/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 + build_button_icon(button, ALL, force = TRUE) + // TODO: Pull all of this into the build button structure somehow later button.actiontooltipstyle = buttontooltipstyle var/list/our_description = list() our_description += desc @@ -197,7 +246,6 @@ button.desc = our_description.Join(" ") return button - /datum/action/proc/SetId(atom/movable/screen/movable/action_button/our_button, mob/owner) //button id generation var/bitfield = 0 @@ -215,20 +263,97 @@ our_button.id = bitflag return -/datum/action/proc/apply_unavailable_effect(atom/movable/screen/movable/action_button/B) - var/image/img = image('icons/mob/screen_white.dmi', icon_state = "template") - img.alpha = 200 - img.appearance_flags = RESET_COLOR | RESET_ALPHA - img.color = "#000000" - img.plane = FLOAT_PLANE + 1 - B.add_overlay(img) +/datum/action/proc/apply_unavailable_effect(atom/movable/screen/movable/action_button/button) + if(isnull(unavailable_effect)) + unavailable_effect = mutable_appearance('icons/mob/screen_white.dmi', icon_state = "template") + unavailable_effect.alpha = 200 + unavailable_effect.appearance_flags = RESET_COLOR | RESET_ALPHA + unavailable_effect.color = "#000000" + unavailable_effect.plane = FLOAT_PLANE + 1 + button.overlays |= unavailable_effect +/** + * Applies any overlays to our button + * + * 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/button, force = FALSE) + SEND_SIGNAL(src, COMSIG_ACTION_OVERLAY_APPLY, button, force) -/datum/action/proc/apply_button_overlay(atom/movable/screen/movable/action_button/current_button) - current_button.cut_overlays() - if(button_overlay_icon && button_overlay_icon_state) - var/image/img = image(button_overlay_icon, current_button, button_overlay_icon_state) - img.appearance_flags = RESET_COLOR | RESET_ALPHA - img.pixel_x = 0 - img.pixel_y = 0 - current_button.add_overlay(img) + if(!overlay_icon || !overlay_icon_state || (button.active_overlay_icon_state == overlay_icon_state && !force)) + return + + button.cut_overlay(button.button_overlay) + button.button_overlay = mutable_appearance(icon = overlay_icon, icon_state = overlay_icon_state, appearance_flags = (RESET_COLOR|RESET_ALPHA)) + button.add_overlay(button.button_overlay) + button.active_overlay_icon_state = overlay_icon_state + +/// Checks if our action is actively selected. Used for selecting icons primarily. +/datum/action/proc/is_action_active(atom/movable/screen/movable/action_button/button) + return FALSE + +/** + * Creates the background underlay for the button + * + * 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/button, force = FALSE) + if(!background_icon || !background_icon_state || (button.active_underlay_icon_state == background_icon_state && !force)) + return + + // 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, + ) + + // 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(button) ? "bg_state_active" : "bg_state" + + // Make the underlay + button.underlays.Cut() + var/image/underlay = image(icon = icon_settings["bg_icon"], icon_state = icon_settings[used_icon_key]) + button.underlays += underlay + button.active_underlay_icon_state = icon_settings[used_icon_key] + +/** + * Applies our button icon and icon state to the button + * + * 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/button, force = FALSE) + if(!button_icon || !button_icon_state || (button.icon_state == button_icon_state && !force)) + return + + button.icon = button_icon + button.icon_state = button_icon_state + +/// Updates our buttons if our target's icon was updated +/datum/action/proc/on_target_icon_update(datum/source, updates, updated) + SIGNAL_HANDLER // COMSIG_ATOM_UPDATED_ICON + + 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) diff --git a/code/datums/actions/item_action.dm b/code/datums/actions/item_action.dm index 8ad5b4cdd9f..eec08e49a57 100644 --- a/code/datums/actions/item_action.dm +++ b/code/datums/actions/item_action.dm @@ -1,17 +1,15 @@ //Presets for item actions /datum/action/item_action check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_HANDS_BLOCKED|AB_CHECK_CONSCIOUS - var/use_itemicon = TRUE + button_icon_state = null -/datum/action/item_action/New(Target, custom_icon, custom_icon_state) +/datum/action/item_action/New(Target) ..() var/obj/item/I = target I.actions += src - if(custom_icon && custom_icon_state) - use_itemicon = FALSE - button_overlay_icon = custom_icon - button_overlay_icon_state = custom_icon_state - UpdateButtons() + // 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/Destroy() var/obj/item/I = target @@ -27,25 +25,6 @@ I.ui_action_click(owner, type, left_click) return TRUE -/datum/action/item_action/apply_button_overlay(atom/movable/screen/movable/action_button/current_button) - if(use_itemicon) - if(target) - var/obj/item/I = target - var/old_layer = I.layer - var/old_plane = I.plane - var/old_appearance_flags = I.appearance_flags - I.layer = FLOAT_LAYER //AAAH - I.plane = FLOAT_PLANE //^ what that guy said - I.appearance_flags |= RESET_COLOR | RESET_ALPHA - current_button.cut_overlays() - current_button.add_overlay(I) - I.layer = old_layer - I.plane = old_plane - I.appearance_flags = old_appearance_flags - else - ..() - - /datum/action/item_action/toggle_light name = "Toggle Light" @@ -60,13 +39,11 @@ /datum/action/item_action/print_forensic_report name = "Print Report" - button_overlay_icon_state = "scanner_print" - use_itemicon = FALSE + button_icon_state = "scanner_print" /datum/action/item_action/clear_records name = "Clear Scanner Records" - button_overlay_icon_state = "scanner_clear" - use_itemicon = FALSE + button_icon_state = "scanner_clear" /datum/action/item_action/toggle_gunlight name = "Toggle Gunlight" @@ -86,14 +63,9 @@ /datum/action/item_action/set_internals name = "Set Internals" -/datum/action/item_action/set_internals/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force) - if(!..()) // no button available - return - if(!iscarbon(owner)) - return - var/mob/living/carbon/C = owner - if(target == C.internal) - button.icon_state = "template_active" +/datum/action/item_action/set_internals/is_action_active(atom/movable/screen/movable/action_button/button) + var/mob/living/carbon/carbon_owner = owner + return istype(carbon_owner) && target == carbon_owner.internal /datum/action/item_action/toggle_mister name = "Toggle Mister" @@ -121,27 +93,27 @@ /datum/action/item_action/toggle_unfriendly_fire name = "Toggle Friendly Fire \[ON\]" desc = "Toggles if the club's blasts cause friendly fire." - button_overlay_icon_state = "vortex_ff_on" + button_icon_state = "vortex_ff_on" /datum/action/item_action/toggle_unfriendly_fire/Trigger(left_click) if(..()) - UpdateButtons() + build_all_button_icons() -/datum/action/item_action/toggle_unfriendly_fire/UpdateButtons() +/datum/action/item_action/toggle_unfriendly_fire/build_all_button_icons(update_flags, force) if(istype(target, /obj/item/hierophant_club)) var/obj/item/hierophant_club/H = target if(H.friendly_fire_check) - button_overlay_icon_state = "vortex_ff_off" + button_icon_state = "vortex_ff_off" name = "Toggle Friendly Fire \[OFF\]" else - button_overlay_icon_state = "vortex_ff_on" + button_icon_state = "vortex_ff_on" name = "Toggle Friendly Fire \[ON\]" ..() /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." - button_overlay_icon_state = "vortex_recall" + button_icon_state = "vortex_recall" /datum/action/item_action/vortex_recall/IsAvailable() if(istype(target, /obj/item/hierophant_club)) @@ -278,7 +250,7 @@ /datum/action/item_action/toggle_research_scanner name = "Toggle Research Scanner" - button_overlay_icon_state = "scan_mode" + button_icon_state = "scan_mode" /datum/action/item_action/toggle_research_scanner/Trigger(left_click) if(IsAvailable()) @@ -293,8 +265,8 @@ /datum/action/item_action/toggle_research_scanner/apply_button_overlay(atom/movable/screen/movable/action_button/current_button) current_button.cut_overlays() - if(button_overlay_icon && button_overlay_icon_state) - var/image/img = image(button_overlay_icon, current_button, "scan_mode") + if(button_icon && button_icon_state) + var/image/img = image(button_icon, current_button, "scan_mode") img.appearance_flags = RESET_COLOR | RESET_ALPHA current_button.overlays += img @@ -320,15 +292,13 @@ /datum/action/item_action/slipping name = "Tactical Slip" desc = "Activates the clown shoes' ankle-stimulating module, allowing the user to do a short slip forward going under anyone." - button_overlay_icon_state = "clown" + button_icon_state = "clown" // Jump boots /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." - button_overlay_icon_state = "jetboot" - use_itemicon = FALSE - + button_icon_state = "jetboot" /datum/action/item_action/gravity_jump name = "Gravity jump" @@ -408,3 +378,4 @@ /datum/action/item_action/call_link name = "Call MODlink" + diff --git a/code/datums/actions/spell_action.dm b/code/datums/actions/spell_action.dm index 60d57021f51..739338a06a0 100644 --- a/code/datums/actions/spell_action.dm +++ b/code/datums/actions/spell_action.dm @@ -1,6 +1,6 @@ //Preset for spells /datum/action/spell_action - button_background_icon_state = "bg_spell" + background_icon_state = "bg_spell" var/recharge_text_color = "#FFFFFF" /datum/action/spell_action/New(Target) @@ -9,12 +9,11 @@ S.action = src name = S.name desc = S.desc - button_overlay_icon = S.action_icon - button_background_icon = S.action_background_icon - button_overlay_icon_state = S.action_icon_state - button_background_icon_state = S.action_background_icon_state - UpdateButtons() - + button_icon = S.action_icon + button_icon_state = S.action_icon_state + background_icon = S.action_background_icon + background_icon_state = S.action_background_icon_state + build_all_button_icons() /datum/action/spell_action/Destroy() var/datum/spell/S = target @@ -53,17 +52,17 @@ if(!istype(S)) return ..() - var/alpha = S.cooldown_handler.get_cooldown_alpha() + unavailable_effect = mutable_appearance('icons/mob/screen_white.dmi', icon_state = "template") + unavailable_effect.appearance_flags = RESET_COLOR | RESET_ALPHA + unavailable_effect.color = "#000000" + unavailable_effect.plane = FLOAT_PLANE + 1 + unavailable_effect.alpha = S.cooldown_handler.get_cooldown_alpha() - var/image/img = image('icons/mob/screen_white.dmi', icon_state = "template") - img.alpha = alpha - img.appearance_flags = RESET_COLOR | RESET_ALPHA - img.color = "#000000" - img.plane = FLOAT_PLANE + 1 - button.add_overlay(img) // Make a holder for the charge text - var/image/count_down_holder = image('icons/effects/effects.dmi', icon_state = "nothing") - count_down_holder.plane = FLOAT_PLANE + 1.1 + var/image/count_down_holder = mutable_appearance('icons/effects/effects.dmi', icon_state = "nothing", appearance_flags = RESET_COLOR | RESET_ALPHA) var/text = S.cooldown_handler.cooldown_info() + count_down_holder.maptext_y = 4 count_down_holder.maptext = "
[text]
" - button.add_overlay(count_down_holder) + unavailable_effect.add_overlay(count_down_holder) + + button.overlays |= unavailable_effect diff --git a/code/datums/components/action_item_overlay.dm b/code/datums/components/action_item_overlay.dm new file mode 100644 index 00000000000..bb5a049edbf --- /dev/null +++ b/code/datums/components/action_item_overlay.dm @@ -0,0 +1,81 @@ +/** + * 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 + /// UID of the item the component uses to apply as an overlay. + var/item_uid + /// 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 && !istype(item)) + stack_trace("[type] created with a non-null, non-movable item; item must be null or movable") + 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_uid = item.UID() + src.item_callback = item_callback + +/datum/component/action_item_overlay/Destroy(force) + item_uid = null + item_callback = null + 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)) + if(item_appearance) + current_button.cut_overlay(item_appearance) + item_appearance = null + return + + var/atom/movable/muse = item_callback?.Invoke() || locateUID(item_uid) + if(!istype(muse)) + if(item_appearance) // New item does not exist but we have an old appearance + current_button.cut_overlay(item_appearance) + item_appearance = null + 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/scope.dm b/code/datums/components/scope.dm index 324896538d9..37b046a8791 100644 --- a/code/datums/components/scope.dm +++ b/code/datums/components/scope.dm @@ -276,4 +276,4 @@ /datum/action/zoom name = "Toggle Scope" check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING - button_overlay_icon_state = "sniper_zoom" + button_icon_state = "sniper_zoom" diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index e7248ca6594..28c075bcc1f 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -168,7 +168,7 @@ /// The hangup action handler, for handling the hangup button displayed in the top left corner of the screen /datum/action/innate/end_holocall name = "End Holocall" - button_overlay_icon_state = "camera_off" + button_icon_state = "camera_off" var/datum/holocall/hcall /datum/action/innate/end_holocall/New(Target, datum/holocall/HC) diff --git a/code/datums/spell_cooldown/spell_charges.dm b/code/datums/spell_cooldown/spell_charges.dm index 47803609ab2..e2e33b3653b 100644 --- a/code/datums/spell_cooldown/spell_charges.dm +++ b/code/datums/spell_cooldown/spell_charges.dm @@ -28,7 +28,7 @@ if(recharge_time > world.time) return FALSE current_charges++ - spell_parent.action.UpdateButtons() + spell_parent.action.build_all_button_icons() if(current_charges < max_charges) // we have more recharges to go recharge_time = world.time + recharge_duration return FALSE diff --git a/code/datums/spell_cooldown/spell_cooldown.dm b/code/datums/spell_cooldown/spell_cooldown.dm index 9ac6dbf4520..62b0a71a7df 100644 --- a/code/datums/spell_cooldown/spell_cooldown.dm +++ b/code/datums/spell_cooldown/spell_cooldown.dm @@ -33,7 +33,7 @@ if(!spell_parent.action) stack_trace("[spell_parent.type] ended up with a null action") return PROCESS_KILL - spell_parent.action.UpdateButtons() + spell_parent.action.build_all_button_icons() if(should_end_cooldown()) return PROCESS_KILL @@ -58,7 +58,7 @@ else recharge_time = get_recharge_time() if(spell_parent.action) - spell_parent.action.UpdateButtons() + spell_parent.action.build_all_button_icons() START_PROCESSING(SSfastprocess, src) /datum/spell_cooldown/proc/revert_cast() diff --git a/code/datums/spells/alien_spells/basetype_alien_spell.dm b/code/datums/spells/alien_spells/basetype_alien_spell.dm index 02ac8ddab2a..f832e490e59 100644 --- a/code/datums/spells/alien_spells/basetype_alien_spell.dm +++ b/code/datums/spells/alien_spells/basetype_alien_spell.dm @@ -15,7 +15,7 @@ Updates the spell's actions on use as well, so they know when they can or can't vessel.stored_plasma = clamp(vessel.stored_plasma + amount, 0, vessel.max_plasma) update_plasma_display(src) for(var/datum/action/spell_action/action in actions) - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/alien_spell action_background_icon_state = "bg_alien" @@ -35,7 +35,7 @@ Updates the spell's actions on use as well, so they know when they can or can't name = "[name] ([plasma_cost])" action.name = name action.desc = desc - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/alien_spell/write_custom_logs(list/targets, mob/user) user.create_log(ATTACK_LOG, "Cast the spell [name]") diff --git a/code/datums/spells/alien_spells/neurotoxin_spit.dm b/code/datums/spells/alien_spells/neurotoxin_spit.dm index 4886e28a179..55048177d82 100644 --- a/code/datums/spells/alien_spells/neurotoxin_spit.dm +++ b/code/datums/spells/alien_spells/neurotoxin_spit.dm @@ -14,8 +14,8 @@ /datum/spell/alien_spell/neurotoxin/update_spell_icon() if(!action) return - action.button_overlay_icon_state = "alien_neurotoxin_[active]" - action.UpdateButtons() + action.button_icon_state = "alien_neurotoxin_[active]" + action.build_all_button_icons() /datum/spell/alien_spell/neurotoxin/cast(list/targets, mob/living/carbon/user) var/target = targets[1] diff --git a/code/datums/spells/lichdom.dm b/code/datums/spells/lichdom.dm index 4df3537367f..45073690978 100644 --- a/code/datums/spells/lichdom.dm +++ b/code/datums/spells/lichdom.dm @@ -105,7 +105,7 @@ if(action) action.name = name action.desc = desc - UpdateButtons() + build_all_button_icons() target.name = "ensouled [target.name]" target.desc += "
A terrible aura surrounds this item, its very existence is offensive to life itself..." diff --git a/code/datums/spells/spell_base.dm b/code/datums/spells/spell_base.dm index b6bd4ed4e43..f783b871951 100644 --- a/code/datums/spells/spell_base.dm +++ b/code/datums/spells/spell_base.dm @@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(spells, typesof(/datum/spell)) custom_handler?.spend_spell_cost(user, src) if(action) - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/proc/invocation(mob/user) //spelling the spell out and setting it on recharge/reducing charges amount switch(invocation_type) @@ -350,7 +350,7 @@ GLOBAL_LIST_INIT(spells, typesof(/datum/spell)) cast(targets, user = user) after_cast(targets, user) if(action) - action.UpdateButtons() + action.build_all_button_icons() /** * Will write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this @@ -421,11 +421,11 @@ GLOBAL_LIST_INIT(spells, typesof(/datum/spell)) custom_handler?.revert_cast(user, src) if(action) - action.UpdateButtons() + action.build_all_button_icons() -/datum/spell/proc/UpdateButtons() +/datum/spell/proc/build_all_button_icons() if(action) - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/proc/adjust_var(mob/living/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types switch(type) diff --git a/code/datums/spells/wizard_spells.dm b/code/datums/spells/wizard_spells.dm index 6d94d5fe0bc..6b285e68557 100644 --- a/code/datums/spells/wizard_spells.dm +++ b/code/datums/spells/wizard_spells.dm @@ -340,8 +340,8 @@ /datum/spell/fireball/update_spell_icon() if(!action) return - action.button_overlay_icon_state = "fireball[active]" - action.UpdateButtons() + action.button_icon_state = "fireball[active]" + action.build_all_button_icons() /datum/spell/fireball/cast(list/targets, mob/living/user = usr) var/target = targets[1] //There is only ever one target for fireball diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm index 5366ffd69e0..9e36133dc96 100644 --- a/code/game/gamemodes/cult/blood_magic.dm +++ b/code/game/gamemodes/cult/blood_magic.dm @@ -1,7 +1,7 @@ /// Blood magic handles the creation of blood spells (formerly talismans) /datum/action/innate/cult/blood_magic name = "Prepare Blood Magic" - button_overlay_icon_state = "carve" + button_icon_state = "carve" desc = "Prepare blood magic by carving runes into your flesh. This is easier with an empowering rune." default_button_position = DEFAULT_BLOODSPELLS var/list/spells = list() @@ -74,7 +74,7 @@ /// The next generation of talismans, handles storage/creation of blood magic /datum/action/innate/cult/blood_spell name = "Blood Magic" - button_overlay_icon_state = "telerune" + button_icon_state = "telerune" desc = "Fear the Old Blood." default_button_position = SCRN_OBJ_CULT_LIST var/charges = 1 @@ -86,7 +86,11 @@ var/health_cost = 0 /// Have we already been positioned into our starting location? var/positioned = FALSE + var/mutable_appearance/button_charge_count +/datum/action/innate/cult/blood_spell/New(target) + . = ..() + button_charge_count = image('icons/effects/effects.dmi', icon_state = "nothing") /datum/action/innate/cult/blood_spell/proc/get_panel_text() if(initial(charges) == 1) @@ -94,14 +98,17 @@ var/available_charges = hand_magic ? "[hand_magic.uses]" : "[charges]" return "[available_charges]/[initial(charges)]" -/datum/action/innate/cult/blood_spell/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force) +/datum/action/innate/cult/blood_spell/update_button_status(atom/movable/screen/movable/action_button/button, force) . = ..() + if(!button) + return + button.overlays -= button_charge_count + var/text = get_panel_text() if(!text || !button) return - var/image/count_down_holder = image('icons/effects/effects.dmi', icon_state = "nothing") - count_down_holder.maptext = "
[text]
" - button.add_overlay(count_down_holder) + button_charge_count.maptext = "
[text]
" + button.overlays |= button_charge_count /datum/action/innate/cult/blood_spell/Grant(mob/living/owner, datum/action/innate/cult/blood_magic/BM) if(health_cost) @@ -148,21 +155,21 @@ /datum/action/innate/cult/blood_spell/stun name = "Stun" desc = "Will knock down and mute a victim on contact. Strike them with a cult blade to complete the invocation, stunning them and extending the mute." - button_overlay_icon_state = "stun" + button_icon_state = "stun" magic_path = /obj/item/melee/blood_magic/stun health_cost = 10 /datum/action/innate/cult/blood_spell/teleport name = "Teleport" desc = "Empowers your hand to teleport yourself or another cultist to a teleport rune on contact." - button_overlay_icon_state = "teleport" + button_icon_state = "teleport" magic_path = /obj/item/melee/blood_magic/teleport health_cost = 7 /datum/action/innate/cult/blood_spell/emp name = "Electromagnetic Pulse" desc = "Releases an Electromagnetic Pulse, affecting nearby non-cultists. The pulse will still affect you." - button_overlay_icon_state = "emp" + button_icon_state = "emp" health_cost = 10 invocation = "Ta'gh fara'qha fel d'amar det!" @@ -198,24 +205,24 @@ /datum/action/innate/cult/blood_spell/shackles name = "Shadow Shackles" desc = "Empowers your hand to start handcuffing victim on contact, and mute them if successful." - button_overlay_icon_state = "shackles" + button_icon_state = "shackles" charges = 4 magic_path = /obj/item/melee/blood_magic/shackles /datum/action/innate/cult/blood_spell/construction name = "Twisted Construction" desc = "Empowers your hand to corrupt certain metalic objects.
Converts:
Plasteel into runed metal
50 metal into a construct shell
Cyborg shells into construct shells
Airlocks into brittle runed airlocks after a delay (harm intent)" - button_overlay_icon_state = "transmute" + button_icon_state = "transmute" magic_path = "/obj/item/melee/blood_magic/construction" health_cost = 12 /datum/action/innate/cult/blood_spell/dagger name = "Summon Dagger" desc = "Summon a ritual dagger, necessary to scribe runes." - button_overlay_icon_state = "cult_dagger" + button_icon_state = "cult_dagger" /datum/action/innate/cult/blood_spell/dagger/New() - button_overlay_icon_state = GET_CULT_DATA(dagger_icon, "cult_dagger") + button_icon_state = GET_CULT_DATA(dagger_icon, "cult_dagger") ..() /datum/action/innate/cult/blood_spell/dagger/Activate() @@ -238,13 +245,13 @@ /datum/action/innate/cult/blood_spell/equipment name = "Summon Equipment" desc = "Empowers your hand to summon combat gear onto a cultist you touch, including cult armor into open slots, a cult bola, and a cult sword." - button_overlay_icon_state = "equip" + button_icon_state = "equip" magic_path = /obj/item/melee/blood_magic/armor /datum/action/innate/cult/blood_spell/horror name = "Hallucinations" desc = "Gives hallucinations to a target at range. A silent and invisible spell." - button_overlay_icon_state = "horror" + button_icon_state = "horror" var/datum/spell/horror/PH charges = 4 @@ -296,10 +303,9 @@ var/mob/living/carbon/human/H = target H.Hallucinate(120 SECONDS) attached_action.charges-- - attached_action.UpdateButtons() attached_action.desc = attached_action.base_desc attached_action.desc += "
Has [attached_action.charges] use\s remaining." - attached_action.UpdateButtons() + attached_action.build_all_button_icons() user.ranged_ability.remove_ranged_ability(user, "[H] has been cursed with living nightmares!") if(attached_action.charges <= 0) to_chat(ranged_ability_user, "You have exhausted the spell's power!") @@ -309,7 +315,7 @@ name = "Conceal Presence" desc = "Alternates between hiding and revealing nearby cult structures, cult airlocks and runes." invocation = "Kla'atu barada nikt'o!" - button_overlay_icon_state = "veiling" + button_icon_state = "veiling" charges = 10 var/revealing = FALSE //if it reveals or not @@ -329,7 +335,7 @@ O.cult_conceal() revealing = TRUE // Switch on use name = "Reveal Runes" - button_overlay_icon_state = "revealing" + button_icon_state = "revealing" else // Unhiding stuff owner.visible_message("A flash of light shines from [owner]'s hand!", \ @@ -344,19 +350,19 @@ O.cult_reveal() revealing = FALSE // Switch on use name = "Conceal Runes" - button_overlay_icon_state = "veiling" + button_icon_state = "veiling" if(charges <= 0) qdel(src) desc = "[revealing ? "Reveals" : "Conceals"] nearby cult structures, airlocks, and runes." desc += "
Has [charges] use\s remaining." - UpdateButtons() + build_all_button_icons() /datum/action/innate/cult/blood_spell/manipulation name = "Blood Rites" desc = "Empowers your hand to manipulate blood. Use on blood or a noncultist to absorb blood to be used later, use on yourself or another cultist to heal them using absorbed blood. \ \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear, firing blood projectiles out of your hands, and more!" invocation = "Fel'th Dol Ab'orod!" - button_overlay_icon_state = "manip" + button_icon_state = "manip" charges = 5 magic_path = /obj/item/melee/blood_magic/manipulator @@ -403,7 +409,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/customised_abstract_text(mob/living/carbon/owner) @@ -436,7 +442,7 @@ else if(source) source.desc = source.base_desc source.desc += "
Has [uses] use\s remaining." - source.UpdateButtons() + source.build_all_button_icons() //The spell effects @@ -576,7 +582,7 @@ user.visible_message("This victim doesn't have enough arms to complete the restraint!") return CuffAttack(C, user) - source.UpdateButtons() + source.build_all_button_icons() ..() /obj/item/melee/blood_magic/shackles/proc/CuffAttack(mob/living/carbon/C, mob/living/user) @@ -872,12 +878,12 @@ target.clean_blood() else steal_blood(user, target) - source.UpdateButtons() + source.build_all_button_icons() return if(isconstruct(target)) heal_construct(user, target) - source.UpdateButtons() + source.build_all_button_icons() return if(istype(target, /obj/item/blood_orb)) @@ -887,10 +893,10 @@ to_chat(user, "You obtain [candidate.blood] blood from the orb of blood!") playsound(user, 'sound/misc/enter_blood.ogg', 50, extrarange = SOUND_RANGE_SET(7)) qdel(candidate) - source.UpdateButtons() + source.build_all_button_icons() return blood_draw(target, user) - source.UpdateButtons() + source.build_all_button_icons() /obj/item/melee/blood_magic/manipulator/proc/blood_draw(atom/target, mob/living/carbon/human/user) var/temp = 0 @@ -994,4 +1000,4 @@ to_chat(user, "You need a free hand for this rite!") uses += BLOOD_BARRAGE_COST // Refund the charges qdel(rite) - source.UpdateButtons() + source.build_all_button_icons() diff --git a/code/game/gamemodes/cult/cult_actions.dm b/code/game/gamemodes/cult/cult_actions.dm index 0fc42ddf9fe..fc3dc0aaae7 100644 --- a/code/game/gamemodes/cult/cult_actions.dm +++ b/code/game/gamemodes/cult/cult_actions.dm @@ -1,6 +1,6 @@ /datum/action/innate/cult - button_overlay_icon = 'icons/mob/actions/actions_cult.dmi' - button_background_icon_state = "bg_cult" + button_icon = 'icons/mob/actions/actions_cult.dmi' + background_icon_state = "bg_cult" check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS buttontooltipstyle = "cult" @@ -14,7 +14,7 @@ /datum/action/innate/cult/comm name = "Communion" desc = "Whispered words that all cultists can hear.
Warning:Nearby non-cultists can still hear you." - button_overlay_icon_state = "cult_comms" + button_icon_state = "cult_comms" check_flags = AB_CHECK_CONSCIOUS /datum/action/innate/cult/comm/Activate() @@ -87,12 +87,12 @@ //Objectives /datum/action/innate/cult/check_progress name = "Study the Veil" - button_overlay_icon_state = "tome" + button_icon_state = "tome" desc = "Check your cult's current progress and objective." check_flags = AB_CHECK_CONSCIOUS /datum/action/innate/cult/check_progress/New() - button_overlay_icon_state = GET_CULT_DATA(tome_icon, "tome") + button_icon_state = GET_CULT_DATA(tome_icon, "tome") ..() /datum/action/innate/cult/check_progress/IsAvailable() @@ -111,11 +111,11 @@ /datum/action/innate/cult/use_dagger name = "Draw Blood Rune" desc = "Use the ritual dagger to create a powerful blood rune." - button_overlay_icon_state = "blood_dagger" + button_icon_state = "blood_dagger" default_button_position = "10:29,4:-2" /datum/action/innate/cult/use_dagger/Grant() - button_overlay_icon_state = GET_CULT_DATA(dagger_icon, "blood_dagger") + button_icon_state = GET_CULT_DATA(dagger_icon, "blood_dagger") ..() /datum/action/innate/cult/use_dagger/Activate() diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 0c832552ab1..3bbc69ada00 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -634,7 +634,7 @@ /datum/action/innate/cult/spear name = "Bloody Bond" desc = "Recall the blood spear to your hand." - button_overlay_icon_state = "bloodspear" + button_icon_state = "bloodspear" default_button_position = "11:31,4:-2" var/obj/item/cult_spear/spear var/cooldown = 0 diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index eb64cbf6ebc..8c15e1bc1e0 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -76,7 +76,7 @@ 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() /datum/spell/ai_spell/proc/check_camera_vision(mob/user, atom/target) var/turf/target_turf = get_turf(target) @@ -207,7 +207,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() temp = "Additional use[action.uses > 1 ? "s" : ""] added to [action.name]!" processing_time -= AM.cost diff --git a/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm index 654f550d503..a7810d43556 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/abductor_camera.dm @@ -69,7 +69,7 @@ /datum/action/innate/teleport_in name = "Send To" - button_overlay_icon_state = "beam_down" + button_icon_state = "beam_down" /datum/action/innate/teleport_in/Activate() if(!target || !iscarbon(owner)) @@ -83,7 +83,7 @@ /datum/action/innate/teleport_out name = "Retrieve" - button_overlay_icon_state = "beam_up" + button_icon_state = "beam_up" /datum/action/innate/teleport_out/Activate() if(!target || !iscarbon(owner)) @@ -96,7 +96,7 @@ /datum/action/innate/teleport_self name = "Send Self" - button_overlay_icon_state = "beam_down" + button_icon_state = "beam_down" /datum/action/innate/teleport_self/Activate() if(!target || !iscarbon(owner)) @@ -110,7 +110,7 @@ /datum/action/innate/vest_mode_swap name = "Switch Vest Mode" - button_overlay_icon_state = "vest_mode" + button_icon_state = "vest_mode" /datum/action/innate/vest_mode_swap/Activate() if(!target || !iscarbon(owner)) @@ -121,7 +121,7 @@ /datum/action/innate/vest_disguise_swap name = "Switch Vest Disguise" - button_overlay_icon_state = "vest_disguise" + button_icon_state = "vest_disguise" /datum/action/innate/vest_disguise_swap/Activate() if(!target || !iscarbon(owner)) @@ -131,7 +131,7 @@ /datum/action/innate/set_droppoint name = "Set Experiment Release Point" - button_overlay_icon_state = "set_drop" + button_icon_state = "set_drop" /datum/action/innate/set_droppoint/Activate() if(!target || !iscarbon(owner)) diff --git a/code/game/gamemodes/miniantags/demons/shadow_demon/shadow_demon.dm b/code/game/gamemodes/miniantags/demons/shadow_demon/shadow_demon.dm index ed9e02690b6..90d5313d5fb 100644 --- a/code/game/gamemodes/miniantags/demons/shadow_demon/shadow_demon.dm +++ b/code/game/gamemodes/miniantags/demons/shadow_demon/shadow_demon.dm @@ -170,8 +170,8 @@ AddSpell(new /datum/spell/fireball/shadow_grapple) var/datum/spell/bloodcrawl/shadow_crawl/S = new AddSpell(S) - whisper_action.button_overlay_icon_state = "shadow_whisper" - whisper_action.button_background_icon_state = "shadow_demon_bg" + whisper_action.button_icon_state = "shadow_whisper" + whisper_action.background_icon_state = "shadow_demon_bg" if(istype(loc, /obj/effect/dummy/slaughter)) S.phased = TRUE RegisterSignal(loc, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/mob/living/simple_animal/demon/shadow, check_darkness)) diff --git a/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm b/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm index 96f4257fff6..a07f50aa10b 100644 --- a/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm +++ b/code/game/gamemodes/miniantags/demons/slaughter_demon/slaughter.dm @@ -164,8 +164,8 @@ /datum/action/innate/demon_whisper name = "Demonic Whisper" - button_overlay_icon_state = "demon_comms" - button_background_icon_state = "bg_demon" + button_icon_state = "demon_comms" + background_icon_state = "bg_demon" /datum/action/innate/demon_whisper/IsAvailable() return ..() diff --git a/code/game/gamemodes/miniantags/guardian/host_actions.dm b/code/game/gamemodes/miniantags/guardian/host_actions.dm index e21f2509415..957c94ee55d 100644 --- a/code/game/gamemodes/miniantags/guardian/host_actions.dm +++ b/code/game/gamemodes/miniantags/guardian/host_actions.dm @@ -5,8 +5,8 @@ */ /datum/action/guardian name = "Generic guardian host action" - button_overlay_icon = 'icons/mob/guardian.dmi' - button_overlay_icon_state = "base" + button_icon = 'icons/mob/guardian.dmi' + button_icon_state = "base" var/mob/living/simple_animal/hostile/guardian/guardian /datum/action/guardian/Grant(mob/M, mob/living/simple_animal/hostile/guardian/G) @@ -24,7 +24,7 @@ /datum/action/guardian/communicate name = "Communicate" desc = "Communicate telepathically with your guardian." - button_overlay_icon_state = "communicate" + button_icon_state = "communicate" /datum/action/guardian/communicate/Trigger(left_click) var/input = tgui_input_text(owner, "Enter a message to tell your guardian:", "Message") @@ -50,7 +50,7 @@ /datum/action/guardian/recall name = "Recall Guardian" desc = "Forcibly recall your guardian." - button_overlay_icon_state = "recall" + button_icon_state = "recall" /datum/action/guardian/recall/Trigger(left_click) guardian.Recall() @@ -63,7 +63,7 @@ /datum/action/guardian/reset_guardian name = "Replace Guardian Player" desc = "Replace your guardian's player with a ghost. This can only be done once." - button_overlay_icon_state = "reset" + button_icon_state = "reset" var/cooldown_timer /datum/action/guardian/reset_guardian/IsAvailable() @@ -82,7 +82,7 @@ // Do this immediately, so the user can't spam a bunch of polls. cooldown_timer = addtimer(CALLBACK(src, PROC_REF(reset_cooldown)), 5 MINUTES) - UpdateButtons() + build_all_button_icons() to_chat(owner, "Searching for a replacement ghost...") var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as [guardian.real_name]?", ROLE_GUARDIAN, FALSE, 15 SECONDS, source = guardian) @@ -184,7 +184,7 @@ */ /datum/action/guardian/reset_guardian/proc/reset_cooldown() cooldown_timer = null - UpdateButtons() + build_all_button_icons() /** * Grants all existing `/datum/action/guardian` type actions to the src mob. diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index 139ded6b2dc..dcc7382b7f5 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -145,7 +145,7 @@ /mob/living/simple_animal/hostile/morph/proc/add_food(amount) gathered_food += amount for(var/datum/action/spell_action/action in actions) - action.UpdateButtons() + action.build_all_button_icons() /mob/living/simple_animal/hostile/morph/proc/assume() @@ -155,8 +155,8 @@ melee_damage_lower = 5 melee_damage_upper = 5 speed = MORPHED_SPEED - ambush_spell.UpdateButtons() - pass_airlock_spell.UpdateButtons() + ambush_spell.build_all_button_icons() + pass_airlock_spell.build_all_button_icons() move_resist = MOVE_FORCE_DEFAULT // They become more fragile and easier to move /mob/living/simple_animal/hostile/morph/proc/restore() @@ -171,7 +171,7 @@ if(ambush_prepared) to_chat(src, "The ambush potential has faded as you take your true form.") failed_ambush() - pass_airlock_spell.UpdateButtons() + pass_airlock_spell.build_all_button_icons() move_resist = MOVE_FORCE_STRONG // Return to their fatness @@ -183,7 +183,7 @@ /mob/living/simple_animal/hostile/morph/proc/failed_ambush() ambush_prepared = FALSE - ambush_spell.UpdateButtons() + ambush_spell.build_all_button_icons() mimic_spell.perfect_disguise = FALSE // Reset the perfect disguise remove_status_effect(/datum/status_effect/morph_ambush) UnregisterSignal(src, COMSIG_MOVABLE_MOVED) diff --git a/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm b/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm index af85ca31121..eba026f9d61 100644 --- a/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm +++ b/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm @@ -10,7 +10,7 @@ name = "[name] ([hunger_cost])" action.name = name action.desc = desc - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/morph_spell/create_new_handler() var/datum/spell_handler/morph/H = new diff --git a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm index e81ec0d03ae..0ff4b65fad7 100644 --- a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm +++ b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon.dm @@ -169,8 +169,8 @@ update_glow() playsound(get_turf(src), 'sound/effects/eleczap.ogg', 30, TRUE) give_spells() - whisper_action.button_overlay_icon_state = "pulse_whisper" - whisper_action.button_background_icon_state = "bg_pulsedemon" + whisper_action.button_icon_state = "pulse_whisper" + whisper_action.background_icon_state = "bg_pulsedemon" /mob/living/simple_animal/demon/pulse_demon/proc/deleted_handler(our_demon, force) SIGNAL_HANDLER @@ -344,7 +344,7 @@ if(!S.action || S.locked) continue if(S.requires_area) - S.action.UpdateButtons() + S.action.build_all_button_icons() // can enter an apc at all? /mob/living/simple_animal/demon/pulse_demon/proc/is_valid_apc(obj/machinery/power/apc/A) @@ -457,7 +457,7 @@ var/dist = S.cast_cost - orig // only update icon if the amount is actually enough to change a spell's availability if(dist == 0 || (dist > 0 && realdelta >= dist) || (dist < 0 && realdelta <= dist)) - S.action.UpdateButtons() + S.action.build_all_button_icons() return realdelta // linear scale for glow strength, see table: diff --git a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm index 3731775c8bf..6b637f7e70b 100644 --- a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm +++ b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm @@ -34,7 +34,7 @@ desc = "[initial(desc)][spell_level == level_max ? "" : " It costs [format_si_suffix(upgrade_cost)] APC\s to upgrade. Alt-Click this spell to upgrade it."]" action.name = name action.desc = desc - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/pulse_demon/can_cast(mob/living/simple_animal/demon/pulse_demon/user, charge_check, show_message) if(!..()) @@ -276,8 +276,8 @@ /datum/spell/pulse_demon/toggle/proc/do_toggle(varstate, mob/user) if(action) - action.button_background_icon_state = varstate ? action_background_icon_state : "[action_background_icon_state]_disabled" - action.UpdateButtons() + action.background_icon_state = varstate ? action_background_icon_state : "[action_background_icon_state]_disabled" + action.build_all_button_icons() if(user) to_chat(user, "You will [varstate ? "now" : "no longer"] [base_message]") return varstate diff --git a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm index dc75a74b1da..d70d689f6ff 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm @@ -175,7 +175,7 @@ name = "[initial(name)] ([cast_amount]E)" action.name = name action.desc = desc - action.UpdateButtons() + action.build_all_button_icons() /datum/spell/aoe/revenant/revert_cast(mob/user) . = ..() @@ -212,7 +212,7 @@ user.reveal(reveal) user.stun(stun) if(action) - action.UpdateButtons() + action.build_all_button_icons() return TRUE //Overload Light: Breaks a light that's online and sends out lightning bolts to all nearby people. diff --git a/code/game/jobs/job/support.dm b/code/game/jobs/job/support.dm index 2ffc85bcdac..6c510820c06 100644 --- a/code/game/jobs/job/support.dm +++ b/code/game/jobs/job/support.dm @@ -456,15 +456,15 @@ //action given to antag clowns /datum/action/innate/toggle_clumsy name = "Toggle Clown Clumsy" - button_overlay_icon_state = "clown" + button_icon_state = "clown" /datum/action/innate/toggle_clumsy/Activate() var/mob/living/carbon/human/H = owner H.dna.SetSEState(GLOB.clumsyblock, TRUE) singlemutcheck(H, GLOB.clumsyblock, MUTCHK_FORCED) active = TRUE - button_background_icon_state = "bg_spell" - UpdateButtons() + background_icon_state = "bg_spell" + build_all_button_icons() to_chat(H, "You start acting clumsy to throw suspicions off. Focus again before using weapons.") /datum/action/innate/toggle_clumsy/Deactivate() @@ -472,8 +472,8 @@ H.dna.SetSEState(GLOB.clumsyblock, FALSE) singlemutcheck(H, GLOB.clumsyblock, MUTCHK_FORCED) active = FALSE - button_background_icon_state = "bg_default" - UpdateButtons() + background_icon_state = "bg_default" + build_all_button_icons() to_chat(H, "You focus and can now use weapons regularly.") /datum/job/mime diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index a920236b48d..1f0b1a6cf98 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -80,7 +80,7 @@ /datum/action/innate/camera_off name = "End Camera View" - button_overlay_icon_state = "camera_off" + button_icon_state = "camera_off" /datum/action/innate/camera_off/Activate() if(!target || !iscarbon(target)) @@ -92,7 +92,7 @@ /datum/action/innate/camera_jump name = "Jump To Camera" - button_overlay_icon_state = "camera_jump" + button_icon_state = "camera_jump" /datum/action/innate/camera_jump/Activate() if(!target || !iscarbon(target)) diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index 437cf6aba10..a6f22a90ff3 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -21,7 +21,7 @@ /datum/action/innate/mecha check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS - button_overlay_icon = 'icons/mob/actions/actions_mecha.dmi' + button_icon = 'icons/mob/actions/actions_mecha.dmi' var/obj/mecha/chassis /datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M) @@ -35,7 +35,7 @@ /datum/action/innate/mecha/mech_eject name = "Eject From Mech" - button_overlay_icon_state = "mech_eject" + button_icon_state = "mech_eject" /datum/action/innate/mecha/mech_eject/Activate() if(!owner) @@ -46,20 +46,20 @@ /datum/action/innate/mecha/mech_toggle_internals name = "Toggle Internal Airtank Usage" - button_overlay_icon_state = "mech_internals_off" + button_icon_state = "mech_internals_off" /datum/action/innate/mecha/mech_toggle_internals/Activate() if(!owner || !chassis || chassis.occupant != owner) return chassis.use_internal_tank = !chassis.use_internal_tank - button_overlay_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]" + button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]" chassis.occupant_message("Now taking air from [chassis.use_internal_tank ? "internal airtank" : "environment"].") chassis.log_message("Now taking air from [chassis.use_internal_tank ? "internal airtank" : "environment"].") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_toggle_lights name = "Toggle Lights" - button_overlay_icon_state = "mech_lights_off" + button_icon_state = "mech_lights_off" /datum/action/innate/mecha/mech_toggle_lights/Activate() if(!owner || !chassis || chassis.occupant != owner) @@ -67,17 +67,17 @@ chassis.lights = !chassis.lights if(chassis.lights) chassis.set_light(chassis.lights_range, chassis.lights_power) - button_overlay_icon_state = "mech_lights_on" + button_icon_state = "mech_lights_on" else chassis.set_light(chassis.lights_range_ambient, chassis.lights_power_ambient) - button_overlay_icon_state = "mech_lights_off" + button_icon_state = "mech_lights_off" chassis.occupant_message("Toggled lights [chassis.lights ? "on" : "off"].") chassis.log_message("Toggled lights [chassis.lights ? "on" : "off"].") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_view_stats name = "View Stats" - button_overlay_icon_state = "mech_view_stats" + button_icon_state = "mech_view_stats" /datum/action/innate/mecha/mech_view_stats/Activate() if(!owner || !chassis || chassis.occupant != owner) @@ -86,7 +86,7 @@ /datum/action/innate/mecha/mech_defence_mode name = "Toggle Defence Mode" - button_overlay_icon_state = "mech_defense_mode_off" + button_icon_state = "mech_defense_mode_off" /datum/action/innate/mecha/mech_defence_mode/Activate(forced_state = null) if(!owner || !chassis || chassis.occupant != owner) @@ -95,7 +95,7 @@ chassis.defence_mode = forced_state else chassis.defence_mode = !chassis.defence_mode - button_overlay_icon_state = "mech_defense_mode_[chassis.defence_mode ? "on" : "off"]" + button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "on" : "off"]" if(chassis.defence_mode) chassis.deflect_chance = chassis.defence_mode_deflect_chance chassis.occupant_message("You enable [chassis] defence mode.") @@ -103,11 +103,11 @@ chassis.deflect_chance = initial(chassis.deflect_chance) chassis.occupant_message("You disable [chassis] defence mode.") chassis.log_message("Toggled defence mode.") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_overload_mode name = "Toggle leg actuators overload" - button_overlay_icon_state = "mech_overload_off" + button_icon_state = "mech_overload_off" /datum/action/innate/mecha/mech_overload_mode/Activate(forced_state = null) if(!owner || !chassis || chassis.occupant != owner) @@ -119,7 +119,7 @@ chassis.leg_overload_mode = forced_state else chassis.leg_overload_mode = !chassis.leg_overload_mode - button_overlay_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]" + button_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]" chassis.log_message("Toggled leg actuators overload.") if(chassis.leg_overload_mode) chassis.leg_overload_mode = 1 @@ -133,11 +133,11 @@ chassis.step_in = initial(chassis.step_in) chassis.step_energy_drain = chassis.normal_step_energy_drain chassis.occupant_message("You disable leg actuators overload.") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_toggle_thrusters name = "Toggle Thrusters" - button_overlay_icon_state = "mech_thrusters_off" + button_icon_state = "mech_thrusters_off" /datum/action/innate/mecha/mech_toggle_thrusters/Activate() if(!owner || !chassis || chassis.occupant != owner) @@ -146,13 +146,13 @@ chassis.thrusters_active = !chassis.thrusters_active if(!chassis.thrusters_active) chassis.step_in = initial(chassis.step_in) - button_overlay_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]" + button_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]" chassis.log_message("Toggled thrusters.") chassis.occupant_message("Thrusters [chassis.thrusters_active ? "en" : "dis"]abled.") /datum/action/innate/mecha/mech_smoke name = "Smoke" - button_overlay_icon_state = "mech_smoke" + button_icon_state = "mech_smoke" /datum/action/innate/mecha/mech_smoke/Activate() if(!owner || !chassis || chassis.occupant != owner) @@ -168,14 +168,14 @@ /datum/action/innate/mecha/mech_zoom name = "Zoom" - button_overlay_icon_state = "mech_zoom_off" + button_icon_state = "mech_zoom_off" /datum/action/innate/mecha/mech_zoom/Activate() if(!owner || !chassis || chassis.occupant != owner) return if(owner.client) chassis.zoom_mode = !chassis.zoom_mode - button_overlay_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]" + button_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]" chassis.log_message("Toggled zoom mode.") chassis.occupant_message("Zoom mode [chassis.zoom_mode ? "en" : "dis"]abled.") if(chassis.zoom_mode) @@ -183,24 +183,24 @@ SEND_SOUND(owner, sound(chassis.zoomsound, volume = 50)) else owner.client.RemoveViewMod("mecha") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_toggle_phasing name = "Toggle Phasing" - button_overlay_icon_state = "mech_phasing_off" + button_icon_state = "mech_phasing_off" /datum/action/innate/mecha/mech_toggle_phasing/Activate() if(!owner || !chassis || chassis.occupant != owner) return chassis.phasing = !chassis.phasing - button_overlay_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]" + button_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]" chassis.occupant_message("En":"#f00\">Dis"]abled phasing.") - UpdateButtons() + build_all_button_icons() /datum/action/innate/mecha/mech_switch_damtype name = "Reconfigure arm microtool arrays" - button_overlay_icon_state = "mech_damtype_brute" + button_icon_state = "mech_damtype_brute" /datum/action/innate/mecha/mech_switch_damtype/Activate() if(!owner || !chassis || chassis.occupant != owner) @@ -217,16 +217,16 @@ new_damtype = "tox" chassis.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.") chassis.damtype = new_damtype - button_overlay_icon_state = "mech_damtype_[new_damtype]" + button_icon_state = "mech_damtype_[new_damtype]" playsound(src, 'sound/mecha/mechmove01.ogg', 50, TRUE) - UpdateButtons() + build_all_button_icons() // Floor Buffer Action /datum/action/innate/mecha/mech_toggle_floorbuffer name = "Toggle Floor Buffer" desc = "Movement speed is decreased while active." - button_overlay_icon = 'icons/obj/vehicles.dmi' - button_overlay_icon_state = "upgrade" + button_icon = 'icons/obj/vehicles.dmi' + button_icon_state = "upgrade" /datum/action/innate/mecha/mech_toggle_floorbuffer/Activate() if(!chassis.floor_buffer) @@ -245,8 +245,8 @@ if(!_equipment) return FALSE equipment = _equipment - button_overlay_icon = equipment.icon - button_overlay_icon_state = equipment.icon_state + button_icon = equipment.icon + button_icon_state = equipment.icon_state name = "Switch module to [equipment.name]" return ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 3161a02f1ea..9768d3b19b7 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -70,10 +70,6 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons var/list/actions = list() /// List of paths of action datums to give to the item on New(). var/list/actions_types = list() - /// List of icons-sheets for a given action to override the icon. - var/list/action_icon = list() - /// List of icon states for a given action to override the icon_state. - var/list/action_icon_state = list() /// What materials the item yields when broken down. Some methods will not recover everything (autolathes only recover metal and glass, for example). var/list/materials = list() @@ -215,7 +211,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons /obj/item/Initialize(mapload) . = ..() for(var/path in actions_types) - new path(src, action_icon[path], action_icon_state[path]) + new path(src) if(isstorage(loc)) //marks all items in storage as being such in_storage = TRUE @@ -1028,9 +1024,9 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons /obj/item/proc/should_stack_with(obj/item/other) return type == other.type && name == other.name -/obj/item/proc/update_action_buttons(status_only = FALSE, force = FALSE) +/obj/item/proc/update_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) /** * Handles the bulk of cigarette lighting interactions. You must call `light()` to actually light the cigarette. diff --git a/code/game/objects/items/weapons/bio_chips/bio_chip_stealth.dm b/code/game/objects/items/weapons/bio_chips/bio_chip_stealth.dm index e7050f91888..76a747c0a1c 100644 --- a/code/game/objects/items/weapons/bio_chips/bio_chip_stealth.dm +++ b/code/game/objects/items/weapons/bio_chips/bio_chip_stealth.dm @@ -18,9 +18,8 @@ name = "Deploy Box" desc = "Find inner peace, here, in the box." check_flags = AB_CHECK_HANDS_BLOCKED | AB_CHECK_IMMOBILE | AB_CHECK_CONSCIOUS | AB_CHECK_STUNNED - button_background_icon_state = "bg_agent" - button_overlay_icon_state = "deploy_box" - use_itemicon = FALSE + background_icon_state = "bg_agent" + button_icon_state = "deploy_box" /// If TRUE, the box can't be deployed var/on_cooldown = FALSE @@ -63,11 +62,11 @@ on_cooldown = TRUE addtimer(CALLBACK(src, PROC_REF(end_cooldown)), 10 SECONDS) owner.clear_fullscreen("agent_box") - UpdateButtons() + build_all_button_icons() /datum/action/item_action/agent_box/proc/end_cooldown() on_cooldown = FALSE - UpdateButtons() + build_all_button_icons() /datum/action/item_action/agent_box/IsAvailable() if(..() && !on_cooldown) diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index aac4c9a2d97..15fba006b05 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -3,7 +3,7 @@ /datum/action/changeling name = "Prototype Sting" desc = "" // Fluff - button_background_icon_state = "bg_changeling" + background_icon_state = "bg_changeling" /// A reference to the changeling's changeling antag datum. var/datum/antagonist/changeling/cling /// Datum path used to determine the location and name of the power in changeling evolution menu UI diff --git a/code/modules/antagonists/changeling/evolution_menu.dm b/code/modules/antagonists/changeling/evolution_menu.dm index cc6f218b970..150ea34343e 100644 --- a/code/modules/antagonists/changeling/evolution_menu.dm +++ b/code/modules/antagonists/changeling/evolution_menu.dm @@ -6,7 +6,7 @@ /datum/action/changeling/evolution_menu name = "Evolution Menu" desc = "Choose our method of subjugation." - button_overlay_icon_state = "changelingsting" + button_icon_state = "changelingsting" power_type = CHANGELING_INNATE_POWER /// Which UI view will be displayed. Compact mode will show only power names, and will leave out their descriptions and helptext. var/view_mode = EXPANDED_MODE diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index 1a6c9c5823a..7d57dbc67c8 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -1,7 +1,7 @@ /datum/action/changeling/absorb_dna name = "Absorb DNA" desc = "Absorb the DNA of our victim. Requires us to strangle them." - button_overlay_icon_state = "absorb_dna" + button_icon_state = "absorb_dna" power_type = CHANGELING_INNATE_POWER req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/apex_predator.dm b/code/modules/antagonists/changeling/powers/apex_predator.dm index cb1a6aecf7f..1db90bbae11 100644 --- a/code/modules/antagonists/changeling/powers/apex_predator.dm +++ b/code/modules/antagonists/changeling/powers/apex_predator.dm @@ -2,7 +2,7 @@ name = "Apex Predator" desc = "We evolve a keen intuition, allowing us to detect the anxieties of nearby lifeforms." helptext = "We will be able to detect the direction and room our prey is in, as well as if they have any injuries." - button_overlay_icon_state = "predator" + button_icon_state = "predator" dna_cost = 1 power_type = CHANGELING_PURCHASABLE_POWER category = /datum/changeling_power_category/utility diff --git a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm index 61a4c0fd0c7..b7e0a5efef0 100644 --- a/code/modules/antagonists/changeling/powers/augmented_eyesight.dm +++ b/code/modules/antagonists/changeling/powers/augmented_eyesight.dm @@ -2,7 +2,7 @@ name = "Augmented Eyesight" desc = "Creates more light sensing rods in our eyes, allowing our vision to penetrate most blocking objects. Protects our vision from flashes while inactive." helptext = "Grants us x-ray vision or flash protection. We will become a lot more vulnerable to flash-based devices while x-ray vision is active." - button_overlay_icon_state = "augmented_eyesight" + button_icon_state = "augmented_eyesight" dna_cost = 4 power_type = CHANGELING_PURCHASABLE_POWER category = /datum/changeling_power_category/utility diff --git a/code/modules/antagonists/changeling/powers/become_headslug.dm b/code/modules/antagonists/changeling/powers/become_headslug.dm index 208b29c6215..b92cb5c9127 100644 --- a/code/modules/antagonists/changeling/powers/become_headslug.dm +++ b/code/modules/antagonists/changeling/powers/become_headslug.dm @@ -2,7 +2,7 @@ name = "Last Resort" desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel that can plant our likeness in a new host. Costs 20 chemicals." helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us." - button_overlay_icon_state = "last_resort" + button_icon_state = "last_resort" chemical_cost = 20 dna_cost = 2 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/biodegrade.dm b/code/modules/antagonists/changeling/powers/biodegrade.dm index 67bfa926634..e4b9b67e9bd 100644 --- a/code/modules/antagonists/changeling/powers/biodegrade.dm +++ b/code/modules/antagonists/changeling/powers/biodegrade.dm @@ -2,7 +2,7 @@ name = "Biodegrade" desc = "Dissolves restraints or other objects preventing free movement if we are restrained. Prepares hand to vomit acid on other objects, doesn't work on living targets. Costs 30 chemicals." helptext = "This is obvious to nearby people, and can destroy standard restraints and closets, and break you out of grabs." - button_overlay_icon_state = "biodegrade" + button_icon_state = "biodegrade" chemical_cost = 30 //High cost to prevent spam dna_cost = 4 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/chameleon_skin.dm b/code/modules/antagonists/changeling/powers/chameleon_skin.dm index 22f99f870d7..18229432573 100644 --- a/code/modules/antagonists/changeling/powers/chameleon_skin.dm +++ b/code/modules/antagonists/changeling/powers/chameleon_skin.dm @@ -2,7 +2,7 @@ name = "Chameleon Skin" desc = "Our skin pigmentation rapidly changes to suit our current environment. Costs 25 chemicals." helptext = "Allows us to become invisible after a few seconds of standing still. While active, it silences our footsteps. Can be toggled on and off." - button_overlay_icon_state = "chameleon_skin" + button_icon_state = "chameleon_skin" dna_cost = 4 chemical_cost = 25 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/contort_body.dm b/code/modules/antagonists/changeling/powers/contort_body.dm index e50686ee1c0..fb6fa8252d7 100644 --- a/code/modules/antagonists/changeling/powers/contort_body.dm +++ b/code/modules/antagonists/changeling/powers/contort_body.dm @@ -1,7 +1,7 @@ /datum/action/changeling/contort_body name = "Contort Body" desc = "We contort our body, allowing us to fit in and under things we normally wouldn't be able to. Costs 25 chemicals." - button_overlay_icon_state = "contort_body" + button_icon_state = "contort_body" chemical_cost = 25 dna_cost = 4 power_type = CHANGELING_PURCHASABLE_POWER diff --git a/code/modules/antagonists/changeling/powers/digitalcamo.dm b/code/modules/antagonists/changeling/powers/digitalcamo.dm index f9f25dc0f93..4ce7480153a 100644 --- a/code/modules/antagonists/changeling/powers/digitalcamo.dm +++ b/code/modules/antagonists/changeling/powers/digitalcamo.dm @@ -2,7 +2,7 @@ name = "Digital Camouflage" desc = "By evolving the ability to distort our form and proportions, we defeat common algorithms used to detect lifeforms on cameras." helptext = "We cannot be tracked by camera while using this skill." - button_overlay_icon_state = "digital_camo" + button_icon_state = "digital_camo" dna_cost = 2 power_type = CHANGELING_PURCHASABLE_POWER category = /datum/changeling_power_category/utility diff --git a/code/modules/antagonists/changeling/powers/environmental_adaption.dm b/code/modules/antagonists/changeling/powers/environmental_adaption.dm index 7d7e4623abe..41986cc7f63 100644 --- a/code/modules/antagonists/changeling/powers/environmental_adaption.dm +++ b/code/modules/antagonists/changeling/powers/environmental_adaption.dm @@ -3,7 +3,7 @@ desc = "Our skin pigmentations rapidly change to suit the environment around us. Needs 10 chemicals in-storage to toggle. Slows down our chemical regeneration by 15%" helptext = "Allows us to darken and change the translucency of our pigmentation. \ The translucent effect works best in dark environments and garments. Can be toggled on and off." - button_overlay_icon_state = "enviro_adaptation" + button_icon_state = "enviro_adaptation" dna_cost = 2 chemical_cost = 10 power_type = CHANGELING_PURCHASABLE_POWER diff --git a/code/modules/antagonists/changeling/powers/epinephrine.dm b/code/modules/antagonists/changeling/powers/epinephrine.dm index 2e95dcce8e2..00e1f19e7b1 100644 --- a/code/modules/antagonists/changeling/powers/epinephrine.dm +++ b/code/modules/antagonists/changeling/powers/epinephrine.dm @@ -2,7 +2,7 @@ name = "Epinephrine Overdose" desc = "We evolve additional sacs of adrenaline throughout our body. Costs 30 chemicals." helptext = "Removes all stuns instantly and adds a short term reduction in further stuns. Can be used while unconscious. Continued use poisons the body." - button_overlay_icon_state = "adrenaline" + button_icon_state = "adrenaline" chemical_cost = 30 dna_cost = 4 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index be466f959ed..2ffddd180ad 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -1,7 +1,7 @@ /datum/action/changeling/fakedeath name = "Regenerative Stasis" desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals." - button_overlay_icon_state = "fake_death" + button_icon_state = "fake_death" chemical_cost = 15 power_type = CHANGELING_INNATE_POWER req_dna = 1 diff --git a/code/modules/antagonists/changeling/powers/fleshmend.dm b/code/modules/antagonists/changeling/powers/fleshmend.dm index 0b2f31e4f92..b0ee5255b5c 100644 --- a/code/modules/antagonists/changeling/powers/fleshmend.dm +++ b/code/modules/antagonists/changeling/powers/fleshmend.dm @@ -2,7 +2,7 @@ name = "Fleshmend" desc = "Our flesh rapidly regenerates, healing our burns, bruises, and shortness of breath. Costs 20 chemicals." helptext = "Does not regrow limbs. Partially recovers our blood. Functions while unconscious." - button_overlay_icon_state = "fleshmend" + button_icon_state = "fleshmend" chemical_cost = 20 dna_cost = 5 req_stat = UNCONSCIOUS diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm index 64abb25dc05..367c755db5f 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -5,7 +5,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) name = "Hivemind Access" desc = "Allows us to upload or absorb DNA in the airwaves. Does not count towards absorb objectives. Costs 10 chemicals." helptext = "Tunes our chemical receptors for hivemind communication, which passively grants us access to the Changeling Hivemind." - button_overlay_icon_state = "hive_absorb" + button_icon_state = "hive_absorb" chemical_cost = 10 power_type = CHANGELING_INNATE_POWER category = /datum/changeling_power_category/utility diff --git a/code/modules/antagonists/changeling/powers/humanform.dm b/code/modules/antagonists/changeling/powers/humanform.dm index 09cc9cf97e2..f85f7cb38c6 100644 --- a/code/modules/antagonists/changeling/powers/humanform.dm +++ b/code/modules/antagonists/changeling/powers/humanform.dm @@ -1,7 +1,7 @@ /datum/action/changeling/humanform name = "Human form" desc = "We change into a human. Costs 5 chemicals." - button_overlay_icon_state = "human_form" + button_icon_state = "human_form" chemical_cost = 5 req_dna = 1 diff --git a/code/modules/antagonists/changeling/powers/lesserform.dm b/code/modules/antagonists/changeling/powers/lesserform.dm index ac9a8ac6d26..bc47c6ea1d8 100644 --- a/code/modules/antagonists/changeling/powers/lesserform.dm +++ b/code/modules/antagonists/changeling/powers/lesserform.dm @@ -2,7 +2,7 @@ name = "Lesser form" desc = "We debase ourselves and become lesser. We become a monkey. Costs 5 chemicals." helptext = "The transformation greatly reduces our size, allowing us to slip out of cuffs and climb through vents." - button_overlay_icon_state = "lesser_form" + button_icon_state = "lesser_form" chemical_cost = 5 dna_cost = 2 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/mimic_voice.dm b/code/modules/antagonists/changeling/powers/mimic_voice.dm index bf478f45dc9..f793790655f 100644 --- a/code/modules/antagonists/changeling/powers/mimic_voice.dm +++ b/code/modules/antagonists/changeling/powers/mimic_voice.dm @@ -2,7 +2,7 @@ name = "Mimic Voice" desc = "We shape our vocal glands to sound like a desired voice." helptext = "Will turn your voice into the name that you enter." - button_overlay_icon_state = "mimic_voice" + button_icon_state = "mimic_voice" dna_cost = 2 req_human = TRUE power_type = CHANGELING_PURCHASABLE_POWER diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index e13c8667235..b857a311e1e 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -119,7 +119,7 @@ name = "Arm Blade" desc = "We reform one of our arms into a deadly blade. Costs 15 chemicals." helptext = "We may retract our armblade in the same manner as we form it. Cannot be used while in lesser form." - button_overlay_icon_state = "armblade" + button_icon_state = "armblade" chemical_cost = 15 dna_cost = 4 req_human = TRUE @@ -183,7 +183,7 @@ Grab will immobilize the target and wrap a tentacle around them. \ Harm will drag the target closer and hit them with the object in our other hand. \ Cannot be used while in our lesser form." - button_overlay_icon_state = "tentacle" + button_icon_state = "tentacle" chemical_cost = 10 dna_cost = 4 req_human = TRUE @@ -406,7 +406,7 @@ name = "Organic Shield" desc = "We reform one of our arms into a hard shield. Costs 20 chemicals." helptext = "Organic tissue cannot resist damage forever, with the shield breaking after it is hit 6 times. Can be used to parry attacks and projectiles. Cannot be used while in lesser form." - button_overlay_icon_state = "organic_shield" + button_icon_state = "organic_shield" chemical_cost = 20 dna_cost = 2 req_human = TRUE @@ -441,7 +441,7 @@ name = "Organic Space Suit" desc = "We grow an organic suit to protect ourselves from space exposure. Costs 20 chemicals." helptext = "We must constantly repair our form to make it space proof, reducing chemical production while we are protected. Cannot be used in lesser form." - button_overlay_icon_state = "organic_suit" + button_icon_state = "organic_suit" chemical_cost = 20 dna_cost = 4 req_human = TRUE @@ -488,7 +488,7 @@ name = "Chitinous Armor" desc = "We turn our skin into tough chitin to protect us from damage. Costs 25 chemicals." helptext = "Upkeep of the armor requires a low expenditure of chemicals. The armor is strong against brute force, but does not provide much protection from lasers. Cannot be used in lesser form." - button_overlay_icon_state = "chitinous_armor" + button_icon_state = "chitinous_armor" chemical_cost = 25 dna_cost = 4 req_human = TRUE @@ -586,7 +586,7 @@ name = "Bone Shard" desc = "We evolve the ability to break off shards of our bone and shape them into throwing weapons which embed into our foes. Costs 15 chemicals." helptext = "The shards of bone will dull upon hitting a target, rendering them unusable as weapons." - button_overlay_icon_state = "boneshard" + button_icon_state = "boneshard" chemical_cost = 15 dna_cost = 3 req_human = TRUE diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index 2750089c4b9..231af787959 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -2,7 +2,7 @@ name = "Anatomic Panacea" desc = "Expels impurifications from our form, curing diseases, removing parasites, sobering us, purging toxins and radiation, and resetting our genetic code completely. Costs 20 chemicals." helptext = "Can be used while unconscious." - button_overlay_icon_state = "panacea" + button_icon_state = "panacea" chemical_cost = 20 dna_cost = 2 req_stat = UNCONSCIOUS diff --git a/code/modules/antagonists/changeling/powers/revive.dm b/code/modules/antagonists/changeling/powers/revive.dm index 7a8b6113438..e034033bf97 100644 --- a/code/modules/antagonists/changeling/powers/revive.dm +++ b/code/modules/antagonists/changeling/powers/revive.dm @@ -1,7 +1,7 @@ /datum/action/changeling/revive name = "Regenerate" desc = "We regenerate, healing all damage from our form." - button_overlay_icon_state = "revive" + button_icon_state = "revive" req_dna = 1 req_stat = DEAD bypass_fake_death = TRUE diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm index 27b1303c534..d89a2f11793 100644 --- a/code/modules/antagonists/changeling/powers/shriek.dm +++ b/code/modules/antagonists/changeling/powers/shriek.dm @@ -2,7 +2,7 @@ name = "Resonant Shriek" desc = "Our lungs and vocal cords shift, allowing us to briefly emit a noise that deafens and confuses the weak minded. Costs 30 chemicals." helptext = "Emits a high frequency sound that confuses and deafens humans, blows out nearby lights and overloads cyborg sensors." - button_overlay_icon_state = "resonant_shriek" + button_icon_state = "resonant_shriek" chemical_cost = 30 dna_cost = 2 req_human = TRUE @@ -42,7 +42,7 @@ /datum/action/changeling/dissonant_shriek name = "Dissonant Shriek" desc = "We shift our vocal cords to release a high frequency sound that overloads nearby electronics. Costs 30 chemicals." - button_overlay_icon_state = "dissonant_shriek" + button_icon_state = "dissonant_shriek" chemical_cost = 30 dna_cost = 2 power_type = CHANGELING_PURCHASABLE_POWER diff --git a/code/modules/antagonists/changeling/powers/strained_muscles.dm b/code/modules/antagonists/changeling/powers/strained_muscles.dm index 7da6101062e..2fd30374bd1 100644 --- a/code/modules/antagonists/changeling/powers/strained_muscles.dm +++ b/code/modules/antagonists/changeling/powers/strained_muscles.dm @@ -5,7 +5,7 @@ name = "Strained Muscles" desc = "We evolve the ability to reduce the acid buildup in our muscles, allowing us to move much faster." helptext = "The strain will use up our chemicals faster over time, and is not sustainable. Can not be used in lesser form." - button_overlay_icon_state = "strained_muscles" + button_icon_state = "strained_muscles" dna_cost = 2 req_human = TRUE power_type = CHANGELING_PURCHASABLE_POWER diff --git a/code/modules/antagonists/changeling/powers/summon_spiders.dm b/code/modules/antagonists/changeling/powers/summon_spiders.dm index 72166420d84..d36f1fe9b5b 100644 --- a/code/modules/antagonists/changeling/powers/summon_spiders.dm +++ b/code/modules/antagonists/changeling/powers/summon_spiders.dm @@ -7,7 +7,7 @@ name = "Spread Infestation" desc = "Our form divides, creating an aggressive arachnid which will regard us as a friend. Costs 30 chemicals." helptext = "The spiders are thoughtless creatures, but will not attack their creators. Their orders can be changed via remote hivemind (Alt+Shift click)." - button_overlay_icon_state = "spread_infestation" + button_icon_state = "spread_infestation" chemical_cost = 30 dna_cost = 4 /// This var keeps track of the changeling's spider count diff --git a/code/modules/antagonists/changeling/powers/swap_form.dm b/code/modules/antagonists/changeling/powers/swap_form.dm index e69a8d6c37b..168e6b850a0 100644 --- a/code/modules/antagonists/changeling/powers/swap_form.dm +++ b/code/modules/antagonists/changeling/powers/swap_form.dm @@ -2,7 +2,7 @@ name = "Swap Forms" desc = "We force ourselves into the body of another form, pushing their consciousness into the form we left behind. Costs 40 chemicals." helptext = "We will bring all our abilities with us, but we will lose our old form DNA in exchange for the new one. The process will seem suspicious to any observers." - button_overlay_icon_state = "cling_mindswap" + button_icon_state = "cling_mindswap" chemical_cost = 40 dna_cost = 2 req_human = TRUE //Monkeys can't grab diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 26462d7dc39..7cadb2500c3 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -79,7 +79,7 @@ name = "Extract DNA Sting" desc = "We stealthily sting a target and extract their DNA. Costs 25 chemicals." helptext = "Will give you the DNA of your target, allowing you to transform into them." - button_overlay_icon_state = "sting_extract" + button_icon_state = "sting_extract" sting_icon = "sting_extract" chemical_cost = 25 power_type = CHANGELING_INNATE_POWER @@ -99,7 +99,7 @@ name = "Mute Sting" desc = "We silently sting a human, completely silencing them for a short time. Costs 20 chemicals." helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot." - button_overlay_icon_state = "sting_mute" + button_icon_state = "sting_mute" sting_icon = "sting_mute" chemical_cost = 20 dna_cost = 4 @@ -115,7 +115,7 @@ name = "Blind Sting" desc = "We temporarily blind our victim. Costs 25 chemicals." helptext = "This sting completely blinds a target for a short time, and leaves them with blurred vision for a long time." - button_overlay_icon_state = "sting_blind" + button_icon_state = "sting_blind" sting_icon = "sting_blind" chemical_cost = 25 dna_cost = 2 @@ -135,7 +135,7 @@ name = "Cryogenic Sting" desc = "We silently sting our victim with a cocktail of chemicals that freezes them from the inside. Costs 15 chemicals." helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing." - button_overlay_icon_state = "sting_cryo" + button_icon_state = "sting_cryo" sting_icon = "sting_cryo" chemical_cost = 15 dna_cost = 4 @@ -153,7 +153,7 @@ name = "Lethargic Sting" desc = "We silently sting our victim with a chemical that will gradually drain their stamina. Costs 50 chemicals." helptext = "Does not provide a warning to the victim, though they will quickly realize they have been poisoned." - button_overlay_icon_state = "sting_lethargic" + button_icon_state = "sting_lethargic" sting_icon = "sting_lethargic" chemical_cost = 50 dna_cost = 4 diff --git a/code/modules/antagonists/changeling/powers/transform.dm b/code/modules/antagonists/changeling/powers/transform.dm index beab27727fc..5add4ad638b 100644 --- a/code/modules/antagonists/changeling/powers/transform.dm +++ b/code/modules/antagonists/changeling/powers/transform.dm @@ -1,7 +1,7 @@ /datum/action/changeling/transform name = "Transform" desc = "We take on the appearance and voice of one we have absorbed. Costs 5 chemicals." - button_overlay_icon_state = "transform" + button_icon_state = "transform" chemical_cost = 5 power_type = CHANGELING_INNATE_POWER req_dna = 1 diff --git a/code/modules/antagonists/mind_flayer/powers/flayer_passives.dm b/code/modules/antagonists/mind_flayer/powers/flayer_passives.dm index 7d670740e41..3653d6ac673 100644 --- a/code/modules/antagonists/mind_flayer/powers/flayer_passives.dm +++ b/code/modules/antagonists/mind_flayer/powers/flayer_passives.dm @@ -268,7 +268,7 @@ return // TODO, add a refund proc? user_eyes.AddComponent(/datum/component/scope, item_action_type = /datum/action/item_action/organ_action/toggle, flags = SCOPE_CLICK_MIDDLE) for(var/datum/action/action in user_eyes.actions) - action.button_background_icon_state = "bg_flayer" + action.background_icon_state = "bg_flayer" action.Grant(owner) /datum/mindflayer_passive/telescopic_eyes/on_remove() @@ -341,7 +341,7 @@ if(!internal_jammer) internal_jammer = new /obj/item/jammer(owner) //Shove it in the flayer's chest for(var/datum/action/action in internal_jammer.actions) - action.button_background_icon_state = "bg_flayer" + action.background_icon_state = "bg_flayer" action.Grant(owner) internal_jammer.range = 15 + ((level - 1) * 5) //Base range of the jammer is 15, each level adds 5 tiles for a max of 25 if you want to be REALLY annoying diff --git a/code/modules/antagonists/vampire/vamp_datum.dm b/code/modules/antagonists/vampire/vamp_datum.dm index 4d4fd9f9f5a..17aef421c7f 100644 --- a/code/modules/antagonists/vampire/vamp_datum.dm +++ b/code/modules/antagonists/vampire/vamp_datum.dm @@ -301,7 +301,7 @@ RESTRICT_TYPE(/datum/antagonist/vampire) check_vampire_upgrade(TRUE) for(var/datum/spell/S in powers) if(S.action) - S.action.UpdateButtons() + S.action.build_all_button_icons() /** * Safely subtract vampire's bloodusable. Clamped between 0 and bloodtotal. diff --git a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm index 959edde1e36..ab290e1217a 100644 --- a/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm +++ b/code/modules/antagonists/vampire/vampire_powers/umbrae_powers.dm @@ -14,7 +14,7 @@ action.name = "[initial(name)] ([V.iscloaking ? "Deactivate" : "Activate"])" SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME) - UpdateButtons() + build_all_button_icons() /datum/spell/vampire/self/cloak/cast(list/targets, mob/user = usr) var/datum/antagonist/vampire/V = user.mind.has_antag_datum(/datum/antagonist/vampire) diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index f4d1d3f7137..a6661fff68e 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -2,7 +2,7 @@ /datum/action/chameleon_outfit name = "Select Chameleon Outfit" - button_overlay_icon_state = "chameleon_outfit" + button_icon_state = "chameleon_outfit" var/list/outfit_options //By default, this list is shared between all instances. It is not static because if it were, subtypes would not be able to have their own. If you ever want to edit it, copy it first. /datum/action/chameleon_outfit/New() @@ -92,7 +92,7 @@ qdel(O) ..() -/datum/action/item_action/chameleon_change/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force) +/datum/action/item_action/chameleon_change/update_button_name(atom/movable/screen/movable/action_button/button, force) . = ..() if(.) button.name = "Change [chameleon_name] Appearance" @@ -138,7 +138,7 @@ update_look(usr, chameleon_list[chameleon_name][params["new_appearance"]]) /datum/action/item_action/chameleon_change/proc/initialize_disguises() - UpdateButtons() + build_all_button_icons() chameleon_blacklist |= typecacheof(target.type) if(!isnull(chameleon_list[chameleon_name])) return @@ -179,7 +179,7 @@ var/obj/item/thing = target thing.update_slot_icon() SStgui.update_uis(src) - UpdateButtons() + build_all_button_icons() /datum/action/item_action/chameleon_change/proc/update_item(obj/item/picked_item) target.name = initial(picked_item.name) diff --git a/code/modules/events/blob/blob_mobs.dm b/code/modules/events/blob/blob_mobs.dm index 0b29a557d36..9ab14900917 100644 --- a/code/modules/events/blob/blob_mobs.dm +++ b/code/modules/events/blob/blob_mobs.dm @@ -206,8 +206,8 @@ /datum/action/innate/communicate_overmind_blob name = "Speak with the overmind" - button_overlay_icon = 'icons/mob/guardian.dmi' - button_overlay_icon_state = "communicate" + button_icon = 'icons/mob/guardian.dmi' + button_icon_state = "communicate" /datum/action/innate/communicate_overmind_blob/Activate() var/mob/living/simple_animal/hostile/blob/blobbernaut/user = owner diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 051821bbe57..9f6de17baac 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -301,8 +301,7 @@ // deck datum actions /datum/action/item_action/draw_card name = "Draw - Draw one card" - button_overlay_icon_state = "draw" - use_itemicon = FALSE + button_icon_state = "draw" /datum/action/item_action/draw_card/Trigger(left_click) if(istype(target, /obj/item/deck)) @@ -312,8 +311,7 @@ /datum/action/item_action/deal_card name = "Deal - deal one card to a person next to you" - button_overlay_icon_state = "deal_card" - use_itemicon = FALSE + button_icon_state = "deal_card" /datum/action/item_action/deal_card/Trigger(left_click) if(istype(target, /obj/item/deck)) @@ -323,8 +321,7 @@ /datum/action/item_action/deal_card_multi name = "Deal multiple card - Deal multiple card to a person next to you" - button_overlay_icon_state = "deal_card_multi" - use_itemicon = FALSE + button_icon_state = "deal_card_multi" /datum/action/item_action/deal_card_multi/Trigger(left_click) if(istype(target, /obj/item/deck)) @@ -334,8 +331,7 @@ /datum/action/item_action/shuffle name = "Shuffle - shuffle the deck" - button_overlay_icon_state = "shuffle" - use_itemicon = FALSE + button_icon_state = "shuffle" /datum/action/item_action/shuffle/Trigger(left_click) if(istype(target, /obj/item/deck)) @@ -890,8 +886,7 @@ /datum/action/item_action/remove_card name = "Remove a card - Remove a single card from the hand." - button_overlay_icon_state = "remove_card" - use_itemicon = FALSE + button_icon_state = "remove_card" /datum/action/item_action/remove_card/IsAvailable() var/obj/item/cardhand/C = target @@ -909,8 +904,7 @@ /datum/action/item_action/discard name = "Discard - Place one or more cards from your hand in front of you." - button_overlay_icon_state = "discard" - use_itemicon = FALSE + button_icon_state = "discard" /datum/action/item_action/discard/Trigger(left_click) if(istype(target, /obj/item/cardhand)) diff --git a/code/modules/martial_arts/krav_maga.dm b/code/modules/martial_arts/krav_maga.dm index b7412e498c9..b796c1ce4c9 100644 --- a/code/modules/martial_arts/krav_maga.dm +++ b/code/modules/martial_arts/krav_maga.dm @@ -13,7 +13,7 @@ /datum/action/neutral_stance name = "Neutral Stance - You relax, cancelling your last Krav Maga stance attack." - button_overlay_icon_state = "neutralstance" + button_icon_state = "neutralstance" /datum/action/neutral_stance/Trigger(left_click) var/mob/living/carbon/human/H = owner @@ -27,7 +27,7 @@ /datum/action/neck_chop name = "Neck Chop - Injures the neck, stopping the victim from speaking for a while." - button_overlay_icon_state = "neckchop" + button_icon_state = "neckchop" /datum/action/neck_chop/Trigger(left_click) var/mob/living/carbon/human/H = owner //This is a janky solution, but I want to refactor krav anyway and un-jank this (written in may 2023) @@ -45,7 +45,7 @@ H.mind.martial_art.in_stance = TRUE /datum/action/leg_sweep name = "Leg Sweep - Trips the victim, rendering them prone and unable to move for a short time." - button_overlay_icon_state = "legsweep" + button_icon_state = "legsweep" /datum/action/leg_sweep/Trigger(left_click) var/mob/living/carbon/human/H = owner @@ -70,7 +70,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." - button_overlay_icon_state = "lungpunch" + button_icon_state = "lungpunch" /datum/action/lung_punch/Trigger(left_click) var/mob/living/carbon/human/H = owner diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 26d68428095..b2c21c82d6d 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -244,7 +244,7 @@ /datum/action/defensive_stance name = "Defensive Stance - Ready yourself to be attacked, allowing you to parry incoming melee hits." - button_overlay_icon_state = "block" + button_icon_state = "block" /datum/action/defensive_stance/Trigger(left_click) var/mob/living/carbon/human/H = owner diff --git a/code/modules/mob/dead/observer/observer_admin_actions.dm b/code/modules/mob/dead/observer/observer_admin_actions.dm index 9dcaa894b39..751e0a5dfa5 100644 --- a/code/modules/mob/dead/observer/observer_admin_actions.dm +++ b/code/modules/mob/dead/observer/observer_admin_actions.dm @@ -13,7 +13,7 @@ given_action.Grant(src) /datum/action/innate/admin - button_overlay_icon = 'icons/mob/actions/actions_admin.dmi' + button_icon = 'icons/mob/actions/actions_admin.dmi' var/rights_required = R_ADMIN /datum/action/innate/admin/Trigger() @@ -29,11 +29,12 @@ /datum/action/innate/admin/ticket name = "Adminhelps" desc = "There are 0 open tickets." - button_overlay_icon_state = "adminhelp" + button_icon_state = "adminhelp" + var/mutable_appearance/button_text var/ticket_amt = 0 /datum/action/innate/admin/ticket/New(Target) - button_overlay_icon_state = "nohelp" + button_icon_state = "nohelp" . = ..() register_ticket_signals() @@ -48,24 +49,26 @@ ticket_amt = _ticket_amt desc = "There are [ticket_amt] open tickets." if(ticket_amt > 0) - button_overlay_icon_state = initial(button_overlay_icon_state) + button_icon_state = initial(button_icon_state) else - button_overlay_icon_state = "nohelp" - UpdateButtons() + button_icon_state = "nohelp" + build_all_button_icons(force = TRUE) -/datum/action/innate/admin/ticket/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force) +/datum/action/innate/admin/ticket/apply_button_overlay(atom/movable/screen/movable/action_button/button, force) . = ..() - if(ticket_amt <= 0) - return - var/image/maptext_holder = image('icons/effects/effects.dmi', icon_state = "nothing") - maptext_holder.plane = FLOAT_PLANE + 1.1 - maptext_holder.maptext = "[ticket_amt]" - maptext_holder.maptext_x = 2 - button.add_overlay(maptext_holder) + // TODO: We need a generic way to handle button text for actions bc this is atrocious + // Yes cutting and adding the overlay each time is required + button.cut_overlay(button_text) + button_text = mutable_appearance('icons/effects/effects.dmi', icon_state = "nothing") + button_text.appearance_flags = RESET_COLOR | RESET_ALPHA + button_text.plane = FLOAT_PLANE + 1 + button_text.maptext_x = 2 + button_text.maptext = ticket_amt > 0 ? "[ticket_amt]" : "" + button.add_overlay(button_text) /datum/action/innate/admin/ticket/mentor name = "Mentorhelps" - button_overlay_icon_state = "mentorhelp" + button_icon_state = "mentorhelp" rights_required = R_MENTOR|R_ADMIN /datum/action/innate/admin/ticket/mentor/register_ticket_signals() diff --git a/code/modules/mob/living/basic/minebots/minebot_abilities.dm b/code/modules/mob/living/basic/minebots/minebot_abilities.dm index 65ff261a172..bc4920bf238 100644 --- a/code/modules/mob/living/basic/minebots/minebot_abilities.dm +++ b/code/modules/mob/living/basic/minebots/minebot_abilities.dm @@ -1,10 +1,10 @@ /datum/action/innate/minedrone check_flags = AB_CHECK_CONSCIOUS - button_background_icon_state = "bg_default" + background_icon_state = "bg_default" /datum/action/innate/minedrone/toggle_light name = "Toggle Light" - button_overlay_icon_state = "mech_lights_off" + button_icon_state = "mech_lights_off" /datum/action/innate/minedrone/toggle_light/Activate() var/mob/living/basic/mining_drone/user = owner @@ -18,7 +18,7 @@ /datum/action/innate/minedrone/toggle_meson_vision name = "Toggle Meson Vision" - button_overlay_icon_state = "meson" + button_icon_state = "meson" /datum/action/innate/minedrone/toggle_meson_vision/Activate() var/mob/living/user = owner @@ -41,7 +41,7 @@ /datum/action/innate/minedrone/dump_ore name = "Dump Ore" - button_overlay_icon_state = "mech_eject" + button_icon_state = "mech_eject" /datum/action/innate/minedrone/dump_ore/Activate() var/mob/living/basic/mining_drone/user = owner diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 08e4b612726..7467d34c97c 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -79,7 +79,7 @@ alien = 0 if(radio_action) - radio_action.UpdateButtons() + radio_action.build_all_button_icons() SSblackbox.record_feedback("amount", "mmis_filled", 1) else to_chat(user, "You can't drop [B]!") @@ -178,7 +178,7 @@ /obj/item/mmi/proc/become_occupied(new_icon) icon_state = new_icon if(radio) - radio_action.UpdateButtons() + radio_action.build_all_button_icons() /obj/item/mmi/examine(mob/user) . = ..() @@ -212,8 +212,8 @@ return ..() /datum/action/generic/configure_mmi_radio/apply_button_overlay(atom/movable/screen/movable/action_button/current_button) - button_overlay_icon = mmi.icon - button_overlay_icon_state = mmi.icon_state + button_icon = mmi.icon + button_icon_state = mmi.icon_state ..() /obj/item/mmi/emp_act(severity) diff --git a/code/modules/mob/living/carbon/alien/alien_base.dm b/code/modules/mob/living/carbon/alien/alien_base.dm index 8db7eb9c5c6..f9322dd50de 100644 --- a/code/modules/mob/living/carbon/alien/alien_base.dm +++ b/code/modules/mob/living/carbon/alien/alien_base.dm @@ -213,7 +213,7 @@ Des: Removes all infected images from the alien. and carry the owner just to make sure*/ /mob/living/carbon/proc/update_plasma_display(mob/owner) for(var/datum/action/spell_action/action in actions) - action.UpdateButtons() + action.build_all_button_icons() if(!hud_used || !isalien(owner)) //clientless aliens or non aliens return hud_used.alien_plasma_display.maptext = "
[get_plasma()]
" diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index 3eb64444c5e..bf203601824 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -155,7 +155,7 @@ name = "Ignite" desc = "Set yourself aflame, bringing yourself closer to exploding!" check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon_state = "sacredflame" + button_icon_state = "sacredflame" /datum/action/innate/golem_ignite/Activate() if(ishuman(owner)) @@ -504,6 +504,7 @@ /datum/action/innate/unstable_teleport name = "Unstable Teleport" check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "blink" var/activated = FALSE // To prevent spamming var/cooldown = 150 var/last_teleport = 0 @@ -545,9 +546,9 @@ H.unbuckle(force = TRUE) do_teleport(H, picked) last_teleport = world.time - UpdateButtons() //action icon looks unavailable + build_all_button_icons() //action icon looks unavailable sleep(cooldown + 5) - UpdateButtons() //action icon looks available again + build_all_button_icons() //action icon looks available again /datum/unarmed_attack/golem/bluespace attack_verb = "bluespace punch" diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 23c5c6bd92f..8506d7ee1f4 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -138,7 +138,7 @@ /datum/action/innate/change_monitor name = "Change Monitor" check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon_state = "scan_mode" + button_icon_state = "scan_mode" /datum/action/innate/change_monitor/Activate() var/mob/living/carbon/human/H = owner diff --git a/code/modules/mob/living/carbon/human/species/moth.dm b/code/modules/mob/living/carbon/human/species/moth.dm index be74a62e4df..8797ec9f547 100644 --- a/code/modules/mob/living/carbon/human/species/moth.dm +++ b/code/modules/mob/living/carbon/human/species/moth.dm @@ -157,8 +157,8 @@ name = "Cocoon" desc = "Restore your wings and antennae, and heal some damage. If your cocoon is broken externally you will take heavy damage!" check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS|AB_CHECK_TURF - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "cocoon1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "cocoon1" /datum/action/innate/cocoon/Activate() var/mob/living/carbon/human/moth/H = owner diff --git a/code/modules/mob/living/carbon/human/species/slimepeople.dm b/code/modules/mob/living/carbon/human/species/slimepeople.dm index 32c1a498b91..c0a1257d33b 100644 --- a/code/modules/mob/living/carbon/human/species/slimepeople.dm +++ b/code/modules/mob/living/carbon/human/species/slimepeople.dm @@ -113,8 +113,8 @@ /datum/action/innate/slimecolor name = "Toggle Recolor" check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "greenglow" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "greenglow" /datum/action/innate/slimecolor/Activate() var/mob/living/carbon/human/H = owner @@ -129,8 +129,8 @@ /datum/action/innate/regrow name = "Regrow limbs" check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "greenglow" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "greenglow" /datum/action/innate/regrow/Activate() var/mob/living/carbon/human/H = owner diff --git a/code/modules/mob/living/carbon/human/species/unathi.dm b/code/modules/mob/living/carbon/human/species/unathi.dm index eddd9c9a6c2..7a9620aaaad 100644 --- a/code/modules/mob/living/carbon/human/species/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/unathi.dm @@ -79,8 +79,8 @@ /datum/action/innate/unathi_ignite name = "Ignite" desc = "A fire forms in your mouth, fierce enough to... light a cigarette. Requires you to drink welding fuel beforehand." - button_overlay_icon = 'icons/obj/cigarettes.dmi' - button_overlay_icon_state = "match_unathi" + button_icon = 'icons/obj/cigarettes.dmi' + button_icon_state = "match_unathi" var/cooldown = 0 var/cooldown_duration = 20 SECONDS var/welding_fuel_used = 3 //one sip, with less strict timing diff --git a/code/modules/mob/living/silicon/robot/robot_module_actions.dm b/code/modules/mob/living/silicon/robot/robot_module_actions.dm index 84b34b0d345..f71b6db9928 100644 --- a/code/modules/mob/living/silicon/robot/robot_module_actions.dm +++ b/code/modules/mob/living/silicon/robot/robot_module_actions.dm @@ -1,7 +1,7 @@ /datum/action/innate/robot_sight var/sight_mode = null - button_overlay_icon = 'icons/obj/decals.dmi' - button_overlay_icon_state = "securearea" + button_icon = 'icons/obj/decals.dmi' + button_icon_state = "securearea" /datum/action/innate/robot_sight/Activate() var/mob/living/silicon/robot/R = owner @@ -22,19 +22,19 @@ /datum/action/innate/robot_sight/thermal name = "Thermal Vision" sight_mode = BORGTHERM - button_overlay_icon = 'icons/obj/clothing/glasses.dmi' - button_overlay_icon_state = "thermal" + button_icon = 'icons/obj/clothing/glasses.dmi' + button_icon_state = "thermal" // ayylmao /datum/action/innate/robot_sight/thermal/alien - button_overlay_icon = 'icons/mob/alien.dmi' - button_overlay_icon_state = "borg-extra-vision" + button_icon = 'icons/mob/alien.dmi' + button_icon_state = "borg-extra-vision" /datum/action/innate/robot_sight/meson name = "Meson Vision" sight_mode = BORGMESON - button_overlay_icon = 'icons/obj/clothing/glasses.dmi' - button_overlay_icon_state = "meson" + button_icon = 'icons/obj/clothing/glasses.dmi' + button_icon_state = "meson" #define MODE_NONE "" #define MODE_MESON "meson" @@ -46,8 +46,8 @@ /datum/action/innate/robot_sight/engineering_scanner name = "Engineering Scanner Vision" sight_mode = BORGMESON - button_overlay_icon = 'icons/obj/clothing/glasses.dmi' - button_overlay_icon_state = "trayson-meson" + button_icon = 'icons/obj/clothing/glasses.dmi' + button_icon_state = "trayson-meson" var/list/mode_list = list(MODE_NONE = MODE_MESON, MODE_MESON = MODE_TRAY, MODE_TRAY = MODE_RAD, MODE_RAD = MODE_PRESSURE, MODE_PRESSURE = MODE_NONE) var/mode = MODE_NONE @@ -55,7 +55,7 @@ var/mob/living/silicon/robot/R = owner mode = mode_list[mode] to_chat(owner, "You turn your enhanced optics [mode ? "to [mode] mode." : "off."]") - button_overlay_icon_state = "trayson-[mode]" + button_icon_state = "trayson-[mode]" if(mode == MODE_MESON) R.sight_mode |= sight_mode @@ -95,8 +95,8 @@ /datum/action/innate/robot_magpulse name = "Magnetic pulse" - button_overlay_icon = 'icons/obj/clothing/shoes.dmi' - button_overlay_icon_state = "magboots0" + button_icon = 'icons/obj/clothing/shoes.dmi' + button_icon_state = "magboots0" var/slowdown_active = 2 // Same as magboots /datum/action/innate/robot_magpulse/Activate() @@ -104,7 +104,7 @@ to_chat(owner, "You turn your magboots on.") var/mob/living/silicon/robot/robot = owner robot.speed += slowdown_active - button_overlay_icon_state = "magboots1" + button_icon_state = "magboots1" active = TRUE /datum/action/innate/robot_magpulse/Deactivate() @@ -112,12 +112,12 @@ to_chat(owner, "You turn your magboots off.") var/mob/living/silicon/robot/robot = owner robot.speed -= slowdown_active - button_overlay_icon_state = initial(button_overlay_icon_state) + button_icon_state = initial(button_icon_state) active = FALSE /datum/action/innate/robot_override_lock name = "Override lockdown" - button_overlay_icon_state = "unlock_self" + button_icon_state = "unlock_self" /datum/action/innate/robot_override_lock/Activate() to_chat(owner, "HARDWARE_OVERRIDE_SYNDICATE: Lockdown lifted. Connection to NT systems severed.") diff --git a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm index c9f9d094e16..083c78a6b2b 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm @@ -57,8 +57,8 @@ /datum/action/innate/diona/merge name = "Merge with gestalt" - button_overlay_icon = 'icons/mob/human_races/r_diona.dmi' - button_overlay_icon_state = "preview" + button_icon = 'icons/mob/human_races/r_diona.dmi' + button_icon_state = "preview" /datum/action/innate/diona/merge/Activate() var/mob/living/simple_animal/diona/user = owner @@ -66,8 +66,8 @@ /datum/action/innate/diona/evolve name = "Evolve" - button_overlay_icon = 'icons/obj/cloning.dmi' - button_overlay_icon_state = "pod_cloning" + button_icon = 'icons/obj/cloning.dmi' + button_icon_state = "pod_cloning" /datum/action/innate/diona/evolve/Activate() var/mob/living/simple_animal/diona/user = owner @@ -75,8 +75,8 @@ /datum/action/innate/diona/steal_blood name = "Steal blood" - button_overlay_icon = 'icons/goonstation/objects/iv.dmi' - button_overlay_icon_state = "bloodbag" + button_icon = 'icons/goonstation/objects/iv.dmi' + button_icon_state = "bloodbag" /datum/action/innate/diona/steal_blood/Activate() var/mob/living/simple_animal/diona/user = owner diff --git a/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm b/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm index 8d5aeeadcfc..376ec0aabb0 100644 --- a/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm +++ b/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm @@ -132,8 +132,8 @@ /datum/action/innate/nian_caterpillar_emerge name = "Evolve" desc = "Weave a cocoon around yourself to evolve into a greater form. The worme." - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "cocoon1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "cocoon1" /datum/action/innate/nian_caterpillar_emerge/proc/emerge(obj/structure/moth_cocoon/C) for(var/mob/living/carbon/human/H in C) diff --git a/code/modules/mob/living/simple_animal/hide_action.dm b/code/modules/mob/living/simple_animal/hide_action.dm index 0f9d6768323..b2de59d53fb 100644 --- a/code/modules/mob/living/simple_animal/hide_action.dm +++ b/code/modules/mob/living/simple_animal/hide_action.dm @@ -4,7 +4,7 @@ var/layer_to_change_from = MOB_LAYER var/layer_to_change_to = TURF_LAYER + 0.2 check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon_state = "mouse_gray_sleep" + button_icon_state = "mouse_gray_sleep" /datum/action/innate/hide/Activate() var/mob/living/simple_animal/simplemob = owner @@ -23,9 +23,9 @@ /datum/action/innate/hide/alien_larva_hide desc = "Allows to hide beneath tables or certain items. Toggled on or off." - button_background_icon_state = "bg_alien" - button_overlay_icon_state = "alien_hide" + background_icon_state = "bg_alien" + button_icon_state = "alien_hide" layer_to_change_to = ABOVE_NORMAL_TURF_LAYER /datum/action/innate/hide/drone_hide - button_overlay_icon_state = "repairbot" + button_icon_state = "repairbot" 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 f70a8397fb3..2c1d98f0be6 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -163,8 +163,8 @@ /datum/action/innate/web_giant_spider name = "Lay Web" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "stickyweb1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "stickyweb1" /datum/action/innate/web_giant_spider/Activate() var/mob/living/simple_animal/hostile/poison/giant_spider/user = owner @@ -172,8 +172,8 @@ /datum/action/innate/wrap_giant_spider name = "Wrap" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "cocoon_large1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "cocoon_large1" /datum/action/innate/wrap_giant_spider/Activate() var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = owner @@ -181,8 +181,8 @@ /datum/action/innate/lay_eggs_giant_spider name = "Lay Eggs" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "eggs" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "eggs" /datum/action/innate/lay_eggs_giant_spider/Activate() var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/user = owner diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm index 8545e2e13ca..9a514ce668b 100644 --- a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm +++ b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm @@ -56,8 +56,8 @@ /datum/action/innate/gorilla_toggle name = "Toggle Stand" desc = "Toggles between crawling and standing up." - button_overlay_icon = 'icons/mob/actions/actions_animal.dmi' - button_overlay_icon_state = "gorilla_toggle" + button_icon = 'icons/mob/actions/actions_animal.dmi' + button_icon_state = "gorilla_toggle" check_flags = AB_CHECK_CONSCIOUS /datum/action/innate/gorilla_toggle/Activate() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index d4d61b686b1..d7d96239e68 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -73,22 +73,22 @@ Difficulty: Medium /datum/action/innate/megafauna_attack/dash name = "Dash To Target" - button_overlay_icon = 'icons/mob/actions/actions.dmi' - button_overlay_icon_state = "sniper_zoom" + button_icon = 'icons/mob/actions/actions.dmi' + button_icon_state = "sniper_zoom" chosen_message = "You are now dashing to your target." chosen_attack_num = 1 /datum/action/innate/megafauna_attack/kinetic_accelerator name = "Fire Kinetic Accelerator" - button_overlay_icon = 'icons/obj/guns/energy.dmi' - button_overlay_icon_state = "kineticgun" + button_icon = 'icons/obj/guns/energy.dmi' + button_icon_state = "kineticgun" chosen_message = "You are now shooting your kinetic accelerator." chosen_attack_num = 2 /datum/action/innate/megafauna_attack/transform_weapon name = "Transform Weapon" - button_overlay_icon = 'icons/obj/lavaland/artefacts.dmi' - button_overlay_icon_state = "cleaving_saw" + button_icon = 'icons/obj/lavaland/artefacts.dmi' + button_icon_state = "cleaving_saw" chosen_message = "You are now transforming your weapon." chosen_attack_num = 3 diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index e61f4b84459..ab6d1aad75e 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -97,29 +97,29 @@ Difficulty: Hard /datum/action/innate/megafauna_attack/triple_charge name = "Triple Charge" - button_overlay_icon = 'icons/mob/actions/actions.dmi' - button_overlay_icon_state = "sniper_zoom" + button_icon = 'icons/mob/actions/actions.dmi' + button_icon_state = "sniper_zoom" chosen_message = "You are now triple charging at the target you click on." chosen_attack_num = 1 /datum/action/innate/megafauna_attack/hallucination_charge name = "Hallucination Charge" - button_overlay_icon = 'icons/effects/bubblegum.dmi' - button_overlay_icon_state = "smack ya one" + button_icon = 'icons/effects/bubblegum.dmi' + button_icon_state = "smack ya one" chosen_message = "You are now charging with hallucinations at the target you click on." chosen_attack_num = 2 /datum/action/innate/megafauna_attack/hallucination_surround name = "Surround Target" - button_overlay_icon = 'icons/turf/walls/wall.dmi' - button_overlay_icon_state = "wall-0" + button_icon = 'icons/turf/walls/wall.dmi' + button_icon_state = "wall-0" chosen_message = "You are now surrounding the target you click on with hallucinations." chosen_attack_num = 3 /datum/action/innate/megafauna_attack/blood_warp name = "Blood Warp" - button_overlay_icon = 'icons/effects/blood.dmi' - button_overlay_icon_state = "floor1" + button_icon = 'icons/effects/blood.dmi' + button_icon_state = "floor1" chosen_message = "You are now warping to blood around your clicked position." chosen_attack_num = 4 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 478b637de9d..dbc0874c2a3 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -80,29 +80,29 @@ Difficulty: Very Hard /datum/action/innate/megafauna_attack/spiral_attack name = "Spiral Shots" - button_overlay_icon = 'icons/mob/actions/actions.dmi' - button_overlay_icon_state = "sniper_zoom" + button_icon = 'icons/mob/actions/actions.dmi' + button_icon_state = "sniper_zoom" chosen_message = "You are now firing in a spiral." chosen_attack_num = 1 /datum/action/innate/megafauna_attack/aoe_attack name = "All Directions" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "at_shield2" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "at_shield2" chosen_message = "You are now firing in all directions." chosen_attack_num = 2 /datum/action/innate/megafauna_attack/shotgun name = "Shotgun Fire" - button_overlay_icon = 'icons/obj/guns/projectile.dmi' - button_overlay_icon_state = "shotgun" + button_icon = 'icons/obj/guns/projectile.dmi' + button_icon_state = "shotgun" chosen_message = "You are now firing shotgun shots where you aim." chosen_attack_num = 3 /datum/action/innate/megafauna_attack/alternating_cardinals name = "Alternating Shots" - button_overlay_icon = 'icons/obj/guns/projectile.dmi' - button_overlay_icon_state = "pistol" + button_icon = 'icons/obj/guns/projectile.dmi' + button_icon_state = "pistol" chosen_message = "You are now firing in alternating cardinal directions." chosen_attack_num = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index cbf347760d6..c108cc54504 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -73,29 +73,29 @@ Difficulty: Medium /datum/action/innate/megafauna_attack/fire_cone name = "Fire Cone" - button_overlay_icon = 'icons/obj/wizard.dmi' - button_overlay_icon_state = "fireball" + button_icon = 'icons/obj/wizard.dmi' + button_icon_state = "fireball" chosen_message = "You are now shooting fire at your target." chosen_attack_num = 1 /datum/action/innate/megafauna_attack/fire_cone_meteors name = "Fire Cone With Meteors" - button_overlay_icon = 'icons/mob/actions/actions.dmi' - button_overlay_icon_state = "sniper_zoom" + button_icon = 'icons/mob/actions/actions.dmi' + button_icon_state = "sniper_zoom" chosen_message = "You are now shooting fire at your target and raining fire around you." chosen_attack_num = 2 /datum/action/innate/megafauna_attack/mass_fire name = "Mass Fire Attack" - button_overlay_icon = 'icons/effects/fire.dmi' - button_overlay_icon_state = "1" + button_icon = 'icons/effects/fire.dmi' + button_icon_state = "1" chosen_message = "You are now shooting mass fire at your target." chosen_attack_num = 3 /datum/action/innate/megafauna_attack/lava_swoop name = "Lava Swoop" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "lavastaff_warn" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "lavastaff_warn" chosen_message = "You are now swooping and raining lava at your target." chosen_attack_num = 4 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 7689123f784..83f0c298e0b 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -92,29 +92,29 @@ Difficulty: Hard /datum/action/innate/megafauna_attack/blink name = "Blink To Target" - button_overlay_icon = 'icons/mob/actions/actions.dmi' - button_overlay_icon_state = "sniper_zoom" + button_icon = 'icons/mob/actions/actions.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" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "hierophant_squares_indefinite" + 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" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "hierophant_blast_indefinite" + 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" - button_overlay_icon = 'icons/obj/lavaland/artefacts.dmi' - button_overlay_icon_state = "hierophant_club_ready_beacon" + 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 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 a9fe322e3ed..eae50b6984e 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -216,8 +216,8 @@ /datum/action/innate/megafauna_attack name = "Megafauna Attack" - button_overlay_icon = 'icons/mob/actions/actions_animal.dmi' - button_overlay_icon_state = "" + button_icon = 'icons/mob/actions/actions_animal.dmi' + button_icon_state = "" var/mob/living/simple_animal/hostile/megafauna/M var/chosen_message var/chosen_attack_num = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm index d1f8f10f4a4..e902959a88e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/elite.dm @@ -102,15 +102,15 @@ While using this makes the system rely on OnFire, it still gives options for tim /datum/action/innate/elite_attack name = "Elite Attack" - button_overlay_icon = 'icons/mob/actions/actions_elites.dmi' - button_overlay_icon_state = "" - button_background_icon_state = "bg_default" + button_icon = 'icons/mob/actions/actions_elites.dmi' + button_icon_state = "" + background_icon_state = "bg_default" ///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 @@ -124,11 +124,11 @@ While using this makes the system rely on OnFire, it still gives options for tim STOP_PROCESSING(SSfastprocess, src) qdel(src) return - UpdateButtons() + build_all_button_icons() -/datum/action/innate/elite_attack/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE) +/datum/action/innate/elite_attack/build_button_icon(atom/movable/screen/movable/action_button/button, update_flags, force) . = ..() - if(status_only) + if(update_flags & UPDATE_BUTTON_STATUS) return var/mob/living/simple_animal/hostile/asteroid/elite/elite_owner = owner var/timeleft = max(elite_owner.ranged_cooldown - world.time, 0) diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/goliath_broodmother.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/goliath_broodmother.dm index 8938920abc4..20b30461a60 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/goliath_broodmother.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/goliath_broodmother.dm @@ -52,25 +52,25 @@ /datum/action/innate/elite_attack/tentacle_patch name = "Tentacle Patch" - button_overlay_icon_state = "tentacle_patch" + button_icon_state = "tentacle_patch" chosen_message = "You are now attacking with a patch of tentacles." chosen_attack_num = TENTACLE_PATCH /datum/action/innate/elite_attack/spawn_children name = "Spawn Children" - button_overlay_icon_state = "spawn_children" + button_icon_state = "spawn_children" chosen_message = "You will spawn two children at your location to assist you in combat. You can have up to 8." chosen_attack_num = SPAWN_CHILDREN /datum/action/innate/elite_attack/rage name = "Rage" - button_overlay_icon_state = "rage" + button_icon_state = "rage" chosen_message = "You will temporarily increase your movement speed." chosen_attack_num = RAGE /datum/action/innate/elite_attack/call_children name = "Call Children" - button_overlay_icon_state = "call_children" + button_icon_state = "call_children" chosen_message = "You will summon your children to your location." chosen_attack_num = CALL_CHILDREN diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm index 660a99a05d4..2d09242c622 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm @@ -74,25 +74,25 @@ /datum/action/innate/elite_attack/herald_trishot name = "Triple Shot" - button_overlay_icon_state = "herald_trishot" + button_icon_state = "herald_trishot" chosen_message = "You are now firing three shots in your chosen direction." chosen_attack_num = HERALD_TRISHOT /datum/action/innate/elite_attack/herald_directionalshot name = "Circular Shot" - button_overlay_icon_state = "herald_directionalshot" + button_icon_state = "herald_directionalshot" chosen_message = "You are firing projectiles in all directions." chosen_attack_num = HERALD_DIRECTIONALSHOT /datum/action/innate/elite_attack/herald_teleshot name = "Teleport Shot" - button_overlay_icon_state = "herald_teleshot" + button_icon_state = "herald_teleshot" chosen_message = "You will now fire a shot which teleports you where it lands." chosen_attack_num = HERALD_TELESHOT /datum/action/innate/elite_attack/herald_mirror name = "Summon Mirror" - button_overlay_icon_state = "herald_mirror" + button_icon_state = "herald_mirror" chosen_message = "You will spawn a mirror which duplicates your attacks." chosen_attack_num = HERALD_MIRROR diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/legionnaire.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/legionnaire.dm index 9b0b7c52ca0..a3d5ab85394 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/legionnaire.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/legionnaire.dm @@ -55,25 +55,25 @@ /datum/action/innate/elite_attack/legionnaire_charge name = "Legionnaire Charge" - button_overlay_icon_state = "legionnaire_charge" + button_icon_state = "legionnaire_charge" chosen_message = "You will attempt to grab your opponent and throw them." chosen_attack_num = LEGIONNAIRE_CHARGE /datum/action/innate/elite_attack/head_detach name = "Release Head" - button_overlay_icon_state = "head_detach" + button_icon_state = "head_detach" chosen_message = "You will now detach your head or kill it if it is already released." chosen_attack_num = HEAD_DETACH /datum/action/innate/elite_attack/bonfire_teleport name = "Bonfire Teleport" - button_overlay_icon_state = "bonfire_teleport" + button_icon_state = "bonfire_teleport" chosen_message = "You will leave a bonfire. Second use will let you swap positions with it indefintiely. Using this move on the same tile as your active bonfire removes it." chosen_attack_num = BONFIRE_TELEPORT /datum/action/innate/elite_attack/spew_smoke name = "Spew Smoke" - button_overlay_icon_state = "spew_smoke" + button_icon_state = "spew_smoke" chosen_message = "Your head will spew smoke in an area, wherever it may be." chosen_attack_num = SPEW_SMOKE diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/pandora.dm index 5ae6ed4fd32..bef759cf474 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/pandora.dm @@ -56,25 +56,25 @@ /datum/action/innate/elite_attack/chaser_burst name = "Chaser Burst" - button_overlay_icon_state = "singular_shot" + button_icon_state = "singular_shot" chosen_message = "You fire a chaser after all mobs in view." chosen_attack_num = CHASER_BURST /datum/action/innate/elite_attack/magic_box name = "Magic Box" - button_overlay_icon_state = "magic_box" + button_icon_state = "magic_box" chosen_message = "You are now attacking with a box of magic squares." chosen_attack_num = MAGIC_BOX /datum/action/innate/elite_attack/pandora_teleport name = "Line Teleport" - button_overlay_icon_state = "pandora_teleport" + button_icon_state = "pandora_teleport" chosen_message = "You will now teleport to your target." chosen_attack_num = PANDORA_TELEPORT /datum/action/innate/elite_attack/aoe_squares name = "AOE Blast" - button_overlay_icon_state = "aoe_squares" + button_icon_state = "aoe_squares" chosen_message = "Your attacks will spawn an AOE blast at your target location." chosen_attack_num = AOE_SQUARES diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm index d5e86b80bfa..49032fa3112 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/actions.dm @@ -2,8 +2,8 @@ /datum/action/innate/terrorspider/web name = "Web" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "stickyweb1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "stickyweb1" /datum/action/innate/terrorspider/web/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/user = owner @@ -11,8 +11,8 @@ /datum/action/innate/terrorspider/wrap name = "Wrap" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "cocoon_large1" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "cocoon_large1" /datum/action/innate/terrorspider/wrap/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/user = owner @@ -23,8 +23,8 @@ /datum/action/innate/terrorspider/greeneggs name = "Lay Green Eggs" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "eggs" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "eggs" /datum/action/innate/terrorspider/greeneggs/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/green/user = owner @@ -35,8 +35,8 @@ /datum/action/innate/terrorspider/ventsmash name = "Smash Welded Vent" - button_overlay_icon = 'icons/atmos/vent_pump.dmi' - button_overlay_icon_state = "map_vent" + button_icon = 'icons/atmos/vent_pump.dmi' + button_icon_state = "map_vent" /datum/action/innate/terrorspider/ventsmash/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/user = owner @@ -44,8 +44,8 @@ /datum/action/innate/terrorspider/remoteview name = "Remote View" - button_overlay_icon = 'icons/obj/eyes.dmi' - button_overlay_icon_state = "heye" + button_icon = 'icons/obj/eyes.dmi' + button_icon_state = "heye" /datum/action/innate/terrorspider/remoteview/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/user = owner @@ -56,7 +56,7 @@ /datum/action/innate/terrorspider/mother/royaljelly name = "Lay Royal Jelly" - button_overlay_icon_state = "spiderjelly" + button_icon_state = "spiderjelly" /datum/action/innate/terrorspider/mother/royaljelly/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/mother/user = owner @@ -64,8 +64,8 @@ /datum/action/innate/terrorspider/mother/gatherspiderlings name = "Gather Spiderlings" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "spiderling" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "spiderling" /datum/action/innate/terrorspider/mother/gatherspiderlings/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/mother/user = owner @@ -73,8 +73,8 @@ /datum/action/innate/terrorspider/mother/incubateeggs name = "Incubate Eggs" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "eggs" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "eggs" /datum/action/innate/terrorspider/mother/incubateeggs/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/mother/user = owner @@ -84,8 +84,8 @@ /datum/action/innate/terrorspider/queen/queennest name = "Nest" - button_overlay_icon = 'icons/mob/terrorspider.dmi' - button_overlay_icon_state = "terror_queen" + button_icon = 'icons/mob/terrorspider.dmi' + button_icon_state = "terror_queen" /datum/action/innate/terrorspider/queen/queennest/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/queen/user = owner @@ -93,7 +93,7 @@ /datum/action/innate/terrorspider/queen/queensense name = "Hive Sense" - button_overlay_icon_state = "mindswap" + button_icon_state = "mindswap" /datum/action/innate/terrorspider/queen/queensense/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/queen/user = owner @@ -101,8 +101,8 @@ /datum/action/innate/terrorspider/queen/queeneggs name = "Lay Queen Eggs" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "eggs" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "eggs" /datum/action/innate/terrorspider/queen/queeneggs/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/queen/user = owner @@ -113,8 +113,8 @@ /datum/action/innate/terrorspider/queen/empress/empresserase name = "Empress Erase Brood" - button_overlay_icon = 'icons/effects/blood.dmi' - button_overlay_icon_state = "mgibbl1" + button_icon = 'icons/effects/blood.dmi' + button_icon_state = "mgibbl1" /datum/action/innate/terrorspider/queen/empress/empresserase/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/user = owner @@ -122,8 +122,8 @@ /datum/action/innate/terrorspider/queen/empress/empresslings name = "Empresss Spiderlings" - button_overlay_icon = 'icons/effects/effects.dmi' - button_overlay_icon_state = "spiderling" + button_icon = 'icons/effects/effects.dmi' + button_icon_state = "spiderling" /datum/action/innate/terrorspider/queen/empress/empresslings/Activate() var/mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/user = owner diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm index 8bf8842c359..5ce6056da41 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/empress_terror.dm @@ -44,7 +44,7 @@ /mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/NestMode() ..() queeneggs_action.name = "Empress Eggs" - queeneggs_action.UpdateButtons() + queeneggs_action.build_all_button_icons() /mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/LayQueenEggs() var/eggtype = tgui_input_list(src, "What kind of eggs?", "Egg laying", list(TS_DESC_QUEEN, TS_DESC_MOTHER, TS_DESC_PRINCE, TS_DESC_PRINCESS, TS_DESC_RED, TS_DESC_GRAY, TS_DESC_GREEN, TS_DESC_BLACK, TS_DESC_PURPLE, TS_DESC_WHITE, TS_DESC_BROWN)) diff --git a/code/modules/mob/living/simple_animal/slime/slime_powers.dm b/code/modules/mob/living/simple_animal/slime/slime_powers.dm index 9fa8b8c54c5..6b394e20ccc 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_powers.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_powers.dm @@ -7,8 +7,8 @@ /datum/action/innate/slime check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon = 'icons/mob/actions/actions_slime.dmi' - button_background_icon_state = "bg_alien" + button_icon = 'icons/mob/actions/actions_slime.dmi' + background_icon_state = "bg_alien" var/needs_growth = NO_GROWTH_NEEDED /datum/action/innate/slime/IsAvailable() @@ -42,7 +42,7 @@ /datum/action/innate/slime/feed name = "Feed" - button_overlay_icon_state = "slimeeat" + button_icon_state = "slimeeat" /datum/action/innate/slime/feed/Activate() @@ -144,7 +144,7 @@ /datum/action/innate/slime/evolve name = "Evolve" - button_overlay_icon_state = "slimegrow" + button_icon_state = "slimegrow" needs_growth = GROWTH_NEEDED /datum/action/innate/slime/evolve/Activate() @@ -205,7 +205,7 @@ /datum/action/innate/slime/reproduce name = "Reproduce" - button_overlay_icon_state = "slimesplit" + button_icon_state = "slimesplit" needs_growth = GROWTH_NEEDED /datum/action/innate/slime/reproduce/Activate() diff --git a/code/modules/mob/living/stat_states.dm b/code/modules/mob/living/stat_states.dm index 0698dd7bf79..1f71e4a9d39 100644 --- a/code/modules/mob/living/stat_states.dm +++ b/code/modules/mob/living/stat_states.dm @@ -82,7 +82,7 @@ if(mind) for(var/S in mind.spell_list) var/datum/spell/spell = S - spell.UpdateButtons() + spell.build_all_button_icons() return TRUE diff --git a/code/modules/mod/mod_actions.dm b/code/modules/mod/mod_actions.dm index 5509a16fb45..647f8716d5e 100644 --- a/code/modules/mod/mod_actions.dm +++ b/code/modules/mod/mod_actions.dm @@ -1,12 +1,11 @@ /datum/action/item_action/mod - button_overlay_icon = 'icons/mob/actions/actions_mod.dmi' - button_overlay_icon_state = "bg_mod_border" - button_background_icon = 'icons/mob/actions/actions_mod.dmi' - button_background_icon_state = "bg_mod" + button_icon = 'icons/mob/actions/actions_mod.dmi' + button_icon_state = "bg_mod_border" + background_icon = 'icons/mob/actions/actions_mod.dmi' + background_icon_state = "bg_mod" check_flags = AB_CHECK_CONSCIOUS - use_itemicon = FALSE -/datum/action/item_action/mod/New(Target, custom_icon, custom_icon_state) +/datum/action/item_action/mod/New(Target) ..() if(!ismodcontrol(Target)) qdel(src) @@ -23,7 +22,7 @@ /datum/action/item_action/mod/deploy name = "Deploy MODsuit" desc = "LMB: Deploy/Undeploy full suit. MMB: Deploy/Undeploy part." - button_overlay_icon_state = "deploy" + button_icon_state = "deploy" /datum/action/item_action/mod/deploy/Trigger(left_click, attack_self) . = ..() @@ -38,7 +37,7 @@ /datum/action/item_action/mod/activate name = "Activate MODsuit" desc = "LMB: Activate/Deactivate suit with prompt. MMB: Activate/Deactivate suit skipping prompt." - button_overlay_icon_state = "activate" + button_icon_state = "activate" /// First time clicking this will set it to TRUE, second time will activate it. var/ready = FALSE @@ -48,8 +47,8 @@ return if(!ready && left_click) ready = TRUE - button_overlay_icon_state = "activate-ready" - UpdateButtons() + button_icon_state = "activate-ready" + build_all_button_icons() addtimer(CALLBACK(src, PROC_REF(reset_ready)), 3 SECONDS) return var/obj/item/mod/control/mod = target @@ -59,13 +58,13 @@ /// Resets the state requiring to be doubleclicked again. /datum/action/item_action/mod/activate/proc/reset_ready() ready = FALSE - button_overlay_icon_state = initial(button_overlay_icon_state) - UpdateButtons() + button_icon_state = initial(button_icon_state) + build_all_button_icons() /datum/action/item_action/mod/module name = "Toggle Module" desc = "Toggle a MODsuit module." - button_overlay_icon_state = "module" + button_icon_state = "module" /datum/action/item_action/mod/module/Trigger(left_click, attack_self) . = ..() @@ -77,7 +76,7 @@ /datum/action/item_action/mod/panel name = "MODsuit Panel" desc = "Open the MODsuit's panel." - button_overlay_icon_state = "panel" + button_icon_state = "panel" /datum/action/item_action/mod/panel/Trigger(left_click, attack_self) . = ..() @@ -88,20 +87,21 @@ /datum/action/item_action/mod/pinned_module desc = "Activate the module." - button_overlay_icon = 'icons/obj/clothing/modsuit/mod_modules.dmi' - button_overlay_icon_state = "module" + button_icon = 'icons/obj/clothing/modsuit/mod_modules.dmi' + button_icon_state = "module" /// Module we are linked to. var/obj/item/mod/module/module /// A ref to the mob we are pinned to. var/pinner_uid -/datum/action/item_action/mod/pinned_module/New(Target, custom_icon, custom_icon_state, obj/item/mod/module/linked_module, mob/user) +/datum/action/item_action/mod/pinned_module/New(Target, obj/item/mod/module/linked_module, mob/user) + button_icon = linked_module.icon + button_icon_state = linked_module.icon_state name = "Activate [capitalize(linked_module.name)]" desc = "Quickly activate [linked_module]." ..() module = linked_module - button_overlay_icon_state = module.icon_state - button_background_icon_state = ((module.module_type == MODULE_TOGGLE && module.active) ? "bg_mod_active" : "bg_mod") + background_icon_state = ((module.module_type == MODULE_TOGGLE && module.active) ? "bg_mod_active" : "bg_mod") if(linked_module.allow_flags & MODULE_ALLOW_INCAPACITATED) // clears check hands check_flags = AB_CHECK_CONSCIOUS @@ -131,5 +131,5 @@ /datum/action/item_action/mod/pinned_module/proc/linked_button_update() if(module.module_type != MODULE_PASSIVE) - button_background_icon_state = (module.active ? "bg_mod_active" : "bg_mod") - UpdateButtons() + background_icon_state = (module.active ? "bg_mod_active" : "bg_mod") + build_all_button_icons() diff --git a/code/modules/mod/modules/_modules.dm b/code/modules/mod/modules/_modules.dm index 6312dcaa4e0..a0b85e5dfa3 100644 --- a/code/modules/mod/modules/_modules.dm +++ b/code/modules/mod/modules/_modules.dm @@ -331,7 +331,7 @@ qdel(M) pinned_to = list() return - var/datum/action/item_action/mod/pinned_module/new_action = new(Target = mod, custom_icon = src.icon, custom_icon_state = src.icon_state, linked_module = src, user = user) + var/datum/action/item_action/mod/pinned_module/new_action = new(Target = mod, linked_module = src, user = user) to_chat(user, "[new_action] is now pinned to the UI!") diff --git a/code/modules/mod/modules/module_pathfinder.dm b/code/modules/mod/modules/module_pathfinder.dm index 8aada8f4cb8..f86588ea01e 100644 --- a/code/modules/mod/modules/module_pathfinder.dm +++ b/code/modules/mod/modules/module_pathfinder.dm @@ -211,12 +211,11 @@ /datum/action/item_action/mod_recall name = "Recall MOD" desc = "Recall a MODsuit anyplace, anytime." - use_itemicon = FALSE check_flags = AB_CHECK_CONSCIOUS - button_overlay_icon = 'icons/mob/actions/actions_mod.dmi' - button_overlay_icon_state = "recall" - button_background_icon = 'icons/mob/actions/actions_mod.dmi' - button_background_icon_state = "bg_mod" + button_icon = 'icons/mob/actions/actions_mod.dmi' + button_icon_state = "recall" + background_icon = 'icons/mob/actions/actions_mod.dmi' + background_icon_state = "bg_mod" /// The cooldown for the recall. COOLDOWN_DECLARE(recall_cooldown) diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index ba59fee6945..941c6c21010 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -191,7 +191,7 @@ // === SLIME ACTION DATUMS ==== /datum/action/innate/slime_place name = "Place Slimes" - button_overlay_icon_state = "slime_down" + button_icon_state = "slime_down" /datum/action/innate/slime_place/Activate() if(!target || !ishuman(owner)) @@ -211,7 +211,7 @@ /datum/action/innate/slime_pick_up name = "Pick up Slime" - button_overlay_icon_state = "slime_up" + button_icon_state = "slime_up" /datum/action/innate/slime_pick_up/Activate() if(!target || !ishuman(owner)) @@ -233,7 +233,7 @@ /datum/action/innate/feed_slime name = "Feed Slimes" - button_overlay_icon_state = "monkey_down" + button_icon_state = "monkey_down" /datum/action/innate/feed_slime/Activate() if(!target || !ishuman(owner)) @@ -276,7 +276,7 @@ /datum/action/innate/monkey_recycle name = "Recycle Monkeys" - button_overlay_icon_state = "monkey_up" + button_icon_state = "monkey_up" /datum/action/innate/monkey_recycle/Activate() if(!target || !ishuman(owner)) @@ -301,7 +301,7 @@ /datum/action/innate/slime_scan name = "Scan Slime" - button_overlay_icon_state = "slime_scan" + button_icon_state = "slime_scan" /datum/action/innate/slime_scan/Activate() if(!target || !isliving(owner)) @@ -317,7 +317,7 @@ /datum/action/innate/feed_potion name = "Apply Potion" - button_overlay_icon_state = "slime_potion" + button_icon_state = "slime_potion" /datum/action/innate/feed_potion/Activate() if(!target || !ishuman(owner)) @@ -340,7 +340,7 @@ /datum/action/innate/hotkey_help name = "Hotkey Help" - button_overlay_icon_state = "hotkey_help" + button_icon_state = "hotkey_help" /datum/action/innate/hotkey_help/Activate() if(!target || !isliving(owner)) diff --git a/code/modules/research/xenobiology/xenobiology_organs.dm b/code/modules/research/xenobiology/xenobiology_organs.dm index 0cabc01c86e..00efb06c765 100644 --- a/code/modules/research/xenobiology/xenobiology_organs.dm +++ b/code/modules/research/xenobiology/xenobiology_organs.dm @@ -248,8 +248,8 @@ /datum/spell/drake_breath/update_spell_icon() if(!action) return - action.button_overlay_icon_state = "fireball[active]" - action.UpdateButtons() + action.button_icon_state = "fireball[active]" + action.build_all_button_icons() /datum/spell/drake_breath/cast(list/targets, mob/living/user) . = ..() @@ -1030,8 +1030,8 @@ /datum/action/innate/migo_noise name = "Make some noise!" desc = "Your organ YEARNS to make noises of all kinds. Let it loose for a moment!" - button_overlay_icon = 'icons/mob/animal.dmi' - button_overlay_icon_state = "mi-go" + button_icon = 'icons/mob/animal.dmi' + button_icon_state = "mi-go" var/cooldown = 0 COOLDOWN_DECLARE(migo_cooldown) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 3111600bd47..83050ab1d16 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -257,8 +257,8 @@ /datum/action/innate/shuttledocker_rotate name = "Rotate" - button_overlay_icon = 'icons/mob/actions/actions_mecha.dmi' - button_overlay_icon_state = "mech_cycle_equip_off" + button_icon = 'icons/mob/actions/actions_mecha.dmi' + button_icon_state = "mech_cycle_equip_off" /datum/action/innate/shuttledocker_rotate/Activate() if(QDELETED(target) || !isliving(target)) @@ -270,8 +270,8 @@ /datum/action/innate/shuttledocker_place name = "Place" - button_overlay_icon = 'icons/mob/actions/actions_mecha.dmi' - button_overlay_icon_state = "mech_zoom_off" + button_icon = 'icons/mob/actions/actions_mecha.dmi' + button_icon_state = "mech_zoom_off" /datum/action/innate/shuttledocker_place/Activate() if(QDELETED(target) || !isliving(target)) diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm index 841b13d39c7..b86d5cc82d1 100644 --- a/code/modules/surgery/dental_implant.dm +++ b/code/modules/surgery/dental_implant.dm @@ -37,7 +37,7 @@ user.drop_item() tool.forceMove(target) - var/datum/action/item_action/hands_free/activate_pill/P = new(tool, tool.icon, tool.icon_state) + var/datum/action/item_action/hands_free/activate_pill/P = new(tool) P.name = "Activate Pill ([tool.name])" P.Grant(target) @@ -47,6 +47,11 @@ /datum/action/item_action/hands_free/activate_pill name = "Activate Pill" +/datum/action/item_action/hands_free/activate_pill/New(Target, obj/item/tool) + button_icon = tool.icon + button_icon_state = tool.icon_state + return ..() + /datum/action/item_action/hands_free/activate_pill/Trigger(left_click = TRUE) if(!..(left_click, FALSE)) return diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 23191f787ee..3ef8a489c0a 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -219,6 +219,9 @@ /obj/item/organ/internal/cyberimp/arm/gun/taser/l parent_organ = "l_arm" +/datum/action/item_action/organ_action/toggle/utility_belt + button_icon = 'icons/obj/clothing/belts.dmi' + button_icon_state = "utilitybelt" /obj/item/organ/internal/cyberimp/arm/toolset name = "integrated toolset implant" @@ -227,8 +230,7 @@ origin_tech = "materials=3;engineering=4;biotech=3;powerstorage=4" contents = newlist(/obj/item/screwdriver/cyborg, /obj/item/wrench/cyborg, /obj/item/weldingtool/largetank/cyborg, /obj/item/crowbar/cyborg, /obj/item/wirecutters/cyborg, /obj/item/multitool/cyborg) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/clothing/belts.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "utilitybelt") + actions_types = list(/datum/action/item_action/organ_action/toggle/utility_belt) /obj/item/organ/internal/cyberimp/arm/toolset/l parent_organ = "l_arm" @@ -240,26 +242,32 @@ return TRUE return FALSE +/datum/action/item_action/organ_action/toggle/abductor_belt + button_icon = 'icons/obj/abductor.dmi' + button_icon_state = "belt" + /obj/item/organ/internal/cyberimp/arm/toolset_abductor name = "alien toolset implant" desc = "An alien toolset, designed to be installed on subject's arm." icon_state = "toolkit_engineering" origin_tech = "materials=5;engineering=5;plasmatech=5;powerstorage=4;abductor=3" contents = newlist(/obj/item/screwdriver/abductor, /obj/item/wirecutters/abductor, /obj/item/crowbar/abductor, /obj/item/wrench/abductor, /obj/item/weldingtool/abductor, /obj/item/multitool/abductor) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/abductor.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "belt") + actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt) /obj/item/organ/internal/cyberimp/arm/toolset_abductor/l parent_organ = "l_arm" +/datum/action/item_action/organ_action/toggle/abductor_janibelt + button_icon = 'icons/obj/abductor.dmi' + button_icon_state = "janibelt_abductor" + /obj/item/organ/internal/cyberimp/arm/janitorial_abductor name = "alien janitorial toolset implant" desc = "A set of alien janitorial tools, designed to be installed on subject's arm." icon_state = "toolkit_janitor" origin_tech = "materials=5;engineering=5;biotech=5;powerstorage=4;abductor=2" contents = newlist(/obj/item/mop/advanced/abductor, /obj/item/soap/syndie/abductor, /obj/item/lightreplacer/bluespace/abductor, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter/abductor, /obj/item/reagent_containers/spray/cleaner/safety/abductor) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/abductor.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "janibelt_abductor") + actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt) /obj/item/organ/internal/cyberimp/arm/janitorial_abductor/l parent_organ = "l_arm" @@ -270,8 +278,7 @@ icon_state = "toolkit_surgical" origin_tech = "materials=5;engineering=5;plasmatech=5;powerstorage=4;abductor=2" contents = newlist(/obj/item/retractor/alien, /obj/item/hemostat/alien, /obj/item/bonesetter/alien, /obj/item/scalpel/laser/alien, /obj/item/circular_saw/alien, /obj/item/bonegel/alien, /obj/item/fix_o_vein/alien, /obj/item/surgicaldrill/alien) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/abductor.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "belt") + actions_types = list(/datum/action/item_action/organ_action/toggle/abductor_belt) /obj/item/organ/internal/cyberimp/arm/surgical_abductor/l parent_organ = "l_arm" @@ -282,21 +289,27 @@ contents = newlist(/obj/item/melee/energy/blade/hardlight) origin_tech = "materials=4;combat=5;biotech=3;powerstorage=2;syndicate=5" +/datum/action/item_action/organ_action/toggle/medibeam + button_icon = 'icons/obj/chronos.dmi' + button_icon_state = "chronogun" + /obj/item/organ/internal/cyberimp/arm/medibeam name = "integrated medical beamgun" desc = "A cybernetic implant that allows the user to project a healing beam from their hand." contents = newlist(/obj/item/gun/medbeam) origin_tech = "materials=5;combat=2;biotech=5;powerstorage=4;syndicate=1" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/chronos.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "chronogun") + actions_types = list(/datum/action/item_action/organ_action/toggle/medibeam) + +/datum/action/item_action/organ_action/toggle/flash + button_icon = 'icons/obj/device.dmi' + button_icon_state = "flash" /obj/item/organ/internal/cyberimp/arm/flash name = "integrated high-intensity photon projector" //Why not desc = "An integrated projector mounted onto a user's arm, that is able to be used as a powerful flash." contents = newlist(/obj/item/flash/armimplant) origin_tech = "materials=4;combat=3;biotech=4;magnets=4;powerstorage=3" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/device.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "flash") + actions_types = list(/datum/action/item_action/organ_action/toggle/medibeam) /obj/item/organ/internal/cyberimp/arm/flash/New() ..() @@ -331,27 +344,33 @@ icon_state = "m1911" emp_proof = 1 +/datum/action/item_action/organ_action/toggle/dufflebag_med + button_icon = 'icons/obj/storage.dmi' + button_icon_state = "duffel-med" + /obj/item/organ/internal/cyberimp/arm/surgery name = "surgical toolset implant" desc = "A set of surgical tools hidden behind a concealed panel on the user's arm." icon_state = "toolkit_surgical" contents = newlist(/obj/item/retractor/augment, /obj/item/hemostat/augment, /obj/item/cautery/augment, /obj/item/bonesetter/augment, /obj/item/scalpel/augment, /obj/item/circular_saw/augment, /obj/item/bonegel/augment, /obj/item/fix_o_vein/augment, /obj/item/surgicaldrill/augment) origin_tech = "materials=3;engineering=3;biotech=3;programming=2;magnets=3" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/storage.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "duffel-med") + actions_types = list(/datum/action/item_action/organ_action/toggle/dufflebag_med) /obj/item/organ/internal/cyberimp/arm/surgery/l parent_organ = "l_arm" slot = "l_arm_device" +/datum/action/item_action/organ_action/toggle/janibelt + button_icon = 'icons/obj/clothing/belts.dmi' + button_icon_state = "janibelt" + /obj/item/organ/internal/cyberimp/arm/janitorial name = "janitorial toolset implant" desc = "A set of janitorial tools hidden behind a concealed panel on the user's arm." icon_state = "toolkit_janitor" contents = newlist(/obj/item/mop/advanced, /obj/item/soap, /obj/item/lightreplacer, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter, /obj/item/reagent_containers/spray/cleaner/safety) origin_tech = "materials=3;engineering=4;biotech=3" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/clothing/belts.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "janibelt") + actions_types = list(/datum/action/item_action/organ_action/toggle/janibelt) /obj/item/organ/internal/cyberimp/arm/janitorial/l parent_organ = "l_arm" @@ -363,8 +382,7 @@ desc = "A set of advanced janitorial tools hidden behind a concealed panel on the user's arm." contents = newlist(/obj/item/mop/advanced, /obj/item/soap/deluxe, /obj/item/lightreplacer/bluespace, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter, /obj/item/reagent_containers/spray/cleaner/advanced) origin_tech = "materials=5;engineering=6;biotech=5" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/clothing/belts.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "janibelt") + actions_types = list(/datum/action/item_action/organ_action/toggle/janibelt) emp_proof = TRUE /// its for ERT, but still probably a good idea. @@ -372,14 +390,17 @@ parent_organ = "l_arm" slot = "l_arm_device" +/datum/action/item_action/organ_action/toggle/botanybelt + button_icon = 'icons/obj/clothing/belts.dmi' + button_icon_state = "botanybelt" + /obj/item/organ/internal/cyberimp/arm/botanical name = "botanical toolset implant" desc = "A set of botanical tools hidden behind a concealed panel on the user's arm." icon_state = "toolkit_hydro" contents = newlist(/obj/item/plant_analyzer, /obj/item/cultivator, /obj/item/hatchet, /obj/item/shovel/spade, /obj/item/reagent_containers/spray/weedspray, /obj/item/reagent_containers/spray/pestspray) origin_tech = "materials=3;engineering=4;biotech=3" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/clothing/belts.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "botanybelt") + actions_types = list(/datum/action/item_action/organ_action/toggle/botanybelt) /obj/item/organ/internal/cyberimp/arm/botanical/l parent_organ = "l_arm" @@ -467,21 +488,27 @@ H.visible_message("[H] unplugs from \the [A].", "You unplug from \the [A].") drawing_power = FALSE +/datum/action/item_action/organ_action/toggle/telebaton + button_icon = 'icons/obj/items.dmi' + button_icon_state = "baton" + /obj/item/organ/internal/cyberimp/arm/telebaton name = "telebaton implant" desc = "Telescopic baton implant. Does what it says on the tin" // A better description contents = newlist(/obj/item/melee/classic_baton) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/items.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "baton") + actions_types = list(/datum/action/item_action/organ_action/toggle/telebaton) + +/datum/action/item_action/organ_action/toggle/advanced_mop + button_icon = 'icons/obj/janitor.dmi' + button_icon_state = "advmop" /obj/item/organ/internal/cyberimp/arm/advmop name = "advanced mop implant" desc = "Advanced mop implant. Does what it says on the tin" // A better description contents = newlist(/obj/item/mop/advanced) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/janitor.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "advmop") + actions_types = list(/datum/action/item_action/organ_action/toggle/advanced_mop) // Razorwire implant, long reach whip made of extremely thin wire, ouch! @@ -563,14 +590,17 @@ return FALSE return TRUE +/datum/action/item_action/organ_action/toggle/razorwire + button_icon = 'icons/obj/surgery.dmi' + button_icon_state = "razorwire" + /obj/item/organ/internal/cyberimp/arm/razorwire name = "razorwire spool implant" desc = "An integrated spool of razorwire, capable of being used as a weapon when whipped at your foes. \ Built into the back of your hand, try your best to not get it tangled." contents = newlist(/obj/item/melee/razorwire) icon_state = "razorwire" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/surgery.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "razorwire") + actions_types = list(/datum/action/item_action/organ_action/toggle/razorwire) origin_tech = "combat=5;biotech=5;syndicate=2" stealth_level = 1 // Hidden from health analyzers @@ -618,13 +648,16 @@ ammo_type = /obj/item/ammo_casing/shotgun/rubbershot max_ammo = 1 +/datum/action/item_action/organ_action/toggle/shell_cannon + button_icon = 'icons/obj/surgery.dmi' + button_icon_state = "shell_cannon" + /obj/item/organ/internal/cyberimp/arm/shell_launcher name = "shell launch system implant" desc = "A mounted, single-shot housing for a shell launch cannon; capable of firing twelve-gauge shotgun shells." contents = newlist(/obj/item/gun/projectile/revolver/doublebarrel/shell_launcher) icon_state = "shell_cannon" - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/surgery.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "shell_cannon") + actions_types = list(/datum/action/item_action/organ_action/toggle/shell_cannon) /obj/item/organ/internal/cyberimp/arm/shell_launcher/emp_act(severity) if(!owner) @@ -673,6 +706,10 @@ mercenaries, and firearm enthusiasts. Its appeal lies not just in its stealth but also in its compatibility with Shellguard's range of modular products, \ and the potential beyond its advertised capabilities." +/datum/action/item_action/organ_action/toggle/v1_arm + button_icon = 'icons/obj/items.dmi' + button_icon_state = "v1_arm" + /obj/item/organ/internal/cyberimp/arm/v1_arm name = "vortex feedback arm implant" desc = "An implant, that when deployed surrounds the users arm in armor and circuitry, allowing them to redirect nearby projectiles with feedback from the vortex anomaly core." @@ -683,8 +720,7 @@ slot = "l_arm_device" contents = newlist(/obj/item/shield/v1_arm) - action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/items.dmi') - action_icon_state = list(/datum/action/item_action/organ_action/toggle = "v1_arm") + actions_types = list(/datum/action/item_action/organ_action/toggle/v1_arm) var/disabled = FALSE /obj/item/organ/internal/cyberimp/arm/v1_arm/emp_act(severity) diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index e4c8a70d684..7772ad14adc 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -380,8 +380,8 @@ /datum/action/item_action/organ_action/toggle/sensory_enhancer name = "Activate Qani-Laaca System" desc = "Activates your Qani-Laaca computer and grants you its powers. LMB: Short, safer activation. ALT/MIDDLE: Longer, more powerful, more dangerous activation." - button_overlay_icon = 'icons/obj/surgery.dmi' - button_overlay_icon_state = "sandy" + button_icon = 'icons/obj/surgery.dmi' + button_icon_state = "sandy" /// Keeps track of how much mephedrone we inject into people on activation var/injection_amount = 10 diff --git a/code/modules/surgery/organs/subtypes/skrell_organs.dm b/code/modules/surgery/organs/subtypes/skrell_organs.dm index aaf6dd9390a..f0354eaa16d 100644 --- a/code/modules/surgery/organs/subtypes/skrell_organs.dm +++ b/code/modules/surgery/organs/subtypes/skrell_organs.dm @@ -15,13 +15,12 @@ var/obj/item/held_item /datum/action/item_action/organ_action/toggle/headpocket - use_itemicon = FALSE - button_overlay_icon_state = "skrell_headpocket_in" + button_icon_state = "skrell_headpocket_in" /obj/item/organ/internal/headpocket/proc/update_button_state() for(var/datum/action/item_action/T in actions) - T.button_overlay_icon_state = "skrell_headpocket[held_item ? "_out" : "_in"]" - T.UpdateButtons() + T.button_icon_state = "skrell_headpocket[held_item ? "_out" : "_in"]" + T.build_all_button_icons() /obj/item/organ/internal/headpocket/Destroy() empty_contents() diff --git a/code/modules/vehicle/ambulance.dm b/code/modules/vehicle/ambulance.dm index ef230e2b67e..72f21525f40 100644 --- a/code/modules/vehicle/ambulance.dm +++ b/code/modules/vehicle/ambulance.dm @@ -20,8 +20,8 @@ /datum/action/ambulance_alarm name = "Toggle Sirens" - button_overlay_icon = 'icons/obj/vehicles.dmi' - button_overlay_icon_state = "docwagon2" + button_icon = 'icons/obj/vehicles.dmi' + button_icon_state = "docwagon2" check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_LYING | AB_CHECK_CONSCIOUS var/toggle_cooldown = 40 var/cooldown = 0 diff --git a/code/modules/vehicle/bicycle.dm b/code/modules/vehicle/bicycle.dm index 6fd01b62bd6..b08239f06b0 100644 --- a/code/modules/vehicle/bicycle.dm +++ b/code/modules/vehicle/bicycle.dm @@ -45,8 +45,8 @@ /datum/action/bicycle_bell name = "Ring Bell" desc = "Go on, ring your bicycle bell!" - button_overlay_icon = 'icons/obj/bureaucracy.dmi' - button_overlay_icon_state = "desk_bell" + button_icon = 'icons/obj/bureaucracy.dmi' + button_icon_state = "desk_bell" COOLDOWN_DECLARE(ring_cooldown) /datum/action/bicycle_bell/Trigger(left_click) diff --git a/code/modules/vehicle/janivehicle.dm b/code/modules/vehicle/janivehicle.dm index bb7e0d4a282..e97ae0bf88a 100644 --- a/code/modules/vehicle/janivehicle.dm +++ b/code/modules/vehicle/janivehicle.dm @@ -46,8 +46,8 @@ /datum/action/floor_buffer name = "Toggle Floor Buffer" desc = "Movement speed is decreased while active." - button_overlay_icon = 'icons/obj/vehicles.dmi' - button_overlay_icon_state = "upgrade" + button_icon = 'icons/obj/vehicles.dmi' + button_icon_state = "upgrade" /datum/action/floor_buffer/Trigger(left_click) . = ..() diff --git a/code/modules/vehicle/tg_vehicles/tg_vehicle_actions.dm b/code/modules/vehicle/tg_vehicles/tg_vehicle_actions.dm index c82fb7f001b..44e59182199 100644 --- a/code/modules/vehicle/tg_vehicles/tg_vehicle_actions.dm +++ b/code/modules/vehicle/tg_vehicles/tg_vehicle_actions.dm @@ -188,9 +188,9 @@ /datum/action/vehicle check_flags = AB_CHECK_HANDS_BLOCKED | AB_CHECK_IMMOBILE | AB_CHECK_CONSCIOUS - button_background_icon = 'icons/mob/actions/actions_vehicle.dmi' - button_overlay_icon = 'icons/mob/actions/actions_vehicle.dmi' - button_overlay_icon_state = "vehicle_eject" + background_icon = 'icons/mob/actions/actions_vehicle.dmi' + button_icon = 'icons/mob/actions/actions_vehicle.dmi' + button_icon_state = "vehicle_eject" var/obj/tgvehicle/vehicle_target var/obj/tgvehicle/vehicle_ridden_target @@ -201,7 +201,7 @@ /datum/action/vehicle/skateboard/ollie name = "Ollie" desc = "Get some air! Land on a table or fence to do a gnarly grind." - button_overlay_icon_state = "skateboard_ollie" + button_icon_state = "skateboard_ollie" check_flags = AB_CHECK_CONSCIOUS /datum/action/vehicle/skateboard/ollie/Trigger(left_click) @@ -251,7 +251,7 @@ /datum/action/vehicle/skateboard/kickflip name = "Kickflip" desc = "Kick your board up and catch it." - button_overlay_icon_state = "skateboard_ollie" + button_icon_state = "skateboard_ollie" check_flags = AB_CHECK_CONSCIOUS /datum/action/vehicle/skateboard/kickflip/Trigger(left_click) diff --git a/icons/mob/actions/actions.dmi b/icons/mob/actions/actions.dmi index 22ca74f6e2f..e81510947ed 100644 Binary files a/icons/mob/actions/actions.dmi and b/icons/mob/actions/actions.dmi differ diff --git a/paradise.dme b/paradise.dme index c860f2e42cc..ca19945519a 100644 --- a/paradise.dme +++ b/paradise.dme @@ -502,6 +502,7 @@ #include "code\datums\cache\crew.dm" #include "code\datums\cache\powermonitor.dm" #include "code\datums\components\_component.dm" +#include "code\datums\components\action_item_overlay.dm" #include "code\datums\components\ai_retaliate_advanced.dm" #include "code\datums\components\anti_magic.dm" #include "code\datums\components\basic_mob_aggro_emote.dm"