Fix some issues with new root canvas stuff
This commit is contained in:
@@ -163,8 +163,7 @@ void AlxPlayerControllerBase::AddWidgetToRoot(UUserWidget *Widget)
|
||||
|
||||
if (Widget->GetParent() == PC->RootCanvas) return;
|
||||
|
||||
UlxRootCanvasSlot *Slot = PC->RootCanvas->AddChildToRootCanvas(Widget);
|
||||
Slot->SlotUnderConstruction = false;
|
||||
PC->RootCanvas->AddChildToRootCanvas(Widget);
|
||||
}
|
||||
|
||||
void AlxPlayerControllerBase::BuildInputStack(TArray<UInputComponent*>& InputStack)
|
||||
@@ -239,7 +238,7 @@ void AlxPlayerControllerBase::BuildInputStack(TArray<UInputComponent*>& InputSta
|
||||
}
|
||||
|
||||
// Now add the widget-managed input components.
|
||||
for (UlxRootCanvasSlot *Slot : ReverseIterate(WidgetSlots))
|
||||
for (UlxRootCanvasSlot *Slot : WidgetSlots)
|
||||
{
|
||||
if (Slot->EnableEnhancedInput)
|
||||
{
|
||||
@@ -269,15 +268,14 @@ void AlxPlayerControllerBase::UpdateInputMode()
|
||||
if (!SlateUser.IsValid()) return;
|
||||
|
||||
|
||||
// Get the desired configuration from the first widget.
|
||||
// TODO: Maybe we don't have to sort the whole array.
|
||||
TArray<UlxRootCanvasSlot*> WidgetSlots = RootCanvas->GetSortedUserWidgets();
|
||||
RootCanvas->UpdateZOrders();
|
||||
|
||||
// Get the desired configuration from the top widget.
|
||||
UUserWidget *Widget = nullptr;
|
||||
UWidget *Focus = nullptr;
|
||||
bool ShowPointer = false;
|
||||
if (!WidgetSlots.IsEmpty())
|
||||
if (UlxRootCanvasSlot *Top = RootCanvas->GetTopWidget())
|
||||
{
|
||||
UlxRootCanvasSlot *Top = WidgetSlots[0];
|
||||
Widget = Cast<UUserWidget>(Top->GetContent());
|
||||
Focus = Widget->GetDesiredFocusWidget();
|
||||
ShowPointer = Top->ShowPointer;
|
||||
|
||||
Reference in New Issue
Block a user