diff --git a/common/scripted_guis/wc_magic_guis.txt b/common/scripted_guis/wc_magic_guis.txt index 0ef39a4b77..3d08feb5f2 100644 --- a/common/scripted_guis/wc_magic_guis.txt +++ b/common/scripted_guis/wc_magic_guis.txt @@ -1405,6 +1405,20 @@ cancel_cast_sgui = { } } +can_cancel_cast_sgui = { + scope = character + saved_scopes = { spell } + + is_valid = { + custom_description = { + text = cant_cancel_ritual_trigger + NOT = { + spell_is_ritual_trigger = { SPELL = scope:spell } + } + } + } +} + test_sgui = { scope = character diff --git a/common/trigger_localization/wc_magic_triggers.txt b/common/trigger_localization/wc_magic_triggers.txt index c1d58598d1..5824ed88b3 100644 --- a/common/trigger_localization/wc_magic_triggers.txt +++ b/common/trigger_localization/wc_magic_triggers.txt @@ -110,4 +110,13 @@ only_target_self_trigger = { spell_cant_be_hacked_trigger = { first = WC_CANT_HACK_SPELL +} + +spell_is_ritual_trigger = { + first = WC_SPELL_IS_RITUAL + first_not = WC_SPELL_IS_NOT_RITUAL +} + +cant_cancel_ritual_trigger = { + first_not = WC_CANT_CANCEL_RITUAL_NOT } \ No newline at end of file diff --git a/gui/spellbook_widget.gui b/gui/spellbook_widget.gui index 338faa9432..090f095eed 100644 --- a/gui/spellbook_widget.gui +++ b/gui/spellbook_widget.gui @@ -1694,6 +1694,8 @@ widget = { button_standard = { text = "CANCEL_CAST_BUTTON" + tooltip = "[GetScriptedGui('can_cancel_cast_sgui').IsValidTooltip( GuiScope.SetRoot( GetPlayer.MakeScope ).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]" + enabled = "[GetScriptedGui( 'can_cancel_cast_sgui' ).IsValid(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]" onclick = "[GetScriptedGui( 'cancel_cast_sgui' ).Execute(GuiScope.SetRoot(GetPlayer.MakeScope).AddScope( 'spell', MakeScopeFlag(Scope.GetFlagName)).End)]" } } diff --git a/localization/english/triggers/wc_magic_triggers_l_english.yml b/localization/english/triggers/wc_magic_triggers_l_english.yml index 3b9528eff0..49024e1021 100644 --- a/localization/english/triggers/wc_magic_triggers_l_english.yml +++ b/localization/english/triggers/wc_magic_triggers_l_english.yml @@ -69,4 +69,7 @@ WC_ONLY_TARGET_SELF_FIRST_NOT:0 "You can only target yourself." WC_CANT_HACK_SPELL:0 "Can't hack this spell." WC_CANT_REDUCE_RITUAL_SPELL:0 "Can't reduce the cooldown of rituals." - WC_CANT_REVERSE_RITUAL_SPELL:0 "Can't reverse the causality of rituals." \ No newline at end of file + WC_CANT_REVERSE_RITUAL_SPELL:0 "Can't reverse the causality of rituals." + WC_SPELL_IS_RITUAL:0 "This is a ritual spell." + WC_SPELL_IS_NOT_RITUAL:0 "This is not a ritual spell." + WC_CANT_CANCEL_RITUAL_NOT:0 "Can't cancel a ritual cast." \ No newline at end of file