Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.3.1 #18

Merged
merged 28 commits into from
Jan 5, 2025
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0ccb5e0
[InputSystem] try to fix "WhileInputActive"(not possible), "OnInputTr…
Ciberusps Oct 14, 2024
dec5186
[Docs] BlueprintNodes
Ciberusps Oct 15, 2024
b2e4568
Update README.md
Ciberusps Oct 16, 2024
cf66076
Merge branch 'main' into dev
Ciberusps Oct 16, 2024
693c6eb
Update UHLAbilitySystemComponent.cpp
Ciberusps Oct 16, 2024
34fc2a5
[DebugSubsystem] check Blocks not empty
Ciberusps Oct 17, 2024
19217a4
Merge branch 'main' into dev
Ciberusps Oct 19, 2024
3c90a2e
Merge branch 'main' into dev
Ciberusps Oct 21, 2024
97ad953
[Anim] ANS_UHL_Base add ShouldUseExperimentalUHLFeatures, NotifyEndOr…
Ciberusps Oct 25, 2024
be5fa31
ANS_EnableRootMotionZAxisMovement land check
Ciberusps Oct 28, 2024
690e8e5
ANS_EnableRootMotionZAxisMovement ground check
Ciberusps Oct 29, 2024
2408a20
Merge branch 'main' into dev
Ciberusps Nov 12, 2024
6fec47f
Update README.md
Ciberusps Nov 14, 2024
560cd49
Update README.md
Ciberusps Nov 14, 2024
c7dc544
[Editor] CustomThumbnails refactoring
Ciberusps Nov 14, 2024
2cc1f3c
[Debug] experimental debug lines through "AHUD::DrawHUD"
Ciberusps Nov 15, 2024
923b2d7
[Debug] experimental debug lines through "AHUD::DrawHUD" 2
Ciberusps Nov 15, 2024
066ef6f
ANS_UHL_Base fix critical build err
Ciberusps Nov 16, 2024
24c81d5
UUHLTraceUtilsBPL::SweepCapsuleMultiByChannel
Ciberusps Nov 17, 2024
7e17ac2
Update README.md
Ciberusps Nov 19, 2024
af29abd
[BPL] GetMostDistantActor
Ciberusps Nov 22, 2024
21abdaa
[Editor] CustomIcons add classes array support
Ciberusps Dec 20, 2024
77d960c
[DebugSubsystem] fix RandomColors for DebugCategories
Ciberusps Dec 21, 2024
5bf688b
by default InstancingPolicy = InstancedPerActor
Ciberusps Jan 5, 2025
b8f7067
Revert "by default InstancingPolicy = InstancedPerActor"
Ciberusps Jan 5, 2025
31243b1
update readme.md
Ciberusps Jan 5, 2025
3b1fc36
update readme.md
Ciberusps Jan 5, 2025
07dcdee
Merge branch 'main' into dev
Ciberusps Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Content/BP_UHL_BlueprintNode.uasset
Binary file not shown.
Binary file removed Content/BP_UHL_BlueprintNodes.uasset
Binary file not shown.
50 changes: 41 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -106,7 +106,11 @@ UHL consists of 3 modules:
> - [TurnTo](#turnto)
> - [Subsystems](#subsystems)
> - [DebugSubsystem](#debugsubsystem)
> - [UHLHUD](#uhlhud)
> - [UnrealHelperLibraryBPL](#unrealhelperlibrarybpl)
> - Gameplay
> - GetActorClosestToCenterOfScreen
> - GetMostDistantActor
> - GAS
> - TryActivateAbilityWithTag
> - TryCancelAbilityWithTag
@@ -122,13 +126,17 @@ UHL consists of 3 modules:
> - [GetPointAtAngleRelativeToOtherActor](#getpointatanglerelativetootheractor)
> - [GetPointAtDirectionRelativeToOtherActor](#getpointatdirectionrelativetootheractor)
> - [DirectionToAngle](#directiontoangle)
> - UI/Screen
> - GetViewportSizeUnscaled
> - Misc
> - [GetProjectVersion](#getprojectversion)
> - [GetNamesOfComponentsOnObject](#getnamesofcomponentsonobject)
> - [GetAssetsOfClass](#getassetsofclass)
> - GetBuildType
> <!-- - GetActorComponentByName -->
> <!-- - GetSceneComponentByName -->
> - Debug
> - DrawDebugLineOnCanvas
> - Other
> - [GetHighestPoint](#gethighestpoint)
> - [LoadingUtilLibrary](#loadingutillibrary)
@@ -141,7 +149,7 @@ UHL consists of 3 modules:
> - [TraceUtilsBPL](#traceutilsbpl)
> - SweepCapsuleSingleByChannel
> - [Settings](#settings)
> - [UHL Settings](#)
> - [UHL Settings](#uhl-settings)

**UnrealHelperEditor**

@@ -647,6 +655,22 @@ void AUHLPlayerController::BeginPlay()
How to add DebugCategory:
1)

How to subscribe on debug category change in C++

```c++
UAA_WaitDebugCategoryChange* WaitDebugCategoryChangeTask = UAA_WaitDebugCategoryChange::WaitDebugCategoryChange(
Actor->GetWorld(),
YourGameplayTags::TAG_DebugCategory_Combat // same as FGameplayTag("DebugCategory.Something")
);
WaitDebugCategoryChangeTask->OnChange.AddUniqueDynamic(this, &UCombatSubsystem::OnDebugCategoryChanged);
// on activation "OnDebugCategoryChanged" will be fired
WaitDebugCategoryChangeTask->Activate();
```

#### UHLHUD

HUD with debugging abilities, for now used to display debug bars(e.g. HP/hidden attributes)

### LoadingUtilLibrary

**UHLLoadingUtilLibrary** - loading utils from Lyra
@@ -684,7 +708,11 @@ if you don't want to copy paste your `AttributeSets`

**Custom thumnails** - to override thumbnail by your own, just implement `IUHECustomThumbnail` interface and define your own icon using `GetCustomThumbnailIcon()`

> [!WARNING]
> ⚠️ NOT sure that blueprints supported for now

```C++
// UInventoryItem.h
#if WITH_EDITOR
#include "UHECustomThumbnail.h"
#endif
@@ -697,19 +725,23 @@ class IUHECustomThumbnail {};
class GAMECODE_API UInventoryItem : public UObject,
public IUHECustomThumbnail
{
// ...

/** IUHECustomThumbnail **/
/** IUHECustomThumbnail **/
#if WITH_EDITOR
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
UTexture2D* GetCustomThumbnailIcon() { return Description.Icon; };
virtual UTexture2D* GetCustomThumbnailIcon_Implementation() const override;
#endif
/** ~IUHECustomThumbnail **/
}

// ...
```
------------------------------------------------------------------

⚠️ for now works only with C++, TODO add support for blueprints
// UInventoryItem.cpp
#if WITH_EDITOR
UTexture2D* UInventoryItem::GetCustomThumbnailIcon_Implementation()
{
return Description.Icon;
}
#endif
```

Thanks to [this post](https://forums.unrealengine.com/t/custom-thumbnail-not-display-asset-is-never-loaded/143155/2?u=ciberus) and [this](https://forums.unrealengine.com/t/custom-thumbnail-on-blueprint/337532/3?u=ciberus)

7 changes: 6 additions & 1 deletion Source/UnrealHelperEditor/Private/UHECustomThumbnail.cpp
Original file line number Diff line number Diff line change
@@ -5,4 +5,9 @@

// Add default functionality here for any IUHECustomThumbnail functions that are not pure virtual.

#include UE_INLINE_GENERATED_CPP_BY_NAME(UHECustomThumbnail)
#include UE_INLINE_GENERATED_CPP_BY_NAME(UHECustomThumbnail)

UTexture2D* IUHECustomThumbnail::GetCustomThumbnailIcon_Implementation() const
{
return nullptr;
}
19 changes: 14 additions & 5 deletions Source/UnrealHelperEditor/Private/UnrealHelperEditorStyle.cpp
Original file line number Diff line number Diff line change
@@ -53,16 +53,25 @@ TSharedRef< FSlateStyleSet > FUnrealHelperEditorStyle::Create()
FString Path = CustomClassIcon.Texture2D.GetLongPackageName();
UObject* IconImageObject = LoadObject<UObject>(nullptr, *Path);

if (IsValid(IconImageObject) && IsValid(CustomClassIcon.Class))
if (IsValid(IconImageObject))
{
UTexture2D* IconImage = Cast<UTexture2D>(IconImageObject);
// FSlateDynamicImageBrush* DynamicImageBrush = new FSlateDynamicImageBrush(IconImage, Icon20x20, FName("CapsuleHitRegistrator"));
FSlateImageBrush* ImageBrush = new FSlateImageBrush(IconImage, Icon20x20);

FString ClassName = CustomClassIcon.Class->GetName();
// Modify the class icons to use our new awesome icons
FString IconStyleName = FString::Printf(TEXT("ClassIcon.%s"), *ClassName);
Style->Set(FName(IconStyleName), ImageBrush);
TArray<TSubclassOf<UObject>> AllClasses = CustomClassIcon.Classes;
// support deprecated value
if (IsValid(CustomClassIcon.Class))
{
AllClasses.Add(CustomClassIcon.Class);
}
for (const TSubclassOf<UObject> Class : AllClasses)
{
FString ClassName = Class->GetName();
// Modify the class icons to use our new awesome icons
FString IconStyleName = FString::Printf(TEXT("ClassIcon.%s"), *ClassName);
Style->Set(FName(IconStyleName), ImageBrush);
}
}
}

5 changes: 4 additions & 1 deletion Source/UnrealHelperEditor/Public/Development/UHESettings.h
Original file line number Diff line number Diff line change
@@ -13,8 +13,11 @@ struct UNREALHELPEREDITOR_API FUHECustomClassIconDescription

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="CustomClassIconDescription")
TSoftObjectPtr<UTexture2D> Texture2D;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="CustomClassIconDescription")
// deprecated, TODO: remove
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="CustomClassIconDescription", meta=(DeprecatedProperty, DeprecationMessage="Deprecated use Classes"))
TSubclassOf<UObject> Class;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="CustomClassIconDescription")
TArray<TSubclassOf<UObject>> Classes;
};

/**
3 changes: 2 additions & 1 deletion Source/UnrealHelperEditor/Public/UHECustomThumbnail.h
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ class UNREALHELPEREDITOR_API IUHECustomThumbnail

/** IUHECustomThumbnail **/
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category="Custom Thumbnail")
UTexture2D* GetCustomThumbnailIcon();
UTexture2D* GetCustomThumbnailIcon() const;
virtual UTexture2D* GetCustomThumbnailIcon_Implementation() const;
/** ~IUHECustomThumbnail **/
};
Original file line number Diff line number Diff line change
@@ -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<UUHLGameplayAbility>(AbilitySpec->Ability);

const UUHLGameplayAbility* AbilityCDO = Cast<UUHLGameplayAbility>(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<UUHLGameplayAbility>(AbilitySpec->Ability);

if (AbilityCDO->GetActivationPolicy() == EUHLAbilityActivationPolicy::OnInputTriggered)
const UUHLGameplayAbility* AbilityCDO = Cast<UUHLGameplayAbility>(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<UUHLGameplayAbility>(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<UUHLGameplayAbility>(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();
}
Original file line number Diff line number Diff line change
@@ -49,9 +49,7 @@ void UANS_ActivateAbility::NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequ

void UANS_ActivateAbility::OnMontageBlendingOut(UAnimMontage* Montage, bool bInterrupted)
{
if (!bDeactivateOnMontageBlendingOut
|| !CurrentAnimMontage.IsValid()
|| Montage != CurrentAnimMontage)
if (!bDeactivateOnMontageBlendingOut || !Montage)
{
return;
}
Loading