This commit is contained in:
chinosk
2025-03-18 09:28:58 +00:00
parent 45338b40cd
commit 3fe2d1775b
39 changed files with 56771 additions and 68 deletions

View File

@@ -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) {