Merge branch 'milek-dev' into gfx-work

This commit is contained in:
milek7
2018-12-03 23:43:02 +01:00
40 changed files with 987 additions and 571 deletions

View File

@@ -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();
}
}