diff --git a/.github/workflows/build-with-project.yml b/.github/workflows/build-with-project.yml new file mode 100644 index 0000000..0f8a281 --- /dev/null +++ b/.github/workflows/build-with-project.yml @@ -0,0 +1,47 @@ +name: Build with blueprint project + +on: + push: + branches: + - "**" + +jobs: + build: + runs-on: self-hosted + steps: + - name: Check out UE5.4 project + uses: actions/checkout@v3 + with: + repository: Ciberusps/UE_5_4_Blueprint + path: UE_5_4_Blueprint + + - name: Check out UnrealHelperLibrary to Plugins folder + uses: actions/checkout@v3 + with: + path: UE_5_4_Blueprint/Plugins/UnrealHelperLibrary + + - name: Build project + uses: OrchidIsle/UE5-Build-Project@latest + with: + RUNUAT_PATH: 'S:/Epic Games/UE_5.4/Engine/Build/BatchFiles/RunUAT.bat' + UPROJECT_PATH: ${{ github.workspace }}/UE_5_4_Blueprint/UE_5_4_Blueprint.uproject + BUILD_CONFIG: Development + PLATFORM: Win64 + CLEAN: true + COOK: true + STAGE: true + PACKAGE: true + PAK: false + SERVER: false + ARCHIVE: false + ARCHIVE_PATH: 'C:/Archives/MyGame' + NULLRHI: true + EDITOR: true + ENCRYPT_INI: true + # RELEASE: '1.0.0' + # PATCH: '0.9.0' + # MAPS: 'Map1,Map2' + DELETE_PDB: true + # ANTICHEAT_ENABLED: true + # ANTICHEAT_PRIVATE_KEY: 'base64encodedprivatekey' + # ANTICHEAT_PUBLIC_CERT: 'base64encodedpubliccert' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbb40d7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,84 @@ +# name: Build/release + +# on: +# push: +# tags: +# - "*" + +# jobs: +# release: +# runs-on: ${{ matrix.os }} + +# defaults: +# run: +# shell: bash + +# # env: +# # STEAMWORKS_SDK_ARCHIVE_PASSWORD: ${{ secrets.STEAMWORKS_SDK_ARCHIVE_PASSWORD }} +# # STEAMWORKS_SDK_GOOGLE_DRIVE_LINK: ${{ secrets.STEAMWORKS_SDK_GOOGLE_DRIVE_LINK }} + +# strategy: +# fail-fast: false +# matrix: +# os: [windows-latest, macos-latest, ubuntu-latest] + +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 + +# - name: Install Node.js, NPM and Yarn +# uses: actions/setup-node@v3 +# with: +# node-version: "16" +# cache: "npm" + +# - name: TEMPORARY - Install gdown for fetchSteamworksSdk.js +# run: pip3 install gdown + +# - name: Install dependencies +# run: | +# npm install --legacy-peer-deps + +# - name: Build +# run: | +# npm run postinstall +# npm run build + +# - name: Publish to github +# env: +# # These values are used for auto updates signing +# # APPLE_ID: ${{ secrets.APPLE_ID }} +# # APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }} +# # CSC_LINK: ${{ secrets.CSC_LINK }} +# # CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} +# # This is used for uploading release assets to github +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: npm exec electron-builder -- --publish always + +# # - id: setup-steamcmd +# # uses: CyberAndrii/setup-steamcmd@v1.1.1 + +# # - name: Create steamworks build script +# # run: node ./scripts/createSteamBuildScript.js +# # env: +# # STEAM_APP_ID: 1904150 +# # RELEASE_BRANCH: development +# # DEPOT_WINDOWS_ID: 1904151 +# # DEPOT_LINUX_ID: 1904152 +# # DEPOT_MACOS_ID: 1904153 +# # RUNNER_OS: $RUNNER_OS + +# # - name: Generate steam guard auth code +# # id: generate +# # uses: CyberAndrii/steam-totp@v1.0.2 +# # with: +# # shared_secret: ${{ secrets.STEAM_SHARED_SECRET }} + +# # - name: Publish to Steam +# # run: | +# # node ./scripts/publishToSteam.js +# # env: +# # STEAM_CMD: ${{ steps.setup-steamcmd.outputs.executable }} +# # STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} +# # STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }} +# # STEAM_GUARD_CODE: ${{ steps.generate.outputs.code }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a9a34c1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,221 @@ +name: Test + +on: + push: + branches: + - "**" + # - "!main" + # - "!l10n_main" + +# env: +# STEAMWORKS_SDK_ARCHIVE_PASSWORD: ${{ secrets.STEAMWORKS_SDK_ARCHIVE_PASSWORD }} +# STEAMWORKS_SDK_GOOGLE_DRIVE_LINK: ${{ secrets.STEAMWORKS_SDK_GOOGLE_DRIVE_LINK }} + +jobs: + build-plugins: + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: true + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: false + swap-storage: true + - name: Check out UnrealHelperLibrary to Plugins folder + uses: actions/checkout@v3 + with: + path: UnrealHelperLibrary + - name: + run: | + echo ${{ secrets.UNREAL_ENGINE_PERSONAL_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + docker pull ghcr.io/epicgames/unreal-engine:dev-slim-5.4 + - uses: addnab/docker-run-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.UNREAL_ENGINE_PERSONAL_TOKEN }} + registry: ghcr.io + image: ghcr.io/epicgames/unreal-engine:dev-slim-5.4 + options: -v ${{ github.workspace }}:/work -e ABC=123 + run: | + echo "Running Script" + mkdir -p "Result" + test -e "./Engine/Build/BatchFiles/RunUAT.sh" && echo file exists || echo file not found + test -e "/work/UnrealHelperLibrary/UnrealHelperLibrary.uplugin" && echo file exists || echo file not found + test -e "/work/Result" && echo file exists || echo file not found + test -e "Result" && echo file exists || echo file not found + ./Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -plugin="/work/UnrealHelperLibrary/UnrealHelperLibrary.uplugin" -package="./Result" -platform=Win64 +# - name: Build Plugins (UHL) +# shell: sh +# run: | +# "home/ue4/UnrealEngine/Engine/BatchFiles/RunUAT.sh BuildPlugin -plugin="${{ github.workspace }}/UnrealHelperLibrary/UnrealHelperLibrary.uplugin" -package="${{ github.workspace }}/Result"" +# clean-up-space: +# runs-on: ubuntu-latest +# steps: +# Works better +# - name: Free Disk Space (Ubuntu) +# uses: jlumbroso/free-disk-space@main +# with: +# # this might remove tools that are actually needed, +# # if set to "true" but frees about 6 GB +# tool-cache: false +# # all of these default to true, but feel free to set to +# # "false" if necessary for your workflow +# android: true +# dotnet: true +# haskell: true +# large-packages: true +# docker-images: false +# swap-storage: true +# # free some space +# - name: Maximize build space +# uses: easimon/maximize-build-space@master +# with: +# # root-reserve-mb: 512 +# # swap-size-mb: 1024 +# remove-dotnet: 'true' +# build: +# runs-on: self-hosted +# # runs-on: ubuntu-latest +# container: +# image: ghcr.io/epicgames/unreal-engine:dev-slim-5.4 +# credentials: +# username: ${{ github.actor }} +# password: ${{ secrets.UNREAL_ENGINE_PERSONAL_TOKEN }} +# # needs: clean-up-space +# steps: +# - name: Check out UE5.4 project +# uses: actions/checkout@v3 +# with: +# repository: Ciberusps/UE_5_4_Blueprint +# path: UE_5_4_Blueprint +# - name: Check out UE5.4 project +# shell: bash +# run: | +# ls +# - name: Check out UnrealHelperLibrary to Plugins folder +# uses: actions/checkout@v3 +# with: +# # path: UE_5_4_Blueprint/Plugins/UnrealHelperLibrary +# path: UnrealHelperLibrary +# - name: Build Plugins (UHL) +# shell: powershell +# run: | +# mkdir "Temp" +# $pluginPath = Resolve-Path -Path "UE_5_4_Blueprint/Plugins/UnrealHelperLibrary/UnrealHelperLibrary.uplugin" +# $tempDirAbsolutePath = Resolve-Path -Path "Temp" +# "S:/Epic Games/UE_5.4/Engine/Build/BatchFiles/RunUAT.bat BuildPlugin -plugin="$pluginPath" -package="$tempDirAbsolutePath"" +# - name: Build project +# uses: OrchidIsle/UE5-Build-Project@latest +# with: +# # RUNUAT_PATH: 'S:/Epic Games/UE_5.4/Engine/Build/BatchFiles/RunUAT.bat' +# # UE folder in epic provided container - /home/ue4/UnrealEngine/Engine/Binaries +# RUNUAT_PATH: 'home/ue4/UnrealEngine/Engine/BatchFiles/RunUAT' +# UPROJECT_PATH: ${{ github.workspace }}/UE_5_4_Blueprint/UE_5_4_Blueprint.uproject +# BUILD_CONFIG: Development +# PLATFORM: Win64 +# CLEAN: true +# COOK: true +# STAGE: true +# PACKAGE: true +# PAK: true +# SERVER: false +# ARCHIVE: false +# ARCHIVE_PATH: 'C:/Archives/MyGame' +# NULLRHI: true +# EDITOR: true +# ENCRYPT_INI: true +# # RELEASE: '1.0.0' +# # PATCH: '0.9.0' +# # MAPS: 'Map1,Map2' +# DELETE_PDB: true +# # ANTICHEAT_ENABLED: true +# # ANTICHEAT_PRIVATE_KEY: 'base64encodedprivatekey' +# # ANTICHEAT_PUBLIC_CERT: 'base64encodedpubliccert' + + + + + + + +# lint: +# runs-on: self-hosted +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 + +# lint-prettier: +# runs-on: ubuntu-latest +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 +# - name: Install Node.js, NPM and Yarn +# uses: actions/setup-node@v3 +# with: +# node-version: "16" +# cache: "npm" +# - name: TEMPORARY - Install gdown for fetchSteamworksSdk.js +# run: pip3 install gdown +# - name: Install dependencies +# run: npm install --legacy-peer-deps +# - name: Lint Prettier +# run: npm run lint:prettier + +# lint-types: +# runs-on: ubuntu-latest +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 +# - name: Install Node.js, NPM and Yarn +# uses: actions/setup-node@v3 +# with: +# node-version: "16" +# cache: "npm" +# - name: TEMPORARY - Install gdown for fetchSteamworksSdk.js +# run: pip3 install gdown +# - name: Install dependencies +# run: npm install --legacy-peer-deps +# - name: Lint Types +# run: npm run lint:types + +# licenses-check: +# runs-on: ubuntu-latest +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 +# - name: Install Node.js, NPM and Yarn +# uses: actions/setup-node@v3 +# with: +# node-version: "16" +# cache: "npm" +# - name: TEMPORARY - Install gdown for fetchSteamworksSdk.js +# run: pip3 install gdown +# - name: Install dependencies +# run: npm install --legacy-peer-deps +# - name: Test +# run: npm run lint:licenses + +# test: +# runs-on: ubuntu-latest +# steps: +# - name: Check out Git repository +# uses: actions/checkout@v3 +# - name: Install Node.js, NPM and Yarn +# uses: actions/setup-node@v3 +# with: +# node-version: "16" +# cache: "npm" +# - name: TEMPORARY - Install gdown for fetchSteamworksSdk.js +# run: pip3 install gdown +# - name: Install dependencies +# run: npm install --legacy-peer-deps +# - name: Test +# run: npm run test diff --git a/Config/FilterPlugin.ini b/Config/FilterPlugin.ini new file mode 100644 index 0000000..9c78e11 --- /dev/null +++ b/Config/FilterPlugin.ini @@ -0,0 +1,11 @@ +[FilterPlugin] +; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and +; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. +; +; Examples: +; /README.txt +; /Extras/... +; /Binaries/ThirdParty/*.dll + +/README.md +/Config/... \ No newline at end of file diff --git a/Content/Tools/EUW_UHL_Utils.uasset b/Content/Tools/EUW_UHL_Utils.uasset index 4104eb3..c5a750f 100644 Binary files a/Content/Tools/EUW_UHL_Utils.uasset and b/Content/Tools/EUW_UHL_Utils.uasset differ diff --git a/README.md b/README.md index 839fecb..579c0da 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,6 @@ UHL consists of 3 modules: > - AnimNotifyState (ANS) > - [ANS_UHL_Base](#ans_uhl_base) > - [ANS_ActivateAbility](#ans_activateability) -> -> > - [AI](#ai) > - Components > - [AIPerceptionComponent](#uhlaiperceptioncomponent) @@ -733,3 +731,9 @@ TODO check ref - https://github.com/Atulin/ChannelMerger ## Special Thanks [@Ingarnm](https://github.com/Ingarnm), [@Vamp1rk0](https://github.com/Vamp1rk0) for feedback + +## Github Actions + +- make your github runner +- Add `UE_5_4_Blueprint` as safe directory +`git config --global --add safe.directory D:/_work/unreal-helper-library/unreal-helper-library/UE_5_4_Blueprint` \ No newline at end of file diff --git a/Source/UnrealHelperEditor/Private/UnrealHelperEditor.cpp b/Source/UnrealHelperEditor/Private/UnrealHelperEditor.cpp index adb6b47..62dcb11 100644 --- a/Source/UnrealHelperEditor/Private/UnrealHelperEditor.cpp +++ b/Source/UnrealHelperEditor/Private/UnrealHelperEditor.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "UnrealHelperEditor.h" #include "UnrealHelperEditorStyle.h" diff --git a/Source/UnrealHelperEditor/Private/UnrealHelperEditorCommands.cpp b/Source/UnrealHelperEditor/Private/UnrealHelperEditorCommands.cpp index ede8067..e948d4c 100644 --- a/Source/UnrealHelperEditor/Private/UnrealHelperEditorCommands.cpp +++ b/Source/UnrealHelperEditor/Private/UnrealHelperEditorCommands.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "UnrealHelperEditorCommands.h" diff --git a/Source/UnrealHelperEditor/Private/UnrealHelperEditorStyle.cpp b/Source/UnrealHelperEditor/Private/UnrealHelperEditorStyle.cpp index 2a58d8a..44b5de7 100644 --- a/Source/UnrealHelperEditor/Private/UnrealHelperEditorStyle.cpp +++ b/Source/UnrealHelperEditor/Private/UnrealHelperEditorStyle.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "UnrealHelperEditorStyle.h" #include "UnrealHelperEditor.h" diff --git a/Source/UnrealHelperEditor/Public/UnrealHelperEditor.h b/Source/UnrealHelperEditor/Public/UnrealHelperEditor.h index 8dc470e..9132469 100644 --- a/Source/UnrealHelperEditor/Public/UnrealHelperEditor.h +++ b/Source/UnrealHelperEditor/Public/UnrealHelperEditor.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once diff --git a/Source/UnrealHelperEditor/Public/UnrealHelperEditorCommands.h b/Source/UnrealHelperEditor/Public/UnrealHelperEditorCommands.h index c01e132..6d7ba49 100644 --- a/Source/UnrealHelperEditor/Public/UnrealHelperEditorCommands.h +++ b/Source/UnrealHelperEditor/Public/UnrealHelperEditorCommands.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once diff --git a/Source/UnrealHelperEditor/Public/UnrealHelperEditorStyle.h b/Source/UnrealHelperEditor/Public/UnrealHelperEditorStyle.h index 31ef722..44646e0 100644 --- a/Source/UnrealHelperEditor/Public/UnrealHelperEditorStyle.h +++ b/Source/UnrealHelperEditor/Public/UnrealHelperEditorStyle.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once diff --git a/Source/UnrealHelperEditor/UnrealHelperEditor.Build.cs b/Source/UnrealHelperEditor/UnrealHelperEditor.Build.cs index f6e2b46..9039a24 100644 --- a/Source/UnrealHelperEditor/UnrealHelperEditor.Build.cs +++ b/Source/UnrealHelperEditor/UnrealHelperEditor.Build.cs @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov using UnrealBuildTool; diff --git a/Source/UnrealHelperLibrary/Private/AI/Composite/BTC_RandomSelector.cpp b/Source/UnrealHelperLibrary/Private/AI/Composite/BTC_RandomSelector.cpp index d4d7403..6b87ee8 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Composite/BTC_RandomSelector.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Composite/BTC_RandomSelector.cpp @@ -4,6 +4,14 @@ #include "AI/Composite/BTC_RandomSelector.h" #include "BehaviorTree/BTTaskNode.h" +#include "BehaviorTree/BTCompositeNode.h" +#include "BehaviorTree/BehaviorTreeComponent.h" +#include "BehaviorTree/BlackboardComponent.h" +#include "Misc/EngineVersionComparison.h" +#include "GameFramework/Actor.h" +#include "VisualLogger/VisualLogger.h" +#include "BehaviorTree/BTTaskNode.h" +#include "BehaviorTree/BTAuxiliaryNode.h" #include "Kismet/KismetMathLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTC_RandomSelector) @@ -84,21 +92,16 @@ FName UBTC_RandomSelector::GetNodeIconName() const #endif #if UE_VERSION_NEWER_THAN(5, 4, 0) -uint16 UBTC_RandomSelector::GetInstanceMemorySize() const -{ - return sizeof(FBTRandomSelectorMemory); -} - void UBTC_RandomSelector::InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const { - InitializeNodeMemory(NodeMemory, InitType); + InitializeNodeMemory(NodeMemory, InitType); } void UBTC_RandomSelector::CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const { - CleanupNodeMemory(NodeMemory, CleanupType); + CleanupNodeMemory(NodeMemory, CleanupType); } #endif diff --git a/Source/UnrealHelperLibrary/Private/AI/Data/TurnSettings.cpp b/Source/UnrealHelperLibrary/Private/AI/Data/TurnSettings.cpp index f744647..e329b82 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Data/TurnSettings.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Data/TurnSettings.cpp @@ -2,6 +2,7 @@ #include "AI/Data/TurnSettings.h" +#include "Animation/AnimMontage.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(TurnSettings) diff --git a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InAngle.cpp b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InAngle.cpp index 76e99e3..32425e8 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InAngle.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InAngle.cpp @@ -12,6 +12,7 @@ #include "Components/CapsuleComponent.h" #include "GameFramework/Character.h" #include "GameFramework/Controller.h" +#include "DrawDebugHelpers.h" #include "Kismet/KismetMathLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTD_InAngle) diff --git a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp index 29558c2..710e752 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_InRange.cpp @@ -10,6 +10,7 @@ #include "BehaviorTree/Blackboard/BlackboardKeyType_Vector.h" #include "Components/CapsuleComponent.h" #include "GameFramework/Character.h" +#include "DrawDebugHelpers.h" #include "Kismet/KismetMathLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTD_InRange) diff --git a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp index 055e217..5e078e0 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Decorators/BTD_RandomChance.cpp @@ -3,7 +3,6 @@ #include "AI/Decorators/BTD_RandomChance.h" -#include "BehaviorTree/BlackboardComponent.h" #include "BehaviorTree/BlackboardData.h" #include "Kismet/KismetMathLibrary.h" @@ -53,4 +52,4 @@ FName UBTD_RandomChance::GetNodeIconName() const // return FName("CodeView.ClassIcon"); return FName("GraphEditor.StructGlyph"); } -#endif // WITH_EDITOR +#endif diff --git a/Source/UnrealHelperLibrary/Private/AI/Services/BTS_GameplayFocus.cpp b/Source/UnrealHelperLibrary/Private/AI/Services/BTS_GameplayFocus.cpp index b320d00..e6993bf 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Services/BTS_GameplayFocus.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Services/BTS_GameplayFocus.cpp @@ -3,6 +3,11 @@ #include "AI/Services/BTS_GameplayFocus.h" +#include "GameFramework/Actor.h" +#include "BehaviorTree/BlackboardComponent.h" +#include "BehaviorTree/BehaviorTreeComponent.h" +#include "BehaviorTree/BehaviorTreeTypes.h" +#include "BehaviorTree/Services/BTService_DefaultFocus.h" #include "AIController.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTS_GameplayFocus) diff --git a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp index 39a0cf6..425e061 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp @@ -4,6 +4,10 @@ #include "AI/Tasks/BTT_PlayAnimMontage.h" #include "AIController.h" +#include "Engine/World.h" +#include "TimerManager.h" +#include "Animation/AnimMontage.h" +#include "Components/SkeletalMeshComponent.h" #include "GameFramework/Character.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTT_PlayAnimMontage) diff --git a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_TurnTo.cpp b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_TurnTo.cpp index ac7afdc..dac64a0 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_TurnTo.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_TurnTo.cpp @@ -8,7 +8,9 @@ #include "BehaviorTree/Blackboard/BlackboardKeyType_Object.h" #include "BehaviorTree/Blackboard/BlackboardKeyType_Rotator.h" #include "BehaviorTree/Blackboard/BlackboardKeyType_Vector.h" +#include "GameFramework/Actor.h" #include "GameFramework/Character.h" +#include "Animation/AnimMontage.h" #include "Utils/UnrealHelperLibraryBPL.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(BTT_TurnTo) diff --git a/Source/UnrealHelperLibrary/Private/AbilitySystem/Tasks/AT_InterpolateToPosition.cpp b/Source/UnrealHelperLibrary/Private/AbilitySystem/Tasks/AT_InterpolateToPosition.cpp index e9d9b7d..4b2eeff 100644 --- a/Source/UnrealHelperLibrary/Private/AbilitySystem/Tasks/AT_InterpolateToPosition.cpp +++ b/Source/UnrealHelperLibrary/Private/AbilitySystem/Tasks/AT_InterpolateToPosition.cpp @@ -4,6 +4,8 @@ #include "AbilitySystem/Tasks/AT_InterpolateToPosition.h" #include "Curves/CurveVector.h" +#include "Curves/CurveFloat.h" +#include "Engine/World.h" #include "GameFramework/Character.h" #include "GameFramework/CharacterMovementComponent.h" #include "Kismet/KismetSystemLibrary.h" diff --git a/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySet.cpp b/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySet.cpp index a86bb2a..96587ca 100644 --- a/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySet.cpp +++ b/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySet.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "AbilitySystem/UHLAbilitySet.h" @@ -7,10 +7,7 @@ #include UE_INLINE_GENERATED_CPP_BY_NAME(UHLAbilitySet) -void FUHLAbilitySet_GrantedHandles::SetAbilitySetTags(const FGameplayTagContainer& AbilitySetTagContainer) -{ - AbilitySetTags = AbilitySetTagContainer; -} +void FUHLAbilitySet_GrantedHandles::SetAbilitySetTags(const FGameplayTagContainer& AbilitySetTagContainer) { AbilitySetTags = AbilitySetTagContainer; } void FUHLAbilitySet_GrantedHandles::AddAbilitySpecHandle(const FGameplayAbilitySpecHandle& Handle) { @@ -28,10 +25,7 @@ void FUHLAbilitySet_GrantedHandles::AddGameplayEffectHandle(const FActiveGamepla } } -void FUHLAbilitySet_GrantedHandles::AddAttributeSet(UAttributeSet* Set) -{ - GrantedAttributeSets.Add(Set); -} +void FUHLAbilitySet_GrantedHandles::AddAttributeSet(UAttributeSet* Set) { GrantedAttributeSets.Add(Set); } void FUHLAbilitySet_GrantedHandles::TakeFromAbilitySystem(UAbilitySystemComponent* ASC) { @@ -64,16 +58,13 @@ void FUHLAbilitySet_GrantedHandles::TakeFromAbilitySystem(UAbilitySystemComponen ASC->RemoveSpawnedAttribute(Set); } - AbilitySetTags.Reset(); + AbilitySetTags.Reset(); AbilitySpecHandles.Reset(); GameplayEffectHandles.Reset(); GrantedAttributeSets.Reset(); } -UUHLAbilitySet::UUHLAbilitySet(const FObjectInitializer& ObjectInitializer) - : Super(ObjectInitializer) -{ -} +UUHLAbilitySet::UUHLAbilitySet(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {} void UUHLAbilitySet::GiveToAbilitySystem(UAbilitySystemComponent* ASC, FUHLAbilitySet_GrantedHandles* OutGrantedHandles, UObject* SourceObject) const { @@ -85,33 +76,33 @@ void UUHLAbilitySet::GiveToAbilitySystem(UAbilitySystemComponent* ASC, FUHLAbili return; } - // Save AbilitySetTags to handles - OutGrantedHandles->SetAbilitySetTags(AbilitySetTags); + // Save AbilitySetTags to handles + OutGrantedHandles->SetAbilitySetTags(AbilitySetTags); - // Grant the simple gameplay abilities. - for (int32 AbilityIndex = 0; AbilityIndex < GrantedSimpleGameplayAbilities.Num(); ++AbilityIndex) - { - TSubclassOf AbilityToGrant = GrantedSimpleGameplayAbilities[AbilityIndex]; + // Grant the simple gameplay abilities. + for (int32 AbilityIndex = 0; AbilityIndex < GrantedSimpleGameplayAbilities.Num(); ++AbilityIndex) + { + TSubclassOf AbilityToGrant = GrantedSimpleGameplayAbilities[AbilityIndex]; - if (!IsValid(AbilityToGrant)) - { - UE_LOG(LogUHLAbilitySystem, Error, TEXT("GrantedSimpleGameplayAbilities[%d] on ability set [%s] is not valid."), AbilityIndex, *GetNameSafe(this)); - continue; - } + if (!IsValid(AbilityToGrant)) + { + UE_LOG(LogUHLAbilitySystem, Error, TEXT("GrantedSimpleGameplayAbilities[%d] on ability set [%s] is not valid."), AbilityIndex, *GetNameSafe(this)); + continue; + } - UGameplayAbility* AbilityCDO = AbilityToGrant->GetDefaultObject(); + UGameplayAbility* AbilityCDO = AbilityToGrant->GetDefaultObject(); - FGameplayAbilitySpec AbilitySpec(AbilityCDO, 1); - AbilitySpec.SourceObject = SourceObject; + FGameplayAbilitySpec AbilitySpec(AbilityCDO, 1); + AbilitySpec.SourceObject = SourceObject; - const FGameplayAbilitySpecHandle AbilitySpecHandle = ASC->GiveAbility(AbilitySpec); + const FGameplayAbilitySpecHandle AbilitySpecHandle = ASC->GiveAbility(AbilitySpec); + + if (OutGrantedHandles) + { + OutGrantedHandles->AddAbilitySpecHandle(AbilitySpecHandle); + } + } - if (OutGrantedHandles) - { - OutGrantedHandles->AddAbilitySpecHandle(AbilitySpecHandle); - } - } - // Grant the gameplay abilities. for (int32 AbilityIndex = 0; AbilityIndex < GrantedGameplayAbilities.Num(); ++AbilityIndex) { @@ -180,11 +171,10 @@ void UUHLAbilitySet::GiveToAbilitySystem(UAbilitySystemComponent* ASC, FUHLAbili TArray> UUHLAbilitySet::GetAllAbilitiesList() const { - TArray> Result = GrantedSimpleGameplayAbilities; - for (const FUHLAbilitySet_GameplayAbility& GrantedGameplayAbility : GrantedGameplayAbilities) - { - Result.Add(GrantedGameplayAbility.Ability); - } - return Result; + TArray> Result = GrantedSimpleGameplayAbilities; + for (const FUHLAbilitySet_GameplayAbility& GrantedGameplayAbility : GrantedGameplayAbilities) + { + Result.Add(GrantedGameplayAbility.Ability); + } + return Result; } - diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_ActivateAbility.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_ActivateAbility.cpp index a245745..f2b4689 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_ActivateAbility.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_ActivateAbility.cpp @@ -3,8 +3,11 @@ #include "Animation/Notifies/ANS_ActivateAbility.h" +#include "Engine/World.h" +#include "Animation/AnimMontage.h" #include "AbilitySystemComponent.h" #include "AbilitySystemInterface.h" +#include "Components/SkeletalMeshComponent.h" #include "Utils/UnrealHelperLibraryBPL.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_ActivateAbility) diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CatchToAbilityInputCache.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CatchToAbilityInputCache.cpp index 2e93a5b..bac0a5b 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CatchToAbilityInputCache.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CatchToAbilityInputCache.cpp @@ -5,6 +5,7 @@ #include "AbilitySystemInterface.h" #include "AbilitySystem/UHLAbilitySystemComponent.h" +#include "Components/SkeletalMeshComponent.h" #include "Core/UHLGameplayTags.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_CatchToAbilityInputCache) diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CheckAbilityInputCache.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CheckAbilityInputCache.cpp index d8a34d0..b0f50cb 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CheckAbilityInputCache.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_CheckAbilityInputCache.cpp @@ -5,6 +5,7 @@ #include "AbilitySystemInterface.h" #include "AbilitySystem/UHLAbilitySystemComponent.h" +#include "Components/SkeletalMeshComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_CheckAbilityInputCache) diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.cpp index 602295e..f927568 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.cpp @@ -5,6 +5,8 @@ #include "GameFramework/Character.h" #include "GameFramework/CharacterMovementComponent.h" +#include "Animation/AnimInstance.h" +#include "Components/SkeletalMeshComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_EnableRootMotionZAxisMovement) diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_MagnetTo.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_MagnetTo.cpp index d531dbb..d6b3f76 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_MagnetTo.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_MagnetTo.cpp @@ -5,6 +5,7 @@ #include "GameFramework/Character.h" #include "Kismet/KismetMathLibrary.h" +#include "Components/SkeletalMeshComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_MagnetTo) @@ -15,8 +16,8 @@ void UANS_MagnetTo::NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceB // Speed = Distance / TotalDuration / 60; BaseCharacter = Cast(MeshComp->GetOwner()); - FTimerHandle TimerHandle; - MeshComp->GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &UANS_MagnetTo::TimerTick, 0.0f, true, -1); + // FTimerHandle TimerHandle; + // MeshComp->GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &UANS_MagnetTo::TimerTick, 0.0f, true, -1); // GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &ABaseDestructibleActor::FinalDestruct, TimeToDisappear); } @@ -37,9 +38,3 @@ void UANS_MagnetTo::NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBas { Super::NotifyEnd(MeshComp, Animation, EventReference); } - -void UANS_MagnetTo::TimerTick() -{ - float test = 0.0f; -} - diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_UHL_Base.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_UHL_Base.cpp index 4fec787..3a510ef 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_UHL_Base.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/ANS_UHL_Base.cpp @@ -2,6 +2,10 @@ #include "Animation/Notifies/ANS_UHL_Base.h" +#include "Animation/AnimInstance.h" +#include "Animation/AnimMontage.h" +#include "Engine/World.h" +#include "Components/SkeletalMeshComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ANS_UHL_Base) diff --git a/Source/UnrealHelperLibrary/Private/Animation/Notifies/AN_UHL_Base.cpp b/Source/UnrealHelperLibrary/Private/Animation/Notifies/AN_UHL_Base.cpp index 00e534c..f1f6b95 100644 --- a/Source/UnrealHelperLibrary/Private/Animation/Notifies/AN_UHL_Base.cpp +++ b/Source/UnrealHelperLibrary/Private/Animation/Notifies/AN_UHL_Base.cpp @@ -2,6 +2,7 @@ #include "Animation/Notifies/AN_UHL_Base.h" +#include "Components/SkeletalMeshComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(AN_UHL_Base) diff --git a/Source/UnrealHelperLibrary/Private/Characters/UHLBaseCharacterWithASC.cpp b/Source/UnrealHelperLibrary/Private/Characters/UHLBaseCharacterWithASC.cpp index c0745d4..1bed30e 100644 --- a/Source/UnrealHelperLibrary/Private/Characters/UHLBaseCharacterWithASC.cpp +++ b/Source/UnrealHelperLibrary/Private/Characters/UHLBaseCharacterWithASC.cpp @@ -3,6 +3,7 @@ #include "Characters/UHLBaseCharacterWithASC.h" +#include "GameFramework/Controller.h" #include "AbilitySystem/UHLAbilitySystemComponent.h" #include "AbilitySystem/AttributeSets/UHLBaseCharacterAttributeSet.h" diff --git a/Source/UnrealHelperLibrary/Private/Core/UHLPlayerController.cpp b/Source/UnrealHelperLibrary/Private/Core/UHLPlayerController.cpp index 314c4ed..38a69e0 100644 --- a/Source/UnrealHelperLibrary/Private/Core/UHLPlayerController.cpp +++ b/Source/UnrealHelperLibrary/Private/Core/UHLPlayerController.cpp @@ -4,6 +4,8 @@ #include "Core/UHLPlayerController.h" #include "Kismet/GameplayStatics.h" +#include "Engine/World.h" +#include "Engine/GameInstance.h" #include "Subsystems/DebugSubsystem/UHLDebugSubsystem.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(UHLPlayerController) diff --git a/Source/UnrealHelperLibrary/Private/Input/UHLInputConfig.cpp b/Source/UnrealHelperLibrary/Private/Input/UHLInputConfig.cpp index e02613a..a6dcc35 100644 --- a/Source/UnrealHelperLibrary/Private/Input/UHLInputConfig.cpp +++ b/Source/UnrealHelperLibrary/Private/Input/UHLInputConfig.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "Input/UHLInputConfig.h" // #include "LyraLogChannels.h" @@ -8,9 +8,7 @@ #include UE_INLINE_GENERATED_CPP_BY_NAME(UHLInputConfig) -UUHLInputConfig::UUHLInputConfig(const FObjectInitializer& ObjectInitializer) -{ -} +UUHLInputConfig::UUHLInputConfig(const FObjectInitializer& ObjectInitializer) {} // const UInputAction* UGCInputConfig::FindNativeInputActionForTag(const FGameplayTag& InputTag, bool bLogNotFound) const // { diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.cpp index e35fd91..513b60b 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.cpp @@ -3,6 +3,10 @@ #include "Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.h" +#include "UnrealEngine.h" +#include "Engine/Engine.h" +#include "Engine/World.h" +#include "Engine/GameInstance.h" #include "Kismet/GameplayStatics.h" #include "Subsystems/DebugSubsystem/UHLDebugSubsystem.h" diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Abilities.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Abilities.cpp index 6bc6a58..3d80041 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Abilities.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Abilities.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Abilities.h" +#include "Engine/World.h" #include "Kismet/KismetSystemLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(DCC_AbilitySystem_Abilities) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Attributes.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Attributes.cpp index a27e8d6..7334248 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Attributes.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Attributes.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Attributes.h" +#include "Engine/World.h" #include "Kismet/KismetSystemLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(DCC_AbilitySystem_Attributes) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Effects.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Effects.cpp index 065b73a..2aaf050 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Effects.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Effects.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategories/DCC_AbilitySystem_Effects.h" +#include "Engine/World.h" #include "Kismet/KismetSystemLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(DCC_AbilitySystem_Effects) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_Collisions.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_Collisions.cpp index 15e1c8d..e568b08 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_Collisions.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_Collisions.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategories/DCC_Collisions.h" +#include "Engine/World.h" #include "Kismet/KismetSystemLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(DCC_Collisions) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_InputSystem_EnhancedInput.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_InputSystem_EnhancedInput.cpp index 8360b4b..e43daeb 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_InputSystem_EnhancedInput.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategories/DCC_InputSystem_EnhancedInput.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategories/DCC_InputSystem_EnhancedInput.h" +#include "Engine/World.h" #include "Kismet/KismetSystemLibrary.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(DCC_InputSystem_EnhancedInput) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategoryButtonWidget.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategoryButtonWidget.cpp index 0e76fbf..454f957 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategoryButtonWidget.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/DebugCategoryButtonWidget.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/DebugCategoryButtonWidget.h" +#include "Engine/GameInstance.h" #include "Blueprint/WidgetTree.h" #include "Components/Button.h" #include "Components/ButtonSlot.h" diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.cpp index 51e912a..a506bfb 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.cpp @@ -1,4 +1,7 @@ -#include "Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h" +// Copyright (c) 2024 Pavel Penkov + + +#include "Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(UHLDebugCategoryComponent) diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp index 81dd426..8f35061 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/UHLDebugSubsystem.h" +#include "GameFramework/Pawn.h" #include "AbilitySystemInterface.h" #include "AbilitySystem/UHLAbilitySystemComponent.h" #include "Blueprint/UserWidget.h" diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UI/UHLDebugCategoriesListWidget.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UI/UHLDebugCategoriesListWidget.cpp index ad5f981..e87e3cb 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UI/UHLDebugCategoriesListWidget.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UI/UHLDebugCategoriesListWidget.cpp @@ -3,6 +3,7 @@ #include "Subsystems/DebugSubsystem/UI/UHLDebugCategoriesListWidget.h" +#include "Engine/GameInstance.h" #include "Blueprint/WidgetTree.h" #include "Components/Button.h" #include "Components/ButtonSlot.h" diff --git a/Source/UnrealHelperLibrary/Private/UnrealHelperLibrary.cpp b/Source/UnrealHelperLibrary/Private/UnrealHelperLibrary.cpp index e3f0673..abebec3 100644 --- a/Source/UnrealHelperLibrary/Private/UnrealHelperLibrary.cpp +++ b/Source/UnrealHelperLibrary/Private/UnrealHelperLibrary.cpp @@ -1,7 +1,8 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "UnrealHelperLibrary.h" +#include "Misc/Paths.h" #include "GameplayTagsManager.h" #define LOCTEXT_NAMESPACE "FUnrealHelperLibraryModule" @@ -11,80 +12,79 @@ DEFINE_LOG_CATEGORY(LogUHLAbilitySystem); void FUnrealHelperLibraryModule::StartupModule() { - UGameplayTagsManager& TagsManager = UGameplayTagsManager::Get(); + UGameplayTagsManager& TagsManager = UGameplayTagsManager::Get(); // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module - TagsManager.AddTagIniSearchPath(FPaths::ProjectPluginsDir() / TEXT("UnrealHelperLibrary/Config/Tags")); - - // TArray> OutTagArray; - // TArray OutPaths; - // TagsManager.GetTagSourceSearchPaths(OutPaths); - // TagsManager.GetAllTagsFromSource(FApp::GetProjectName(), OutTagArray); - // // GameplayTagsManager.FindTagsWithSource() - // - // // TODO find MainModule name - // FString Test1 = FApp::GetName(); - // FString Test2 = FApp::GetProjectName(); - // FString Test3 = FApp::GetInstanceName(); - // FString Test6 = FModuleManager::Get().GetGameBinariesDirectory(); - // - // // TArray OutModuleStatuses; - // // FModuleManager::Get().QueryModules(OutModuleStatuses); - // - // // FModuleStatus* MyGameModule = OutModuleStatuses.FindByPredicate([](const FModuleStatus& ModuleStatusStatus) { - // // return ModuleStatusStatus.bIsGameModule && ModuleStatusStatus.bIsLoaded; - // // }); - // - // // Ask the module manager for a list of currently-loaded gameplay modules - // UGameplayTagsManager::Get().OnLastChanceToAddNativeTags().AddLambda([this]() - // { - // UGameplayTagsManager& TagsManager2 = UGameplayTagsManager::Get(); - // - // // StaticImpl.RootTag = UGameplayTagsManager::Get().AddNativeGameplayTag(TagT::GetRootTagStr()); - // TArray GameModulesNames; - // TArray ModuleStatuses; - // FModuleManager::Get().QueryModules(ModuleStatuses); - // - // for (FModuleStatus& ModuleStatus : ModuleStatuses) - // { - // // We only care about game modules that are currently loaded - // if (ModuleStatus.bIsLoaded && ModuleStatus.bIsGameModule) - // { - // GameModulesNames.Add(MoveTemp(ModuleStatus.Name)); - // } - // } - // - // for (const FString& GameModulesName : GameModulesNames) - // { - // // GameplayTagsManager.FindTagsWithSource(FString("Bogatyr"), NativeTags); - // TArray NativeTags; - // TagsManager2.FindTagsWithSource(GameModulesName, NativeTags); - // - // for (FGameplayTag& NativeTag : NativeTags) - // { - // FName NativeTagNam = NativeTag.GetTagName(); - // // FNativeGameplayTag* Test = new FNativeGameplayTag(FName("UnrealHelperLibrary"), FName("UnrealHelperLibrary"), NativeTagNam, "", ENativeGameplayTagToken::PRIVATE_USE_MACRO_INSTEAD); - // // TagsManager2.AddNativeGameplayTag(Test); - // TagsManager2.AddNativeGameplayTag(NativeTagNam, ""); - // } - // } - // FName TestTag = "Test123.Test322.Test123"; - // TagsManager2.AddNativeGameplayTag(TestTag, ""); - // // UGameplayTagsManager::Get().DoneAddingNativeTags(); - // }); - // - // TagsManager.ConstructGameplayTagTree(); - // TagsManager.LoadGameplayTagTables(); + TagsManager.AddTagIniSearchPath(FPaths::ProjectPluginsDir() / TEXT("UnrealHelperLibrary/Config/Tags")); + // TArray> OutTagArray; + // TArray OutPaths; + // TagsManager.GetTagSourceSearchPaths(OutPaths); + // TagsManager.GetAllTagsFromSource(FApp::GetProjectName(), OutTagArray); + // // GameplayTagsManager.FindTagsWithSource() + // + // // TODO find MainModule name + // FString Test1 = FApp::GetName(); + // FString Test2 = FApp::GetProjectName(); + // FString Test3 = FApp::GetInstanceName(); + // FString Test6 = FModuleManager::Get().GetGameBinariesDirectory(); + // + // // TArray OutModuleStatuses; + // // FModuleManager::Get().QueryModules(OutModuleStatuses); + // + // // FModuleStatus* MyGameModule = OutModuleStatuses.FindByPredicate([](const FModuleStatus& ModuleStatusStatus) { + // // return ModuleStatusStatus.bIsGameModule && ModuleStatusStatus.bIsLoaded; + // // }); + // + // // Ask the module manager for a list of currently-loaded gameplay modules + // UGameplayTagsManager::Get().OnLastChanceToAddNativeTags().AddLambda([this]() + // { + // UGameplayTagsManager& TagsManager2 = UGameplayTagsManager::Get(); + // + // // StaticImpl.RootTag = UGameplayTagsManager::Get().AddNativeGameplayTag(TagT::GetRootTagStr()); + // TArray GameModulesNames; + // TArray ModuleStatuses; + // FModuleManager::Get().QueryModules(ModuleStatuses); + // + // for (FModuleStatus& ModuleStatus : ModuleStatuses) + // { + // // We only care about game modules that are currently loaded + // if (ModuleStatus.bIsLoaded && ModuleStatus.bIsGameModule) + // { + // GameModulesNames.Add(MoveTemp(ModuleStatus.Name)); + // } + // } + // + // for (const FString& GameModulesName : GameModulesNames) + // { + // // GameplayTagsManager.FindTagsWithSource(FString("Bogatyr"), NativeTags); + // TArray NativeTags; + // TagsManager2.FindTagsWithSource(GameModulesName, NativeTags); + // + // for (FGameplayTag& NativeTag : NativeTags) + // { + // FName NativeTagNam = NativeTag.GetTagName(); + // // FNativeGameplayTag* Test = new FNativeGameplayTag(FName("UnrealHelperLibrary"), FName("UnrealHelperLibrary"), NativeTagNam, "", ENativeGameplayTagToken::PRIVATE_USE_MACRO_INSTEAD); + // // TagsManager2.AddNativeGameplayTag(Test); + // TagsManager2.AddNativeGameplayTag(NativeTagNam, ""); + // } + // } + // FName TestTag = "Test123.Test322.Test123"; + // TagsManager2.AddNativeGameplayTag(TestTag, ""); + // // UGameplayTagsManager::Get().DoneAddingNativeTags(); + // }); + // + // TagsManager.ConstructGameplayTagTree(); + // TagsManager.LoadGameplayTagTables(); - // for (const FGameplayTag& Tag : NativeTags) - // { - // if (IsTagOnlyAvailableFromExcludedSources(Manager, Tag, ExcludedPlugins)) - // { - // FAssetIdentifier TagId = FAssetIdentifier(FGameplayTag::StaticStruct(), Tag.GetTagName()); - // AssetIdsInPlugin.Add(TagId); - // } - // } - // } + // for (const FGameplayTag& Tag : NativeTags) + // { + // if (IsTagOnlyAvailableFromExcludedSources(Manager, Tag, ExcludedPlugins)) + // { + // FAssetIdentifier TagId = FAssetIdentifier(FGameplayTag::StaticStruct(), Tag.GetTagName()); + // AssetIdsInPlugin.Add(TagId); + // } + // } + // } } void FUnrealHelperLibraryModule::ShutdownModule() diff --git a/Source/UnrealHelperLibrary/Private/Utils/UHLTraceUtilsBPL.cpp b/Source/UnrealHelperLibrary/Private/Utils/UHLTraceUtilsBPL.cpp index 7145f0e..3950dae 100644 --- a/Source/UnrealHelperLibrary/Private/Utils/UHLTraceUtilsBPL.cpp +++ b/Source/UnrealHelperLibrary/Private/Utils/UHLTraceUtilsBPL.cpp @@ -2,8 +2,10 @@ #include "Utils/UHLTraceUtilsBPL.h" - -// #include "UnrealHelperLibraryBPLibrary.h" +#include "Engine/World.h" +#include "Engine/EngineTypes.h" +#include "Engine/HitResult.h" +#include "DrawDebugHelpers.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(UHLTraceUtilsBPL) diff --git a/Source/UnrealHelperLibrary/Private/Utils/UnrealHelperLibraryBPL.cpp b/Source/UnrealHelperLibrary/Private/Utils/UnrealHelperLibraryBPL.cpp index b23fffa..c4137fd 100644 --- a/Source/UnrealHelperLibrary/Private/Utils/UnrealHelperLibraryBPL.cpp +++ b/Source/UnrealHelperLibrary/Private/Utils/UnrealHelperLibraryBPL.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #include "Utils/UnrealHelperLibraryBPL.h" @@ -23,6 +23,11 @@ #include "Kismet/GameplayStatics.h" #include "Kismet/KismetMathLibrary.h" #include "Kismet/KismetSystemLibrary.h" +#include "Misc/ConfigCacheIni.h" +#include "Animation/AnimMontage.h" +#include "DrawDebugHelpers.h" +#include "Engine/World.h" +#include "Engine/GameInstance.h" #include "Subsystems/DebugSubsystem/UHLDebugSubsystem.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(UnrealHelperLibraryBPL) @@ -32,241 +37,230 @@ static const int32 DEPTH_PRIORITY = -1; FString UUnrealHelperLibraryBPL::GetProjectVersion() { FString ProjectVersion; - GConfig->GetString( - TEXT("/Script/EngineSettings.GeneralProjectSettings"), - TEXT("ProjectVersion"), - ProjectVersion, - GGameIni - ); + GConfig->GetString(TEXT("/Script/EngineSettings.GeneralProjectSettings"), TEXT("ProjectVersion"), ProjectVersion, GGameIni); return ProjectVersion; } -void UUnrealHelperLibraryBPL::DebugPrintStrings(const FString& A, const FString& B, const FString& C, - const FString& D, const FString& E, const FString& F, const FString& G, const FString& H, const FString& I, - const FString& J, float Duration, const FName Key, const bool bEnabled) +void UUnrealHelperLibraryBPL::DebugPrintStrings(const FString& A, const FString& B, const FString& C, const FString& D, const FString& E, const FString& F, const FString& G, const FString& H, + const FString& I, const FString& J, float Duration, const FName Key, const bool bEnabled) { FString StringResult; - StringResult.Empty(A.Len() + B.Len() + C.Len() + D.Len() + E.Len() + 1); // adding one for the string terminator + StringResult.Empty(A.Len() + B.Len() + C.Len() + D.Len() + E.Len() + 1); // adding one for the string terminator StringResult += A; StringResult += B; StringResult += C; StringResult += D; StringResult += E; - if (!bEnabled) return; + if (!bEnabled) + return; - UKismetSystemLibrary::PrintString( - nullptr, StringResult,true, true, - FLinearColor(0, 0.66, 1), Duration, Key - ); + UKismetSystemLibrary::PrintString(nullptr, StringResult, true, true, FLinearColor(0, 0.66, 1), Duration, Key); } void UUnrealHelperLibraryBPL::DebugPrintString(const UObject* WorldContextObject, const FString& A, float Duration, const FName Key, const bool bEnabled) { FString StringResult; - StringResult.Empty(A.Len() + 1); // adding one for the string terminator + StringResult.Empty(A.Len() + 1); // adding one for the string terminator - if (!bEnabled) return; + if (!bEnabled) + return; - UKismetSystemLibrary::PrintString( - WorldContextObject, StringResult,true, true, - FLinearColor(0, 0.66, 1), Duration, Key - ); + UKismetSystemLibrary::PrintString(WorldContextObject, StringResult, true, true, FLinearColor(0, 0.66, 1), Duration, Key); } -void UUnrealHelperLibraryBPL::DrawDebugBar() -{ -} +void UUnrealHelperLibraryBPL::DrawDebugBar() {} float UUnrealHelperLibraryBPL::GetAnimMontageSectionLengthByName(UAnimMontage* AnimMontage, FName SectionName) { float Result = -1; - if (!IsValid(AnimMontage)) return Result; + if (!IsValid(AnimMontage)) + return Result; int32 SectionIdx = SectionName.IsNone() ? 0 : AnimMontage->GetSectionIndex(SectionName); - if (SectionIdx == INDEX_NONE) return Result; + if (SectionIdx == INDEX_NONE) + return Result; DebugPrintString(AnimMontage->GetWorld(), FString::Printf(TEXT("Section %s %i"), *SectionName.ToString(), SectionIdx), Result); Result = AnimMontage->GetSectionLength(SectionIdx); return Result; } -FGameplayEffectSpec UUnrealHelperLibraryBPL::CreateGenericGASGameplayEffectSpec(TSubclassOf GameplayEffectClass, AActor* HitInstigator, AActor* InEffectCauser, - const FHitResult& HitResult, const UObject* SourceObject) +FGameplayEffectSpec UUnrealHelperLibraryBPL::CreateGenericGASGameplayEffectSpec( + TSubclassOf GameplayEffectClass, AActor* HitInstigator, AActor* InEffectCauser, const FHitResult& HitResult, const UObject* SourceObject) { - const UGameplayEffect* GameplayEffect = GameplayEffectClass->GetDefaultObject(); - FGameplayEffectContext* GameplayEffectContext = new FGameplayEffectContext(HitInstigator, InEffectCauser); - FGameplayEffectContextHandle GameplayEffectContextHandle(GameplayEffectContext); - GameplayEffectContextHandle.AddHitResult(HitResult); - GameplayEffectContextHandle.AddSourceObject(SourceObject); - FGameplayEffectSpec GameplayEffectSpec(GameplayEffect, GameplayEffectContextHandle); - return GameplayEffectSpec; + const UGameplayEffect* GameplayEffect = GameplayEffectClass->GetDefaultObject(); + FGameplayEffectContext* GameplayEffectContext = new FGameplayEffectContext(HitInstigator, InEffectCauser); + FGameplayEffectContextHandle GameplayEffectContextHandle(GameplayEffectContext); + GameplayEffectContextHandle.AddHitResult(HitResult); + GameplayEffectContextHandle.AddSourceObject(SourceObject); + FGameplayEffectSpec GameplayEffectSpec(GameplayEffect, GameplayEffectContextHandle); + return GameplayEffectSpec; } void UUnrealHelperLibraryBPL::UpdateStateGameplayTags(UAbilitySystemComponent* ASC, bool bCondition, FGameplayTag PositiveConditionTag, FGameplayTag NegativeConditionTag) { - if (!ASC) return; - - if (bCondition) - { - if (!ASC->HasMatchingGameplayTag(PositiveConditionTag)) - { - ASC->AddLooseGameplayTag(PositiveConditionTag); - } - if (NegativeConditionTag != FGameplayTag::EmptyTag) - { - ASC->RemoveLooseGameplayTag(NegativeConditionTag, 999999); - } - } - else - { - if (NegativeConditionTag == FGameplayTag::EmptyTag) - { - ASC->RemoveLooseGameplayTag(PositiveConditionTag, 999999); - } - else - { - if (!ASC->HasMatchingGameplayTag(NegativeConditionTag)) - { - ASC->AddLooseGameplayTag(NegativeConditionTag); - } - ASC->RemoveLooseGameplayTag(PositiveConditionTag, 999999); - } - } + if (!ASC) + return; + + if (bCondition) + { + if (!ASC->HasMatchingGameplayTag(PositiveConditionTag)) + { + ASC->AddLooseGameplayTag(PositiveConditionTag); + } + if (NegativeConditionTag != FGameplayTag::EmptyTag) + { + ASC->RemoveLooseGameplayTag(NegativeConditionTag, 999999); + } + } + else + { + if (NegativeConditionTag == FGameplayTag::EmptyTag) + { + ASC->RemoveLooseGameplayTag(PositiveConditionTag, 999999); + } + else + { + if (!ASC->HasMatchingGameplayTag(NegativeConditionTag)) + { + ASC->AddLooseGameplayTag(NegativeConditionTag); + } + ASC->RemoveLooseGameplayTag(PositiveConditionTag, 999999); + } + } } bool UUnrealHelperLibraryBPL::TryActivateAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag, bool bAllowRemoteActivation) { - if (!IsValid(ASC)) return false; - return ASC->TryActivateAbilitiesByTag(FGameplayTagContainer(GameplayTag), bAllowRemoteActivation); + if (!IsValid(ASC)) + return false; + return ASC->TryActivateAbilitiesByTag(FGameplayTagContainer(GameplayTag), bAllowRemoteActivation); } bool UUnrealHelperLibraryBPL::TryCancelAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag) { - if (!IsValid(ASC)) return false; + if (!IsValid(ASC)) + return false; - bool bResult = false; - TArray AbilitiesToCancel; - ASC->GetActivatableGameplayAbilitySpecsByAllMatchingTags(FGameplayTagContainer(GameplayTag), AbilitiesToCancel, false); + bool bResult = false; + TArray AbilitiesToCancel; + ASC->GetActivatableGameplayAbilitySpecsByAllMatchingTags(FGameplayTagContainer(GameplayTag), AbilitiesToCancel, false); - for (FGameplayAbilitySpec* AbilitySpec : AbilitiesToCancel) - { - TArray AbilityInstances = AbilitySpec->GetAbilityInstances(); - for (UGameplayAbility* Ability : AbilityInstances) - { - if (Ability->IsActive()) - { - Ability->K2_CancelAbility(); - bResult = true; - } - } - } - return bResult; + for (FGameplayAbilitySpec* AbilitySpec : AbilitiesToCancel) + { + TArray AbilityInstances = AbilitySpec->GetAbilityInstances(); + for (UGameplayAbility* Ability : AbilityInstances) + { + if (Ability->IsActive()) + { + Ability->K2_CancelAbility(); + bResult = true; + } + } + } + return bResult; } TArray UUnrealHelperLibraryBPL::TryCancelAbilitiesWithTags(UAbilitySystemComponent* ASC, TArray GameplayTags) { - if (!IsValid(ASC)) return {}; + if (!IsValid(ASC)) + return {}; - TArray Result; - for (auto GameplayTag : GameplayTags) - { - Result.Add(TryCancelAbilityWithTag(ASC, GameplayTag)); - } - return Result; + TArray Result; + for (auto GameplayTag : GameplayTags) + { + Result.Add(TryCancelAbilityWithTag(ASC, GameplayTag)); + } + return Result; } -int32 UUnrealHelperLibraryBPL::FireGameplayEvent(UAbilitySystemComponent* ASC, FGameplayTag EventTag, const FGameplayEventData& Payload) -{ - return ASC->HandleGameplayEvent(EventTag, &Payload); -} +int32 UUnrealHelperLibraryBPL::FireGameplayEvent(UAbilitySystemComponent* ASC, FGameplayTag EventTag, const FGameplayEventData& Payload) { return ASC->HandleGameplayEvent(EventTag, &Payload); } FGameplayTag UUnrealHelperLibraryBPL::FindTagByString(const FString& TagString, bool bMatchPartialString) { - const UGameplayTagsManager& Manager = UGameplayTagsManager::Get(); - FGameplayTag Tag = Manager.RequestGameplayTag(FName(*TagString), false); + const UGameplayTagsManager& Manager = UGameplayTagsManager::Get(); + FGameplayTag Tag = Manager.RequestGameplayTag(FName(*TagString), false); - if (!Tag.IsValid() && bMatchPartialString) - { - FGameplayTagContainer AllTags; - Manager.RequestAllGameplayTags(AllTags, true); + if (!Tag.IsValid() && bMatchPartialString) + { + FGameplayTagContainer AllTags; + Manager.RequestAllGameplayTags(AllTags, true); - for (const FGameplayTag& TestTag : AllTags) - { - if (TestTag.ToString().Contains(TagString)) - { - // UE_LOG(LogUnrealHelperLibrary, Display, TEXT("Could not find exact match for tag [%s] but found partial match on tag [%s]."), *TagString, *TestTag.ToString()); - Tag = TestTag; - break; - } - } - } + for (const FGameplayTag& TestTag : AllTags) + { + if (TestTag.ToString().Contains(TagString)) + { + // UE_LOG(LogUnrealHelperLibrary, Display, TEXT("Could not find exact match for tag [%s] but found partial match on tag [%s]."), *TagString, *TestTag.ToString()); + Tag = TestTag; + break; + } + } + } - return Tag; + return Tag; } EUHLDirection UUnrealHelperLibraryBPL::GetOppositeDirection(EUHLDirection Direction_In) { switch (Direction_In) { - case EUHLDirection::Left: return EUHLDirection::Right; - case EUHLDirection::Right: return EUHLDirection::Left; - case EUHLDirection::Front: return EUHLDirection::Back; - case EUHLDirection::Back: return EUHLDirection::Front; - default: return EUHLDirection::None; + case EUHLDirection::Left: + return EUHLDirection::Right; + case EUHLDirection::Right: + return EUHLDirection::Left; + case EUHLDirection::Front: + return EUHLDirection::Back; + case EUHLDirection::Back: + return EUHLDirection::Front; + default: + return EUHLDirection::None; } } TArray UUnrealHelperLibraryBPL::GetNamesOfComponentsOnObject(UObject* OwnerObject, UClass* Class) { - TArray Result = {}; + TArray Result = {}; - UBlueprintGeneratedClass* BlueprintGeneratedClass = OwnerObject->IsA() - ? Cast(OwnerObject) - : Cast(OwnerObject->GetClass()); - if (!BlueprintGeneratedClass) return Result; + UBlueprintGeneratedClass* BlueprintGeneratedClass = + OwnerObject->IsA() ? Cast(OwnerObject) : Cast(OwnerObject->GetClass()); + if (!BlueprintGeneratedClass) + return Result; - TArray DefaultObjectSubobjects; - BlueprintGeneratedClass->GetDefaultObjectSubobjects(DefaultObjectSubobjects); + TArray DefaultObjectSubobjects; + BlueprintGeneratedClass->GetDefaultObjectSubobjects(DefaultObjectSubobjects); - // Search for ActorComponents created from C++ - for (UObject* DefaultSubObject : DefaultObjectSubobjects) - { - if (DefaultSubObject->IsA(Class)) - { - Result.Add(DefaultSubObject->GetName()); - } - } + // Search for ActorComponents created from C++ + for (UObject* DefaultSubObject : DefaultObjectSubobjects) + { + if (DefaultSubObject->IsA(Class)) + { + Result.Add(DefaultSubObject->GetName()); + } + } - // Search for ActorComponents created in Blueprint - for (USCS_Node* Node : BlueprintGeneratedClass->SimpleConstructionScript->GetAllNodes()) - { - if (Node->ComponentClass->IsChildOf(Class)) - { - Result.Add(Node->GetVariableName().ToString()); - } - } + // Search for ActorComponents created in Blueprint + for (USCS_Node* Node : BlueprintGeneratedClass->SimpleConstructionScript->GetAllNodes()) + { + if (Node->ComponentClass->IsChildOf(Class)) + { + Result.Add(Node->GetVariableName().ToString()); + } + } - return Result; + return Result; } float UUnrealHelperLibraryBPL::RelativeAngleToActor( - AActor* ActorRelativeToWhomAngleCalculated, - AActor* TargetActor, - bool bRelativeToActorBack, - const bool bDebug, - const float DebugLifetime, - const FLinearColor DebugColor -) + AActor* ActorRelativeToWhomAngleCalculated, AActor* TargetActor, bool bRelativeToActorBack, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) { - if (!IsValid(ActorRelativeToWhomAngleCalculated) || !IsValid(TargetActor)) return FLOAT_ERROR; + if (!IsValid(ActorRelativeToWhomAngleCalculated) || !IsValid(TargetActor)) + return FLOAT_ERROR; float Multiplier = bRelativeToActorBack ? 1 : -1; float Result = UKismetAnimationLibrary::CalculateDirection( - ActorRelativeToWhomAngleCalculated->GetActorLocation() - TargetActor->GetActorLocation(), - (ActorRelativeToWhomAngleCalculated->GetActorForwardVector() * Multiplier).ToOrientationRotator() - ); + ActorRelativeToWhomAngleCalculated->GetActorLocation() - TargetActor->GetActorLocation(), (ActorRelativeToWhomAngleCalculated->GetActorForwardVector() * Multiplier).ToOrientationRotator()); if (bDebug) { @@ -285,19 +279,15 @@ float UUnrealHelperLibraryBPL::RelativeAngleToActor( float UUnrealHelperLibraryBPL::RelativeAngleToVector(AActor* ActorRelativeToWhomAngleCalculated, FVector TargetVector) { - if (!IsValid(ActorRelativeToWhomAngleCalculated)) return FLOAT_ERROR; - return UKismetAnimationLibrary::CalculateDirection( - ActorRelativeToWhomAngleCalculated->GetActorLocation() - TargetVector, - (ActorRelativeToWhomAngleCalculated->GetActorForwardVector() * -1).ToOrientationRotator() - ); + if (!IsValid(ActorRelativeToWhomAngleCalculated)) + return FLOAT_ERROR; + return UKismetAnimationLibrary::CalculateDirection( + ActorRelativeToWhomAngleCalculated->GetActorLocation() - TargetVector, (ActorRelativeToWhomAngleCalculated->GetActorForwardVector() * -1).ToOrientationRotator()); } float UUnrealHelperLibraryBPL::RelativeAngleVectorToVector(FVector VectorRelativeToWhomAngleCalculated, FVector TargetVector) { - return UKismetAnimationLibrary::CalculateDirection( - VectorRelativeToWhomAngleCalculated - TargetVector, - (VectorRelativeToWhomAngleCalculated * -1).ToOrientationRotator() - ); + return UKismetAnimationLibrary::CalculateDirection(VectorRelativeToWhomAngleCalculated - TargetVector, (VectorRelativeToWhomAngleCalculated * -1).ToOrientationRotator()); } EUHLDirection UUnrealHelperLibraryBPL::GetHitReactDirection(const FVector& SourceActorLocation, const AActor* TargetActor) @@ -329,306 +319,304 @@ EUHLDirection UUnrealHelperLibraryBPL::GetHitReactDirection(const FVector& Sourc UActorComponent* UUnrealHelperLibraryBPL::GetActorComponentByName(AActor* Actor, FString Name) { - if (!IsValid(Actor)) return nullptr; + if (!IsValid(Actor)) + return nullptr; - for (UActorComponent* Component : Actor->GetComponents()) - { - if (Component->GetName() == Name) - { - return Component; - } - } - return nullptr; + for (UActorComponent* Component : Actor->GetComponents()) + { + if (Component->GetName() == Name) + { + return Component; + } + } + return nullptr; } USceneComponent* UUnrealHelperLibraryBPL::GetSceneComponentByName(AActor* Actor, FString Name) { - if (!IsValid(Actor)) return nullptr; + if (!IsValid(Actor)) + return nullptr; - return Cast(GetActorComponentByName(Actor, Name)); + return Cast(GetActorComponentByName(Actor, Name)); } FVector UUnrealHelperLibraryBPL::GetRandomPointInBox(const USceneComponent* Component, bool bOnGround, bool bDrawDebug, float DebugDrawTime) { - FVector Origin; - FVector BoxExtent; - float SphereRadius; + FVector Origin; + FVector BoxExtent; + float SphereRadius; - UKismetSystemLibrary::GetComponentBounds(Component, Origin, BoxExtent, SphereRadius); - FVector RandomPoint = UKismetMathLibrary::RandomPointInBoundingBox(Origin, BoxExtent); + UKismetSystemLibrary::GetComponentBounds(Component, Origin, BoxExtent, SphereRadius); + FVector RandomPoint = UKismetMathLibrary::RandomPointInBoundingBox(Origin, BoxExtent); - if (bOnGround) - { - RandomPoint.Z = GetHighestPointInBox(Component).Z; - FHitResult OutHit; - UKismetSystemLibrary::LineTraceSingle(Component->GetWorld(), RandomPoint, FVector(0, 0, -999999), - TraceTypeQuery1, false, TArray(), - bDrawDebug ? EDrawDebugTrace::Type::ForDuration : EDrawDebugTrace::Type::None, OutHit, - true, FLinearColor::Red, FLinearColor::Green, DebugDrawTime - ); - if (OutHit.IsValidBlockingHit()) - { - RandomPoint = OutHit.Location; - } - } + if (bOnGround) + { + RandomPoint.Z = GetHighestPointInBox(Component).Z; + FHitResult OutHit; + UKismetSystemLibrary::LineTraceSingle(Component->GetWorld(), RandomPoint, FVector(0, 0, -999999), TraceTypeQuery1, false, TArray(), + bDrawDebug ? EDrawDebugTrace::Type::ForDuration : EDrawDebugTrace::Type::None, OutHit, true, FLinearColor::Red, FLinearColor::Green, DebugDrawTime); + if (OutHit.IsValidBlockingHit()) + { + RandomPoint = OutHit.Location; + } + } - return RandomPoint; + return RandomPoint; } FVector UUnrealHelperLibraryBPL::GetHighestPointInBox(const USceneComponent* Component) { - if (!IsValid(Component)) return VECTOR_ERROR; - - FVector Origin; - FVector BoxExtent; - float SphereRadius = 0.0f; - UKismetSystemLibrary::GetComponentBounds(Component, Origin, BoxExtent, SphereRadius); - - const FVector BoxMin = Origin - BoxExtent; - const FVector BoxMax = Origin + BoxExtent; - return FBox(BoxMin, BoxMax).Max; -} - -void UUnrealHelperLibraryBPL::GetPointAtRelativeAngle(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const float Angle, const float Distance, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) -{ - if (!IsValid(ActorIn)) - { - Point = VECTOR_ERROR; - return; - } - FVector Result = ActorIn->GetActorLocation() + ActorIn->GetActorForwardVector().RotateAngleAxis(Angle, FVector(0, 0, 1)) * Distance; - if (bDebug) - { - DrawDebugString(ActorIn->GetWorld(), Result, FString::Printf(TEXT("Angle %.2f°\nDistance %.2f"), Angle, Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); - DrawDebugSphere(ActorIn->GetWorld(), Result, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); - FVector ArrowLineEnd = ActorIn->GetActorLocation() + ActorIn->GetActorForwardVector().RotateAngleAxis(Angle, FVector(0, 0, 1)) * (Distance - 10); - DrawDebugDirectionalArrow(ActorIn->GetWorld(), ActorIn->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); - } + if (!IsValid(Component)) + return VECTOR_ERROR; + + FVector Origin; + FVector BoxExtent; + float SphereRadius = 0.0f; + UKismetSystemLibrary::GetComponentBounds(Component, Origin, BoxExtent, SphereRadius); + + const FVector BoxMin = Origin - BoxExtent; + const FVector BoxMax = Origin + BoxExtent; + return FBox(BoxMin, BoxMax).Max; +} + +void UUnrealHelperLibraryBPL::GetPointAtRelativeAngle( + FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const float Angle, const float Distance, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) +{ + if (!IsValid(ActorIn)) + { + Point = VECTOR_ERROR; + return; + } + FVector Result = ActorIn->GetActorLocation() + ActorIn->GetActorForwardVector().RotateAngleAxis(Angle, FVector(0, 0, 1)) * Distance; + if (bDebug) + { + DrawDebugString(ActorIn->GetWorld(), Result, FString::Printf(TEXT("Angle %.2f°\nDistance %.2f"), Angle, Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); + DrawDebugSphere(ActorIn->GetWorld(), Result, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); + FVector ArrowLineEnd = ActorIn->GetActorLocation() + ActorIn->GetActorForwardVector().RotateAngleAxis(Angle, FVector(0, 0, 1)) * (Distance - 10); + DrawDebugDirectionalArrow(ActorIn->GetWorld(), ActorIn->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); + } Point = Result; PointRotation = (Point - ActorIn->GetActorLocation()).ToOrientationRotator(); } -void UUnrealHelperLibraryBPL::GetPointAtRelativeDirection(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const EUHLDirection Direction, const float Distance, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor, const FText DebugText) +void UUnrealHelperLibraryBPL::GetPointAtRelativeDirection(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const EUHLDirection Direction, const float Distance, const bool bDebug, + const float DebugLifetime, const FLinearColor DebugColor, const FText DebugText) { - if (!IsValid(ActorIn)) return; + if (!IsValid(ActorIn)) + return; - float Angle = DirectionToAngle(Direction); - GetPointAtRelativeAngle(Point, PointRotation, ActorIn, Angle, Distance); + float Angle = DirectionToAngle(Direction); + GetPointAtRelativeAngle(Point, PointRotation, ActorIn, Angle, Distance); - if (bDebug) - { - const UEnum* EnumPtr = FindObject(nullptr, TEXT("EUHLDirection"), true); - if (EnumPtr) - { - DrawDebugString(ActorIn->GetWorld(), Point, FString::Printf(TEXT("%s \nDirection %s\nDistance %.2f"), *DebugText.BuildSourceString(), *EnumPtr->GetNameStringByValue((uint8)Direction), Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); - } - DrawDebugSphere(ActorIn->GetWorld(), Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); - FVector ArrowLineEnd; - FRotator ArrowLineEndRotation; - GetPointAtRelativeAngle(ArrowLineEnd, ArrowLineEndRotation, ActorIn, Angle, Distance - 10); - DrawDebugDirectionalArrow(ActorIn->GetWorld(), ActorIn->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); - } + if (bDebug) + { + const UEnum* EnumPtr = FindObject(nullptr, TEXT("EUHLDirection"), true); + if (EnumPtr) + { + DrawDebugString(ActorIn->GetWorld(), Point, + FString::Printf(TEXT("%s \nDirection %s\nDistance %.2f"), *DebugText.BuildSourceString(), *EnumPtr->GetNameStringByValue((uint8)Direction), Distance), 0, DebugColor.ToFColor(true), + DebugLifetime, true, 1.0f); + } + DrawDebugSphere(ActorIn->GetWorld(), Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); + FVector ArrowLineEnd; + FRotator ArrowLineEndRotation; + GetPointAtRelativeAngle(ArrowLineEnd, ArrowLineEndRotation, ActorIn, Angle, Distance - 10); + DrawDebugDirectionalArrow(ActorIn->GetWorld(), ActorIn->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); + } } -void UUnrealHelperLibraryBPL::GetPointAtAngleRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const float Angle, const float Distance, const bool bTakeZFromActor1, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) +void UUnrealHelperLibraryBPL::GetPointAtAngleRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const float Angle, const float Distance, + const bool bTakeZFromActor1, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) { - if (!IsValid(Actor1) || !IsValid(Actor2)) return; + if (!IsValid(Actor1) || !IsValid(Actor2)) + return; const FVector Actor1Location = Actor1->GetActorLocation(); - const FVector Actor2Location = Actor2->GetActorLocation(); - const FVector DirectionBetweenActors = (Actor2Location - Actor1Location).GetSafeNormal(); - Point = Actor1Location + (DirectionBetweenActors.RotateAngleAxis(Angle, FVector(0, 0, 1)) * Distance); - Point.Z = bTakeZFromActor1 ? Actor1Location.Z : Actor2Location.Z; + const FVector Actor2Location = Actor2->GetActorLocation(); + const FVector DirectionBetweenActors = (Actor2Location - Actor1Location).GetSafeNormal(); + Point = Actor1Location + (DirectionBetweenActors.RotateAngleAxis(Angle, FVector(0, 0, 1)) * Distance); + Point.Z = bTakeZFromActor1 ? Actor1Location.Z : Actor2Location.Z; PointRotation = (Point - Actor1Location).ToOrientationRotator(); - if (bDebug) - { - UWorld* DebugWorld = Actor1->GetWorld(); - DrawDebugString(DebugWorld, Point, FString::Printf(TEXT("Angle %.2f°\nDistance %.2f"), Angle, Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); - DrawDebugSphere(DebugWorld, Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); - FVector ArrowLineEnd = Actor1Location + (DirectionBetweenActors.RotateAngleAxis(Angle, FVector(0, 0, 1)) * (Distance - 10)); - Point.Z = bTakeZFromActor1 ? Actor1Location.Z : Actor2Location.Z; - DrawDebugDirectionalArrow(DebugWorld, Actor1Location, Actor2Location, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 1); - DrawDebugDirectionalArrow(DebugWorld, Actor1Location, ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); - } + if (bDebug) + { + UWorld* DebugWorld = Actor1->GetWorld(); + DrawDebugString(DebugWorld, Point, FString::Printf(TEXT("Angle %.2f°\nDistance %.2f"), Angle, Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); + DrawDebugSphere(DebugWorld, Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); + FVector ArrowLineEnd = Actor1Location + (DirectionBetweenActors.RotateAngleAxis(Angle, FVector(0, 0, 1)) * (Distance - 10)); + Point.Z = bTakeZFromActor1 ? Actor1Location.Z : Actor2Location.Z; + DrawDebugDirectionalArrow(DebugWorld, Actor1Location, Actor2Location, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 1); + DrawDebugDirectionalArrow(DebugWorld, Actor1Location, ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); + } } -void UUnrealHelperLibraryBPL::GetPointAtDirectionRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const EUHLDirection Direction, const float Distance, const bool bTakeZFromActor1, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) +void UUnrealHelperLibraryBPL::GetPointAtDirectionRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const EUHLDirection Direction, + const float Distance, const bool bTakeZFromActor1, const bool bDebug, const float DebugLifetime, const FLinearColor DebugColor) { - if (!IsValid(Actor1) || !IsValid(Actor2)) return; + if (!IsValid(Actor1) || !IsValid(Actor2)) + return; float Angle = DirectionToAngle(Direction); GetPointAtAngleRelativeToOtherActor(Point, PointRotation, Actor1, Actor2, Angle, Distance, bTakeZFromActor1); - if (bDebug) - { - const UEnum* EnumPtr = FindObject(nullptr, TEXT("EUHLDirection"), true); - if (EnumPtr) - { - DrawDebugString(Actor1->GetWorld(), Point, FString::Printf(TEXT("Direction %s\nDistance %.2f"), *EnumPtr->GetNameStringByValue((uint8)Direction), Distance), 0, DebugColor.ToFColor(true), DebugLifetime, true, 1.0f); - } - DrawDebugSphere(Actor1->GetWorld(), Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); - FVector ArrowLineEnd; - FRotator ArrowLineEndRotation; - GetPointAtAngleRelativeToOtherActor(ArrowLineEnd, ArrowLineEndRotation, Actor1, Actor2, Angle, Distance, bTakeZFromActor1); - DrawDebugDirectionalArrow(Actor1->GetWorld(), Actor1->GetActorLocation(), Actor2->GetActorLocation(), RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 1); - DrawDebugDirectionalArrow(Actor1->GetWorld(), Actor1->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); - } + if (bDebug) + { + const UEnum* EnumPtr = FindObject(nullptr, TEXT("EUHLDirection"), true); + if (EnumPtr) + { + DrawDebugString(Actor1->GetWorld(), Point, FString::Printf(TEXT("Direction %s\nDistance %.2f"), *EnumPtr->GetNameStringByValue((uint8)Direction), Distance), 0, DebugColor.ToFColor(true), + DebugLifetime, true, 1.0f); + } + DrawDebugSphere(Actor1->GetWorld(), Point, 10.0f, 12, DebugColor.ToFColor(true), true, DebugLifetime, DEPTH_PRIORITY, 1); + FVector ArrowLineEnd; + FRotator ArrowLineEndRotation; + GetPointAtAngleRelativeToOtherActor(ArrowLineEnd, ArrowLineEndRotation, Actor1, Actor2, Angle, Distance, bTakeZFromActor1); + DrawDebugDirectionalArrow(Actor1->GetWorld(), Actor1->GetActorLocation(), Actor2->GetActorLocation(), RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 1); + DrawDebugDirectionalArrow(Actor1->GetWorld(), Actor1->GetActorLocation(), ArrowLineEnd, RELATIVE_POINT_ARROW_SIZE, FColor::White, true, DebugLifetime, DEPTH_PRIORITY, 2); + } } float UUnrealHelperLibraryBPL::DirectionToAngle(const EUHLDirection DirectionIn) { - if (DirectionIn == EUHLDirection::Front) return 0.0f; - if (DirectionIn == EUHLDirection::Back) return 180.0f; - if (DirectionIn == EUHLDirection::Left) return -90.0f; - if (DirectionIn == EUHLDirection::Right) return 90.0f; - if (DirectionIn == EUHLDirection::FrontLeft) return -45.0f; - if (DirectionIn == EUHLDirection::FrontRight) return 45.0f; - if (DirectionIn == EUHLDirection::BackLeft) return -135.0f; - if (DirectionIn == EUHLDirection::BackRight) return 135.0f; - return 0.0f; + if (DirectionIn == EUHLDirection::Front) + return 0.0f; + if (DirectionIn == EUHLDirection::Back) + return 180.0f; + if (DirectionIn == EUHLDirection::Left) + return -90.0f; + if (DirectionIn == EUHLDirection::Right) + return 90.0f; + if (DirectionIn == EUHLDirection::FrontLeft) + return -45.0f; + if (DirectionIn == EUHLDirection::FrontRight) + return 45.0f; + if (DirectionIn == EUHLDirection::BackLeft) + return -135.0f; + if (DirectionIn == EUHLDirection::BackRight) + return 135.0f; + return 0.0f; } -float UUnrealHelperLibraryBPL::ConvertPercentToMultiplier(float Percent) -{ - return (100.0f - Percent) / 100.0f; -} +float UUnrealHelperLibraryBPL::ConvertPercentToMultiplier(float Percent) { return (100.0f - Percent) / 100.0f; } -bool UUnrealHelperLibraryBPL::IsPreviewWorld(UObject* WorldContextObject) -{ - return WorldContextObject->GetWorld()->IsPreviewWorld(); -} +bool UUnrealHelperLibraryBPL::IsPreviewWorld(UObject* WorldContextObject) { return WorldContextObject->GetWorld()->IsPreviewWorld(); } -bool UUnrealHelperLibraryBPL::IsGameWorld(UObject* WorldContextObject) -{ - return WorldContextObject->GetWorld()->IsGameWorld(); -} +bool UUnrealHelperLibraryBPL::IsGameWorld(UObject* WorldContextObject) { return WorldContextObject->GetWorld()->IsGameWorld(); } -bool UUnrealHelperLibraryBPL::IsEditorWorld(UObject* WorldContextObject) -{ - return WorldContextObject->GetWorld()->IsEditorWorld(); -} +bool UUnrealHelperLibraryBPL::IsEditorWorld(UObject* WorldContextObject) { return WorldContextObject->GetWorld()->IsEditorWorld(); } -bool UUnrealHelperLibraryBPL::IsObjectInPreviewWorld(UObject* Object) -{ - return Object->GetWorld()->IsPreviewWorld(); -} +bool UUnrealHelperLibraryBPL::IsObjectInPreviewWorld(UObject* Object) { return Object->GetWorld()->IsPreviewWorld(); } -bool UUnrealHelperLibraryBPL::IsObjectInEditorWorld(UObject* Object) -{ - return Object->GetWorld()->IsEditorWorld(); -} +bool UUnrealHelperLibraryBPL::IsObjectInEditorWorld(UObject* Object) { return Object->GetWorld()->IsEditorWorld(); } -bool UUnrealHelperLibraryBPL::IsObjectInGameWorld(UObject* Object) -{ - return Object->GetWorld()->IsGameWorld(); -} +bool UUnrealHelperLibraryBPL::IsObjectInGameWorld(UObject* Object) { return Object->GetWorld()->IsGameWorld(); } bool UUnrealHelperLibraryBPL::IsOtherActorInAngle(AActor* Actor, AActor* OtherActor, TArray Ranges) { - float RelativeAngle = RelativeAngleToActor(Actor, OtherActor); - bool bInAngle = false; - for (FFloatRange Range : Ranges) - { - bInAngle = UKismetMathLibrary::InRange_FloatFloat(RelativeAngle, Range.GetLowerBoundValue(), Range.GetUpperBoundValue(), true, true); - if (bInAngle) break; - } - return bInAngle; + float RelativeAngle = RelativeAngleToActor(Actor, OtherActor); + bool bInAngle = false; + for (FFloatRange Range : Ranges) + { + bInAngle = UKismetMathLibrary::InRange_FloatFloat(RelativeAngle, Range.GetLowerBoundValue(), Range.GetUpperBoundValue(), true, true); + if (bInAngle) + break; + } + return bInAngle; } bool UUnrealHelperLibraryBPL::IsOtherCharacterInRange(ACharacter* Character, ACharacter* OtherCharacter, FFloatRange Range, bool bIncludeSelfCapsuleRadius, bool bIncludeTargetCapsuleRadius) { - if (!Character || !OtherCharacter) return false; + if (!Character || !OtherCharacter) + return false; - float CurrentDistance = Character->GetDistanceTo(OtherCharacter); + float CurrentDistance = Character->GetDistanceTo(OtherCharacter); - if (bIncludeSelfCapsuleRadius) - { - CurrentDistance -= Character->GetCapsuleComponent()->GetScaledCapsuleRadius(); - } - if (bIncludeTargetCapsuleRadius) - { - CurrentDistance -= OtherCharacter->GetCapsuleComponent()->GetScaledCapsuleRadius(); - } + if (bIncludeSelfCapsuleRadius) + { + CurrentDistance -= Character->GetCapsuleComponent()->GetScaledCapsuleRadius(); + } + if (bIncludeTargetCapsuleRadius) + { + CurrentDistance -= OtherCharacter->GetCapsuleComponent()->GetScaledCapsuleRadius(); + } - bool bInRange = UKismetMathLibrary::InRange_FloatFloat(CurrentDistance, Range.GetLowerBoundValue(), Range.GetUpperBoundValue()); - return bInRange; + bool bInRange = UKismetMathLibrary::InRange_FloatFloat(CurrentDistance, Range.GetLowerBoundValue(), Range.GetUpperBoundValue()); + return bInRange; } FString UUnrealHelperLibraryBPL::GetPathToFile(UObject* Object) { - FString NameAndWithSlash = FString::Printf(TEXT("/%s"), *Object->GetName()); - return Object->GetPathName(NULL).Replace(*Object->GetName(), TEXT("")); + FString NameAndWithSlash = FString::Printf(TEXT("/%s"), *Object->GetName()); + return Object->GetPathName(NULL).Replace(*Object->GetName(), TEXT("")); } bool UUnrealHelperLibraryBPL::IsDebugBuild() { - EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); - if (BuildConfiguration == EBuildConfiguration::Debug - || BuildConfiguration == EBuildConfiguration::DebugGame) - { - return true; - } - return false; + EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); + if (BuildConfiguration == EBuildConfiguration::Debug || BuildConfiguration == EBuildConfiguration::DebugGame) + { + return true; + } + return false; } bool UUnrealHelperLibraryBPL::IsDevelopmentBuild() { - EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); - return BuildConfiguration == EBuildConfiguration::Development; + EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); + return BuildConfiguration == EBuildConfiguration::Development; } bool UUnrealHelperLibraryBPL::IsShippingBuild() { - EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); - return BuildConfiguration == EBuildConfiguration::Shipping; + EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); + return BuildConfiguration == EBuildConfiguration::Shipping; } bool UUnrealHelperLibraryBPL::IsTestBuild() { - EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); - return BuildConfiguration == EBuildConfiguration::Test; + EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); + return BuildConfiguration == EBuildConfiguration::Test; } bool UUnrealHelperLibraryBPL::IsInEditor() { #if WITH_EDITOR - return true; + return true; #else - return false; + return false; #endif } EUHLBuildType UUnrealHelperLibraryBPL::GetBuildType() { - if (IsInEditor()) return EUHLBuildType::Editor; + if (IsInEditor()) + return EUHLBuildType::Editor; - EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); - switch (BuildConfiguration) - { - case EBuildConfiguration::Debug: - return EUHLBuildType::Debug; - break; - case EBuildConfiguration::DebugGame: - return EUHLBuildType::Debug; + EBuildConfiguration BuildConfiguration = FApp::GetBuildConfiguration(); + switch (BuildConfiguration) + { + case EBuildConfiguration::Debug: + return EUHLBuildType::Debug; + break; + case EBuildConfiguration::DebugGame: + return EUHLBuildType::Debug; break; - case EBuildConfiguration::Development: - return EUHLBuildType::Development; + case EBuildConfiguration::Development: + return EUHLBuildType::Development; break; - case EBuildConfiguration::Shipping: - return EUHLBuildType::Shipping; + case EBuildConfiguration::Shipping: + return EUHLBuildType::Shipping; break; - case EBuildConfiguration::Test: - return EUHLBuildType::Test; + case EBuildConfiguration::Test: + return EUHLBuildType::Test; break; - default: - return IsInEditor() ? EUHLBuildType::Editor : EUHLBuildType::None; - break; - } + default: + return IsInEditor() ? EUHLBuildType::Editor : EUHLBuildType::None; + break; + } } -EBBValueType UUnrealHelperLibraryBPL::BlackboardKeyToBBValueType( - FBlackboardKeySelector BlackboardKey) +EBBValueType UUnrealHelperLibraryBPL::BlackboardKeyToBBValueType(FBlackboardKeySelector BlackboardKey) { EBBValueType Result = EBBValueType::None; @@ -700,12 +688,13 @@ FLinearColor UUnrealHelperLibraryBPL::RandomLinearColor(int32 Seed) bool UUnrealHelperLibraryBPL::IsUHLDebugCategoryEnabled(UObject* WorldContextObject, FGameplayTag DebugCategoryGameplayTag) { - UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(WorldContextObject); - if (!IsValid(GameInstance)) return false; + UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(WorldContextObject); + if (!IsValid(GameInstance)) + return false; - UUHLDebugSubsystem* UHLDebugSubsystem = GameInstance->GetSubsystem(); - if (!IsValid(UHLDebugSubsystem)) return false; + UUHLDebugSubsystem* UHLDebugSubsystem = GameInstance->GetSubsystem(); + if (!IsValid(UHLDebugSubsystem)) + return false; - return UHLDebugSubsystem->IsCategoryEnabled(DebugCategoryGameplayTag); + return UHLDebugSubsystem->IsCategoryEnabled(DebugCategoryGameplayTag); } - diff --git a/Source/UnrealHelperLibrary/Public/AI/Composite/BTC_RandomSelector.h b/Source/UnrealHelperLibrary/Public/AI/Composite/BTC_RandomSelector.h index a4be644..b0275b4 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Composite/BTC_RandomSelector.h +++ b/Source/UnrealHelperLibrary/Public/AI/Composite/BTC_RandomSelector.h @@ -3,13 +3,18 @@ #pragma once #include "CoreMinimal.h" +#include "UObject/ObjectMacros.h" #include "BehaviorTree/BTCompositeNode.h" +#include "BehaviorTree/BehaviorTreeTypes.h" #include "Misc/EngineVersionComparison.h" #include "BTC_RandomSelector.generated.h" -struct FBTRandomSelectorMemory -{ -}; +class UBehaviorTreeComponent; + +// Should nest from "FBTCompositeMemory" or build error fail on FAB servers +// struct FBTRandomSelectorMemory : public FBTCompositeMemory +// { +// }; /** * RandomSelector composite node. @@ -25,7 +30,7 @@ class UNREALHELPERLIBRARY_API UBTC_RandomSelector : public UBTCompositeNode GENERATED_BODY() public: - explicit UBTC_RandomSelector(const FObjectInitializer& ObjectInitializer); + UBTC_RandomSelector(const FObjectInitializer& ObjectInitializer); // TODO validate that chances count == ChildrenNum // if no chance specified, node without chance will win always @@ -45,7 +50,6 @@ class UNREALHELPERLIBRARY_API UBTC_RandomSelector : public UBTCompositeNode #if UE_VERSION_NEWER_THAN(5, 4, 0) // 5.4.0 and up only code - virtual uint16 GetInstanceMemorySize() const override; virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const override; virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const override; #endif diff --git a/Source/UnrealHelperLibrary/Public/AI/Data/TurnSettings.h b/Source/UnrealHelperLibrary/Public/AI/Data/TurnSettings.h index 427ff7c..3c40188 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Data/TurnSettings.h +++ b/Source/UnrealHelperLibrary/Public/AI/Data/TurnSettings.h @@ -3,8 +3,10 @@ #pragma once #include "CoreMinimal.h" +#include "Engine/DataAsset.h" #include "TurnSettings.generated.h" +class UAnimMontage; USTRUCT(Blueprintable) struct FTurnRange diff --git a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_Base.h b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_Base.h index b15be97..3ba88ce 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_Base.h +++ b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_Base.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "BehaviorTree/BehaviorTreeTypes.h" #include "BehaviorTree/BTDecorator.h" #include "BTD_Base.generated.h" diff --git a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InAngle.h b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InAngle.h index 8edeec6..bd22271 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InAngle.h +++ b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InAngle.h @@ -6,6 +6,8 @@ #include "AI/Decorators/BTD_Base.h" #include "BTD_InAngle.generated.h" +class ACharacter; + struct FBTInAngleMemory { }; diff --git a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InRange.h b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InRange.h index a0a9d7b..e4bd558 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InRange.h +++ b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_InRange.h @@ -5,7 +5,6 @@ #include "CoreMinimal.h" #include "BTD_Base.h" #include "BehaviorTree/BTCompositeNode.h" -#include "BehaviorTree/BTDecorator.h" #include "BTD_InRange.generated.h" struct FBTInRangeMemory diff --git a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h index fd0af0d..4f5aa63 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h +++ b/Source/UnrealHelperLibrary/Public/AI/Decorators/BTD_RandomChance.h @@ -19,7 +19,7 @@ class UNREALHELPERLIBRARY_API UBTD_RandomChance : public UBTDecorator // UPROPERTY(Category="Decorator", EditAnywhere, meta=(UIMin=0.0f, UIMax=1.0f, ClampMin=0.0f, ClampMax=1.0f, EditCondition="!bUseUnclamped && !bUseBlackboardValue", EditConditionHides)) UPROPERTY(Category="Decorator", EditAnywhere, meta=(UIMin=0.0f, UIMax=1.0f, ClampMin=0.0f, ClampMax=1.0f)) - float Chance; + float Chance = 1.0f; // UPROPERTY(Category=Decorator, EditAnywhere, meta=(EditCondition="bUseUnclamped && !bUseBlackboardValue", EditConditionHides)) // float ChanceUnclamped; // TODO value from blackboard diff --git a/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h b/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h index 83dcfb6..8470057 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h +++ b/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h @@ -4,9 +4,12 @@ #include "CoreMinimal.h" #include "Misc/EngineVersionComparison.h" +#include "BehaviorTree/BehaviorTreeTypes.h" #include "BehaviorTree/Services/BTService_DefaultFocus.h" #include "BTS_GameplayFocus.generated.h" +class UBehaviorTreeComponent; + /** * Prevents rotation jittering while moving to enemy * Requires to turned on "UseControllerDesiredRotation" @@ -24,7 +27,6 @@ class UNREALHELPERLIBRARY_API UBTS_GameplayFocus : public UBTService_DefaultFocu UBTS_GameplayFocus(const FObjectInitializer& ObjectInitializer); #if UE_VERSION_NEWER_THAN(5, 4, 0) - virtual uint16 GetInstanceMemorySize() const override { return sizeof(FBTFocusMemory); } virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const override; virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const override; #endif diff --git a/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_TurnTo.h b/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_TurnTo.h index eec77e5..448b18f 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_TurnTo.h +++ b/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_TurnTo.h @@ -12,6 +12,7 @@ #include "BTT_TurnTo.generated.h" class AAIController; +class ACharacter; struct FBTTurnToMemory : FBTFocusMemory { diff --git a/Source/UnrealHelperLibrary/Public/AbilitySystem/Abilities/UHLGameplayAbility.h b/Source/UnrealHelperLibrary/Public/AbilitySystem/Abilities/UHLGameplayAbility.h index 60b596d..df74c6f 100644 --- a/Source/UnrealHelperLibrary/Public/AbilitySystem/Abilities/UHLGameplayAbility.h +++ b/Source/UnrealHelperLibrary/Public/AbilitySystem/Abilities/UHLGameplayAbility.h @@ -50,7 +50,7 @@ class UNREALHELPERLIBRARY_API UUHLGameplayAbility : public UGameplayAbility GENERATED_BODY() public: - UFUNCTION(BlueprintCallable) + UFUNCTION(BlueprintCallable, Category = "UHL GameplayAbility") EUHLAbilityActivationPolicy GetActivationPolicy() const { return ActivationPolicy; } // UFUNCTION(BlueprintCallable) diff --git a/Source/UnrealHelperLibrary/Public/AbilitySystem/Tasks/AT_InterpolateToPosition.h b/Source/UnrealHelperLibrary/Public/AbilitySystem/Tasks/AT_InterpolateToPosition.h index 259a02b..bf8698b 100644 --- a/Source/UnrealHelperLibrary/Public/AbilitySystem/Tasks/AT_InterpolateToPosition.h +++ b/Source/UnrealHelperLibrary/Public/AbilitySystem/Tasks/AT_InterpolateToPosition.h @@ -6,6 +6,7 @@ #include "Abilities/Tasks/AbilityTask.h" #include "AT_InterpolateToPosition.generated.h" +class UCurveVector; DECLARE_DYNAMIC_MULTICAST_DELEGATE(FInterpolateToPositionSimpleDelegate); /** @@ -58,10 +59,10 @@ class UNREALHELPERLIBRARY_API UAT_InterpolateToPosition : public UAbilityTask FVector TargetLocation; UPROPERTY(Replicated) - float DurationOfMovement; + float DurationOfMovement = 0.0f; - float TimeMoveStarted; - float TimeMoveWillEnd; + float TimeMoveStarted = 0.0f; + float TimeMoveWillEnd = 0.0f; UPROPERTY(Replicated) TObjectPtr LerpCurve; diff --git a/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySet.h b/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySet.h index c9b71e9..d5a3fae 100644 --- a/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySet.h +++ b/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySet.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once @@ -17,7 +17,6 @@ class UUHLAbilitySystemComponent; class UUHLGameplayAbility; class UObject; - /** * FUHLAbilitySet_GameplayAbility * @@ -29,21 +28,19 @@ struct FUHLAbilitySet_GameplayAbility GENERATED_BODY() public: - // Gameplay ability to grant. - UPROPERTY(EditDefaultsOnly, Category="GameplayAbility") + UPROPERTY(EditDefaultsOnly, Category = "GameplayAbility") TSubclassOf Ability = nullptr; // Level of ability to grant. - UPROPERTY(EditDefaultsOnly, Category="GameplayAbility") + UPROPERTY(EditDefaultsOnly, Category = "GameplayAbility") int32 AbilityLevel = 1; // Tag used to process input for the ability. - UPROPERTY(EditDefaultsOnly, Category="GameplayAbility", Meta = (Categories = "InputTag")) + UPROPERTY(EditDefaultsOnly, Category = "GameplayAbility", Meta = (Categories = "InputTag")) FGameplayTag InputTag; }; - /** * FUHLAbilitySet_GameplayEffect * @@ -55,13 +52,12 @@ struct FUHLAbilitySet_GameplayEffect GENERATED_BODY() public: - // Gameplay effect to grant. - UPROPERTY(EditDefaultsOnly, Category="GameplayEffect") + UPROPERTY(EditDefaultsOnly, Category = "GameplayEffect") TSubclassOf GameplayEffect = nullptr; // Level of gameplay effect to grant. - UPROPERTY(EditDefaultsOnly, Category="GameplayEffect") + UPROPERTY(EditDefaultsOnly, Category = "GameplayEffect") float EffectLevel = 1.0f; }; @@ -77,9 +73,8 @@ struct FUHLAbilitySet_AttributeSet public: // Gameplay effect to grant. - UPROPERTY(EditDefaultsOnly, Category="AttributeSet") + UPROPERTY(EditDefaultsOnly, Category = "AttributeSet") TSubclassOf AttributeSet; - }; /** @@ -93,9 +88,9 @@ struct FUHLAbilitySet_GrantedHandles GENERATED_BODY() public: - FGameplayTagContainer GetAbilitySetTags() const { return AbilitySetTags; } - void SetAbilitySetTags(const FGameplayTagContainer& AbilitySetTagContainer); - + FGameplayTagContainer GetAbilitySetTags() const { return AbilitySetTags; } + void SetAbilitySetTags(const FGameplayTagContainer& AbilitySetTagContainer); + void AddAbilitySpecHandle(const FGameplayAbilitySpecHandle& Handle); void AddGameplayEffectHandle(const FActiveGameplayEffectHandle& Handle); void AddAttributeSet(UAttributeSet* Set); @@ -103,9 +98,9 @@ struct FUHLAbilitySet_GrantedHandles void TakeFromAbilitySystem(UAbilitySystemComponent* ASC); protected: - UPROPERTY() - FGameplayTagContainer AbilitySetTags; - + UPROPERTY() + FGameplayTagContainer AbilitySetTags; + // Handles to the granted abilities. UPROPERTY() TArray AbilitySpecHandles; @@ -119,7 +114,6 @@ struct FUHLAbilitySet_GrantedHandles TArray> GrantedAttributeSets; }; - /** * UUHLAbilitySet * @@ -133,33 +127,32 @@ class UUHLAbilitySet : public UPrimaryDataAsset GENERATED_BODY() public: - UUHLAbilitySet(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); // Grants the ability set to the specified ability system component. // The returned handles can be used later to take away anything that was granted. void GiveToAbilitySystem(UAbilitySystemComponent* ASC, FUHLAbilitySet_GrantedHandles* OutGrantedHandles, UObject* SourceObject = nullptr) const; - TArray> GetAllAbilitiesList() const; - + TArray> GetAllAbilitiesList() const; + protected: - // AbilitySetTag to associate with and can be removed "RemoveAbilitySetByTag" - UPROPERTY(EditDefaultsOnly, Category = "AbilitySet Tags", meta=(TitleProperty=Ability)) - FGameplayTagContainer AbilitySetTags; - - // Gameplay abilities to grant when this ability set is granted. - UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta=(TitleProperty=Ability)) - TArray> GrantedSimpleGameplayAbilities; - + // AbilitySetTag to associate with and can be removed "RemoveAbilitySetByTag" + UPROPERTY(EditDefaultsOnly, Category = "AbilitySet Tags", meta = (TitleProperty = Ability)) + FGameplayTagContainer AbilitySetTags; + + // Gameplay abilities to grant when this ability set is granted. + UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta = (TitleProperty = Ability)) + TArray> GrantedSimpleGameplayAbilities; + // Gameplay abilities to grant when this ability set is granted. - UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta=(TitleProperty=Ability)) + UPROPERTY(EditDefaultsOnly, Category = "Gameplay Abilities", meta = (TitleProperty = Ability)) TArray GrantedGameplayAbilities; // Gameplay effects to grant when this ability set is granted. - UPROPERTY(EditDefaultsOnly, Category = "Gameplay Effects", meta=(TitleProperty=GameplayEffect)) + UPROPERTY(EditDefaultsOnly, Category = "Gameplay Effects", meta = (TitleProperty = GameplayEffect)) TArray GrantedGameplayEffects; // Attribute sets to grant when this ability set is granted. - UPROPERTY(EditDefaultsOnly, Category = "Attribute Sets", meta=(TitleProperty=AttributeSet)) + UPROPERTY(EditDefaultsOnly, Category = "Attribute Sets", meta = (TitleProperty = AttributeSet)) TArray GrantedAttributes; }; diff --git a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_ActivateAbility.h b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_ActivateAbility.h index 8941a5a..9d9feb7 100644 --- a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_ActivateAbility.h +++ b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_ActivateAbility.h @@ -4,11 +4,11 @@ #include "CoreMinimal.h" #include "ANS_UHL_Base.h" +#include "UObject/WeakInterfacePtr.h" #include "GameplayTagContainer.h" +#include "AbilitySystemInterface.h" #include "ANS_ActivateAbility.generated.h" -class IAbilitySystemInterface; - /** * */ diff --git a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.h b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.h index 69dd635..d0576f2 100644 --- a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.h +++ b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_EnableRootMotionZAxisMovement.h @@ -4,9 +4,11 @@ #include "CoreMinimal.h" #include "Animation/AnimNotifies/AnimNotifyState.h" +#include "Engine/EngineTypes.h" #include "ANS_EnableRootMotionZAxisMovement.generated.h" -class ABBaseCharacter; +class ACharacter; + /** * */ @@ -30,7 +32,7 @@ class UNREALHELPERLIBRARY_API UANS_EnableRootMotionZAxisMovement : public UAnimN private: TWeakObjectPtr BaseCharacter; - EMovementMode InitialMovementMode; + EMovementMode InitialMovementMode = EMovementMode::MOVE_None; UFUNCTION() void OnMontageBlendingOut(UAnimMontage* Montage, bool bInterrupted); diff --git a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_MagnetTo.h b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_MagnetTo.h index bc2967c..a4f2a68 100644 --- a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_MagnetTo.h +++ b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_MagnetTo.h @@ -7,6 +7,8 @@ #include "BehaviorTree/BlackboardData.h" #include "ANS_MagnetTo.generated.h" +class ACharacter; + /** * */ @@ -45,13 +47,10 @@ class UNREALHELPERLIBRARY_API UANS_MagnetTo : public UAnimNotifyState private: TWeakObjectPtr BaseCharacter; - EMovementMode InitialMovementMode; + // EMovementMode InitialMovementMode; float Speed = 0.0f; float Alpha = 0.0f; - UFUNCTION() - void TimerTick(); - // UFUNCTION() // void OnMontageBlendingOut(UAnimMontage* Montage, bool bInterrupted); }; diff --git a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_UHL_Base.h b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_UHL_Base.h index f9f3945..0ef69d3 100644 --- a/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_UHL_Base.h +++ b/Source/UnrealHelperLibrary/Public/Animation/Notifies/ANS_UHL_Base.h @@ -6,6 +6,8 @@ #include "Animation/AnimNotifies/AnimNotifyState.h" #include "ANS_UHL_Base.generated.h" +class UAnimMontage; + /** * with events like OnMontageBlendOut, OnMontageInterrupted... * you can disable subscribing OnMontageBlendOut, by "bUseOnMontageBlendingOut=false" in constructor @@ -15,8 +17,6 @@ class UNREALHELPERLIBRARY_API UANS_UHL_Base : public UAnimNotifyState { GENERATED_BODY() -public: - protected: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="ANS_UHL_Base") bool bUseOnMontageBlendingOut = true; diff --git a/Source/UnrealHelperLibrary/Public/Animation/Notifies/AN_UHL_Base.h b/Source/UnrealHelperLibrary/Public/Animation/Notifies/AN_UHL_Base.h index da27ff1..9cb0810 100644 --- a/Source/UnrealHelperLibrary/Public/Animation/Notifies/AN_UHL_Base.h +++ b/Source/UnrealHelperLibrary/Public/Animation/Notifies/AN_UHL_Base.h @@ -6,9 +6,7 @@ #include "Animation/AnimNotifies/AnimNotify.h" #include "AN_UHL_Base.generated.h" -/** - * - */ +class USkeletalMeshComponent; DECLARE_MULTICAST_DELEGATE_OneParam(FOnNotifySignature, USkeletalMeshComponent*) UCLASS() diff --git a/Source/UnrealHelperLibrary/Public/Development/UHLDebugSubsystemSettings.h b/Source/UnrealHelperLibrary/Public/Development/UHLDebugSubsystemSettings.h index f3f2589..c52a348 100644 --- a/Source/UnrealHelperLibrary/Public/Development/UHLDebugSubsystemSettings.h +++ b/Source/UnrealHelperLibrary/Public/Development/UHLDebugSubsystemSettings.h @@ -4,6 +4,7 @@ #include "CoreMinimal.h" #include "GameplayTagContainer.h" +#include "Misc/App.h" #include "Engine/DeveloperSettingsBackedByCVars.h" #include "Subsystems/DebugSubsystem/UHLDebugSubsystem.h" #include "UHLDebugSubsystemSettings.generated.h" diff --git a/Source/UnrealHelperLibrary/Public/Input/UHLInputConfig.h b/Source/UnrealHelperLibrary/Public/Input/UHLInputConfig.h index 11633d4..84c2c6b 100644 --- a/Source/UnrealHelperLibrary/Public/Input/UHLInputConfig.h +++ b/Source/UnrealHelperLibrary/Public/Input/UHLInputConfig.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once @@ -26,10 +26,9 @@ struct FUHLInputAction GENERATED_BODY() public: - - UPROPERTY(EditDefaultsOnly, Category="InputAction") + UPROPERTY(EditDefaultsOnly, Category = "InputAction") const UInputAction* InputAction = nullptr; - UPROPERTY(EditDefaultsOnly, Category="InputAction", Meta = (Categories = "InputTag")) + UPROPERTY(EditDefaultsOnly, Category = "InputAction", Meta = (Categories = "InputTag")) FGameplayTag InputTag; }; @@ -44,11 +43,11 @@ struct FUHLInputActionAbilities GENERATED_BODY() public: - UPROPERTY(EditDefaultsOnly, Category="InputActionAbilities") - bool bEnabled = true; - UPROPERTY(EditDefaultsOnly, Category="InputActionAbilities") + UPROPERTY(EditDefaultsOnly, Category = "InputActionAbilities") + bool bEnabled = true; + UPROPERTY(EditDefaultsOnly, Category = "InputActionAbilities") const UInputAction* InputAction = nullptr; - UPROPERTY(EditDefaultsOnly, Category="InputActionAbilities") + UPROPERTY(EditDefaultsOnly, Category = "InputActionAbilities") TArray AbilitiesToActivate; }; @@ -72,16 +71,16 @@ class UNREALHELPERLIBRARY_API UUHLInputConfig : public UDataAsset // List of input actions used by the owner. These input actions are mapped to a gameplay tag and must be manually bound. // UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (TitleProperty = "InputAction")) // TArray NativeInputActions; - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Native Input Actions") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Native Input Actions") FUHLInputAction NativeInputAction_Move; - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Native Input Actions") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Native Input Actions") FUHLInputAction NativeInputAction_LookMouse; - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Native Input Actions") + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Native Input Actions") FUHLInputAction NativeInputAction_LookStick; - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Native Input Actions") - FUHLInputAction NativeInputAction_Interact; + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Native Input Actions") + FUHLInputAction NativeInputAction_Interact; // List of input actions used by the owner. These input actions are mapped to a gameplay tag and are automatically bound to abilities with matching input tags. - UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="AbilityInputActions", Meta = (TitleProperty = "InputAction")) + UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "AbilityInputActions", Meta = (TitleProperty = "InputAction")) TArray AbilityInputActions; }; diff --git a/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.h b/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.h index e8aa3d1..b85c807 100644 --- a/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.h +++ b/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/AA_WaitDebugCategoryChange.h @@ -5,7 +5,6 @@ #include "CoreMinimal.h" #include "GameplayTagContainer.h" #include "Kismet/BlueprintAsyncActionBase.h" -#include "UnrealHelperLibrary/UnrealHelperLibraryTypes.h" #include "AA_WaitDebugCategoryChange.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FWaitDebugCategoryChanged, bool, bEnabled); diff --git a/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h b/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h index 89c02f4..ce75bcc 100644 --- a/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h +++ b/Source/UnrealHelperLibrary/Public/Subsystems/DebugSubsystem/UHLDebugCategoryComponent.h @@ -1,4 +1,6 @@ -#pragma once +// Copyright (c) 2024 Pavel Penkov + +#pragma once #include "CoreMinimal.h" #include "UHLDebugCategoryComponent.generated.h" diff --git a/Source/UnrealHelperLibrary/Public/UnrealHelperLibrary.h b/Source/UnrealHelperLibrary/Public/UnrealHelperLibrary.h index 4944de7..91ef517 100644 --- a/Source/UnrealHelperLibrary/Public/UnrealHelperLibrary.h +++ b/Source/UnrealHelperLibrary/Public/UnrealHelperLibrary.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once @@ -10,7 +10,6 @@ UNREALHELPERLIBRARY_API DECLARE_LOG_CATEGORY_EXTERN(LogUHLAbilitySystem, Log, Al class FUnrealHelperLibraryModule : public IModuleInterface { public: - /** IModuleInterface implementation */ virtual void StartupModule() override; virtual void ShutdownModule() override; diff --git a/Source/UnrealHelperLibrary/Public/Utils/UHLTraceUtilsBPL.h b/Source/UnrealHelperLibrary/Public/Utils/UHLTraceUtilsBPL.h index e77b4cb..f49f5df 100644 --- a/Source/UnrealHelperLibrary/Public/Utils/UHLTraceUtilsBPL.h +++ b/Source/UnrealHelperLibrary/Public/Utils/UHLTraceUtilsBPL.h @@ -3,6 +3,8 @@ #pragma once #include "CoreMinimal.h" +#include "Engine/EngineTypes.h" +#include "CollisionQueryParams.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "UHLTraceUtilsBPL.generated.h" diff --git a/Source/UnrealHelperLibrary/Public/Utils/UnrealHelperLibraryBPL.h b/Source/UnrealHelperLibrary/Public/Utils/UnrealHelperLibraryBPL.h index 16d48b1..7ebd06e 100644 --- a/Source/UnrealHelperLibrary/Public/Utils/UnrealHelperLibraryBPL.h +++ b/Source/UnrealHelperLibrary/Public/Utils/UnrealHelperLibraryBPL.h @@ -1,11 +1,12 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Pavel Penkov #pragma once #include "GameplayEffect.h" +#include "UnrealHelperLibrary/UnrealHelperLibraryTypes.h" +#include "AssetRegistry/AssetData.h" #include "AssetRegistry/AssetRegistryModule.h" #include "Kismet/BlueprintFunctionLibrary.h" -#include "UnrealHelperLibrary/UnrealHelperLibraryTypes.h" #include "UnrealHelperLibraryBPL.generated.h" struct FBlackboardKeySelector; @@ -17,22 +18,22 @@ const float RELATIVE_POINT_ARROW_SIZE = 200.0f; // - keywords for every method /* -* Function library class. -* Each function in it is expected to be static and represents blueprint node that can be called in any blueprint. -* -* When declaring function you can define metadata for the node. Key function specifiers will be BlueprintPure and BlueprintCallable. -* BlueprintPure - means the function does not affect the owning object in any way and thus creates a node without Exec pins. -* BlueprintCallable - makes a function which can be executed in Blueprints - Thus it has Exec pins. -* DisplayName - full name of the node, shown when you mouse over the node and in the blueprint drop down menu. -* Its lets you name the node using characters not allowed in C++ function names. -* CompactNodeTitle - the word(s) that appear on the node. -* Keywords - the list of keywords that helps you to find node when you search for it using Blueprint drop-down menu. -* Good example is "Print String" node which you can find also by using keyword "log". -* Category - the category your node will be under in the Blueprint drop-down menu. -* -* For more info on custom blueprint nodes visit documentation: -* https://wiki.unrealengine.com/Custom_Blueprint_Node_Creation -*/ + * Function library class. + * Each function in it is expected to be static and represents blueprint node that can be called in any blueprint. + * + * When declaring function you can define metadata for the node. Key function specifiers will be BlueprintPure and BlueprintCallable. + * BlueprintPure - means the function does not affect the owning object in any way and thus creates a node without Exec pins. + * BlueprintCallable - makes a function which can be executed in Blueprints - Thus it has Exec pins. + * DisplayName - full name of the node, shown when you mouse over the node and in the blueprint drop down menu. + * Its lets you name the node using characters not allowed in C++ function names. + * CompactNodeTitle - the word(s) that appear on the node. + * Keywords - the list of keywords that helps you to find node when you search for it using Blueprint drop-down menu. + * Good example is "Print String" node which you can find also by using keyword "log". + * Category - the category your node will be under in the Blueprint drop-down menu. + * + * For more info on custom blueprint nodes visit documentation: + * https://wiki.unrealengine.com/Custom_Blueprint_Node_Creation + */ UCLASS() class UNREALHELPERLIBRARY_API UUnrealHelperLibraryBPL : public UBlueprintFunctionLibrary { @@ -42,63 +43,65 @@ class UNREALHELPERLIBRARY_API UUnrealHelperLibraryBPL : public UBlueprintFunctio // UFUNCTION(BlueprintCallable, meta = (Keywords = "UnrealHelperLibrary sample test testing"), Category = "UnrealHelperLibraryTesting") // static float UnrealHelperLibraryRandomWeight(TMap); -/** Gameplay **/ + /** Gameplay **/ // Get HitReactDirection - direction(front/back/left/right) opposite to character(SourceActorLocation) that made hit // TODO add // - GetHitSourceDirection // - bool bUse8Directions UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary") static EUHLDirection GetHitReactDirection(const FVector& SourceActorLocation, const AActor* TargetActor); -/** Gameplay **/ - -/** Debug **/ - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Debug", meta = (Keywords = "UnrealHelperLibrary debug Development", AdvancedDisplay="D,E,F,G,H,I,J,Duration")) - static void DebugPrintStrings(const FString& A, const FString& B = "", const FString& C = "", const FString& D = "", const FString& E = "", const FString& F = "", const FString& G = "", const FString& H = "", const FString& I = "", const FString& J = "", float Duration = 2.0f, const FName Key = NAME_None, const bool bEnabled = true); - UFUNCTION(Category = "UnrealHelperLibrary", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary debug Development", AdvancedDisplay="D,E,F,G,H,I,J,Duration")) - static void DebugPrintString(const UObject* WorldContextObject, const FString& A, float Duration = 2.0f, const FName Key = NAME_None, const bool bEnabled = true); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Debug", meta = (Keywords = "UnrealHelperLibrary debug Development")) - static void DrawDebugBar(); -/** ~Debug **/ - -/** Anims **/ + /** Gameplay **/ + + /** Debug **/ + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Debug", meta = (Keywords = "UnrealHelperLibrary debug Development", AdvancedDisplay = "D,E,F,G,H,I,J,Duration")) + static void DebugPrintStrings(const FString& A, const FString& B = "", const FString& C = "", const FString& D = "", const FString& E = "", const FString& F = "", const FString& G = "", + const FString& H = "", const FString& I = "", const FString& J = "", float Duration = 2.0f, const FName Key = NAME_None, const bool bEnabled = true); + UFUNCTION(Category = "UnrealHelperLibrary", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary debug Development", AdvancedDisplay = "D,E,F,G,H,I,J,Duration")) + static void DebugPrintString(const UObject* WorldContextObject, const FString& A, float Duration = 2.0f, const FName Key = NAME_None, const bool bEnabled = true); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Debug", meta = (Keywords = "UnrealHelperLibrary debug Development")) + static void DrawDebugBar(); + /** ~Debug **/ + + /** Anims **/ // TODO dont work correctly, fix // if SectionName not specified will be used first section UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Animations", meta = (Keywords = "UnrealHelperLibrary anim montage")) static float GetAnimMontageSectionLengthByName(UAnimMontage* AnimMontage, FName SectionName = NAME_None); -/** ~Anims **/ - -/** GAS **/ - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary debug GAS Development")) - static FGameplayEffectSpec CreateGenericGASGameplayEffectSpec(TSubclassOf GameplayEffectClass, AActor* HitInstigator, AActor* InEffectCauser, const FHitResult& HitResult, const UObject* SourceObject); - /** - * UUnrealHelperLibraryBPL::UpdateStateGameplayTags(ASC, GetMovementComponent()->Velocity.Length() > 0, - UHLGameplayTags::TAG_Character_State_IsMoving, - UHLGameplayTags::TAG_Character_State_IsIdling); + /** ~Anims **/ + + /** GAS **/ + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary debug GAS Development")) + static FGameplayEffectSpec CreateGenericGASGameplayEffectSpec( + TSubclassOf GameplayEffectClass, AActor* HitInstigator, AActor* InEffectCauser, const FHitResult& HitResult, const UObject* SourceObject); + /** + * UUnrealHelperLibraryBPL::UpdateStateGameplayTags(ASC, GetMovementComponent()->Velocity.Length() > 0, + UHLGameplayTags::TAG_Character_State_IsMoving, + UHLGameplayTags::TAG_Character_State_IsIdling); bCondition = true ? TAG_Character_State_IsMoving : TAG_Character_State_IsIdling - UUnrealHelperLibraryBPL::UpdateStateGameplayTags(ASC, CharacterMovementVector.Length() > 0.4f, - UHLGameplayTags::TAG_Character_State_HasMoveInput, - FGameplayTag::EmptyTag); + UUnrealHelperLibraryBPL::UpdateStateGameplayTags(ASC, CharacterMovementVector.Length() > 0.4f, + UHLGameplayTags::TAG_Character_State_HasMoveInput, + FGameplayTag::EmptyTag); bCondition = true ? TAG_Character_State_HasMoveInput : NONE - */ - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) - static void UpdateStateGameplayTags(UAbilitySystemComponent* ASC, bool bCondition, FGameplayTag PositiveConditionTag, FGameplayTag NegativeConditionTag); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) - static bool TryActivateAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag, bool bAllowRemoteActivation); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) - static bool TryCancelAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) - static TArray TryCancelAbilitiesWithTags(UAbilitySystemComponent* ASC, TArray GameplayTags); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability event fire")) - static int32 FireGameplayEvent(UAbilitySystemComponent* ASC, FGameplayTag EventTag, const FGameplayEventData& Payload); - - // "FGameplayTag::RequestGameplayTag()" crashes build on start, use this to find tag - // function from Lyra - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary gameplaytag tag")) - static FGameplayTag FindTagByString(const FString& TagString, bool bMatchPartialString = false); -/** ~GAS **/ - -/** Angles **/ + */ + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) + static void UpdateStateGameplayTags(UAbilitySystemComponent* ASC, bool bCondition, FGameplayTag PositiveConditionTag, FGameplayTag NegativeConditionTag); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) + static bool TryActivateAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag, bool bAllowRemoteActivation); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) + static bool TryCancelAbilityWithTag(UAbilitySystemComponent* ASC, FGameplayTag GameplayTag); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability")) + static TArray TryCancelAbilitiesWithTags(UAbilitySystemComponent* ASC, TArray GameplayTags); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary ability event fire")) + static int32 FireGameplayEvent(UAbilitySystemComponent* ASC, FGameplayTag EventTag, const FGameplayEventData& Payload); + + // "FGameplayTag::RequestGameplayTag()" crashes build on start, use this to find tag + // function from Lyra + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|GAS", meta = (Keywords = "UnrealHelperLibrary gameplaytag tag")) + static FGameplayTag FindTagByString(const FString& TagString, bool bMatchPartialString = false); + /** ~GAS **/ + + /** Angles **/ /** * Calculates relative angle to other actor [-180, 180] * @param ActorRelativeToWhomAngleCalculated @@ -108,128 +111,128 @@ class UNREALHELPERLIBRARY_API UUnrealHelperLibraryBPL : public UBlueprintFunctio * @param DebugLifetime * @param DebugColor */ - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "ActorRelativeToWhomAngleCalculated", Keywords = "UnrealHelperLibrary debug Development angle relative GetAngle RelativeTo", AdvancedDisplay="bDebug,DebugLifetime,DebugColor,bRelativeToActorBack")) - static float RelativeAngleToActor( - AActor* ActorRelativeToWhomAngleCalculated, - AActor* TargetActor, - bool bRelativeToActorBack = false, - const bool bDebug = false, - const float DebugLifetime = -1, - const FLinearColor DebugColor = FLinearColor::White - ); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "ActorRelativeToWhomAngleCalculated", Keywords = "UnrealHelperLibrary debug Development angle relative GetAngle RelativeTo")) + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", + meta = (DefaultToSelf = "ActorRelativeToWhomAngleCalculated", Keywords = "UnrealHelperLibrary debug Development angle relative GetAngle RelativeTo", + AdvancedDisplay = "bDebug,DebugLifetime,DebugColor,bRelativeToActorBack")) + static float RelativeAngleToActor(AActor* ActorRelativeToWhomAngleCalculated, AActor* TargetActor, bool bRelativeToActorBack = false, const bool bDebug = false, const float DebugLifetime = -1, + const FLinearColor DebugColor = FLinearColor::White); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", + meta = (DefaultToSelf = "ActorRelativeToWhomAngleCalculated", Keywords = "UnrealHelperLibrary debug Development angle relative GetAngle RelativeTo")) static float RelativeAngleToVector(AActor* ActorRelativeToWhomAngleCalculated, FVector TargetVector); UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (Keywords = "UnrealHelperLibrary debug Development angle relative GetAngle RelativeTo")) static float RelativeAngleVectorToVector(FVector VectorRelativeToWhomAngleCalculated, FVector TargetVector); UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Angles") static EUHLDirection GetOppositeDirection(EUHLDirection Direction_In); -/** ~Angles **/ - -/** Utils **/ - // Get project version from "Project Settings" - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary version")) - static FString GetProjectVersion(); - UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary debug Development")) - static TArray GetNamesOfComponentsOnObject(UObject* OwnerObject, UClass* Class); - - // return all assets of specified class in template - template - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") - static void GetAssetsOfClass(TArray& OutArray) - { - FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked("AssetRegistry"); - TArray AssetData; - AssetRegistryModule.Get().GetAssetsByClass(T::StaticClass()->GetClassPathName(), AssetData); - for (int i = 0; i < AssetData.Num(); i++) { - T* Object = Cast(AssetData[i].GetAsset()); - OutArray.Add(Object); - } - } - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") - static UActorComponent* GetActorComponentByName(AActor* Actor, FString Name); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") - static USceneComponent* GetSceneComponentByName(AActor* Actor, FString Name); - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary bounds box extent")) - static FVector GetRandomPointInBox(const USceneComponent* Component, bool bOnGround, bool bDrawDebug = false, float DebugDrawTime = 5.0f); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary bounds box extent")) - static FVector GetHighestPointInBox(const USceneComponent* Component); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "ActorIn", AdvancedDisplay="bDebug,DebugLifetime,DebugColor")) - static void GetPointAtRelativeAngle(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const float Angle, const float Distance, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "ActorIn", AdvancedDisplay="bDebug,DebugLifetime,DebugColor,DebugText")) - static void GetPointAtRelativeDirection(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const EUHLDirection Direction, const float Distance, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White, const FText DebugText = FText()); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "Actor1", AdvancedDisplay="bTakeZFromActor1,bDebug,DebugLifetime,DebugColor")) - static void GetPointAtAngleRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const float Angle, const float Distance, const bool bTakeZFromActor1 = true, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "Actor1", AdvancedDisplay="bTakeZFromActor1,bDebug,DebugLifetime,DebugColor")) - static void GetPointAtDirectionRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const EUHLDirection Direction, const float Distance, const bool bTakeZFromActor1 = true, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") - static float DirectionToAngle(const EUHLDirection DirectionIn); - // e.g. 60% -> x0.4, 40% -> x0.6, 100% -> x0.0, 0% -> x1.0 - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") - static float ConvertPercentToMultiplier(float Percent); - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) - static bool IsPreviewWorld(UObject* WorldContextObject); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) - static bool IsGameWorld(UObject* WorldContextObject); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) - static bool IsEditorWorld(UObject* WorldContextObject); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary preview editor")) - static bool IsObjectInPreviewWorld(UObject* Object); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary preview editor")) - static bool IsObjectInEditorWorld(UObject* Object); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary game preview editor")) - static bool IsObjectInGameWorld(UObject* Object); - // TODO: ??? - // UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary") - // static EUHLDirection AngleToDirection(const float AngleIn); - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "Actor", Keywords = "UnrealHelperLibrary angle distance")) - static bool IsOtherActorInAngle(AActor* Actor, AActor* OtherActor, TArray Ranges); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "Character", Keywords = "UnrealHelperLibrary angle distance")) - static bool IsOtherCharacterInRange(ACharacter* Character, ACharacter* OtherCharacter, FFloatRange Range, bool bIncludeSelfCapsuleRadius, bool bIncludeTargetCapsuleRadius); - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary file path")) - static FString GetPathToFile(UObject* Object); - - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary build debug")) - static bool IsDebugBuild(); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary build debug development")) - static bool IsDevelopmentBuild(); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary build debug production release shipping")) - static bool IsShippingBuild(); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary build debug test")) - static bool IsTestBuild(); - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary editor InEditor withEditor")) - static bool IsInEditor(); - // Are in Debug/Development/Shipping/Test build or Editor. If we WITH_EDITOR returns Editor, - // no matter what EBuildConfiguration is currently used(mostly WITH_EDITOR is Development) - // if real build returns - FApp::GetBuildConfiguration() result, except Debug and DebugGame are same "Debug" - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta=(Keywords = "UnrealHelperLibrary build debug test")) - static EUHLBuildType GetBuildType(); -/** ~Utils **/ - -/** AI **/ + /** ~Angles **/ + + /** Utils **/ + // Get project version from "Project Settings" + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary version")) + static FString GetProjectVersion(); + UFUNCTION(BlueprintCallable, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary debug Development")) + static TArray GetNamesOfComponentsOnObject(UObject* OwnerObject, UClass* Class); + + // return all assets of specified class in template + template + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") + static void GetAssetsOfClass(TArray& OutArray) + { + FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked("AssetRegistry"); + TArray AssetData; + AssetRegistryModule.Get().GetAssetsByClass(T::StaticClass()->GetClassPathName(), AssetData); + for (int i = 0; i < AssetData.Num(); i++) + { + T* Object = Cast(AssetData[i].GetAsset()); + OutArray.Add(Object); + } + } + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") + static UActorComponent* GetActorComponentByName(AActor* Actor, FString Name); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") + static USceneComponent* GetSceneComponentByName(AActor* Actor, FString Name); + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary bounds box extent")) + static FVector GetRandomPointInBox(const USceneComponent* Component, bool bOnGround, bool bDrawDebug = false, float DebugDrawTime = 5.0f); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary bounds box extent")) + static FVector GetHighestPointInBox(const USceneComponent* Component); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "ActorIn", AdvancedDisplay = "bDebug,DebugLifetime,DebugColor")) + static void GetPointAtRelativeAngle(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const float Angle, const float Distance, const bool bDebug = false, + const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "ActorIn", AdvancedDisplay = "bDebug,DebugLifetime,DebugColor,DebugText")) + static void GetPointAtRelativeDirection(FVector& Point, FRotator& PointRotation, const AActor* ActorIn, const EUHLDirection Direction, const float Distance, const bool bDebug = false, + const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White, const FText DebugText = FText()); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "Actor1", AdvancedDisplay = "bTakeZFromActor1,bDebug,DebugLifetime,DebugColor")) + static void GetPointAtAngleRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const float Angle, const float Distance, + const bool bTakeZFromActor1 = true, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (DefaultToSelf = "Actor1", AdvancedDisplay = "bTakeZFromActor1,bDebug,DebugLifetime,DebugColor")) + static void GetPointAtDirectionRelativeToOtherActor(FVector& Point, FRotator& PointRotation, const AActor* Actor1, const AActor* Actor2, const EUHLDirection Direction, const float Distance, + const bool bTakeZFromActor1 = true, const bool bDebug = false, const float DebugLifetime = -1, const FLinearColor DebugColor = FLinearColor::White); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") + static float DirectionToAngle(const EUHLDirection DirectionIn); + // e.g. 60% -> x0.4, 40% -> x0.6, 100% -> x0.0, 0% -> x1.0 + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils") + static float ConvertPercentToMultiplier(float Percent); + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) + static bool IsPreviewWorld(UObject* WorldContextObject); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) + static bool IsGameWorld(UObject* WorldContextObject); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary preview editor")) + static bool IsEditorWorld(UObject* WorldContextObject); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary preview editor")) + static bool IsObjectInPreviewWorld(UObject* Object); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary preview editor")) + static bool IsObjectInEditorWorld(UObject* Object); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary game preview editor")) + static bool IsObjectInGameWorld(UObject* Object); + // TODO: ??? + // UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary") + // static EUHLDirection AngleToDirection(const float AngleIn); + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "Actor", Keywords = "UnrealHelperLibrary angle distance")) + static bool IsOtherActorInAngle(AActor* Actor, AActor* OtherActor, TArray Ranges); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Angles", meta = (DefaultToSelf = "Character", Keywords = "UnrealHelperLibrary angle distance")) + static bool IsOtherCharacterInRange(ACharacter* Character, ACharacter* OtherCharacter, FFloatRange Range, bool bIncludeSelfCapsuleRadius, bool bIncludeTargetCapsuleRadius); + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary file path")) + static FString GetPathToFile(UObject* Object); + + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary build debug")) + static bool IsDebugBuild(); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary build debug development")) + static bool IsDevelopmentBuild(); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary build debug production release shipping")) + static bool IsShippingBuild(); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary build debug test")) + static bool IsTestBuild(); + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary editor InEditor withEditor")) + static bool IsInEditor(); + // Are in Debug/Development/Shipping/Test build or Editor. If we WITH_EDITOR returns Editor, + // no matter what EBuildConfiguration is currently used(mostly WITH_EDITOR is Development) + // if real build returns - FApp::GetBuildConfiguration() result, except Debug and DebugGame are same "Debug" + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Utils", meta = (Keywords = "UnrealHelperLibrary build debug test")) + static EUHLBuildType GetBuildType(); + /** ~Utils **/ + + /** AI **/ static EBBValueType BlackboardKeyToBBValueType(FBlackboardKeySelector BlackboardKey); -/** ~AI **/ + /** ~AI **/ -/** Colors **/ + /** Colors **/ // "Makes a random but quite nice color" - literally C++ FColor::MakeRandomColor // if seed >= 0 than FColor::MakeRandomSeededColor will be used - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Colors", meta=(Keywords = "UnrealHelperLibrary color random", AdvancedDisplay="Seed")) + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Colors", meta = (Keywords = "UnrealHelperLibrary color random", AdvancedDisplay = "Seed")) static FColor RandomColor(int32 Seed = -1); // "Makes a random but quite nice color" - literally C++ FLinearColor::MakeRandomColor // if seed >= 0 than FLinearColor::MakeRandomSeededColor will be used - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Colors", meta=(Keywords = "UnrealHelperLibrary color random", AdvancedDisplay="Seed")) + UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Colors", meta = (Keywords = "UnrealHelperLibrary color random", AdvancedDisplay = "Seed")) static FLinearColor RandomLinearColor(int32 Seed = -1); -/** ~Colors **/ + /** ~Colors **/ -/** DebugSubsystem **/ - UFUNCTION(BlueprintPure, Category = "UnrealHelperLibrary|Debug", meta = (Categories = "UHL.DebugCategory,DebugCategory", WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary debug")) - static bool IsUHLDebugCategoryEnabled(UObject* WorldContextObject, FGameplayTag DebugCategoryGameplayTag); -/** ~DebugSubsystem **/ + /** DebugSubsystem **/ + UFUNCTION( + BlueprintPure, Category = "UnrealHelperLibrary|Debug", meta = (Categories = "UHL.DebugCategory,DebugCategory", WorldContext = "WorldContextObject", Keywords = "UnrealHelperLibrary debug")) + static bool IsUHLDebugCategoryEnabled(UObject* WorldContextObject, FGameplayTag DebugCategoryGameplayTag); + /** ~DebugSubsystem **/ }; - - - diff --git a/Source/UnrealHelperLibrary/UnrealHelperLibrary.Build.cs b/Source/UnrealHelperLibrary/UnrealHelperLibrary.Build.cs index 2b63f14..f0cc6f5 100644 --- a/Source/UnrealHelperLibrary/UnrealHelperLibrary.Build.cs +++ b/Source/UnrealHelperLibrary/UnrealHelperLibrary.Build.cs @@ -1,4 +1,4 @@ -// Some copyright should be here... +// Copyright (c) 2024 Pavel Penkov using UnrealBuildTool; diff --git a/Source/UnrealHelperLibrary/UnrealHelperLibraryTypes.h b/Source/UnrealHelperLibrary/UnrealHelperLibraryTypes.h index abc1695..3751ded 100644 --- a/Source/UnrealHelperLibrary/UnrealHelperLibraryTypes.h +++ b/Source/UnrealHelperLibrary/UnrealHelperLibraryTypes.h @@ -1,4 +1,6 @@ -#pragma once +// Copyright (c) 2024 Pavel Penkov + +#pragma once const FVector VECTOR_ERROR = FVector(404, 404, 404); const float FLOAT_ERROR = -99999.0f; diff --git a/UnrealHelperLibrary.uplugin b/UnrealHelperLibrary.uplugin index d225577..10c52d7 100644 --- a/UnrealHelperLibrary.uplugin +++ b/UnrealHelperLibrary.uplugin @@ -40,6 +40,17 @@ "Name": "GameplayAbilities", "Enabled": true }, + { + "Name": "DataRegistry", + "Enabled": true + }, + { + "Name": "GameplayTagsEditor", + "Enabled": true, + "TargetAllowList": [ + "Editor" + ] + }, { "Name": "EnhancedInput", "Enabled": true