add execonexit

This commit is contained in:
milek7
2019-04-03 01:55:44 +02:00
parent 5160073282
commit 63ac1e05e1
3 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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