From 70a29468c82f5ece5462a28ce6059c2c63286740 Mon Sep 17 00:00:00 2001 From: Viktor Blomme Date: Thu, 17 Apr 2025 16:43:04 +0200 Subject: [PATCH] Add priority --- .../Private/Input/GBFInputMappingContextStackItem.cpp | 2 +- .../Public/Input/GBFInputMappingContextStackItem.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/GameBaseFramework/Private/Input/GBFInputMappingContextStackItem.cpp b/Source/GameBaseFramework/Private/Input/GBFInputMappingContextStackItem.cpp index 9366fe44..78465828 100644 --- a/Source/GameBaseFramework/Private/Input/GBFInputMappingContextStackItem.cpp +++ b/Source/GameBaseFramework/Private/Input/GBFInputMappingContextStackItem.cpp @@ -15,7 +15,7 @@ void UGBFInputMappingContextStackItem::AddToInputSystem( UEnhancedInputLocalPlay for ( auto & imc : InputMappingContexts ) { - input_system->AddMappingContext( imc.Get(), 0 ); + input_system->AddMappingContext( imc.Get(), Priority ); } } diff --git a/Source/GameBaseFramework/Public/Input/GBFInputMappingContextStackItem.h b/Source/GameBaseFramework/Public/Input/GBFInputMappingContextStackItem.h index 952a4700..639df274 100644 --- a/Source/GameBaseFramework/Public/Input/GBFInputMappingContextStackItem.h +++ b/Source/GameBaseFramework/Public/Input/GBFInputMappingContextStackItem.h @@ -24,4 +24,7 @@ class GAMEBASEFRAMEWORK_API UGBFInputMappingContextStackItem final : public UDat private: UPROPERTY( EditDefaultsOnly, BlueprintReadOnly, meta = ( AllowPrivateAccess ) ) TArray< TObjectPtr< UInputMappingContext > > InputMappingContexts; + + UPROPERTY( EditDefaultsOnly, BlueprintReadOnly, meta = ( AllowPrivateAccess ) ) + int32 Priority = 0; };