feat: Added statistics and crash log uploading (#1149)

Co-authored-by: Justus Garbe <gihihoh@gmail.com>
This commit is contained in:
Nik
2023-06-20 11:55:56 +02:00
committed by GitHub
parent 54061c56bf
commit f703b15165
23 changed files with 401 additions and 94 deletions

View File

@@ -40,24 +40,6 @@ namespace hex::plugin::builtin {
/* General */
/* Values of this setting :
0 - do not check for updates on startup
1 - check for updates on startup
2 - default value - ask the user if he wants to check for updates. This value should only be encountered on the first startup.
*/
#if defined(HEX_UPDATE_CHECK)
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2, [](auto name, nlohmann::json &setting) {
static bool enabled = static_cast<int>(setting) == 1;
if (ImGui::Checkbox(name.data(), &enabled)) {
setting = static_cast<int>(enabled);
return true;
}
return false;
});
#endif
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", 1, [](auto name, nlohmann::json &setting) {
static bool enabled = static_cast<int>(setting);
@@ -124,6 +106,34 @@ namespace hex::plugin::builtin {
return false;
});
/*
Values of this setting :
0 - do not check for updates on startup
1 - check for updates on startup
2 - default value - ask the user if he wants to check for updates. This value should only be encountered on the first startup.
*/
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 2, [](auto name, nlohmann::json &setting) {
static bool enabled = static_cast<int>(setting) == 1;
if (ImGui::Checkbox(name.data(), &enabled)) {
setting = static_cast<int>(enabled);
return true;
}
return false;
});
ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.upload_crash_logs", 1, [](auto name, nlohmann::json &setting) {
static bool enabled = static_cast<int>(setting) == 1;
if (ImGui::Checkbox(name.data(), &enabled)) {
setting = static_cast<int>(enabled);
return true;
}
return false;
});
/* Interface */
ContentRegistry::Settings::add("hex.builtin.setting.interface", "hex.builtin.setting.interface.color", "Dark", [](auto name, nlohmann::json &setting) {