Skip to content

Commit ee23146

Browse files
committed
Release version 1.0.0.
1 parent 08184be commit ee23146

23 files changed

Lines changed: 2013 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"FileVersion": 3,
3+
"Version": 1,
4+
"VersionName": "1.0",
5+
"FriendlyName": "Component Dynamic Effects",
6+
"Description": "Actor Component for managing dynamic status effects in single-player games.",
7+
"Category": "Experimental",
8+
"CreatedBy": "Pavel Gornostaev",
9+
"CreatedByURL": "https://github.com/Pavreally",
10+
"DocsURL": "https://github.com/Pavreally/ComponentDynamicEffects",
11+
"MarketplaceURL": "",
12+
"SupportURL": "",
13+
"CanContainContent": true,
14+
"IsBetaVersion": true,
15+
"IsExperimentalVersion": true,
16+
"Installed": true,
17+
"Modules": [
18+
{
19+
"Name": "ComponentDynamicEffects",
20+
"Type": "Runtime",
21+
"LoadingPhase": "Default",
22+
"PlatformAllowList": [
23+
"Win64",
24+
"Android"
25+
]
26+
}
27+
]
28+
}
89.6 KB
Binary file not shown.
12.7 KB
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright Epic Games, Inc. All Rights Reserved.
2+
3+
using UnrealBuildTool;
4+
5+
public class ComponentDynamicEffects : ModuleRules
6+
{
7+
public ComponentDynamicEffects(ReadOnlyTargetRules Target) : base(Target)
8+
{
9+
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
10+
11+
PublicIncludePaths.AddRange(
12+
new string[] {
13+
// ... add public include paths required here ...
14+
}
15+
);
16+
17+
18+
PrivateIncludePaths.AddRange(
19+
new string[] {
20+
// ... add other private include paths required here ...
21+
}
22+
);
23+
24+
25+
PublicDependencyModuleNames.AddRange(
26+
new string[]
27+
{
28+
"Core",
29+
"CoreUObject",
30+
"Engine",
31+
"GameplayTags",
32+
// ... add other public dependencies that you statically link with here ...
33+
}
34+
);
35+
36+
37+
PrivateDependencyModuleNames.AddRange(
38+
new string[]
39+
{
40+
"Slate",
41+
"SlateCore",
42+
// ... add private dependencies that you statically link with here ...
43+
}
44+
);
45+
46+
47+
DynamicallyLoadedModuleNames.AddRange(
48+
new string[]
49+
{
50+
// ... add any modules that your module loads dynamically here ...
51+
}
52+
);
53+
}
54+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Pavel Gornostaev <https://github.com/Pavreally>
2+
3+
#include "ComponentDynamicEffects.h"
4+
#include "GameplayTagsManager.h"
5+
#include "Misc/Paths.h"
6+
7+
#define LOCTEXT_NAMESPACE "FComponentDynamicEffectsModule"
8+
9+
// Define the log category.
10+
DEFINE_LOG_CATEGORY(LogComponentDynamicEffects);
11+
12+
void FComponentDynamicEffectsModule::StartupModule()
13+
{
14+
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
15+
16+
// Adding a path to plugin tags
17+
UGameplayTagsManager::Get().AddTagIniSearchPath(
18+
FPaths::ProjectPluginsDir() / TEXT("ComponentDynamicEffects/Config/Tags"));
19+
}
20+
21+
void FComponentDynamicEffectsModule::ShutdownModule()
22+
{
23+
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
24+
// we call this function before unloading the module.
25+
}
26+
27+
#undef LOCTEXT_NAMESPACE
28+
29+
IMPLEMENT_MODULE(FComponentDynamicEffectsModule, ComponentDynamicEffects)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Pavel Gornostaev <https://github.com/Pavreally>
2+
3+
#include "Components/ActorCDE.h"
4+
5+
UActorCDE::UActorCDE()
6+
{
7+
PrimaryComponentTick.bCanEverTick = true;
8+
SetComponentTickEnabled(false);
9+
}
10+
11+
void UActorCDE::OnRegister()
12+
{
13+
Super::OnRegister();
14+
15+
bRuntimeRegisteredEffectsRefreshed = false;
16+
InitializeRegisteredEffectsFromAssets();
17+
}
18+
19+
void UActorCDE::BeginPlay()
20+
{
21+
Super::BeginPlay();
22+
23+
EnsureRegisteredEffectsInitialized();
24+
RebuildAggregatedTags();
25+
UpdateComponentTickState();
26+
}
27+
28+
void UActorCDE::EndPlay(const EEndPlayReason::Type EndPlayReason)
29+
{
30+
if (!ActiveEffects.IsEmpty())
31+
{
32+
TArray<FGameplayTag> EffectTags;
33+
ActiveEffects.GetKeys(EffectTags);
34+
35+
for (const FGameplayTag& EffectTag : EffectTags)
36+
{
37+
RemoveEffect(EffectTag);
38+
}
39+
}
40+
41+
Super::EndPlay(EndPlayReason);
42+
}
43+
44+
void UActorCDE::BroadcastEffectAdded(const FActiveStatusEffectCDE& Effect)
45+
{
46+
if (OnEffectAddedCDE.IsBound())
47+
{
48+
OnEffectAddedCDE.Broadcast(Effect);
49+
}
50+
51+
if (OnEffectAddedBP.IsBound())
52+
{
53+
OnEffectAddedBP.Broadcast(Effect);
54+
}
55+
}
56+
57+
void UActorCDE::BroadcastEffectUpdated(const FActiveStatusEffectCDE& Effect)
58+
{
59+
if (OnEffectUpdatedCDE.IsBound())
60+
{
61+
OnEffectUpdatedCDE.Broadcast(Effect);
62+
}
63+
64+
if (OnEffectUpdatedBP.IsBound())
65+
{
66+
OnEffectUpdatedBP.Broadcast(Effect);
67+
}
68+
}
69+
70+
void UActorCDE::BroadcastEffectStackChanged(const FActiveStatusEffectCDE& Effect)
71+
{
72+
if (OnEffectStackChangedCDE.IsBound())
73+
{
74+
OnEffectStackChangedCDE.Broadcast(Effect);
75+
}
76+
77+
if (OnEffectStackChangedBP.IsBound())
78+
{
79+
OnEffectStackChangedBP.Broadcast(Effect);
80+
}
81+
}
82+
83+
void UActorCDE::BroadcastEffectRemoved(FGameplayTag EffectTag, EEffectRemoveReason Reason)
84+
{
85+
if (OnEffectRemovedCDE.IsBound())
86+
{
87+
OnEffectRemovedCDE.Broadcast(EffectTag, Reason);
88+
}
89+
90+
if (OnEffectRemovedBP.IsBound())
91+
{
92+
OnEffectRemovedBP.Broadcast(EffectTag, Reason);
93+
}
94+
}

0 commit comments

Comments
 (0)