mirror of
https://git.chinosk6.cn/chinosk/gkms-localify-dmm.git
synced 2026-03-22 08:10:09 +07:00
update
This commit is contained in:
61
src/main.cpp
61
src/main.cpp
@@ -23,8 +23,10 @@ std::filesystem::path ConfigJson = gakumasLocalPath / "localizationConfig.json";
|
||||
|
||||
bool g_has_config_file = false;
|
||||
bool g_enable_console = true;
|
||||
bool g_confirm_every_times = false;
|
||||
std::vector<std::string> g_pluginPath{};
|
||||
bool g_useRemoteAssets = false;
|
||||
bool g_useAPIAssets = false;
|
||||
std::string g_remoteResourceUrl = "";
|
||||
std::string g_useAPIAssetsURL = "";
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -47,30 +49,43 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
void readProgramConfig()
|
||||
void readProgramConfig() {
|
||||
std::vector<std::string> dicts{};
|
||||
std::ifstream config_stream{ ProgramConfigJson };
|
||||
|
||||
if (!config_stream.is_open())
|
||||
return;
|
||||
|
||||
rapidjson::IStreamWrapper wrapper{ config_stream };
|
||||
rapidjson::Document document;
|
||||
|
||||
document.ParseStream(wrapper);
|
||||
|
||||
if (!document.HasParseError())
|
||||
{
|
||||
std::vector<std::string> dicts{};
|
||||
std::ifstream config_stream{ ProgramConfigJson };
|
||||
|
||||
if (!config_stream.is_open())
|
||||
return;
|
||||
|
||||
rapidjson::IStreamWrapper wrapper{ config_stream };
|
||||
rapidjson::Document document;
|
||||
|
||||
document.ParseStream(wrapper);
|
||||
|
||||
if (!document.HasParseError())
|
||||
{
|
||||
g_has_config_file = true;
|
||||
if (document.HasMember("enableConsole")) {
|
||||
g_enable_console = document["enableConsole"].GetBool();
|
||||
}
|
||||
g_has_config_file = true;
|
||||
if (document.HasMember("enableConsole")) {
|
||||
g_enable_console = document["enableConsole"].GetBool();
|
||||
}
|
||||
config_stream.close();
|
||||
|
||||
if (document.HasMember("useRemoteAssets")) {
|
||||
g_useRemoteAssets = document["useRemoteAssets"].GetBool();
|
||||
}
|
||||
|
||||
if (document.HasMember("transRemoteZipUrl")) {
|
||||
g_remoteResourceUrl = document["transRemoteZipUrl"].GetString();
|
||||
}
|
||||
|
||||
if (document.HasMember("useAPIAssets")) {
|
||||
g_useAPIAssets = document["useAPIAssets"].GetBool();
|
||||
}
|
||||
|
||||
if (document.HasMember("useAPIAssetsURL")) {
|
||||
g_useAPIAssetsURL = document["useAPIAssetsURL"].GetString();
|
||||
}
|
||||
|
||||
}
|
||||
config_stream.close();
|
||||
}
|
||||
|
||||
LONG WINAPI AddressExceptionHandler(EXCEPTION_POINTERS* ExceptionInfo) {
|
||||
|
||||
Reference in New Issue
Block a user