- Buffered inputs are no longer handled by a component on the PlayerController, but by a LocalPlayerSubsystem instead.
- Combo manager connects to this subsystem entirely on its own when its owner is the player character.
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
// ©2022 Batty Bovine Productions, LLC. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ComboInputAssets.generated.h"
|
||||
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct COMBOINPUT_API FComboSequenceAction
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
// Action to perform when the associated combo sequence node is activated.
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TObjectPtr<const class UComboAction> ComboAction;
|
||||
|
||||
// Sequence node to switch to once this action is complete.
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TObjectPtr<const class UComboSequenceNode> NextNode;
|
||||
};
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class COMBOINPUT_API UComboAction : public UDataAsset
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Human-readable name of this combo action.
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
FName ActionName;
|
||||
};
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class COMBOINPUT_API UComboSequenceNode : public UDataAsset
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(BlueprintReadOnly, EditAnywhere)
|
||||
TMap<const class UComboInputAsset *, struct FComboSequenceAction> ComboBranch;
|
||||
};
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class COMBOINPUT_API UComboInputAsset : public UDataAsset
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
bool MatchesInputAction(const class UInputAction* Action) const
|
||||
{
|
||||
if (this->ActionGroup.Num() == 1 && this->ActionGroup.Contains(Action))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool MatchesInputActions(TSet<const class UInputAction *> Actions) const
|
||||
{
|
||||
if (this->ActionGroup.Num() == Actions.Num())
|
||||
{
|
||||
for (const UInputAction *Action : Actions)
|
||||
{
|
||||
if (!this->ActionGroup.Contains(Action))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Human-readable name of this combo input.
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
||||
FName ComboInputName;
|
||||
|
||||
// Combined actions that add up to this combo input when activated
|
||||
// within a short time of one another. If only one is present, then
|
||||
// this combo input asset will simply represent that action.
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
||||
TSet<TObjectPtr<const class UInputAction>> ActionGroup;
|
||||
|
||||
// Combo inputs that should be prevented from occurring during this
|
||||
// action. These will be locked when the action is broadcast, and
|
||||
// should be unlocked by the receiving actor by sending an unlock
|
||||
// event.
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
||||
TSet<TObjectPtr<const class UComboInputAsset>> LockedComboInputs;
|
||||
};
|
||||
Reference in New Issue
Block a user