mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'milek-dev' into gfx-work
This commit is contained in:
@@ -208,23 +208,27 @@ driver_ui::set_cursor( bool const Visible ) {
|
||||
// render() subclass details
|
||||
void
|
||||
driver_ui::render_() {
|
||||
|
||||
if( m_paused ) {
|
||||
// pause/quit modal
|
||||
auto const popupheader { locale::strings[ locale::string::driver_pause_header ].c_str() };
|
||||
ImGui::OpenPopup( popupheader );
|
||||
if( ImGui::BeginPopupModal( popupheader, nullptr, ImGuiWindowFlags_AlwaysAutoResize ) ) {
|
||||
auto const popupwidth{ locale::strings[ locale::string::driver_pause_header ].size() * 7 };
|
||||
if( ImGui::Button( locale::strings[ locale::string::driver_pause_resume ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
auto const pausemask { 1 | 2 };
|
||||
Global.iPause &= ~pausemask;
|
||||
}
|
||||
if( ImGui::Button( locale::strings[ locale::string::driver_pause_quit ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
glfwSetWindowShouldClose( m_window, 1 );
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
// pause/quit modal
|
||||
auto const popupheader { locale::strings[ locale::string::driver_pause_header ].c_str() };
|
||||
if (m_paused && !m_pause_modal_opened)
|
||||
{
|
||||
m_pause_modal_opened = true;
|
||||
ImGui::OpenPopup(popupheader);
|
||||
}
|
||||
if( ImGui::BeginPopupModal( popupheader, &m_pause_modal_opened, ImGuiWindowFlags_AlwaysAutoResize ) ) {
|
||||
auto const popupwidth{ locale::strings[ locale::string::driver_pause_header ].size() * 7 };
|
||||
if( ImGui::Button( locale::strings[ locale::string::driver_pause_resume ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
|
||||
auto const pausemask { 1 | 2 };
|
||||
Global.iPause &= ~pausemask;
|
||||
}
|
||||
if( ImGui::Button( locale::strings[ locale::string::driver_pause_quit ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
|
||||
glfwSetWindowShouldClose( m_window, 1 );
|
||||
}
|
||||
if (!m_paused)
|
||||
{
|
||||
m_pause_modal_opened = false;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user