mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 08:46:00 +01:00
Lua script screens beside the WebAssembly ones
This commit is contained in:
@@ -76,6 +76,10 @@ void global_settings::FinalizeConfig()
|
||||
wasm_enabled = false;
|
||||
#endif
|
||||
|
||||
#ifndef WITH_LUA
|
||||
luascreens_enabled = false;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
Console::ModeSet(iFeedbackMode, iFeedbackPort);
|
||||
#endif
|
||||
@@ -881,23 +885,30 @@ bool global_settings::ConfigParseUI(cParser& Parser, const std::string& token)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool global_settings::ConfigParseWasm(cParser& Parser, std::string_view const token)
|
||||
bool global_settings::ConfigParseScriptScreens(cParser& Parser, std::string_view const token)
|
||||
{
|
||||
if (token == "luascreens.enabled")
|
||||
{
|
||||
ParseOne(Parser, luascreens_enabled, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token == "wasm.enabled")
|
||||
{
|
||||
ParseOne(Parser, wasm_enabled, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token == "wasm.cabframes")
|
||||
// wasm.cabframes and wasm.externalframes: the first names of the keys, from before the Lua screens
|
||||
if (token == "screens.cabframes" || token == "wasm.cabframes")
|
||||
{
|
||||
ParseOneClamped(Parser, wasm_cabframes, 1, 1000);
|
||||
ParseOneClamped(Parser, screens_cabframes, 1, 1000);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (token == "wasm.externalframes")
|
||||
if (token == "screens.externalframes" || token == "wasm.externalframes")
|
||||
{
|
||||
ParseOneClamped(Parser, wasm_externalframes, 1, 1000);
|
||||
ParseOneClamped(Parser, screens_externalframes, 1, 1000);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1400,7 +1411,7 @@ void global_settings::ConfigParse(cParser& Parser)
|
||||
if (ConfigParsePython(Parser, token))
|
||||
continue;
|
||||
|
||||
if (ConfigParseWasm(Parser, token))
|
||||
if (ConfigParseScriptScreens(Parser, token))
|
||||
continue;
|
||||
|
||||
if (ConfigParseNetwork(Parser, token))
|
||||
@@ -1870,9 +1881,10 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
||||
export_as_text( Output, "python.threadedupload", python_threadedupload );
|
||||
export_as_text( Output, "python.uploadmain", python_uploadmain );
|
||||
export_as_text( Output, "python.mipmaps", python_mipmaps );
|
||||
export_as_text( Output, "luascreens.enabled", luascreens_enabled );
|
||||
export_as_text( Output, "wasm.enabled", wasm_enabled );
|
||||
export_as_text( Output, "wasm.cabframes", wasm_cabframes );
|
||||
export_as_text( Output, "wasm.externalframes", wasm_externalframes );
|
||||
export_as_text( Output, "screens.cabframes", screens_cabframes );
|
||||
export_as_text( Output, "screens.externalframes", screens_externalframes );
|
||||
export_as_text( Output, "async.trainThreads", trainThreads );
|
||||
for( auto const &server : network_servers ) {
|
||||
Output
|
||||
|
||||
@@ -296,9 +296,10 @@ struct global_settings {
|
||||
bool python_sharectx = true;
|
||||
bool python_uploadmain = true;
|
||||
std::chrono::duration<float> python_minframetime {0.01f};
|
||||
bool luascreens_enabled{true}; // screens drawn by Lua scripts (luascreen:, luadestinationsign: in the .mmd)
|
||||
bool wasm_enabled{true}; // screens drawn by WebAssembly modules (wasmscreen:, wasmdestinationsign: in the .mmd)
|
||||
int wasm_cabframes{4}; // the wasm screens in the cab are refreshed every so many rendered frames
|
||||
int wasm_externalframes{30}; // the wasm screens outside the cab (destination signs) are refreshed every so many rendered frames
|
||||
int screens_cabframes{4}; // the script screens in the cab are refreshed every so many rendered frames
|
||||
int screens_externalframes{30}; // the script screens outside the cab (destination signs) are refreshed every so many rendered frames
|
||||
|
||||
bool gfx_skiprendering = false;
|
||||
int gfx_framebuffer_width = -1;
|
||||
@@ -393,7 +394,7 @@ struct global_settings {
|
||||
bool ConfigParseSimulation(cParser& Parser, const std::string& token);
|
||||
bool ConfigParseUI(cParser& Parser, const std::string& token);
|
||||
bool ConfigParsePython(cParser& Parser, const std::string& token);
|
||||
bool ConfigParseWasm(cParser& Parser, std::string_view token);
|
||||
bool ConfigParseScriptScreens(cParser& Parser, std::string_view token);
|
||||
bool ConfigParseNetwork(cParser& Parser, const std::string& token);
|
||||
bool ConfigParseHardware(cParser& Parser, const std::string& token);
|
||||
bool ConfigParseDebug(cParser& Parser, const std::string& token);
|
||||
|
||||
Reference in New Issue
Block a user