diff --git a/Globals.cpp b/Globals.cpp index 683d81e5..38d27f4b 100644 --- a/Globals.cpp +++ b/Globals.cpp @@ -886,6 +886,11 @@ global_settings::ConfigParse(cParser &Parser) { Parser.getTokens(1); Parser >> gui_screensscale; } + else if (token == "execonexit") { + Parser.getTokens(1); + Parser >> exec_on_exit; + std::replace(std::begin(exec_on_exit), std::end(exec_on_exit), '_', ' '); + } } while ((token != "") && (token != "endconfig")); //(!Parser->EndOfFile) // na koniec trochę zależności if (!bLoadTraction) // wczytywanie drutów i słupów diff --git a/Globals.h b/Globals.h index b8c067cb..167e5c55 100644 --- a/Globals.h +++ b/Globals.h @@ -210,6 +210,8 @@ struct global_settings { float map_highlight_distance = 3000.0f; float gui_screensscale = 0.5f; + std::string exec_on_exit; + struct extraviewport_config { std::string monitor; int width, height; diff --git a/application.cpp b/application.cpp index 3112bdef..55733bda 100644 --- a/application.cpp +++ b/application.cpp @@ -350,6 +350,9 @@ eu07_application::exit() { } m_taskqueue.exit(); glfwTerminate(); + + if (!Global.exec_on_exit.empty()) + system(Global.exec_on_exit.c_str()); } void