From bd6c7be5ca94acd22b2811a1ed3d46226ba83db8 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Mon, 2 Oct 2023 23:49:10 -0400 Subject: [PATCH] rename CogInterfaces to CogInterface --- Plugins/CogAbility/CogAbility.uplugin | 2 +- .../Source/CogAbility/CogAbility.Build.cs | 2 +- .../Private/CogAbilityWindow_Cheats.cpp | 2 +- .../Private/CogAbilityWindow_Damages.cpp | 12 ++++++------ .../Public/CogAbilityWindow_Damages.h | 4 ++-- Plugins/CogDebug/CogDebug.uplugin | 2 +- .../CogDebug/Source/CogDebug/CogDebug.Build.cs | 2 +- .../Source/CogDebug/Private/CogDebugPlot.cpp | 2 +- .../CogDebug/Private/CogDebugSettings.cpp | 2 +- .../CogInterface.uplugin} | 4 ++-- .../Resources/Icon128.png | Bin .../Source/CogInterface/CogInterface.Build.cs} | 4 ++-- .../Private/CogInterfaceModule.cpp} | 8 ++++---- .../Public/CogInterfaceAllegianceActor.h} | 2 +- .../Public/CogInterfaceDamageActor.h} | 16 ++++++++-------- .../Public/CogInterfaceFilteredActor.h} | 2 +- .../CogInterface/Public/CogInterfaceModule.h | 17 +++++++++++++++++ .../CogInterfaces/Public/CogInterfacesModule.h | 17 ----------------- Source/CogSample/CogSample.Build.cs | 2 +- Source/CogSample/CogSampleCharacter.cpp | 8 ++++---- Source/CogSample/CogSampleCharacter.h | 10 +++++----- 21 files changed, 60 insertions(+), 60 deletions(-) rename Plugins/{CogInterfaces/CogInterfaces.uplugin => CogInterface/CogInterface.uplugin} (86%) rename Plugins/{CogInterfaces => CogInterface}/Resources/Icon128.png (100%) rename Plugins/{CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs => CogInterface/Source/CogInterface/CogInterface.Build.cs} (83%) rename Plugins/{CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp => CogInterface/Source/CogInterface/Private/CogInterfaceModule.cpp} (66%) rename Plugins/{CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h => CogInterface/Source/CogInterface/Public/CogInterfaceAllegianceActor.h} (93%) rename Plugins/{CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h => CogInterface/Source/CogInterface/Public/CogInterfaceDamageActor.h} (71%) rename Plugins/{CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h => CogInterface/Source/CogInterface/Public/CogInterfaceFilteredActor.h} (85%) create mode 100644 Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceModule.h delete mode 100644 Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h diff --git a/Plugins/CogAbility/CogAbility.uplugin b/Plugins/CogAbility/CogAbility.uplugin index 4388429..a1b7e00 100644 --- a/Plugins/CogAbility/CogAbility.uplugin +++ b/Plugins/CogAbility/CogAbility.uplugin @@ -27,7 +27,7 @@ "Enabled": true }, { - "Name": "CogInterfaces", + "Name": "CogInterface", "Enabled": true }, { diff --git a/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs b/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs index 803a161..65bb171 100644 --- a/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs +++ b/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs @@ -23,7 +23,7 @@ public class CogAbility : ModuleRules { "Core", "CogImgui", - "CogInterfaces", + "CogInterface", "CogDebug", "CogWindow", "GameplayAbilities", diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp index 3a73938..51b0179 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp @@ -1,7 +1,7 @@ #include "CogAbilityWindow_Cheats.h" #include "CogAbilityDataAsset_Cheats.h" -#include "CogInterfacesAllegiance.h" +#include "CogInterfaceAllegianceActor.h" #include "CogDebugDraw.h" #include "CogImguiHelper.h" #include "EngineUtils.h" diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp index b83bab1..a1cc587 100644 --- a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp +++ b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp @@ -1,6 +1,6 @@ #include "CogAbilityWindow_Damages.h" -#include "CogInterfacesDamageActor.h" +#include "CogInterfaceDamageActor.h" #include "CogImguiHelper.h" #include "imgui.h" @@ -236,12 +236,12 @@ void UCogAbilityWindow_Damages::RenderContent() //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Damages::OnSelectionChanged(AActor* OldSelection, AActor* NewSelection) { - if (ICogInterfacesDamageActor* DamageActor = Cast(OldSelection)) + if (ICogInterfaceDamageActor* DamageActor = Cast(OldSelection)) { DamageActor->OnDamageEvent().Remove(OnDamageEventDelegate); } - if (ICogInterfacesDamageActor* DamageActor = Cast(NewSelection)) + if (ICogInterfaceDamageActor* DamageActor = Cast(NewSelection)) { 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(); - if (Params.Type == ECogInterfacesDamageEventType::DamageDealt) + if (Params.Type == ECogInterfaceDamageEventType::DamageDealt) { 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); } diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h index 2abad20..6c3951f 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h +++ b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h @@ -4,7 +4,7 @@ #include "CogWindow.h" #include "CogAbilityWindow_Damages.generated.h" -struct FCogInterfacesDamageParams; +struct FCogInterfaceDamageParams; //-------------------------------------------------------------------------------------------------------------------------- class FCogDamageInstance @@ -64,7 +64,7 @@ protected: private: UFUNCTION() - void OnDamageEvent(const FCogInterfacesDamageParams& Params); + void OnDamageEvent(const FCogInterfaceDamageParams& Params); FCogDamageStats DamageDealtStats; FCogDamageStats DamageReceivedStats; diff --git a/Plugins/CogDebug/CogDebug.uplugin b/Plugins/CogDebug/CogDebug.uplugin index 3d1a827..3953e44 100644 --- a/Plugins/CogDebug/CogDebug.uplugin +++ b/Plugins/CogDebug/CogDebug.uplugin @@ -32,7 +32,7 @@ "Enabled": true }, { - "Name": "CogInterfaces", + "Name": "CogInterface", "Enabled": true } ] diff --git a/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs b/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs index 30284bc..12d9968 100644 --- a/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs +++ b/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs @@ -23,7 +23,7 @@ public class CogDebug : ModuleRules { "Core", "CogImgui", - "CogInterfaces", + "CogInterface", } ); diff --git a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp index 4e2d82c..db96271 100644 --- a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp +++ b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp @@ -2,7 +2,7 @@ #include "CogDebugDraw.h" #include "CogDebugHelper.h" -#include "CogInterfacesFilteredActor.h" +#include "CogInterfaceFilteredActor.h" #include "CogImguiHelper.h" FCogDebugPlotEvent FCogDebugPlot::DefaultEvent; diff --git a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp index e358496..124a462 100644 --- a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp +++ b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp @@ -1,6 +1,6 @@ #include "CogDebugSettings.h" -#include "CogInterfacesFilteredActor.h" +#include "CogInterfaceFilteredActor.h" //-------------------------------------------------------------------------------------------------------------------------- TWeakObjectPtr FCogDebugSettings::Selection; diff --git a/Plugins/CogInterfaces/CogInterfaces.uplugin b/Plugins/CogInterface/CogInterface.uplugin similarity index 86% rename from Plugins/CogInterfaces/CogInterfaces.uplugin rename to Plugins/CogInterface/CogInterface.uplugin index 4b4c3e7..c690e32 100644 --- a/Plugins/CogInterfaces/CogInterfaces.uplugin +++ b/Plugins/CogInterface/CogInterface.uplugin @@ -2,7 +2,7 @@ "FileVersion": 1, "Version": 1, "VersionName": "1.0", - "FriendlyName": "CogInterfaces", + "FriendlyName": "CogInterface", "Description": "", "Category": "Other", "CreatedBy": "Arnaud Jamin", @@ -16,7 +16,7 @@ "Installed": false, "Modules": [ { - "Name": "CogInterfaces", + "Name": "CogInterface", "Type": "Runtime", "LoadingPhase": "Default" } diff --git a/Plugins/CogInterfaces/Resources/Icon128.png b/Plugins/CogInterface/Resources/Icon128.png similarity index 100% rename from Plugins/CogInterfaces/Resources/Icon128.png rename to Plugins/CogInterface/Resources/Icon128.png diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs b/Plugins/CogInterface/Source/CogInterface/CogInterface.Build.cs similarity index 83% rename from Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs rename to Plugins/CogInterface/Source/CogInterface/CogInterface.Build.cs index 68c66ac..361a77c 100644 --- a/Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs +++ b/Plugins/CogInterface/Source/CogInterface/CogInterface.Build.cs @@ -1,8 +1,8 @@ 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; diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp b/Plugins/CogInterface/Source/CogInterface/Private/CogInterfaceModule.cpp similarity index 66% rename from Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp rename to Plugins/CogInterface/Source/CogInterface/Private/CogInterfaceModule.cpp index 2a66e3b..238cffe 100644 --- a/Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp +++ b/Plugins/CogInterface/Source/CogInterface/Private/CogInterfaceModule.cpp @@ -1,17 +1,17 @@ -#include "CogInterfacesModule.h" +#include "CogInterfaceModule.h" #define LOCTEXT_NAMESPACE "FCogInterfacesModule" //-------------------------------------------------------------------------------------------------------------------------- -void FCogInterfacesModule::StartupModule() +void FCogInterfaceModule::StartupModule() { } //-------------------------------------------------------------------------------------------------------------------------- -void FCogInterfacesModule::ShutdownModule() +void FCogInterfaceModule::ShutdownModule() { } #undef LOCTEXT_NAMESPACE -IMPLEMENT_MODULE(FCogInterfacesModule, CogInterfaces) \ No newline at end of file +IMPLEMENT_MODULE(FCogInterfaceModule, CogInterface) \ No newline at end of file diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceAllegianceActor.h similarity index 93% rename from Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h rename to Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceAllegianceActor.h index f0ca125..b473d02 100644 --- a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h +++ b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceAllegianceActor.h @@ -1,7 +1,7 @@ #pragma once #include "CoreMinimal.h" -#include "CogInterfacesAllegiance.generated.h" +#include "CogInterfaceAllegianceActor.generated.h" //-------------------------------------------------------------------------------------------------------------------------- UENUM(BlueprintType) diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceDamageActor.h similarity index 71% rename from Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h rename to Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceDamageActor.h index c67c20b..dc5348f 100644 --- a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h +++ b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceDamageActor.h @@ -1,11 +1,11 @@ #pragma once #include "CoreMinimal.h" -#include "CogInterfacesDamageActor.generated.h" +#include "CogInterfaceDamageActor.generated.h" //-------------------------------------------------------------------------------------------------------------------------- UENUM(BlueprintType) -enum class ECogInterfacesDamageEventType : uint8 +enum class ECogInterfaceDamageEventType : uint8 { DamageDealt, DamageReceived, @@ -14,11 +14,11 @@ enum class ECogInterfacesDamageEventType : uint8 //-------------------------------------------------------------------------------------------------------------------------- USTRUCT() -struct FCogInterfacesDamageParams +struct FCogInterfaceDamageParams { GENERATED_BODY() - ECogInterfacesDamageEventType Type; + ECogInterfaceDamageEventType Type; TObjectPtr DamageDealer; TObjectPtr DamageReceiver; 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) -class UCogInterfacesDamageActor : public UInterface +class UCogInterfaceDamageActor : public UInterface { GENERATED_BODY() }; //-------------------------------------------------------------------------------------------------------------------------- -class ICogInterfacesDamageActor +class ICogInterfaceDamageActor { GENERATED_BODY() public: - virtual FCogAbilityOnDamageEvent& OnDamageEvent() = 0; + virtual FCogInterfaceOnDamageEvent& OnDamageEvent() = 0; }; \ No newline at end of file diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceFilteredActor.h similarity index 85% rename from Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h rename to Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceFilteredActor.h index fc2822e..de13c0f 100644 --- a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h +++ b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceFilteredActor.h @@ -1,7 +1,7 @@ #pragma once #include "CoreMinimal.h" -#include "CogInterfacesFilteredActor.generated.h" +#include "CogInterfaceFilteredActor.generated.h" UINTERFACE(MinimalAPI, Blueprintable) class UCogInterfacesFilteredActor : public UInterface diff --git a/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceModule.h b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceModule.h new file mode 100644 index 0000000..f93b9f7 --- /dev/null +++ b/Plugins/CogInterface/Source/CogInterface/Public/CogInterfaceModule.h @@ -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("CogInterface"); } + + virtual void StartupModule() override; + + virtual void ShutdownModule() override; + +private: +}; diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h deleted file mode 100644 index 9d22e37..0000000 --- a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h +++ /dev/null @@ -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("CogInterfaces"); } - - virtual void StartupModule() override; - - virtual void ShutdownModule() override; - -private: -}; diff --git a/Source/CogSample/CogSample.Build.cs b/Source/CogSample/CogSample.Build.cs index d1524c8..04328f7 100644 --- a/Source/CogSample/CogSample.Build.cs +++ b/Source/CogSample/CogSample.Build.cs @@ -25,7 +25,7 @@ public class CogSample : ModuleRules PublicDependencyModuleNames.AddRange(new string[] { "CogImgui", - "CogInterfaces", + "CogInterface", "CogWindow", "CogEngine", "CogInput", diff --git a/Source/CogSample/CogSampleCharacter.cpp b/Source/CogSample/CogSampleCharacter.cpp index 2a8e9c0..29753ea 100644 --- a/Source/CogSample/CogSampleCharacter.cpp +++ b/Source/CogSample/CogSampleCharacter.cpp @@ -348,8 +348,8 @@ void ACogSampleCharacter::Look(const FInputActionValue& Value) void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingDamage, AActor* DamageDealer, const FGameplayEffectSpec& EffectSpec) { #if USE_COG - FCogInterfacesDamageParams Params; - Params.Type = ECogInterfacesDamageEventType::DamageReceived; + FCogInterfaceDamageParams Params; + Params.Type = ECogInterfaceDamageEventType::DamageReceived; Params.MitigatedDamage = ReceivedDamage; Params.IncomingDamage = IncomingDamage; 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) { #if USE_COG - FCogInterfacesDamageParams Params; - Params.Type = ECogInterfacesDamageEventType::DamageDealt; + FCogInterfaceDamageParams Params; + Params.Type = ECogInterfaceDamageEventType::DamageDealt; Params.MitigatedDamage = ReceivedDamage; Params.IncomingDamage = IncomingDamage; Params.DamageDealer = this; diff --git a/Source/CogSample/CogSampleCharacter.h b/Source/CogSample/CogSampleCharacter.h index 2b845ba..9890554 100644 --- a/Source/CogSample/CogSampleCharacter.h +++ b/Source/CogSample/CogSampleCharacter.h @@ -5,8 +5,8 @@ #include "ActiveGameplayEffectHandle.h" #include "AttributeSet.h" #include "CogDefines.h" -#include "CogInterfacesDamageActor.h" -#include "CogInterfacesFilteredActor.h" +#include "CogInterfaceDamageActor.h" +#include "CogInterfaceFilteredActor.h" #include "GameFramework/Character.h" #include "GameplayAbilitySpecHandle.h" #include "GameplayTagContainer.h" @@ -59,7 +59,7 @@ UCLASS(config=Game) class ACogSampleCharacter : public ACharacter , public IAbilitySystemInterface , public ICogInterfacesFilteredActor - , public ICogInterfacesDamageActor + , public ICogInterfaceDamageActor { GENERATED_BODY() @@ -75,7 +75,7 @@ public: virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) 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; } void OnAcknowledgePossession(APlayerController* InController); @@ -146,7 +146,7 @@ public: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability) TArray> Effects; - FCogAbilityOnDamageEvent OnDamageEventDelegate; + FCogInterfaceOnDamageEvent OnDamageEventDelegate; private: