From 831776b40dc6505cc2cf740f5fa63ef0634629a0 Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Mon, 22 Apr 2024 15:33:07 -0500
Subject: [PATCH] fixes some action button issues (#25140)
* fixes some action button issues
* murder
* thanks autocopy
* morph and xenos
* Update code/datums/action.dm
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
---------
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
---
code/datums/action.dm | 5 +++--
code/datums/spells/alien_spells/basetype_alien_spell.dm | 3 +++
code/game/gamemodes/miniantags/morph/spells/morph_spell.dm | 3 +++
.../gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm | 4 ++--
.../game/gamemodes/miniantags/revenant/revenant_abilities.dm | 3 +++
5 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/code/datums/action.dm b/code/datums/action.dm
index d85eaa080a3..511865a1c61 100644
--- a/code/datums/action.dm
+++ b/code/datums/action.dm
@@ -120,7 +120,8 @@
return
if(!status_only)
button.name = name
- button.desc = desc
+ if(desc)
+ button.desc = "[desc] [initial(button.desc)]"
if(owner?.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND)
var/list/settings = owner.hud_used.get_action_buttons_icons()
if(button.icon != settings["bg_icon"])
@@ -679,7 +680,7 @@
var/datum/spell/spell = target
if(owner)
- return spell.can_cast(owner)
+ return spell.can_cast(owner, show_message = TRUE)
return FALSE
/datum/action/spell_action/apply_unavailable_effect(atom/movable/screen/movable/action_button/button)
diff --git a/code/datums/spells/alien_spells/basetype_alien_spell.dm b/code/datums/spells/alien_spells/basetype_alien_spell.dm
index 547cba3c438..12d98e8e489 100644
--- a/code/datums/spells/alien_spells/basetype_alien_spell.dm
+++ b/code/datums/spells/alien_spells/basetype_alien_spell.dm
@@ -32,6 +32,9 @@ Updates the spell's actions on use as well, so they know when they can or can't
..()
if(plasma_cost)
name = "[name] ([plasma_cost])"
+ action.name = name
+ action.desc = desc
+ action.UpdateButtons()
/datum/spell/alien_spell/write_custom_logs(list/targets, mob/user)
user.create_log(ATTACK_LOG, "Cast the spell [name]")
diff --git a/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm b/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm
index d2581020824..af85ca31121 100644
--- a/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm
+++ b/code/game/gamemodes/miniantags/morph/spells/morph_spell.dm
@@ -8,6 +8,9 @@
..()
if(hunger_cost)
name = "[name] ([hunger_cost])"
+ action.name = name
+ action.desc = desc
+ action.UpdateButtons()
/datum/spell/morph_spell/create_new_handler()
var/datum/spell_handler/morph/H = new
diff --git a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm
index fb537324b9a..8bb7f2a626c 100644
--- a/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm
+++ b/code/game/gamemodes/miniantags/pulsedemon/pulsedemon_abilities.dm
@@ -28,10 +28,10 @@
/datum/spell/pulse_demon/proc/update_info()
if(locked)
name = "[initial(name)] (Locked) ([format_si_suffix(unlock_cost)]W)"
- desc = "[initial(desc)] It costs [format_si_suffix(unlock_cost)]W to unlock."
+ desc = "[initial(desc)] It costs [format_si_suffix(unlock_cost)]W to unlock. Alt-Click this spell to unlock it."
else
name = "[initial(name)][cast_cost == 0 ? "" : " ([format_si_suffix(cast_cost)]W)"]"
- desc = "[initial(desc)][spell_level == level_max ? "" : " It costs [format_si_suffix(upgrade_cost)]W to upgrade."]"
+ desc = "[initial(desc)][spell_level == level_max ? "" : " It costs [format_si_suffix(upgrade_cost)]W to upgrade. Alt-Click this spell to upgrade it."]"
action.name = name
action.desc = desc
action.UpdateButtons()
diff --git a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm
index 0bb6122c1b2..0913180f2ef 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm
@@ -163,6 +163,9 @@
name = "[initial(name)] ([unlock_amount]E)"
else
name = "[initial(name)] ([cast_amount]E)"
+ action.name = name
+ action.desc = desc
+ action.UpdateButtons()
/datum/spell/aoe/revenant/revert_cast(mob/user)
. = ..()