mirror of
https://git.chinosk6.cn/chinosk/gkms-local.git
synced 2026-02-04 09:04:52 +00:00
增加 free camera,支持配置修改,增加图标
This commit is contained in:
24
app/src/main/cpp/GakumasLocalify/config/Config.cpp
Normal file
24
app/src/main/cpp/GakumasLocalify/config/Config.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <string>
|
||||
#include "nlohmann/json.hpp"
|
||||
#include "../Log.h"
|
||||
|
||||
namespace GakumasLocal::Config {
|
||||
bool isConfigInit = false;
|
||||
|
||||
bool enabled = true;
|
||||
bool enableFreeCamera = false;
|
||||
|
||||
void LoadConfig(const std::string& configStr) {
|
||||
try {
|
||||
const auto config = nlohmann::json::parse(configStr);
|
||||
|
||||
enabled = config["enabled"];
|
||||
enableFreeCamera = config["enableFreeCamera"];
|
||||
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
Log::ErrorFmt("LoadConfig error: %s", e.what());
|
||||
}
|
||||
isConfigInit = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user