mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-06 07:38:46 +00:00
Add the removal of an active gameplay effect
This commit is contained in:
@@ -85,7 +85,7 @@ void FCogAbilityWindow_Effects::RenderContent()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Effects::RenderEffectsTable()
|
void FCogAbilityWindow_Effects::RenderEffectsTable()
|
||||||
{
|
{
|
||||||
const UAbilitySystemComponent* AbilitySystemComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetSelection(), true);
|
UAbilitySystemComponent* AbilitySystemComponent = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(GetSelection(), true);
|
||||||
if (AbilitySystemComponent == nullptr)
|
if (AbilitySystemComponent == nullptr)
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled("Selection has no ability system component");
|
ImGui::TextDisabled("Selection has no ability system component");
|
||||||
@@ -170,7 +170,7 @@ void FCogAbilityWindow_Effects::RenderEffectsTable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogAbilityWindow_Effects::RenderEffectRow(const UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected)
|
void FCogAbilityWindow_Effects::RenderEffectRow(UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected)
|
||||||
{
|
{
|
||||||
const FActiveGameplayEffect* ActiveEffectPtr = AbilitySystemComponent.GetActiveGameplayEffect(ActiveHandle);
|
const FActiveGameplayEffect* ActiveEffectPtr = AbilitySystemComponent.GetActiveGameplayEffect(ActiveHandle);
|
||||||
if (ActiveEffectPtr == nullptr)
|
if (ActiveEffectPtr == nullptr)
|
||||||
@@ -238,6 +238,13 @@ void FCogAbilityWindow_Effects::RenderEffectRow(const UAbilitySystemComponent& A
|
|||||||
}
|
}
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::Button("Remove"))
|
||||||
|
{
|
||||||
|
AbilitySystemComponent.RemoveActiveGameplayEffect(ActiveHandle);
|
||||||
|
ImGui::CloseCurrentPopup();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ protected:
|
|||||||
|
|
||||||
virtual void RenderEffectsTable();
|
virtual void RenderEffectsTable();
|
||||||
|
|
||||||
virtual void RenderEffectRow(const UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected);
|
virtual void RenderEffectRow(UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffectHandle& ActiveHandle, int32 Index, int32& Selected);
|
||||||
|
|
||||||
virtual void RenderEffectInfo(const UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffect& ActiveEffect, const UGameplayEffect& Effect);
|
virtual void RenderEffectInfo(const UAbilitySystemComponent& AbilitySystemComponent, const FActiveGameplayEffect& ActiveEffect, const UGameplayEffect& Effect);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user