From 81540a77f00f1e3a6af937c0173ef1a96eb02432 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Mon, 2 Oct 2023 17:27:19 -0400 Subject: [PATCH] Add CogInterfaces plugin to fix interface usage when compiling shipping builds --- .../Characters/Children/Hero1/BP_Hero1.uasset | Bin 44365 -> 44554 bytes .../Characters/Children/Hero2/BP_Hero2.uasset | Bin 44665 -> 44665 bytes Content/Core/Debug/DA_Debug_Spawns.uasset | Bin 3164 -> 3164 bytes Plugins/CogAbility/CogAbility.uplugin | 4 ++ .../Source/CogAbility/CogAbility.Build.cs | 1 + .../Private/CogAbilityWindow_Cheats.cpp | 10 ++-- .../Private/CogAbilityWindow_Damages.cpp | 32 ++++++------- .../Public/CogAbilityWindow_Damages.h | 12 +++-- Plugins/CogDebug/CogDebug.uplugin | 4 ++ .../Source/CogDebug/CogDebug.Build.cs | 5 +- .../Private/CogDebugLogCategoryManager.cpp | 31 +++++++++++- .../Source/CogDebug/Private/CogDebugPlot.cpp | 4 +- .../CogDebug/Private/CogDebugSettings.cpp | 4 +- .../Public/CogDebugLogCategoryManager.h | 5 +- .../Private/CogEngineWindow_LogCategories.cpp | 2 +- .../Private/CogEngineWindow_Stats.cpp | 6 ++- Plugins/CogInterfaces/CogInterfaces.uplugin | 26 +++++++++++ Plugins/CogInterfaces/Resources/Icon128.png | Bin 0 -> 12699 bytes .../CogInterfaces/CogInterfaces.Build.cs | 44 ++++++++++++++++++ .../Private/CogInterfacesModule.cpp | 17 +++++++ .../Public/CogInterfacesAllegiance.h} | 10 ++-- .../Public/CogInterfacesDamageActor.h} | 22 ++++++--- .../Public/CogInterfacesFilteredActor.h} | 6 +-- .../Public/CogInterfacesModule.h | 17 +++++++ Source/CogSample/CogSample.Build.cs | 1 + Source/CogSample/CogSampleCharacter.cpp | 10 ++-- Source/CogSample/CogSampleCharacter.h | 21 ++------- .../CogSampleCharacterMovementComponent.cpp | 12 +++-- Source/CogSample/CogSampleLogCategories.cpp | 18 +++++-- Source/CogSample/CogSampleLogCategories.h | 4 ++ 30 files changed, 247 insertions(+), 81 deletions(-) create mode 100644 Plugins/CogInterfaces/CogInterfaces.uplugin create mode 100644 Plugins/CogInterfaces/Resources/Icon128.png create mode 100644 Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs create mode 100644 Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp rename Plugins/{CogDebug/Source/CogDebug/Public/CogDebugAllegianceInterface.h => CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h} (67%) rename Plugins/{CogAbility/Source/CogAbility/Public/CogAbilityDamageActorInterface.h => CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h} (64%) rename Plugins/{CogDebug/Source/CogDebug/Public/CogDebugFilteredActorInterface.h => CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h} (56%) create mode 100644 Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h diff --git a/Content/Characters/Children/Hero1/BP_Hero1.uasset b/Content/Characters/Children/Hero1/BP_Hero1.uasset index 70a31fb24924adbfc305c2f679cb2b35195dc114..1827bcd5cb9e9a26cf651ffa71f63e5f56fd6715 100644 GIT binary patch delta 2572 zcmZuzeNYr-7~fqux)X0Yyn|cLl?6HOpt88B$d5k~bP6cUgqlXjKrJUMCltyLgj-Go z(v;uX09!@6+AroIe>VRWbC!Qm-O|Qqf?sEqb_V%%Ewh&_=xyK8U2)9+y9!(q%IHiWe}YwYi7o9NRD#x1Lt3pyMq_wmYGiH(NGP=1cf9US(o* z&HMy~v2Lc!1vF9#e>K`kCc7C%?IJ~HhlVm$r00BtIXkr+i&p78l<`h@&SADz8fw>S zI%~D&0ka>{Sc^krp~N9tYv}BA)HJ9XyV;_%u$b(}ZVuD6XganAg7N6tkZ~G94kbgc zaSCjS;WbX-S|4aN^vWlZeLEr>6Or8%k=-1Tt&Ye#BC_=wtMA|>WIDt5gp4q8cEtG- zEh}t4JrUX7N$d%%P@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dNsb||bZVVyUWXhwYmJRY8XY0pChAr!>+Jwz~zg6WQ=f;4%F@_e4nJt_;9L@zlC z{RqZ74S*EzY<7^-({p6Gbis z*K3Cm!iCea61UZwFuXI}qbSUxKpd0>+r1)}gRmFMeLP#NK&MZHsL#%34Jj4)MEPTA z0pjP`vLXF+ZsH--`fcp*D)JXv>776yS_%Cg7Gc6)CT8JCCrIffL~jUsAzi~Uhyf=& z8?YDA^aWKwYn3f<{5Lk^_&T%)&dKU8appg4P-z#rqkQ>?!CoUOme}<5gXKm9a5rsnvg$Wv~^D2H~r@Ok(%?iR8Qur=7+8{SWcd{{bE18ms^S diff --git a/Content/Characters/Children/Hero2/BP_Hero2.uasset b/Content/Characters/Children/Hero2/BP_Hero2.uasset index 7c16939979b1a64fc491b67f26017f98e8c5efa3..3ebdd58c50c722f215902c6e3707ce4ab7e6a37b 100644 GIT binary patch delta 54 zcmV-60LlOP+yeRB07{M~v*N3l0_R5>_y7O^ delta 54 zcmV-60LlOP+yeRB0D} Ag#Z8m diff --git a/Plugins/CogAbility/CogAbility.uplugin b/Plugins/CogAbility/CogAbility.uplugin index adce5c1..4388429 100644 --- a/Plugins/CogAbility/CogAbility.uplugin +++ b/Plugins/CogAbility/CogAbility.uplugin @@ -26,6 +26,10 @@ "Name": "CogImgui", "Enabled": true }, + { + "Name": "CogInterfaces", + "Enabled": true + }, { "Name": "CogDebug", "Enabled": true diff --git a/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs b/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs index 66c42db..803a161 100644 --- a/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs +++ b/Plugins/CogAbility/Source/CogAbility/CogAbility.Build.cs @@ -23,6 +23,7 @@ public class CogAbility : ModuleRules { "Core", "CogImgui", + "CogInterfaces", "CogDebug", "CogWindow", "GameplayAbilities", diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Cheats.cpp index a923fd6..3a73938 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 "CogDebugAllegianceInterface.h" +#include "CogInterfacesAllegiance.h" #include "CogDebugDraw.h" #include "CogImguiHelper.h" #include "EngineUtils.h" @@ -142,15 +142,15 @@ void UCogAbilityWindow_Cheats::RequestCheat(AActor* CheatInstigator, AActor* Sel { if (AActor* OtherActor = *It) { - ECogAllegiance Allegiance = ECogAllegiance::Enemy; + ECogInterfacesAllegiance Allegiance = ECogInterfacesAllegiance::Enemy; - if (ICogAllegianceInterface* AllegianceInterface = Cast(OtherActor)) + if (ICogInterfacesAllegianceActor* AllegianceInterface = Cast(OtherActor)) { AllegianceInterface->GetAllegiance(CheatInstigator); } - if ((IsShiftDown && (Allegiance == ECogAllegiance::Enemy)) - || (IsAltDown && (Allegiance == ECogAllegiance::Ally))) + if ((IsShiftDown && (Allegiance == ECogInterfacesAllegiance::Enemy)) + || (IsAltDown && (Allegiance == ECogInterfacesAllegiance::Ally))) { Actors.Add(OtherActor); } diff --git a/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp b/Plugins/CogAbility/Source/CogAbility/Private/CogAbilityWindow_Damages.cpp index c1c8eb0..b83bab1 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 "CogAbilityDamageActorInterface.h" +#include "CogInterfacesDamageActor.h" #include "CogImguiHelper.h" #include "imgui.h" @@ -149,6 +149,10 @@ static void DrawDamages(FCogDamageStats& Damage) ImGui::EndTable(); } + ImGui::Text("Timer"); + ImGui::SameLine(FCogWindowWidgets::TextBaseWidth * 20); + ImGui::Text("%0.2f", Damage.Timer); + ImGui::Text("Crits"); ImGui::SameLine(FCogWindowWidgets::TextBaseWidth * 20); FCogWindowWidgets::ProgressBarCentered(Damage.Count == 0 ? 0.0f : Damage.Crits / (float)Damage.Count, ImVec2(-1, 0), TCHAR_TO_ANSI(*FString::Printf(TEXT("%d / %d"), Damage.Crits, Damage.Count))); @@ -173,11 +177,6 @@ static void DrawDamages(FCogDamageStats& Damage) ImGui::Spacing(); } -//-------------------------------------------------------------------------------------------------------------------------- -UCogAbilityWindow_Damages::UCogAbilityWindow_Damages() -{ -} - //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Damages::RenderContent() { @@ -237,39 +236,36 @@ void UCogAbilityWindow_Damages::RenderContent() //-------------------------------------------------------------------------------------------------------------------------- void UCogAbilityWindow_Damages::OnSelectionChanged(AActor* OldSelection, AActor* NewSelection) { - if (ICogAbilityDamageActorInterface* DamageActor = Cast(OldSelection)) + if (ICogInterfacesDamageActor* DamageActor = Cast(OldSelection)) { DamageActor->OnDamageEvent().Remove(OnDamageEventDelegate); } - if (ICogAbilityDamageActorInterface* DamageActor = Cast(NewSelection)) + if (ICogInterfacesDamageActor* DamageActor = Cast(NewSelection)) { OnDamageEventDelegate = DamageActor->OnDamageEvent().AddUObject(this, &UCogAbilityWindow_Damages::OnDamageEvent); } } //-------------------------------------------------------------------------------------------------------------------------- -void UCogAbilityWindow_Damages::RenderTick(float DeltaSeconds) +void UCogAbilityWindow_Damages::GameTick(float DeltaSeconds) { - Super::RenderTick(DeltaSeconds); + Super::GameTick(DeltaSeconds); DamageReceivedStats.Tick(DeltaSeconds); DamageDealtStats.Tick(DeltaSeconds); } //-------------------------------------------------------------------------------------------------------------------------- -void UCogAbilityWindow_Damages::OnDamageEvent(const FCogAbilityDamageParams& Params) +void UCogAbilityWindow_Damages::OnDamageEvent(const FCogInterfacesDamageParams& Params) { - DamageDealtStats.Restart(); - DamageReceivedStats.Restart(); - AActor* Selection = GetSelection(); - if (Selection == Params.DamageDealer.Get()) + if (Params.Type == ECogInterfacesDamageEventType::DamageDealt) { - DamageDealtStats.AddDamage(Params.ReceivedDamage, Params.IncomingDamage, Params.IsCritical); + DamageDealtStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical); } - else if (Selection == Params.DamageReceiver.Get()) + else if (Params.Type == ECogInterfacesDamageEventType::DamageReceived) { - DamageReceivedStats.AddDamage(Params.ReceivedDamage, Params.IncomingDamage, Params.IsCritical); + DamageReceivedStats.AddDamage(Params.MitigatedDamage, Params.IncomingDamage, Params.IsCritical); } } \ No newline at end of file diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h b/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityWindow_Damages.h index a64f459..2abad20 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 FCogAbilityDamageParams; +struct FCogInterfacesDamageParams; //-------------------------------------------------------------------------------------------------------------------------- class FCogDamageInstance @@ -52,17 +52,19 @@ class COGABILITY_API UCogAbilityWindow_Damages : public UCogWindow GENERATED_BODY() public: - UCogAbilityWindow_Damages(); - virtual void RenderContent() override; - virtual void RenderTick(float DeltaSeconds) override; protected: + + virtual void RenderContent() override; + + virtual void GameTick(float DeltaSeconds) override; + virtual void OnSelectionChanged(AActor* OldSelection, AActor* NewSelection) override; private: UFUNCTION() - void OnDamageEvent(const FCogAbilityDamageParams& Params); + void OnDamageEvent(const FCogInterfacesDamageParams& Params); FCogDamageStats DamageDealtStats; FCogDamageStats DamageReceivedStats; diff --git a/Plugins/CogDebug/CogDebug.uplugin b/Plugins/CogDebug/CogDebug.uplugin index 7f6bc71..3d1a827 100644 --- a/Plugins/CogDebug/CogDebug.uplugin +++ b/Plugins/CogDebug/CogDebug.uplugin @@ -30,6 +30,10 @@ { "Name": "CogImgui", "Enabled": true + }, + { + "Name": "CogInterfaces", + "Enabled": true } ] } \ No newline at end of file diff --git a/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs b/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs index c1ab114..30284bc 100644 --- a/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs +++ b/Plugins/CogDebug/Source/CogDebug/CogDebug.Build.cs @@ -22,8 +22,9 @@ public class CogDebug : ModuleRules new string[] { "Core", - "CogImgui" - } + "CogImgui", + "CogInterfaces", + } ); diff --git a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugLogCategoryManager.cpp b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugLogCategoryManager.cpp index 8aefe18..536e34b 100644 --- a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugLogCategoryManager.cpp +++ b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugLogCategoryManager.cpp @@ -12,10 +12,37 @@ DEFINE_LOG_CATEGORY(LogCogServerDebug); TMap FCogDebugLogCategoryManager::LogCategories; + //-------------------------------------------------------------------------------------------------------------------------- -void FCogDebugLogCategoryManager::AddLogCategory(FLogCategoryBase& LogCategory) +// FCogDebugLogCategoryInfo +//-------------------------------------------------------------------------------------------------------------------------- +FString FCogDebugLogCategoryInfo::GetDisplayName() const { - LogCategories.Add(LogCategory.GetCategoryName(), FCogDebugLogCategoryInfo{ &LogCategory, ELogVerbosity::NumVerbosity }); + if (DisplayName.IsEmpty() == false) + { + return DisplayName; + } + + if (LogCategory != nullptr) + { + return LogCategory->GetCategoryName().ToString(); + } + + return FString("Invalid"); +} + +//-------------------------------------------------------------------------------------------------------------------------- +// FCogDebugLogCategoryManager +//-------------------------------------------------------------------------------------------------------------------------- +void FCogDebugLogCategoryManager::AddLogCategory(FLogCategoryBase& LogCategory, const FString& DisplayName) +{ + LogCategories.Add(LogCategory.GetCategoryName(), + FCogDebugLogCategoryInfo + { + &LogCategory, + ELogVerbosity::NumVerbosity, + DisplayName, + }); } //-------------------------------------------------------------------------------------------------------------------------- diff --git a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp index 4ee7d03..4e2d82c 100644 --- a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp +++ b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugPlot.cpp @@ -1,8 +1,8 @@ #include "CogDebugPlot.h" -#include "CogDebugFilteredActorInterface.h" #include "CogDebugDraw.h" #include "CogDebugHelper.h" +#include "CogInterfacesFilteredActor.h" #include "CogImguiHelper.h" FCogDebugPlotEvent FCogDebugPlot::DefaultEvent; @@ -427,7 +427,7 @@ FCogDebugPlotEntry* FCogDebugPlot::RegisterPlot(const UObject* WorldContextObjec //--------------------------------------------------------------------------------- // Cast to ICogActorFilteringDebugInterface to know if we should filter //--------------------------------------------------------------------------------- - if (Cast(WorldContextObject)) + if (Cast(WorldContextObject)) { if (WorldContextObject != FCogDebugSettings::GetSelection()) { diff --git a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp index 9961ec8..e358496 100644 --- a/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp +++ b/Plugins/CogDebug/Source/CogDebug/Private/CogDebugSettings.cpp @@ -1,5 +1,7 @@ #include "CogDebugSettings.h" +#include "CogInterfacesFilteredActor.h" + //-------------------------------------------------------------------------------------------------------------------------- TWeakObjectPtr FCogDebugSettings::Selection; bool FCogDebugSettings::FilterBySelection = true; @@ -72,7 +74,7 @@ bool FCogDebugSettings::IsDebugActiveForActor(const AActor* Actor) return true; } - if (Cast(Actor)) + if (Cast(Actor)) { return (SelectionPtr == Actor || FilterBySelection == false); } diff --git a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugLogCategoryManager.h b/Plugins/CogDebug/Source/CogDebug/Public/CogDebugLogCategoryManager.h index ccbb266..2d15edb 100644 --- a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugLogCategoryManager.h +++ b/Plugins/CogDebug/Source/CogDebug/Public/CogDebugLogCategoryManager.h @@ -13,12 +13,15 @@ struct COGDEBUG_API FCogDebugLogCategoryInfo { FLogCategoryBase* LogCategory = nullptr; ELogVerbosity::Type ServerVerbosity = ELogVerbosity::NoLogging; + FString DisplayName; + + FString GetDisplayName() const; }; //-------------------------------------------------------------------------------------------------------------------------- struct COGDEBUG_API FCogDebugLogCategoryManager { - static void AddLogCategory(FLogCategoryBase& LogCategory); + static void AddLogCategory(FLogCategoryBase& LogCategory, const FString& DisplayName = ""); static bool IsVerbosityActive(ELogVerbosity::Type Verbosity); diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_LogCategories.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_LogCategories.cpp index 1964445..717396c 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_LogCategories.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_LogCategories.cpp @@ -71,7 +71,7 @@ void UCogEngineWindow_LogCategories::RenderContent() FLogCategoryBase* Category = CategoryInfo.LogCategory; ImGui::PushID(Index); - FString CategoryFriendlyName = Category->GetCategoryName().ToString(); + FString CategoryFriendlyName = CategoryInfo.GetDisplayName(); if (bShowAllVerbosity == false) { diff --git a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Stats.cpp b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Stats.cpp index 2d9e1cb..96ce3c5 100644 --- a/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Stats.cpp +++ b/Plugins/CogEngine/Source/CogEngine/Private/CogEngineWindow_Stats.cpp @@ -46,8 +46,7 @@ void UCogEngineWindow_Stats::RenderContent() //-------------------------------------------------------------------------------------------------------------------------- void UCogEngineWindow_Stats::DrawMainMenuWidget(bool Draw, float& Width) { - const float ResetButtonWidth = FCogWindowWidgets::TextBaseWidth * 5; - Width = FCogWindowWidgets::TextBaseWidth * 15; + Width = FCogWindowWidgets::TextBaseWidth * 25; if (Draw == false) { @@ -56,6 +55,7 @@ void UCogEngineWindow_Stats::DrawMainMenuWidget(bool Draw, float& Width) extern ENGINE_API float GAverageFPS; ImGui::TextColored(GetFpsColor(GAverageFPS), "%3dfps ", (int32)GAverageFPS); + ImGui::SetItemTooltip("Frame Per Second"); if (const APlayerController* PlayerController = GetLocalPlayerController()) { @@ -64,6 +64,7 @@ void UCogEngineWindow_Stats::DrawMainMenuWidget(bool Draw, float& Width) const float Ping = PlayerState->GetPingInMilliseconds(); ImGui::SameLine(); ImGui::TextColored(GetPingColor(Ping), "%3dms ", (int32)Ping); + ImGui::SetItemTooltip("Ping"); } if (UNetConnection* Connection = PlayerController->GetNetConnection()) @@ -73,6 +74,7 @@ void UCogEngineWindow_Stats::DrawMainMenuWidget(bool Draw, float& Width) const float TotalPacketLost = OutPacketLost + InPacketLost; ImGui::SameLine(); ImGui::TextColored(GetPacketLossColor(TotalPacketLost), "%2d%% ", (int32)TotalPacketLost); + ImGui::SetItemTooltip("Packet Loss"); } } } diff --git a/Plugins/CogInterfaces/CogInterfaces.uplugin b/Plugins/CogInterfaces/CogInterfaces.uplugin new file mode 100644 index 0000000..4b4c3e7 --- /dev/null +++ b/Plugins/CogInterfaces/CogInterfaces.uplugin @@ -0,0 +1,26 @@ +{ + "FileVersion": 1, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "CogInterfaces", + "Description": "", + "Category": "Other", + "CreatedBy": "Arnaud Jamin", + "CreatedByURL": "", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": true, + "IsBetaVersion": false, + "IsExperimentalVersion": false, + "Installed": false, + "Modules": [ + { + "Name": "CogInterfaces", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ], + "Plugins": [ + ] +} \ No newline at end of file diff --git a/Plugins/CogInterfaces/Resources/Icon128.png b/Plugins/CogInterfaces/Resources/Icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..1231d4aad4d0d462fb7b178eb5b30aa61a10df0b GIT binary patch literal 12699 zcmbta^;gv0*Zs`U4U&S$&|T8qCEeZ9Eg&T@fV6ZsC`gAiNDN4~NP~2D_b~7C{TtqO z&%XQTd(K(+?0wgb)=*Qx!6e57002ixQC90ehW-!esQ>N1#VtqwBMf&%Lr(y}BK#jf zKz1$}0AQ*+$jE4D*t>bTdD^?VLzHA>AnqUCY#p3!0Kj)CPuosM`+!93ZuMGPISQJp z?50JG4$+d1g%Tw(uux;*zmK9WS|rx&A&`?prWh)WLW+-vekImq!;ZmRK-;GN79aLK zDrV$qBjCH!T*uw+_)F8g_+HgjUc)3B3>`aNkw=pcid`=KmS8<>uy0^vn?o`Llg=H$ zM{oE*?Fpv^0rx?oqO3G9v@QVT`xgrxfT`xdxZXq}@D8Q3OhC{tAedK@pfWm?2$1xT zm;M1r%7dVJnGD)MAu?bwYHhUzXs`nojKRBq0chTRRsaYvPNgOW6(#`?LYpXAz+MEX zn$(Mt0}QwTB3tD?Az*^LOfIcrRh_$YBOLV+R}XG z5igtl_3B*-O|*0}b3gqw;=|?|+Y^%b8Xr*SC=LopVlOkbM!HpI#5eGQZQcREIlI=mKs7Qw4`2&0$Ifv(8i;aW`*BV_b4L2ilu`LM-ge#C@1kLa%;utKy(!; zFU3BBg(6Ml+ml3wfOnzK5giKLsUh{6Vl&uHGHqo74Xr4$WR4Ad4B%OG#)cnOv;1Tc`kX!bJFq?9Q)GPDys^pRP;m~XgrKWNx7u@TiRc8ds6#5huVFwc7lItZ`CrU^ruG;6!tUr zk*J#RIFBD>0arM>Liq#X$RKG>+)!Cm1E4LSL#;eX&h-&Xxo*Gltot9 zmAUCi6bBi?qfrfitNd1%Db_6fX};Al0Ku|;-Qdec?SxYq;T^))$MAD}@$)B^Uzu>q zU$J5p%cZ6(mQGCl5dz0@%Fm`XFQf?`&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0K&lUlw-JHIBlzyE74h z!8l|^iJ%=K`F%wITBUr4^6Z4}MEUbtM@r7BHWIWQbT51_4lUg1Tst@YF3p=#C=_OY`xFQL zfnz*<-IavyUEj*^P6JD8W^!1yCScorz&X+8fkTRDOj9TmA79aAEH(f5WCM+dqz_!N(z2Yc$k256D`7 zokD-nLN;IloasUxE|xHTmudJK*|lVNJI{>hCrCl3u3*o1lYsE<%jghb^beRP;wlR7 zpAUOiD@Q)$Vj?dBR;1AV$qu*?!df~1wxi}5!qGU6ksnFloq5F%V@?-4$yNwQs0#{^ykl?EYK&=dPQZ8veX{Vob3^yttw8^cc{bu}|E*TaPekZu$QUxtSLP a;7#~yJh_ha>A&A^fRdb=Y>l)<=>Gxy=2LS3 literal 0 HcmV?d00001 diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs b/Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs new file mode 100644 index 0000000..68c66ac --- /dev/null +++ b/Plugins/CogInterfaces/Source/CogInterfaces/CogInterfaces.Build.cs @@ -0,0 +1,44 @@ +using UnrealBuildTool; + +public class CogInterfaces : ModuleRules +{ + public CogInterfaces(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + } + ); + + + PrivateIncludePaths.AddRange( + new string[] { + } + ); + + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + } + ); + } +} diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp b/Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp new file mode 100644 index 0000000..2a66e3b --- /dev/null +++ b/Plugins/CogInterfaces/Source/CogInterfaces/Private/CogInterfacesModule.cpp @@ -0,0 +1,17 @@ +#include "CogInterfacesModule.h" + +#define LOCTEXT_NAMESPACE "FCogInterfacesModule" + +//-------------------------------------------------------------------------------------------------------------------------- +void FCogInterfacesModule::StartupModule() +{ +} + +//-------------------------------------------------------------------------------------------------------------------------- +void FCogInterfacesModule::ShutdownModule() +{ +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FCogInterfacesModule, CogInterfaces) \ No newline at end of file diff --git a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugAllegianceInterface.h b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h similarity index 67% rename from Plugins/CogDebug/Source/CogDebug/Public/CogDebugAllegianceInterface.h rename to Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h index 13466d0..f0ca125 100644 --- a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugAllegianceInterface.h +++ b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesAllegiance.h @@ -1,11 +1,11 @@ #pragma once #include "CoreMinimal.h" -#include "CogDebugAllegianceInterface.generated.h" +#include "CogInterfacesAllegiance.generated.h" //-------------------------------------------------------------------------------------------------------------------------- UENUM(BlueprintType) -enum class ECogAllegiance : uint8 +enum class ECogInterfacesAllegiance : uint8 { Ally, Enemy @@ -13,17 +13,17 @@ enum class ECogAllegiance : uint8 //-------------------------------------------------------------------------------------------------------------------------- UINTERFACE(MinimalAPI, Blueprintable) -class UCogAllegianceInterface : public UInterface +class UCogInterfacesAllegianceActor : public UInterface { GENERATED_BODY() }; //-------------------------------------------------------------------------------------------------------------------------- -class ICogAllegianceInterface +class ICogInterfacesAllegianceActor { GENERATED_BODY() public: - virtual ECogAllegiance GetAllegiance(const AActor* OtherActor) const = 0; + virtual ECogInterfacesAllegiance GetAllegiance(const AActor* OtherActor) const = 0; }; \ No newline at end of file diff --git a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDamageActorInterface.h b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h similarity index 64% rename from Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDamageActorInterface.h rename to Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h index e09d853..c67c20b 100644 --- a/Plugins/CogAbility/Source/CogAbility/Public/CogAbilityDamageActorInterface.h +++ b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesDamageActor.h @@ -1,33 +1,43 @@ #pragma once #include "CoreMinimal.h" -#include "CogAbilityDamageActorInterface.generated.h" +#include "CogInterfacesDamageActor.generated.h" + +//-------------------------------------------------------------------------------------------------------------------------- +UENUM(BlueprintType) +enum class ECogInterfacesDamageEventType : uint8 +{ + DamageDealt, + DamageReceived, +}; + //-------------------------------------------------------------------------------------------------------------------------- USTRUCT() -struct COGABILITY_API FCogAbilityDamageParams +struct FCogInterfacesDamageParams { GENERATED_BODY() + ECogInterfacesDamageEventType Type; TObjectPtr DamageDealer; TObjectPtr DamageReceiver; - float ReceivedDamage = 0; + float MitigatedDamage = 0; float IncomingDamage = 0; bool IsCritical = false; }; //-------------------------------------------------------------------------------------------------------------------------- -DECLARE_MULTICAST_DELEGATE_OneParam(FCogAbilityOnDamageEvent, const FCogAbilityDamageParams&); +DECLARE_MULTICAST_DELEGATE_OneParam(FCogAbilityOnDamageEvent, const FCogInterfacesDamageParams&); //-------------------------------------------------------------------------------------------------------------------------- UINTERFACE(MinimalAPI, Blueprintable) -class UCogAbilityDamageActorInterface : public UInterface +class UCogInterfacesDamageActor : public UInterface { GENERATED_BODY() }; //-------------------------------------------------------------------------------------------------------------------------- -class ICogAbilityDamageActorInterface +class ICogInterfacesDamageActor { GENERATED_BODY() diff --git a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugFilteredActorInterface.h b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h similarity index 56% rename from Plugins/CogDebug/Source/CogDebug/Public/CogDebugFilteredActorInterface.h rename to Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h index f9a2ccf..fc2822e 100644 --- a/Plugins/CogDebug/Source/CogDebug/Public/CogDebugFilteredActorInterface.h +++ b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesFilteredActor.h @@ -1,15 +1,15 @@ #pragma once #include "CoreMinimal.h" -#include "CogDebugFilteredActorInterface.generated.h" +#include "CogInterfacesFilteredActor.generated.h" UINTERFACE(MinimalAPI, Blueprintable) -class UCogDebugFilteredActorInterface : public UInterface +class UCogInterfacesFilteredActor : public UInterface { GENERATED_BODY() }; -class ICogDebugFilteredActorInterface +class ICogInterfacesFilteredActor { GENERATED_BODY() diff --git a/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h new file mode 100644 index 0000000..9d22e37 --- /dev/null +++ b/Plugins/CogInterfaces/Source/CogInterfaces/Public/CogInterfacesModule.h @@ -0,0 +1,17 @@ +#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 e024d09..d1524c8 100644 --- a/Source/CogSample/CogSample.Build.cs +++ b/Source/CogSample/CogSample.Build.cs @@ -25,6 +25,7 @@ public class CogSample : ModuleRules PublicDependencyModuleNames.AddRange(new string[] { "CogImgui", + "CogInterfaces", "CogWindow", "CogEngine", "CogInput", diff --git a/Source/CogSample/CogSampleCharacter.cpp b/Source/CogSample/CogSampleCharacter.cpp index 0a1b0da..2a8e9c0 100644 --- a/Source/CogSample/CogSampleCharacter.cpp +++ b/Source/CogSample/CogSampleCharacter.cpp @@ -348,8 +348,9 @@ void ACogSampleCharacter::Look(const FInputActionValue& Value) void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingDamage, AActor* DamageDealer, const FGameplayEffectSpec& EffectSpec) { #if USE_COG - FCogAbilityDamageParams Params; - Params.ReceivedDamage = ReceivedDamage; + FCogInterfacesDamageParams Params; + Params.Type = ECogInterfacesDamageEventType::DamageReceived; + Params.MitigatedDamage = ReceivedDamage; Params.IncomingDamage = IncomingDamage; Params.DamageDealer = DamageDealer; Params.DamageReceiver = this; @@ -361,8 +362,9 @@ void ACogSampleCharacter::OnDamageReceived(float ReceivedDamage, float IncomingD void ACogSampleCharacter::OnDamageDealt(float ReceivedDamage, float IncomingDamage, AActor* DamageReceiver, const FGameplayEffectSpec& EffectSpec) { #if USE_COG - FCogAbilityDamageParams Params; - Params.ReceivedDamage = ReceivedDamage; + FCogInterfacesDamageParams Params; + Params.Type = ECogInterfacesDamageEventType::DamageDealt; + Params.MitigatedDamage = ReceivedDamage; Params.IncomingDamage = IncomingDamage; Params.DamageDealer = this; Params.DamageReceiver = DamageReceiver; diff --git a/Source/CogSample/CogSampleCharacter.h b/Source/CogSample/CogSampleCharacter.h index f929d31..2b845ba 100644 --- a/Source/CogSample/CogSampleCharacter.h +++ b/Source/CogSample/CogSampleCharacter.h @@ -1,20 +1,16 @@ #pragma once #include "CoreMinimal.h" -#include "CogDefines.h" #include "AbilitySystemInterface.h" #include "ActiveGameplayEffectHandle.h" #include "AttributeSet.h" +#include "CogDefines.h" +#include "CogInterfacesDamageActor.h" +#include "CogInterfacesFilteredActor.h" #include "GameFramework/Character.h" #include "GameplayAbilitySpecHandle.h" #include "GameplayTagContainer.h" #include "InputActionValue.h" - -#if USE_COG -#include "CogAbilityDamageActorInterface.h" -#include "CogDebugFilteredActorInterface.h" -#endif //USE_COG - #include "CogSampleCharacter.generated.h" class UAbilitySystemComponent; @@ -62,10 +58,8 @@ public: UCLASS(config=Game) class ACogSampleCharacter : public ACharacter , public IAbilitySystemInterface -#if USE_COG - , public ICogDebugFilteredActorInterface - , public ICogAbilityDamageActorInterface -#endif //USE_COG + , public ICogInterfacesFilteredActor + , public ICogInterfacesDamageActor { GENERATED_BODY() @@ -81,11 +75,8 @@ public: virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; virtual void PossessedBy(AController* NewController) override; -#if USE_COG virtual FCogAbilityOnDamageEvent& OnDamageEvent() override { return OnDamageEventDelegate; } virtual bool IsActorFilteringDebug() const override { return true; } -#endif //USE_COG - void OnAcknowledgePossession(APlayerController* InController); @@ -155,9 +146,7 @@ public: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability) TArray> Effects; -#if USE_COG FCogAbilityOnDamageEvent OnDamageEventDelegate; -#endif //USE_COG private: diff --git a/Source/CogSample/CogSampleCharacterMovementComponent.cpp b/Source/CogSample/CogSampleCharacterMovementComponent.cpp index b3eb271..fb6b02e 100644 --- a/Source/CogSample/CogSampleCharacterMovementComponent.cpp +++ b/Source/CogSample/CogSampleCharacterMovementComponent.cpp @@ -233,11 +233,13 @@ void UCogSampleCharacterMovementComponent::TickComponent(float DeltaTime, enum E #if ENABLE_COG - const FVector DebugBottomLocation = Character->GetActorLocation() - FVector::UpVector * CapsuleComponent->GetScaledCapsuleHalfHeight(); + const FVector DebugLocation = Character->GetActorLocation(); + const FVector DebugBottomLocation = DebugLocation - FVector::UpVector * CapsuleComponent->GetScaledCapsuleHalfHeight(); if (FCogDebugSettings::IsDebugActiveForActor(GetPawnOwner())) { const FRotator Rotation = Character->GetActorRotation(); + const FVector Forward = Character->GetActorForwardVector(); const FVector LocalVelocity = Rotation.UnrotateVector(Velocity); const FVector LocalAcceleration = Rotation.UnrotateVector(GetCurrentAcceleration()); const FVector VelocityDelta = (Velocity - DebugLastVelocity) / DeltaTime; @@ -275,8 +277,12 @@ void UCogSampleCharacterMovementComponent::TickComponent(float DeltaTime, enum E } const FColor CapsuleColor = CapsuleComponent->GetCollisionEnabled() == ECollisionEnabled::NoCollision ? FColor::Black : FColor::White; - FCogDebugDraw::Capsule(LogCogCollision, this, CapsuleComponent->GetComponentLocation(), CapsuleComponent->GetScaledCapsuleHalfHeight(), CapsuleComponent->GetScaledCapsuleRadius(), CapsuleComponent->GetComponentQuat(), CapsuleColor, false, 0); - FCogDebugDraw::Axis(LogCogCollision, this, CapsuleComponent->GetComponentLocation(), CapsuleComponent->GetComponentRotation(), 50.0f, false, 0); + FCogDebugDraw::Capsule(LogCogCollision, Character, CapsuleComponent->GetComponentLocation(), CapsuleComponent->GetScaledCapsuleHalfHeight(), CapsuleComponent->GetScaledCapsuleRadius(), CapsuleComponent->GetComponentQuat(), CapsuleColor, false, 0); + FCogDebugDraw::Axis(LogCogCollision, Character, CapsuleComponent->GetComponentLocation(), CapsuleComponent->GetComponentRotation(), 50.0f, false, 0); + FCogDebugDraw::Arrow(LogCogRotation, Character, DebugLocation, DebugLocation + Rotation.Vector() * 100.0f, FColor::Green, true, 0); + FCogDebugDraw::Arrow(LogCogControlRotation, Character, DebugLocation, DebugLocation + Character->GetControlRotation().Vector() * 100.f, FColor::Silver, true, 0); + FCogDebugDraw::Arrow(LogCogBaseAimRotation, Character, DebugLocation, DebugLocation + Character->GetBaseAimRotation().Vector() * 100.f, FColor::Red, true, 0); + FCogDebugDraw::Skeleton(LogCogSkeleton, Character->GetMesh(), FColor::White, false, 1); } DebugLastBottomLocation = DebugBottomLocation; diff --git a/Source/CogSample/CogSampleLogCategories.cpp b/Source/CogSample/CogSampleLogCategories.cpp index 152ad29..a1b2a81 100644 --- a/Source/CogSample/CogSampleLogCategories.cpp +++ b/Source/CogSample/CogSampleLogCategories.cpp @@ -10,17 +10,25 @@ DEFINE_LOG_CATEGORY(LogCogCollision); DEFINE_LOG_CATEGORY(LogCogInput); DEFINE_LOG_CATEGORY(LogCogPosition); +DEFINE_LOG_CATEGORY(LogCogRotation); +DEFINE_LOG_CATEGORY(LogCogControlRotation); +DEFINE_LOG_CATEGORY(LogCogBaseAimRotation); +DEFINE_LOG_CATEGORY(LogCogSkeleton); namespace CogSampleLog { void RegiterAllLogCategories() { #if USE_COG - FCogDebugLogCategoryManager::AddLogCategory(LogAbilitySystem); - FCogDebugLogCategoryManager::AddLogCategory(LogGameplayEffects); - FCogDebugLogCategoryManager::AddLogCategory(LogCogCollision); - FCogDebugLogCategoryManager::AddLogCategory(LogCogInput); - FCogDebugLogCategoryManager::AddLogCategory(LogCogPosition); + FCogDebugLogCategoryManager::AddLogCategory(LogAbilitySystem, "AbilitySystem"); + FCogDebugLogCategoryManager::AddLogCategory(LogGameplayEffects, "Gameplay Effects"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogCollision, "Collision"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogInput, "Input"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogPosition, "Position"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogRotation, "Rotation"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogControlRotation, "ControlRotation"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogBaseAimRotation, "BaseAimRotation"); + FCogDebugLogCategoryManager::AddLogCategory(LogCogSkeleton, "Skeleton"); #endif //USE_COG } } diff --git a/Source/CogSample/CogSampleLogCategories.h b/Source/CogSample/CogSampleLogCategories.h index 353e364..7c4dd88 100644 --- a/Source/CogSample/CogSampleLogCategories.h +++ b/Source/CogSample/CogSampleLogCategories.h @@ -3,6 +3,10 @@ DECLARE_LOG_CATEGORY_EXTERN(LogCogCollision, Warning, All); DECLARE_LOG_CATEGORY_EXTERN(LogCogInput, Warning, All); DECLARE_LOG_CATEGORY_EXTERN(LogCogPosition, Warning, All); +DECLARE_LOG_CATEGORY_EXTERN(LogCogRotation, Warning, All); +DECLARE_LOG_CATEGORY_EXTERN(LogCogControlRotation, Warning, All); +DECLARE_LOG_CATEGORY_EXTERN(LogCogBaseAimRotation, Warning, All); +DECLARE_LOG_CATEGORY_EXTERN(LogCogSkeleton, Warning, All); namespace CogSampleLog {