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

44 lines
993 B
C
Raw Normal View History

2025-03-10 09:43:27 +08:00
// Copyright Sam Bonifacio. All Rights Reserved.
#pragma once
#include "UI/InputMapping.h"
#include "AxisLabel.h"
#include "AxisMapping.generated.h"
/**
* Shows a label for an input axis on a particular scale and allows the user to rebind it
*/
UCLASS(abstract)
class AUTOSETTINGSINPUT_API UAxisMapping : public UInputMapping
{
GENERATED_BODY()
public:
// Name of the axis mapping to display and rebind
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Axis Mapping")
FName AxisName;
// Scale of the axis mapping to display and rebind
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Axis Mapping")
float Scale;
protected:
UPROPERTY(BlueprintReadOnly, Category = "Axis Mapping", meta = (BindWidget))
UAxisLabel* AxisLabel;
virtual void NativeConstruct() override;
virtual void UpdateLabel_Implementation() override;
UAxisLabel* GetAxisLabel() const { return AxisLabel; }
private:
virtual void BindChord(FCapturedInput CapturedInput) override;
};