mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-04 06:38:45 +00:00
various bug fixes
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -252,6 +252,13 @@ void UCogAbilityWindow_Abilities::RenderAbilitiesTable(UAbilitySystemComponent&
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void UCogAbilityWindow_Abilities::RenderAbilityCooldown(const UAbilitySystemComponent& AbilitySystemComponent, UGameplayAbility& Ability)
|
void UCogAbilityWindow_Abilities::RenderAbilityCooldown(const UAbilitySystemComponent& AbilitySystemComponent, UGameplayAbility& Ability)
|
||||||
{
|
{
|
||||||
|
FGameplayAbilitySpec* Spec = Ability.GetCurrentAbilitySpec();
|
||||||
|
|
||||||
|
if (Spec == nullptr)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float RemainingTime, CooldownDuration;
|
float RemainingTime, CooldownDuration;
|
||||||
Ability.GetCooldownTimeRemainingAndDuration(Ability.GetCurrentAbilitySpec()->Handle, AbilitySystemComponent.AbilityActorInfo.Get(), RemainingTime, CooldownDuration);
|
Ability.GetCooldownTimeRemainingAndDuration(Ability.GetCurrentAbilitySpec()->Handle, AbilitySystemComponent.AbilityActorInfo.Get(), RemainingTime, CooldownDuration);
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ void UCogAbilityWindow_Cheats::RequestCheat(AActor* ControlledActor, AActor* Sel
|
|||||||
|
|
||||||
if (ICogCommonAllegianceActorInterface* AllegianceInterface = Cast<ICogCommonAllegianceActorInterface>(OtherActor))
|
if (ICogCommonAllegianceActorInterface* AllegianceInterface = Cast<ICogCommonAllegianceActorInterface>(OtherActor))
|
||||||
{
|
{
|
||||||
AllegianceInterface->GetAllegianceWithOtherActor(ControlledActor);
|
Allegiance = AllegianceInterface->GetAllegianceWithOtherActor(ControlledActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((IsShiftDown && (Allegiance == ECogCommonAllegiance::Enemy))
|
if ((IsShiftDown && (Allegiance == ECogCommonAllegiance::Enemy))
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ void FCogDebugMetricValue::UpdateMetricPerSecond(const float Duration)
|
|||||||
PerSecond = Duration > 1.0f ? Total / Duration : Total;
|
PerSecond = Duration > 1.0f ? Total / Duration : Total;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogDebugMetricEntry::Reset()
|
void FCogDebugMetricEntry::Reset()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "CogDebugMetric.h"
|
#include "CogDebugMetric.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
|
#include "CogWindowWidgets.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -81,29 +82,32 @@ void UCogEngineWindow_Metrics::RenderContent()
|
|||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GetWorld()->GetNetMode() == ENetMode::NM_Client)
|
||||||
|
{
|
||||||
|
ImGui::Text("Currently not available on client");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (FCogDebugMetric::Metrics.IsEmpty())
|
if (FCogDebugMetric::Metrics.IsEmpty())
|
||||||
{
|
{
|
||||||
ImGui::BeginDisabled();
|
|
||||||
ImGui::Text("No metric received yet");
|
ImGui::Text("No metric received yet");
|
||||||
ImGui::EndDisabled();
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
int32 Index = 0;
|
||||||
|
for (auto& Entry : FCogDebugMetric::Metrics)
|
||||||
{
|
{
|
||||||
int32 Index = 0;
|
FName MetricName = Entry.Key;
|
||||||
for (auto& Entry : FCogDebugMetric::Metrics)
|
FCogDebugMetricEntry& Metric = Entry.Value;
|
||||||
|
|
||||||
|
if (ImGui::CollapsingHeader(TCHAR_TO_ANSI(*MetricName.ToString()), ImGuiTreeNodeFlags_DefaultOpen))
|
||||||
{
|
{
|
||||||
FName MetricName = Entry.Key;
|
ImGui::PushID(Index);
|
||||||
FCogDebugMetricEntry& Metric = Entry.Value;
|
DrawMetric(Metric);
|
||||||
|
ImGui::PopID();
|
||||||
if (ImGui::CollapsingHeader(TCHAR_TO_ANSI(*MetricName.ToString()), ImGuiTreeNodeFlags_DefaultOpen))
|
|
||||||
{
|
|
||||||
ImGui::PushID(Index);
|
|
||||||
DrawMetric(Metric);
|
|
||||||
ImGui::PopID();
|
|
||||||
}
|
|
||||||
|
|
||||||
Index++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -293,6 +293,10 @@ void UCogInputWindow_Gamepad::RenderContent()
|
|||||||
ImGui::Dummy(bShowAsOverlay ? CanvasMax - CanvasMin : ContentSize);
|
ImGui::Dummy(bShowAsOverlay ? CanvasMax - CanvasMin : ContentSize);
|
||||||
if (ImGui::BeginPopupContextItem())
|
if (ImGui::BeginPopupContextItem())
|
||||||
{
|
{
|
||||||
|
if (ImGui::Button("Close", ImVec2(-1.0f, 0)))
|
||||||
|
{
|
||||||
|
SetIsVisible(false);
|
||||||
|
}
|
||||||
ImGui::Checkbox("Overlay", &bShowAsOverlay);
|
ImGui::Checkbox("Overlay", &bShowAsOverlay);
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Checkbox("Invert Left Stick Y", &bInvertLeftStickY);
|
ImGui::Checkbox("Invert Left Stick Y", &bInvertLeftStickY);
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ private:
|
|||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float RepeatPeriod = 0.5f;
|
float RepeatPeriod = 0.5f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
|
||||||
float RepeatTime = 0.0f;
|
float RepeatTime = 0.0f;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ private:
|
|||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float Border = 0.02f;
|
float Border = 0.02f;
|
||||||
|
|
||||||
|
UPROPERTY(Config)
|
||||||
|
float RepeatPeriod = 0.5f;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
TWeakObjectPtr<const UCogInputDataAsset> Asset;
|
TWeakObjectPtr<const UCogInputDataAsset> Asset;
|
||||||
|
|
||||||
@@ -78,8 +81,6 @@ private:
|
|||||||
|
|
||||||
ImDrawList* DrawList = nullptr;
|
ImDrawList* DrawList = nullptr;
|
||||||
|
|
||||||
float RepeatPeriod = 0.5f;
|
|
||||||
|
|
||||||
float RepeatTime = 0.0f;
|
float RepeatTime = 0.0f;
|
||||||
|
|
||||||
ImVec2 CanvasMin;
|
ImVec2 CanvasMin;
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ protected:
|
|||||||
|
|
||||||
ULocalPlayer* GetLocalPlayer();
|
ULocalPlayer* GetLocalPlayer();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
bool bHasMenu = false;
|
bool bHasMenu = false;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool bIsVisible = false;
|
bool bIsVisible = false;
|
||||||
|
|
||||||
bool bShowInsideMenu = true;
|
bool bShowInsideMenu = true;
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ void ACogSampleCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >
|
|||||||
|
|
||||||
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleCharacter, ActiveAbilityHandles, Params);
|
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleCharacter, ActiveAbilityHandles, Params);
|
||||||
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleCharacter, Team, Params);
|
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleCharacter, Team, Params);
|
||||||
|
|
||||||
|
Params.Condition = COND_None;
|
||||||
|
DOREPLIFETIME_WITH_PARAMS_FAST(ACogSampleCharacter, Scale, Params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -117,7 +120,8 @@ void ACogSampleCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
|||||||
void ACogSampleCharacter::MarkComponentsAsPendingKill()
|
void ACogSampleCharacter::MarkComponentsAsPendingKill()
|
||||||
{
|
{
|
||||||
Super::MarkComponentsAsPendingKill();
|
Super::MarkComponentsAsPendingKill();
|
||||||
ShutdownAbilitySystem();
|
|
||||||
|
UnregisterFromAbilitySystemEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -262,6 +266,16 @@ void ACogSampleCharacter::InitializeAbilitySystem()
|
|||||||
MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, ActiveAbilityHandles, this);
|
MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, ActiveAbilityHandles, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bIsAbilitySystemInitialized = true;
|
||||||
|
|
||||||
|
AbilitySystem->AddLooseGameplayTags(InitialTags);
|
||||||
|
|
||||||
|
TryFinishInitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogSampleCharacter::RegisterToAbilitySystemEvents()
|
||||||
|
{
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// Register to Tag change events
|
// Register to Tag change events
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
@@ -280,32 +294,10 @@ void ACogSampleCharacter::InitializeAbilitySystem()
|
|||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
GameplayEffectAddedHandle = AbilitySystem->OnActiveGameplayEffectAddedDelegateToSelf.AddUObject(this, &ACogSampleCharacter::OnGameplayEffectAdded);
|
GameplayEffectAddedHandle = AbilitySystem->OnActiveGameplayEffectAddedDelegateToSelf.AddUObject(this, &ACogSampleCharacter::OnGameplayEffectAdded);
|
||||||
GameplayEffectRemovedHandle = AbilitySystem->OnAnyGameplayEffectRemovedDelegate().AddUObject(this, &ACogSampleCharacter::OnGameplayEffectRemoved);
|
GameplayEffectRemovedHandle = AbilitySystem->OnAnyGameplayEffectRemovedDelegate().AddUObject(this, &ACogSampleCharacter::OnGameplayEffectRemoved);
|
||||||
|
|
||||||
bIsAbilitySystemInitialized = true;
|
|
||||||
|
|
||||||
TryFinishInitialize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogSampleCharacter::TryFinishInitialize()
|
void ACogSampleCharacter::UnregisterFromAbilitySystemEvents()
|
||||||
{
|
|
||||||
if (bIsInitialized)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HasActorBegunPlay() == false)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bIsInitialized = true;
|
|
||||||
|
|
||||||
OnInitialized.Broadcast(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
void ACogSampleCharacter::ShutdownAbilitySystem()
|
|
||||||
{
|
{
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// Unregister to Attribute events
|
// Unregister to Attribute events
|
||||||
@@ -325,11 +317,29 @@ void ACogSampleCharacter::ShutdownAbilitySystem()
|
|||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
AbilitySystem->OnActiveGameplayEffectAddedDelegateToSelf.Remove(GameplayEffectAddedHandle);
|
AbilitySystem->OnActiveGameplayEffectAddedDelegateToSelf.Remove(GameplayEffectAddedHandle);
|
||||||
AbilitySystem->OnAnyGameplayEffectRemovedDelegate().Remove(GameplayEffectRemovedHandle);
|
AbilitySystem->OnAnyGameplayEffectRemovedDelegate().Remove(GameplayEffectRemovedHandle);
|
||||||
|
|
||||||
|
|
||||||
AbilitySystem->ClearActorInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogSampleCharacter::TryFinishInitialize()
|
||||||
|
{
|
||||||
|
if (bIsInitialized)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasActorBegunPlay() == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterToAbilitySystemEvents();
|
||||||
|
|
||||||
|
bIsInitialized = true;
|
||||||
|
|
||||||
|
OnInitialized.Broadcast(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogSampleCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
|
void ACogSampleCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
|
||||||
{
|
{
|
||||||
@@ -615,7 +625,15 @@ void ACogSampleCharacter::OnGhostTagNewOrRemoved(const FGameplayTag InTag, int32
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogSampleCharacter::OnScaleAttributeChanged(const FOnAttributeChangeData& Data)
|
void ACogSampleCharacter::OnScaleAttributeChanged(const FOnAttributeChangeData& Data)
|
||||||
{
|
{
|
||||||
SetActorScale3D(FVector(Data.NewValue));
|
Scale = Data.NewValue;
|
||||||
|
MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, Scale, this);
|
||||||
|
OnRep_Scale();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogSampleCharacter::OnRep_Scale()
|
||||||
|
{
|
||||||
|
SetActorScale3D(FVector(Scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
|
||||||
TArray<TSubclassOf<UGameplayEffect>> Effects;
|
TArray<TSubclassOf<UGameplayEffect>> Effects;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
|
||||||
|
FGameplayTagContainer InitialTags;
|
||||||
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FCogSampleCharacterEventDelegate OnInitialized;
|
FCogSampleCharacterEventDelegate OnInitialized;
|
||||||
|
|
||||||
@@ -261,7 +264,9 @@ private:
|
|||||||
|
|
||||||
void InitializeAbilitySystem();
|
void InitializeAbilitySystem();
|
||||||
|
|
||||||
void ShutdownAbilitySystem();
|
void RegisterToAbilitySystemEvents();
|
||||||
|
|
||||||
|
void UnregisterFromAbilitySystemEvents();
|
||||||
|
|
||||||
void OnGameplayEffectAdded(UAbilitySystemComponent* AbilitySystemComponent, const FGameplayEffectSpec& GameplayEffectSpec, FActiveGameplayEffectHandle Handle);
|
void OnGameplayEffectAdded(UAbilitySystemComponent* AbilitySystemComponent, const FGameplayEffectSpec& GameplayEffectSpec, FActiveGameplayEffectHandle Handle);
|
||||||
|
|
||||||
@@ -275,12 +280,18 @@ private:
|
|||||||
|
|
||||||
void UpdateActiveAbilitySlots();
|
void UpdateActiveAbilitySlots();
|
||||||
|
|
||||||
|
UFUNCTION()
|
||||||
|
void OnRep_Scale();
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnRep_ActiveAbilityHandles();
|
void OnRep_ActiveAbilityHandles();
|
||||||
|
|
||||||
UPROPERTY(ReplicatedUsing=OnRep_ActiveAbilityHandles, Transient)
|
UPROPERTY(ReplicatedUsing=OnRep_ActiveAbilityHandles, Transient)
|
||||||
TArray<FGameplayAbilitySpecHandle> ActiveAbilityHandles;
|
TArray<FGameplayAbilitySpecHandle> ActiveAbilityHandles;
|
||||||
|
|
||||||
|
UPROPERTY(ReplicatedUsing = OnRep_Scale, Transient)
|
||||||
|
float Scale = 1.0f;
|
||||||
|
|
||||||
FDelegateHandle GameplayEffectAddedHandle;
|
FDelegateHandle GameplayEffectAddedHandle;
|
||||||
|
|
||||||
FDelegateHandle GameplayEffectRemovedHandle;
|
FDelegateHandle GameplayEffectRemovedHandle;
|
||||||
|
|||||||
Reference in New Issue
Block a user