lyra_game_ue/Source/LyraGame/Settings/CustomSettings/LyraSettingKeyboardInput.h

69 lines
2.1 KiB
C
Raw Normal View History

2025-03-20 11:06:26 +01:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "EnhancedActionKeyMapping.h"
#include "GameSettingValue.h"
#include "UserSettings/EnhancedInputUserSettings.h"
#include "LyraSettingKeyboardInput.generated.h"
class UObject;
//--------------------------------------
// ULyraSettingKeyboardInput
//--------------------------------------
UCLASS()
class ULyraSettingKeyboardInput : public UGameSettingValue
{
GENERATED_BODY()
public:
ULyraSettingKeyboardInput();
void InitializeInputData(const UEnhancedPlayerMappableKeyProfile* KeyProfile, const FKeyMappingRow& MappingData, const FPlayerMappableKeyQueryOptions& QueryOptions);
FText GetKeyTextFromSlot(const EPlayerMappableKeySlot InSlot) const;
UE_DEPRECATED(5.3, "GetPrimaryKeyText has been deprecated, please use GetKeyTextFromSlot instead")
FText GetPrimaryKeyText() const;
UE_DEPRECATED(5.3, "GetSecondaryKeyText has been deprecated, please use GetKeyTextFromSlot instead")
FText GetSecondaryKeyText() const;
virtual void StoreInitial() override;
virtual void ResetToDefault() override;
virtual void RestoreToInitial() override;
bool ChangeBinding(int32 InKeyBindSlot, FKey NewKey);
void GetAllMappedActionsFromKey(int32 InKeyBindSlot, FKey Key, TArray<FName>& OutActionNames) const;
/** Returns true if mappings on this setting have been customized */
bool IsMappingCustomized() const;
FText GetSettingDisplayName() const;
FText GetSettingDisplayCategory() const;
const FKeyMappingRow* FindKeyMappingRow() const;
UEnhancedPlayerMappableKeyProfile* FindMappableKeyProfile() const;
UEnhancedInputUserSettings* GetUserSettings() const;
protected:
/** ULyraSetting */
virtual void OnInitialized() override;
protected:
/** The name of this action's mappings */
FName ActionMappingName;
/** The query options to filter down keys on this setting for */
FPlayerMappableKeyQueryOptions QueryOptions;
/** The profile identifier that this key setting is from */
FGameplayTag ProfileIdentifier;
/** Store the initial key mappings that are set on this for each slot */
TMap<EPlayerMappableKeySlot, FKey> InitialKeyMappings;
};