Skip to content

Input buffer #260

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

Merged
merged 15 commits into from
May 13, 2024
Merged

Input buffer #260

merged 15 commits into from
May 13, 2024

Conversation

Fr0oZzFred
Copy link
Collaborator

@Fr0oZzFred Fr0oZzFred commented Apr 29, 2024

Add input buffer


This change is Reviewable

Frickerson
Frickerson previously approved these changes Apr 30, 2024
@Fr0oZzFred Fr0oZzFred marked this pull request as draft May 6, 2024 08:48
@Fr0oZzFred Fr0oZzFred marked this pull request as ready for review May 6, 2024 11:29
Copy link
Owner

@TheEmidee TheEmidee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 8 files at r1, 1 of 2 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 20 unresolved discussions (waiting on @Fr0oZzFred, @MaxDaniels, @ThibNach, and @VectorGamez)


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 8 at r3 (raw file):

#include "Input/GBFInputComponent.h"

UGBFAbilityInputBufferComponent::UGBFAbilityInputBufferComponent( const FObjectInitializer & ObjectInitializer ) :

object_initializer


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 16 at r3 (raw file):

}

void UGBFAbilityInputBufferComponent::TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction )

CS on function parameters


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 216 at r3 (raw file):

    }

    FGameplayTag most_triggered_tag = triggered_tag_map.FindAndRemoveChecked( max );

you could use a TSortedMap to avoid this code


Source/GameBaseFramework/Private/Characters/Components/GBFHeroComponent.cpp line 227 at r3 (raw file):

}

TMap< const UGBFInputConfig *, TArray< uint32 > > UGBFHeroComponent::GetBoundActionsByInputconfig() const

return by const XXX & to avoid a copy


Source/GameBaseFramework/Private/GAS/Components/GBFAbilitySystemComponent.cpp line 382 at r3 (raw file):

}

UGameplayAbility * UGBFAbilitySystemComponent::FindAbilityClassWithInputTag( FGameplayTag input_tag )

FindAbilityByInputTag


Source/GameBaseFramework/Private/GAS/Components/GBFAbilitySystemComponent.cpp line 382 at r3 (raw file):

}

UGameplayAbility * UGBFAbilitySystemComponent::FindAbilityClassWithInputTag( FGameplayTag input_tag )

the function can be const


Source/GameBaseFramework/Public/Animation/GBFAnimNotifyState_InputBuffer.h line 5 at r3 (raw file):

#include "Characters/Components/GBFAbilityInputBufferComponent.h"

#include <Animation/AnimNotifies/AnimNotifyState.h>

<>


Source/GameBaseFramework/Public/Animation/GBFAnimNotifyState_InputBuffer.h line 28 at r3 (raw file):

    UPROPERTY( EditAnywhere )
    ETriggerPriority TriggerPriority;
    UPROPERTY( EditAnywhere, Meta = ( Categories = "Input" ) )

missing empty line


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 17 at r3 (raw file):

UCLASS( Blueprintable )
class GAMEBASEFRAMEWORK_API UGBFAbilityInputBufferComponent : public UPawnComponent

final


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 24 at r3 (raw file):

    UGBFAbilityInputBufferComponent( const FObjectInitializer & ObjectInitializer );
    void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction ) override;
    UFUNCTION( BlueprintCallable )

empty line above

{
Super::TickComponent( DeltaTime, TickType, ThisTickFunction );
MonitoringTime += DeltaTime;
if ( !ensureAlwaysMsgf( MonitoringTime <= MaxMonitoringTime, TEXT( "Ability Input Buffer didn't call Stop Monitor 5 secs after activation, please call it manually !" ) ) )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print the actual MaxMonitoringTime instead of 5

this->PrimaryComponentTick.bCanEverTick = true;
}

void UGBFAbilityInputBufferComponent::TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the tick would only be fired #if !UE_BUILD_SHIPPING, you can surround the function by that too, both in .h and cpp

public:
UGBFAbilityInputBufferComponent( const FObjectInitializer & ObjectInitializer );
void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction ) override;
UFUNCTION( BlueprintCallable )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UFUNCTION before other functions, except for constructor and inline functions

@@ -38,4 +41,8 @@ class GAMEBASEFRAMEWORK_API UGBFAbilityInputBufferComponent : public UPawnCompon
FGameplayTagContainer InputTagsToCheck;
TArray< FGameplayTag > TriggeredTags;
TArray< uint32 > BindHandles;
};

UPROPERTY( EditDefaultsOnly )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPROPERTY before all other properties

Copy link
Collaborator

@Frickerson Frickerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: all files reviewed, 14 unresolved discussions (waiting on @Fr0oZzFred, @MaxDaniels, and @ThibNach)

Copy link
Collaborator

@Frickerson Frickerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r4, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @Fr0oZzFred, @MaxDaniels, and @ThibNach)

Copy link
Collaborator Author

@Fr0oZzFred Fr0oZzFred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @MaxDaniels, @TheEmidee, @ThibNach, and @VectorGamez)


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 8 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

object_initializer

Done.


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 16 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

CS on function parameters

Done.


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 16 at r3 (raw file):

Previously, VectorGamez (Viktor Blomme) wrote…

Since the tick would only be fired #if !UE_BUILD_SHIPPING, you can surround the function by that too, both in .h and cpp

Done.


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 20 at r3 (raw file):

Previously, VectorGamez (Viktor Blomme) wrote…

print the actual MaxMonitoringTime instead of 5

Done.


Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp line 216 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

you could use a TSortedMap to avoid this code

Done.


Source/GameBaseFramework/Private/Characters/Components/GBFHeroComponent.cpp line 227 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

return by const XXX & to avoid a copy

Done.


Source/GameBaseFramework/Private/GAS/Components/GBFAbilitySystemComponent.cpp line 382 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

FindAbilityByInputTag

Done.


Source/GameBaseFramework/Private/GAS/Components/GBFAbilitySystemComponent.cpp line 382 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

the function can be const

Done.


Source/GameBaseFramework/Public/Animation/GBFAnimNotifyState_InputBuffer.h line 5 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

<>

already done


Source/GameBaseFramework/Public/Animation/GBFAnimNotifyState_InputBuffer.h line 28 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

missing empty line

Done.


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 17 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

final

Done.


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 24 at r3 (raw file):

Previously, TheEmidee (Michael Delva) wrote…

empty line above

Done.


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 24 at r3 (raw file):

Previously, VectorGamez (Viktor Blomme) wrote…

UFUNCTION before other functions, except for constructor and inline functions

Done.


Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h line 45 at r3 (raw file):

Previously, VectorGamez (Viktor Blomme) wrote…

UPROPERTY before all other properties

Done.

Copy link
Owner

@TheEmidee TheEmidee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MaxDaniels, @ThibNach, and @VectorGamez)

@TheEmidee TheEmidee merged commit d9bb431 into develop May 13, 2024
6 checks passed
@TheEmidee TheEmidee deleted the input_buffer branch May 13, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants