mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
feat: Added statistics and crash log uploading (#1149)
Co-authored-by: Justus Garbe <gihihoh@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user