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/Content/BP_UHL_BlueprintNode.uasset b/Content/BP_UHL_BlueprintNode.uasset new file mode 100644 index 0000000..e1bb2e1 Binary files /dev/null and b/Content/BP_UHL_BlueprintNode.uasset differ diff --git a/Content/BP_UHL_BlueprintNodes.uasset b/Content/BP_UHL_BlueprintNodes.uasset deleted file mode 100644 index 04db4e6..0000000 Binary files a/Content/BP_UHL_BlueprintNodes.uasset and /dev/null differ diff --git a/README.md b/README.md index 9b03ec7..579c0da 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ UHL consists of 3 modules: > - [TraceUtilsBPL](#traceutilsbpl) > - SweepCapsuleSingleByChannel > - [Settings](#settings) -> - [UHL Settings](#) +> - [UHL Settings](#uhl-settings) **UnrealHelperEditor** @@ -731,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/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySystemComponent.cpp b/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySystemComponent.cpp index 7634378..99defbe 100644 --- a/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySystemComponent.cpp +++ b/Source/UnrealHelperLibrary/Private/AbilitySystem/UHLAbilitySystemComponent.cpp @@ -366,12 +366,9 @@ void UUHLAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGame { if (!bUseInputConfig) return; - // TODO: mb check how Lyra use that tag? if (HasMatchingGameplayTag(UHLGameplayTags::TAG_Gameplay_AbilityInputBlocked)) { - InputPressedSpecHandles.Reset(); - InputReleasedSpecHandles.Reset(); - InputHeldSpecHandles.Reset(); + ClearAbilityInput(); return; } @@ -389,8 +386,7 @@ void UUHLAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGame { if (AbilitySpec->Ability && !AbilitySpec->IsActive()) { - const UUHLGameplayAbility* AbilityCDO = CastChecked(AbilitySpec->Ability); - + const UUHLGameplayAbility* AbilityCDO = Cast(AbilitySpec->Ability); if (AbilityCDO->GetActivationPolicy() == EUHLAbilityActivationPolicy::WhileInputActive) { AbilitiesToActivate.AddUnique(AbilitySpec->Handle); @@ -410,30 +406,25 @@ void UUHLAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGame { AbilitySpec->InputPressed = true; - // TODO: если абилка активна, нужно пытаться все равно ее активировать, а не просто данные слать - // If ability active, we should try to activate it again, instead of sending data - - // if (AbilitySpec->IsActive()) - // { - // // Ability is active so pass along the input event. - // AbilitySpecInputPressed(*AbilitySpec); - // } - // else - // { - const UUHLGameplayAbility* AbilityCDO = CastChecked(AbilitySpec->Ability); - - if (AbilityCDO->GetActivationPolicy() == EUHLAbilityActivationPolicy::OnInputTriggered) + const UUHLGameplayAbility* AbilityCDO = Cast(AbilitySpec->Ability); + if (AbilitySpec->IsActive() + // TODO move this logic to "OnInputTriggeredForceReactivate" ?? + // If ability active, we should try to activate it again, instead of sending data + // so that's why if "OnInputTriggered" choosed - skip + && AbilityCDO + && AbilityCDO->GetActivationPolicy() != EUHLAbilityActivationPolicy::OnInputTriggered) { - AbilitiesToActivate.AddUnique(AbilitySpec->Handle); - - // TODO: testing - // if (AbilitySpec->IsActive()) - // { - // Ability is active so pass along the input event. - AbilitySpecInputPressed(*AbilitySpec); - // } + // Ability is active so pass along the input event. + AbilitySpecInputPressed(*AbilitySpec); } - // } + else + { + // const UUHLGameplayAbility* AbilityCDO = Cast(AbilitySpec->Ability); + if (AbilityCDO && AbilityCDO->GetActivationPolicy() == EUHLAbilityActivationPolicy::OnInputTriggered) + { + AbilitiesToActivate.AddUnique(AbilitySpec->Handle); + } + } } } } @@ -502,6 +493,19 @@ void UUHLAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGame { // Ability is active so pass along the input event. AbilitySpecInputReleased(*AbilitySpec); + + // if "WhileInputActive" EndAbility automatically + // const UUHLGameplayAbility* AbilityCDO = Cast(AbilitySpec->Ability); + // if (AbilityCDO && AbilityCDO->GetActivationPolicy() == EUHLAbilityActivationPolicy::WhileInputActive) + // { + // const FUHLWhileInputActiveSettings& WhileInputActiveSettings = AbilityCDO->GetWhileInputActiveSettings(); + // if (WhileInputActiveSettings.bCancelAbilityAutomatically) + // { + // // "EndAbility" not accessible, so try to cancel if "bCancelAbilityAutomatically" + // AbilitySpec->Ability->CancelAbility(AbilitySpec->Handle, AbilityActorInfo.Get(), AbilitySpec->ActivationInfo, WhileInputActiveSettings.bReplicateEndAbility); + // // AbilitySpec->Ability->EndAbility(AbilitySpec->Handle, AbilityActorInfo.Get(), AbilitySpec->ActivationInfo, WhileInputActiveSettings.bReplicateEndAbility, WhileInputActiveSettings.bMarkAsCanceledOnEnd); + // } + // } } } } @@ -513,3 +517,10 @@ void UUHLAbilitySystemComponent::ProcessAbilityInput(float DeltaTime, bool bGame InputPressedSpecHandles.Reset(); InputReleasedSpecHandles.Reset(); } + +void UUHLAbilitySystemComponent::ClearAbilityInput() +{ + InputPressedSpecHandles.Reset(); + InputReleasedSpecHandles.Reset(); + InputHeldSpecHandles.Reset(); +} diff --git a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp index df8864b..8f35061 100644 --- a/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp +++ b/Source/UnrealHelperLibrary/Private/Subsystems/DebugSubsystem/UHLDebugSubsystem.cpp @@ -128,6 +128,7 @@ void UUHLDebugSubsystem::EnableDebugCategory(const FGameplayTag DebugCategoryTag for (const FUHLDebugCategory& DebugCategory : DebugCategories) { if (DebugCategory != *UHLDebugCategory + && !UHLDebugCategory->Blocks.IsEmpty() && DebugCategory.Tags.HasAny(UHLDebugCategory->Blocks)) { EnableDebugCategory(DebugCategory.Tags.First(), false); diff --git a/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySystemComponent.h b/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySystemComponent.h index 4af249d..f6b0d1e 100644 --- a/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySystemComponent.h +++ b/Source/UnrealHelperLibrary/Public/AbilitySystem/UHLAbilitySystemComponent.h @@ -105,6 +105,8 @@ class UNREALHELPERLIBRARY_API UUHLAbilitySystemComponent : public UAbilitySystem /** Input Config **/ void ProcessAbilityInput(float DeltaTime, bool bGamePaused); + void ClearAbilityInput(); + virtual void AbilitySpecInputPressed(FGameplayAbilitySpec& Spec) override; virtual void AbilitySpecInputReleased(FGameplayAbilitySpec& Spec) override; virtual void AbilityInputTagPressed(const FGameplayTag InputTag);