Minor corrections to Mouse Click Handling
This commit is contained in:
parent
1625c0012e
commit
3171771876
BIN
Content/Widgets/MainMenu/BP_SelectWeaponWidget.uasset
(Stored with Git LFS)
BIN
Content/Widgets/MainMenu/BP_SelectWeaponWidget.uasset
(Stored with Git LFS)
Binary file not shown.
@ -6,6 +6,7 @@
|
||||
#include "CustomButton.h"
|
||||
#include "StarterWeaponButtonDataObject.h"
|
||||
#include "StarterWeaponButtonWidget.h"
|
||||
#include "Blueprint/WidgetBlueprintLibrary.h"
|
||||
#include "Components/ScrollBox.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
@ -36,7 +37,11 @@ void USelectWeaponWidget::NativeConstruct()
|
||||
|
||||
if (Buttons.Num() > 0)
|
||||
{
|
||||
Buttons[0]->SetKeyboardFocus();
|
||||
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
{
|
||||
UWidgetBlueprintLibrary::SetInputMode_UIOnlyEx(PlayerController, Buttons[0], EMouseLockMode::LockAlways);
|
||||
PlayerController->bShowMouseCursor = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user