fix: input mapping
This commit is contained in:
		| @@ -196,19 +196,21 @@ void AUTAD_UIPlayerController::ShowSkillTree() | ||||
| 	{ | ||||
| 		SkillTreeWidget->AddToViewport(1); | ||||
|  | ||||
| 		// Switch to UI-only input mode to block gameplay actions (like click-to-move) | ||||
| 		FInputModeUIOnly InputMode; | ||||
| 		InputMode.SetWidgetToFocus(SkillTreeWidget->TakeWidget()); | ||||
| 		// Use GameAndUI mode - allows Enhanced Input to work while UI is open | ||||
| 		// Mouse clicks will be consumed by UI widgets automatically | ||||
| 		FInputModeGameAndUI InputMode; | ||||
| 		InputMode.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock); | ||||
| 		InputMode.SetHideCursorDuringCapture(false); | ||||
| 		SetInputMode(InputMode); | ||||
| 		bShowMouseCursor = true; | ||||
|  | ||||
| 		// Switch input mapping context from gameplay to UI | ||||
| 		// This allows UI-specific controls (like Tab to close) to work | ||||
| 		if (UEnhancedInputLocalPlayerSubsystem* Subsystem = | ||||
| 				ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>( | ||||
| 					GetLocalPlayer())) | ||||
| 		{ | ||||
| 			// Remove gameplay context | ||||
| 			// Remove gameplay context to prevent movement actions | ||||
| 			if (DefaultMappingContext) | ||||
| 			{ | ||||
| 				Subsystem->RemoveMappingContext(DefaultMappingContext); | ||||
| @@ -227,9 +229,11 @@ void AUTAD_UIPlayerController::HideSkillTree() | ||||
| 	if (SkillTreeWidget && SkillTreeWidget->IsInViewport()) | ||||
| 	{ | ||||
| 		// Clear any unconfirmed skill selections | ||||
| 		if (AUTAD_UICharacter* Character = Cast<AUTAD_UICharacter>(GetPawn())) | ||||
| 		if (const AUTAD_UICharacter* PlayerCharacter = | ||||
| 				Cast<AUTAD_UICharacter>(GetPawn())) | ||||
| 		{ | ||||
| 			if (USkillTreeComponent* SkillTreeComp = Character->GetSkillTreeComponent()) | ||||
| 			if (USkillTreeComponent* SkillTreeComp = | ||||
| 					PlayerCharacter->GetSkillTreeComponent()) | ||||
| 			{ | ||||
| 				SkillTreeComp->ClearSelection(); | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user