mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2024-11-14 19:25:18 -05:00
parent
75d2d98a46
commit
73262ae207
2 changed files with 12 additions and 23 deletions
|
@ -195,7 +195,7 @@ void pb::firsttime_setup()
|
||||||
|
|
||||||
void pb::mode_change(GameModes mode)
|
void pb::mode_change(GameModes mode)
|
||||||
{
|
{
|
||||||
if (CreditsActive)
|
if (CreditsActive && MissTextBox)
|
||||||
MissTextBox->Clear(true);
|
MissTextBox->Clear(true);
|
||||||
CreditsActive = false;
|
CreditsActive = false;
|
||||||
IdleTimerMs = 0;
|
IdleTimerMs = 0;
|
||||||
|
|
|
@ -436,32 +436,21 @@ void winmain::MainLoop()
|
||||||
|
|
||||||
void winmain::RenderUi()
|
void winmain::RenderUi()
|
||||||
{
|
{
|
||||||
// A minimal window with a button to prevent menu lockout.
|
// Transparent menu bar with a button for preventing menu lockout.
|
||||||
if (!Options.ShowMenu)
|
ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4{});
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4{});
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0);
|
||||||
|
if (!Options.ShowMenu && ImGui::BeginMainMenuBar())
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowPos(ImVec2{});
|
if (ImGui::MenuItem("Menu"))
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{10, 0});
|
|
||||||
if (ImGui::Begin("main", nullptr,
|
|
||||||
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground |
|
|
||||||
ImGuiWindowFlags_AlwaysAutoResize |
|
|
||||||
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing))
|
|
||||||
{
|
{
|
||||||
ImGui::PushID(1);
|
options::toggle(Menu1::Show_Menu);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4{});
|
|
||||||
if (ImGui::Button("Menu"))
|
|
||||||
{
|
|
||||||
options::toggle(Menu1::Show_Menu);
|
|
||||||
}
|
|
||||||
ImGui::PopStyleColor(1);
|
|
||||||
ImGui::PopID();
|
|
||||||
}
|
|
||||||
ImGui::End();
|
|
||||||
ImGui::PopStyleVar();
|
|
||||||
|
|
||||||
// This window can not loose nav focus for some reason, clear it manually.
|
|
||||||
if (ImGui::IsKeyDown(ImGuiKey_Escape) || ImGui::IsKeyDown(ImGuiKey_GamepadFaceRight))
|
|
||||||
ImGui::FocusWindow(nullptr);
|
ImGui::FocusWindow(nullptr);
|
||||||
|
}
|
||||||
|
ImGui::EndMainMenuBar();
|
||||||
}
|
}
|
||||||
|
ImGui::PopStyleVar(1);
|
||||||
|
ImGui::PopStyleColor(2);
|
||||||
|
|
||||||
// No demo window in release to save space
|
// No demo window in release to save space
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
Loading…
Reference in a new issue