From 3e99cf2316f2774fc670107b9efeb1ad02dcc81c Mon Sep 17 00:00:00 2001 From: Samuel Barnett <70705753+sBarnett2025@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:56:28 -0400 Subject: [PATCH] Update World.cpp --- examples/catchthecat/World.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/catchthecat/World.cpp b/examples/catchthecat/World.cpp index a9edfe26..c00e8a66 100644 --- a/examples/catchthecat/World.cpp +++ b/examples/catchthecat/World.cpp @@ -162,11 +162,10 @@ void World::OnGui(ImGuiContext* context) { ImVec2 pos(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f); ImGui::SetNextWindowPos(pos, ImGuiCond_Always, ImVec2(0.5f, 0.5f)); ImGuiWindowFlags flags = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings; - if (ImGui::Begin("Game Over", nullptr, flags)) { - if (ImGui::Button("OK", ImVec2(200, 0))) { - clearWorld(); - } - } + ImGui::Begin("Game Over", nullptr, flags); + if (ImGui::Button("OK", ImVec2(200, 0))) + clearWorld(); + ImGui::End(); } }