mirror of
https://git.chinosk6.cn/chinosk/gkms-local.git
synced 2026-06-19 15:56:02 +07:00
增加 free camera,支持配置修改,增加图标
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef GAKUMAS_LOCALIFY_CONFIG_HPP
|
||||
#define GAKUMAS_LOCALIFY_CONFIG_HPP
|
||||
|
||||
|
||||
namespace GakumasLocal::Config {
|
||||
extern bool isConfigInit;
|
||||
|
||||
extern bool enabled;
|
||||
extern bool enableFreeCamera;
|
||||
|
||||
void LoadConfig(const std::string& configStr);
|
||||
}
|
||||
|
||||
|
||||
#endif //GAKUMAS_LOCALIFY_CONFIG_HPP
|
||||
Reference in New Issue
Block a user