mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-03 05:08:13 +00:00
rename CogInterfaces to CogInterface
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
"Enabled": true
|
"Enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "CogInterfaces",
|
"Name": "CogInterface",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class CogAbility : ModuleRules
|
|||||||
{
|
{
|
||||||
"Core",
|
"Core",
|
||||||
"CogImgui",
|
"CogImgui",
|
||||||
"CogInterfaces",
|
"CogInterface",
|
||||||
"CogDebug",
|
"CogDebug",
|
||||||
"CogWindow",
|
"CogWindow",
|
||||||
"GameplayAbilities",
|
"GameplayAbilities",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "CogAbilityWindow_Cheats.h"
|
#include "CogAbilityWindow_Cheats.h"
|
||||||
|
|
||||||
#include "CogAbilityDataAsset_Cheats.h"
|
#include "CogAbilityDataAsset_Cheats.h"
|
||||||
#include "CogInterfacesAllegiance.h"
|
#include "CogInterfaceAllegianceActor.h"
|
||||||
#include "CogDebugDraw.h"
|
#include "CogDebugDraw.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "EngineUtils.h"
|
#include "EngineUtils.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "CogAbilityWindow_Damages.h"
|
#include "CogAbilityWindow_Damages.h"
|
||||||
|
|
||||||
#include "CogInterfacesDamageActor.h"
|
#include "CogInterfaceDamageActor.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
|
||||||
@@ -236,12 +236,12 @@ void UCogAbilityWindow_Damages::RenderContent()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void UCogAbilityWindow_Damages::OnSelectionChanged(AActor* OldSelection, AActor* NewSelection)
|
void UCogAbilityWindow_Damages::OnSelectionChanged(AActor* OldSelection, AActor* NewSelection)
|
||||||
{
|
{
|
||||||
if (ICogInterfacesDamageActor* DamageActor = Cast<ICogInterfacesDamageActor>(OldSelection))
|
if (ICogInterfaceDamageActor* DamageActor = Cast<ICogInterfaceDamageActor>(OldSelection))
|
||||||
{
|
{
|
||||||
DamageActor->OnDamageEvent().Remove(OnDamageEventDelegate);
|
DamageActor->OnDamageEvent().Remove(OnDamageEventDelegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ICogInterfacesDamageActor* DamageActor = Cast<ICogInterfacesDamageActor>(NewSelection))
|
if (ICogInterfaceDamageActor* DamageActor = Cast<ICogInterfaceDamageActor>(NewSelection))
|
||||||
{
|
{
|
||||||
OnDamageEventDelegate = DamageActor->OnDamageEvent().AddUObject(this, &UCogAbilityWindow_Damages::OnDamageEvent);
|
OnDamageEventDelegate = DamageActor->OnDamageEvent().AddUObject(this, &UCogAbilityWindow_Damages::OnDamageEvent);
|
||||||
}
|
}
|
||||||
@@ -257,14 +257,14 @@ void UCogAbilityWindow_Damages::GameTick(float DeltaSeconds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void UCogAbilityWindow_Damages::OnDamageEvent(const FCogInterfacesDamageParams& Params)
|
void UCogAbilityWindow_Damages::OnDamageEvent(const FCogInterfaceDamageParams& Params)
|
||||||
{
|
{
|
||||||
AActor* Selection = GetSelection();
|
AActor* Selection = GetSelection();
|
||||||
if (Params.Type == ECogInterfacesDamageEventType::DamageDealt)
|
if (Params.Type == ECogInterfaceDamageEventType::DamageDealt)
|
||||||
{
|
{
|
||||||
DamageDealtStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical);
|
DamageDealtStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical);
|
||||||
}
|
}
|
||||||
else if (Params.Type == ECogInterfacesDamageEventType::DamageReceived)
|
else if (Params.Type == ECogInterfaceDamageEventType::DamageReceived)
|
||||||
{
|
{
|
||||||
DamageReceivedStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical);
|
DamageReceivedStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "CogWindow.h"
|
#include "CogWindow.h"
|
||||||
#include "CogAbilityWindow_Damages.generated.h"
|
#include "CogAbilityWindow_Damages.generated.h"
|
||||||
|
|
||||||
struct FCogInterfacesDamageParams;
|
struct FCogInterfaceDamageParams;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
class FCogDamageInstance
|
class FCogDamageInstance
|
||||||
@@ -64,7 +64,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnDamageEvent(const FCogInterfacesDamageParams& Params);
|
void OnDamageEvent(const FCogInterfaceDamageParams& Params);
|
||||||
|
|
||||||
FCogDamageStats DamageDealtStats;
|
FCogDamageStats DamageDealtStats;
|
||||||
FCogDamageStats DamageReceivedStats;
|
FCogDamageStats DamageReceivedStats;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
"Enabled": true
|
"Enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "CogInterfaces",
|
"Name": "CogInterface",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class CogDebug : ModuleRules
|
|||||||
{
|
{
|
||||||
"Core",
|
"Core",
|
||||||
"CogImgui",
|
"CogImgui",
|
||||||
"CogInterfaces",
|
"CogInterface",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "CogDebugDraw.h"
|
#include "CogDebugDraw.h"
|
||||||
#include "CogDebugHelper.h"
|
#include "CogDebugHelper.h"
|
||||||
#include "CogInterfacesFilteredActor.h"
|
#include "CogInterfaceFilteredActor.h"
|
||||||
#include "CogImguiHelper.h"
|
#include "CogImguiHelper.h"
|
||||||
|
|
||||||
FCogDebugPlotEvent FCogDebugPlot::DefaultEvent;
|
FCogDebugPlotEvent FCogDebugPlot::DefaultEvent;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "CogDebugSettings.h"
|
#include "CogDebugSettings.h"
|
||||||
|
|
||||||
#include "CogInterfacesFilteredActor.h"
|
#include "CogInterfaceFilteredActor.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
TWeakObjectPtr<AActor> FCogDebugSettings::Selection;
|
TWeakObjectPtr<AActor> FCogDebugSettings::Selection;
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
"FileVersion": 1,
|
"FileVersion": 1,
|
||||||
"Version": 1,
|
"Version": 1,
|
||||||
"VersionName": "1.0",
|
"VersionName": "1.0",
|
||||||
"FriendlyName": "CogInterfaces",
|
"FriendlyName": "CogInterface",
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"Category": "Other",
|
"Category": "Other",
|
||||||
"CreatedBy": "Arnaud Jamin",
|
"CreatedBy": "Arnaud Jamin",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"Installed": false,
|
"Installed": false,
|
||||||
"Modules": [
|
"Modules": [
|
||||||
{
|
{
|
||||||
"Name": "CogInterfaces",
|
"Name": "CogInterface",
|
||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default"
|
"LoadingPhase": "Default"
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
using UnrealBuildTool;
|
using UnrealBuildTool;
|
||||||
|
|
||||||
public class CogInterfaces : ModuleRules
|
public class CogInterface : ModuleRules
|
||||||
{
|
{
|
||||||
public CogInterfaces(ReadOnlyTargetRules Target) : base(Target)
|
public CogInterface(ReadOnlyTargetRules Target) : base(Target)
|
||||||
{
|
{
|
||||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
+4
-4
@@ -1,17 +1,17 @@
|
|||||||
#include "CogInterfacesModule.h"
|
#include "CogInterfaceModule.h"
|
||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "FCogInterfacesModule"
|
#define LOCTEXT_NAMESPACE "FCogInterfacesModule"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogInterfacesModule::StartupModule()
|
void FCogInterfaceModule::StartupModule()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogInterfacesModule::ShutdownModule()
|
void FCogInterfaceModule::ShutdownModule()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef LOCTEXT_NAMESPACE
|
#undef LOCTEXT_NAMESPACE
|
||||||
|
|
||||||
IMPLEMENT_MODULE(FCogInterfacesModule, CogInterfaces)
|
IMPLEMENT_MODULE(FCogInterfaceModule, CogInterface)
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogInterfacesAllegiance.generated.h"
|
#include "CogInterfaceAllegianceActor.generated.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
+8
-8
@@ -1,11 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogInterfacesDamageActor.generated.h"
|
#include "CogInterfaceDamageActor.generated.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
enum class ECogInterfacesDamageEventType : uint8
|
enum class ECogInterfaceDamageEventType : uint8
|
||||||
{
|
{
|
||||||
DamageDealt,
|
DamageDealt,
|
||||||
DamageReceived,
|
DamageReceived,
|
||||||
@@ -14,11 +14,11 @@ enum class ECogInterfacesDamageEventType : uint8
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
USTRUCT()
|
USTRUCT()
|
||||||
struct FCogInterfacesDamageParams
|
struct FCogInterfaceDamageParams
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
ECogInterfacesDamageEventType Type;
|
ECogInterfaceDamageEventType Type;
|
||||||
TObjectPtr<AActor> DamageDealer;
|
TObjectPtr<AActor> DamageDealer;
|
||||||
TObjectPtr<AActor> DamageReceiver;
|
TObjectPtr<AActor> DamageReceiver;
|
||||||
float MitigatedDamage = 0;
|
float MitigatedDamage = 0;
|
||||||
@@ -27,20 +27,20 @@ struct FCogInterfacesDamageParams
|
|||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
DECLARE_MULTICAST_DELEGATE_OneParam(FCogAbilityOnDamageEvent, const FCogInterfacesDamageParams&);
|
DECLARE_MULTICAST_DELEGATE_OneParam(FCogInterfaceOnDamageEvent, const FCogInterfaceDamageParams&);
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
UINTERFACE(MinimalAPI, Blueprintable)
|
UINTERFACE(MinimalAPI, Blueprintable)
|
||||||
class UCogInterfacesDamageActor : public UInterface
|
class UCogInterfaceDamageActor : public UInterface
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
class ICogInterfacesDamageActor
|
class ICogInterfaceDamageActor
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual FCogAbilityOnDamageEvent& OnDamageEvent() = 0;
|
virtual FCogInterfaceOnDamageEvent& OnDamageEvent() = 0;
|
||||||
};
|
};
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "CogInterfacesFilteredActor.generated.h"
|
#include "CogInterfaceFilteredActor.generated.h"
|
||||||
|
|
||||||
UINTERFACE(MinimalAPI, Blueprintable)
|
UINTERFACE(MinimalAPI, Blueprintable)
|
||||||
class UCogInterfacesFilteredActor : public UInterface
|
class UCogInterfacesFilteredActor : public UInterface
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Modules/ModuleManager.h"
|
||||||
|
|
||||||
|
class COGINTERFACE_API FCogInterfaceModule : public IModuleInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static inline FCogInterfaceModule& Get() { return FModuleManager::LoadModuleChecked<FCogInterfaceModule>("CogInterface"); }
|
||||||
|
|
||||||
|
virtual void StartupModule() override;
|
||||||
|
|
||||||
|
virtual void ShutdownModule() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "Modules/ModuleManager.h"
|
|
||||||
|
|
||||||
class COGINTERFACES_API FCogInterfacesModule : public IModuleInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
static inline FCogInterfacesModule& Get() { return FModuleManager::LoadModuleChecked<FCogInterfacesModule>("CogInterfaces"); }
|
|
||||||
|
|
||||||
virtual void StartupModule() override;
|
|
||||||
|
|
||||||
virtual void ShutdownModule() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
@@ -25,7 +25,7 @@ public class CogSample : ModuleRules
|
|||||||
PublicDependencyModuleNames.AddRange(new string[]
|
PublicDependencyModuleNames.AddRange(new string[]
|
||||||
{
|
{
|
||||||
"CogImgui",
|
"CogImgui",
|
||||||
"CogInterfaces",
|
"CogInterface",
|
||||||
"CogWindow",
|
"CogWindow",
|
||||||
"CogEngine",
|
"CogEngine",
|
||||||
"CogInput",
|
"CogInput",
|
||||||
|
|||||||
@@ -348,8 +348,8 @@ void ACogSampleCharacter::Look(const FInputActionValue& Value)
|
|||||||
void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingDamage, AActor* DamageDealer, const FGameplayEffectSpec& EffectSpec)
|
void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingDamage, AActor* DamageDealer, const FGameplayEffectSpec& EffectSpec)
|
||||||
{
|
{
|
||||||
#if USE_COG
|
#if USE_COG
|
||||||
FCogInterfacesDamageParams Params;
|
FCogInterfaceDamageParams Params;
|
||||||
Params.Type = ECogInterfacesDamageEventType::DamageReceived;
|
Params.Type = ECogInterfaceDamageEventType::DamageReceived;
|
||||||
Params.MitigatedDamage = ReceivedDamage;
|
Params.MitigatedDamage = ReceivedDamage;
|
||||||
Params.IncomingDamage = IncomingDamage;
|
Params.IncomingDamage = IncomingDamage;
|
||||||
Params.DamageDealer = DamageDealer;
|
Params.DamageDealer = DamageDealer;
|
||||||
@@ -362,8 +362,8 @@ void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingD
|
|||||||
void ACogSampleCharacter::OnDamageDealt(float ReceivedDamage, float IncomingDamage, AActor* DamageReceiver, const FGameplayEffectSpec& EffectSpec)
|
void ACogSampleCharacter::OnDamageDealt(float ReceivedDamage, float IncomingDamage, AActor* DamageReceiver, const FGameplayEffectSpec& EffectSpec)
|
||||||
{
|
{
|
||||||
#if USE_COG
|
#if USE_COG
|
||||||
FCogInterfacesDamageParams Params;
|
FCogInterfaceDamageParams Params;
|
||||||
Params.Type = ECogInterfacesDamageEventType::DamageDealt;
|
Params.Type = ECogInterfaceDamageEventType::DamageDealt;
|
||||||
Params.MitigatedDamage = ReceivedDamage;
|
Params.MitigatedDamage = ReceivedDamage;
|
||||||
Params.IncomingDamage = IncomingDamage;
|
Params.IncomingDamage = IncomingDamage;
|
||||||
Params.DamageDealer = this;
|
Params.DamageDealer = this;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
#include "ActiveGameplayEffectHandle.h"
|
#include "ActiveGameplayEffectHandle.h"
|
||||||
#include "AttributeSet.h"
|
#include "AttributeSet.h"
|
||||||
#include "CogDefines.h"
|
#include "CogDefines.h"
|
||||||
#include "CogInterfacesDamageActor.h"
|
#include "CogInterfaceDamageActor.h"
|
||||||
#include "CogInterfacesFilteredActor.h"
|
#include "CogInterfaceFilteredActor.h"
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "GameplayAbilitySpecHandle.h"
|
#include "GameplayAbilitySpecHandle.h"
|
||||||
#include "GameplayTagContainer.h"
|
#include "GameplayTagContainer.h"
|
||||||
@@ -59,7 +59,7 @@ UCLASS(config=Game)
|
|||||||
class ACogSampleCharacter : public ACharacter
|
class ACogSampleCharacter : public ACharacter
|
||||||
, public IAbilitySystemInterface
|
, public IAbilitySystemInterface
|
||||||
, public ICogInterfacesFilteredActor
|
, public ICogInterfacesFilteredActor
|
||||||
, public ICogInterfacesDamageActor
|
, public ICogInterfaceDamageActor
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
virtual void PossessedBy(AController* NewController) override;
|
virtual void PossessedBy(AController* NewController) override;
|
||||||
|
|
||||||
virtual FCogAbilityOnDamageEvent& OnDamageEvent() override { return OnDamageEventDelegate; }
|
virtual FCogInterfaceOnDamageEvent& OnDamageEvent() override { return OnDamageEventDelegate; }
|
||||||
virtual bool IsActorFilteringDebug() const override { return true; }
|
virtual bool IsActorFilteringDebug() const override { return true; }
|
||||||
|
|
||||||
void OnAcknowledgePossession(APlayerController* InController);
|
void OnAcknowledgePossession(APlayerController* InController);
|
||||||
@@ -146,7 +146,7 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
|
||||||
TArray<TSubclassOf<UGameplayEffect>> Effects;
|
TArray<TSubclassOf<UGameplayEffect>> Effects;
|
||||||
|
|
||||||
FCogAbilityOnDamageEvent OnDamageEventDelegate;
|
FCogInterfaceOnDamageEvent OnDamageEventDelegate;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user