I need to create, fundamentally, a separate window in which there will be a widget with buttons (something like a control panel).
I create the second separate window SWindow in which I place the widget. When you press a button on the widget, the game stops, when button it is released - game continues. If this widget is placed in the main window, this does not happen. Is it possible to overcome it? And what can it be connected with?
MyWidgetWindow = SNew(SWindow)
.Title(NSLOCTEXT("OperatorPanel", "WindowTitle", "OperatorPanel"))
.AutoCenter(AutoCenterType)
.ScreenPosition(FVector2D(1310, 10))
.ClientSize(FVector2D(600, 990))
.IsTopmostWindow(false)
.SupportsMinimize(false).SupportsMaximize(false)
.FocusWhenFirstShown(true)
.SaneWindowPlacement(AutoCenterType == EAutoCenter::None)
.UseOSWindowBorder(true)
.SizingRule(ESizingRule::FixedSize)
.HasCloseButton(false);
UUserWidget* LoadingWidget = CreateWidget<UUserWidget>(GetWorld(), wLoading);
TSharedRef<SWidget> loadswidget = LoadingWidget->TakeWidget();
MyWidgetWindow->SetContent(loadswidget);
TSharedPtr< SWindow > ParentWindow = GEngine->GameViewport->GetWindow();
if (!MyWidgetWindow->GetNativeWindow().IsValid()) {
FSlateApplication::Get().AddWindow(MyWidgetWindow.ToSharedRef());
}
MyWidgetWindow->ShowWindow();