change settings to be a hash map instead of a fixed struct

this makes adding settings and changing settings incredibly easy, both
from the console and from lua.
This commit is contained in:
Lion Kortlepel
2022-10-23 17:44:57 +02:00
parent 7d35595683
commit bec09a4761
14 changed files with 250 additions and 248 deletions

View File

@@ -16,11 +16,11 @@
TLuaEngine* LuaAPI::MP::Engine;
TLuaEngine::TLuaEngine()
: mResourceServerPath(fs::path(Application::Settings.Resource) / "Server") {
: mResourceServerPath(fs::path(Application::GetSettingString(StrResourceFolder)) / "Server") {
Application::SetSubsystemStatus("LuaEngine", Application::Status::Starting);
LuaAPI::MP::Engine = this;
if (!fs::exists(Application::Settings.Resource)) {
fs::create_directory(Application::Settings.Resource);
if (!fs::exists(Application::GetSettingString(StrResourceFolder))) {
fs::create_directory(Application::GetSettingString(StrResourceFolder));
}
if (!fs::exists(mResourceServerPath)) {
fs::create_directory(mResourceServerPath);
@@ -36,7 +36,7 @@ TLuaEngine::TLuaEngine()
}
TEST_CASE("TLuaEngine ctor & dtor") {
Application::Settings.Resource = "beammp_server_test_resources";
Application::SetSetting(StrResourceFolder, "beammp_server_test_resources");
TLuaEngine engine;
Application::GracefullyShutdown();
}