mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
milek7/sim branch network code import
This commit is contained in:
@@ -47,22 +47,6 @@ driver_ui::driver_ui() {
|
||||
bool
|
||||
driver_ui::on_key_( int const Key, int const Scancode, int const Action, int const Mods ) {
|
||||
|
||||
if( Key == GLFW_KEY_ESCAPE ) {
|
||||
// toggle pause
|
||||
if( Action != GLFW_PRESS ) { return true; } // recognized, but ignored
|
||||
|
||||
if( Global.iPause & 1 ) {
|
||||
// jeśli pauza startowa
|
||||
// odpauzowanie, gdy po wczytaniu miało nie startować
|
||||
Global.iPause ^= 1;
|
||||
}
|
||||
else if( ( Global.iMultiplayer & 2 ) == 0 ) {
|
||||
// w multiplayerze pauza nie ma sensu
|
||||
Global.iPause ^= 2; // zmiana stanu zapauzowania
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// if the pause is on ignore block other input
|
||||
if( m_paused ) { return true; }
|
||||
|
||||
@@ -192,12 +176,13 @@ driver_ui::render_() {
|
||||
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;
|
||||
command_relay commandrelay;
|
||||
commandrelay.post(user_command::pausetoggle, 0.0, 0.0, GLFW_PRESS, 0);
|
||||
}
|
||||
if( ImGui::Button( locale::strings[ locale::string::driver_pause_quit ].c_str(), ImVec2( popupwidth, 0 ) ) ) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
glfwSetWindowShouldClose( m_window, 1 );
|
||||
command_relay commandrelay;
|
||||
commandrelay.post(user_command::quitsimulation, 0.0, 0.0, GLFW_PRESS, 0);
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user