October3d55/M/AutoSettings/Source/AutoSettingsInput/Public/UI/ActionMapping.h

38 lines
855 B
C
Raw Permalink Normal View History

2025-03-10 09:43:27 +08:00
// Copyright Sam Bonifacio. All Rights Reserved.
#pragma once
#include "UI/InputMapping.h"
#include "ActionLabel.h"
#include "ActionMapping.generated.h"
/**
* Shows a label for an input action and allows the user to rebind it
*/
UCLASS(abstract)
class AUTOSETTINGSINPUT_API UActionMapping : public UInputMapping
{
GENERATED_BODY()
public:
// Name of the action mapping to display and rebind
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Action Mapping")
FName ActionName;
protected:
UPROPERTY(BlueprintReadOnly, Category = "Action Mapping", meta = (BindWidget))
UActionLabel* ActionLabel;
virtual void NativeConstruct() override;
virtual void UpdateLabel_Implementation() override;
UActionLabel* GetActionLabel() const { return ActionLabel; }
private:
virtual void BindChord(FCapturedInput CapturedInput) override;
};