mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-17 23:39:18 +02:00
prepend_scn feature
This commit is contained in:
@@ -12,7 +12,7 @@ set(DEPS_DIR ${DEPS_DIR} "${CMAKE_SOURCE_DIR}/ref")
|
||||
project("eu07")
|
||||
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=undefined")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -Wformat")
|
||||
#set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -fsanitize=address -fsanitize=undefined")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
@@ -1166,6 +1166,10 @@ global_settings::ConfigParse(cParser &Parser) {
|
||||
Parser.getTokens(1);
|
||||
Parser >> map_manualswitchcontrol;
|
||||
}
|
||||
else if (token == "prepend_scn") {
|
||||
Parser.getTokens(1);
|
||||
Parser >> prepend_scn;
|
||||
}
|
||||
/*
|
||||
else if (token == "crashdamage") {
|
||||
Parser.getTokens(1);
|
||||
|
||||
@@ -258,6 +258,7 @@ struct global_settings {
|
||||
float map_highlight_distance = 3000.0f;
|
||||
|
||||
std::string exec_on_exit;
|
||||
std::string prepend_scn;
|
||||
|
||||
struct extraviewport_config {
|
||||
std::string monitor;
|
||||
|
||||
@@ -91,6 +91,10 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
|
||||
state->functionmap.emplace( function.first, std::bind( function.second, this, std::ref( state->input ), std::ref( state->scratchpad ) ) );
|
||||
}
|
||||
|
||||
if (!Global.prepend_scn.empty()) {
|
||||
state->input.injectString(Global.prepend_scn);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user