mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 00:01:37 -07:00
CogImGui: Let the click pass through when imgui input is disabled.
CogSample: Add Start/Escape menu
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,6 +30,11 @@ void SCogImguiWidget::Construct(const FArguments& InArgs)
|
||||
FontAtlas = InArgs._FontAtlas;
|
||||
Render = InArgs._Render;
|
||||
|
||||
if (FCogImguiModule::Get().GetEnableInput() == false)
|
||||
{
|
||||
SetVisibility(EVisibility::SelfHitTestInvisible);
|
||||
}
|
||||
|
||||
ImGuiContext = ImGui::CreateContext(FontAtlas);
|
||||
ImPlotContext = ImPlot::CreateContext();
|
||||
ImPlot::SetImGuiContext(ImGuiContext);
|
||||
@@ -163,6 +168,8 @@ void SCogImguiWidget::TickFocus()
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void SCogImguiWidget::TakeFocus()
|
||||
{
|
||||
SetVisibility(EVisibility::Visible);
|
||||
|
||||
FSlateApplication& SlateApplication = FSlateApplication::Get();
|
||||
|
||||
PreviousUserFocusedWidget = SlateApplication.GetUserFocusedWidget(SlateApplication.GetUserIndexForKeyboard());
|
||||
@@ -182,6 +189,8 @@ void SCogImguiWidget::TakeFocus()
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
void SCogImguiWidget::ReturnFocus()
|
||||
{
|
||||
SetVisibility(EVisibility::SelfHitTestInvisible);
|
||||
|
||||
if (HasKeyboardFocus())
|
||||
{
|
||||
auto FocusWidgetPtr = PreviousUserFocusedWidget.IsValid()
|
||||
@@ -459,6 +468,11 @@ FReply SCogImguiWidget::OnMouseMove(const FGeometry& MyGeometry, const FPointerE
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
FReply SCogImguiWidget::OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& FocusEvent)
|
||||
{
|
||||
if (FCogImguiModule::Get().GetEnableInput() == false)
|
||||
{
|
||||
return FReply::Unhandled();
|
||||
}
|
||||
|
||||
Super::OnFocusReceived(MyGeometry, FocusEvent);
|
||||
|
||||
FSlateApplication::Get().ResetToDefaultPointerInputSettings();
|
||||
|
||||
@@ -108,7 +108,10 @@ void ACogSampleGameState::Tick(float DeltaSeconds)
|
||||
//const float ServerWorldTimeDelta = LocalWorldTime - ServerWorldTime;
|
||||
//FCogDebugPlot::PlotValue(this, "Server World Time Delta", ServerWorldTimeDelta);
|
||||
|
||||
CogWindowManager->Tick(DeltaSeconds);
|
||||
if (CogWindowManager != nullptr)
|
||||
{
|
||||
CogWindowManager->Tick(DeltaSeconds);
|
||||
}
|
||||
|
||||
#endif //ENABLE_COG
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user