mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:30:05 +00:00
Add UI settings for collapsible groups
This commit is contained in:
parent
af650c6687
commit
1e4e2ba1b4
5 changed files with 162 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include <scwx/qt/manager/settings_manager.hpp>
|
||||
#include <scwx/qt/map/map_provider.hpp>
|
||||
#include <scwx/qt/settings/ui_settings.hpp>
|
||||
#include <scwx/qt/util/json.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
|
|
@ -96,6 +97,7 @@ void Shutdown()
|
|||
|
||||
dataChanged |= general_settings().Shutdown();
|
||||
dataChanged |= map_settings().Shutdown();
|
||||
dataChanged |= settings::UiSettings::Instance().Shutdown();
|
||||
|
||||
if (dataChanged)
|
||||
{
|
||||
|
|
@ -128,6 +130,7 @@ static boost::json::value ConvertSettingsToJson()
|
|||
general_settings().WriteJson(settingsJson);
|
||||
map_settings().WriteJson(settingsJson);
|
||||
palette_settings().WriteJson(settingsJson);
|
||||
settings::UiSettings::Instance().WriteJson(settingsJson);
|
||||
|
||||
return settingsJson;
|
||||
}
|
||||
|
|
@ -139,6 +142,7 @@ static void GenerateDefaultSettings()
|
|||
general_settings().SetDefaults();
|
||||
map_settings().SetDefaults();
|
||||
palette_settings().SetDefaults();
|
||||
settings::UiSettings::Instance().SetDefaults();
|
||||
}
|
||||
|
||||
static bool LoadSettings(const boost::json::object& settingsJson)
|
||||
|
|
@ -150,6 +154,7 @@ static bool LoadSettings(const boost::json::object& settingsJson)
|
|||
jsonDirty |= !general_settings().ReadJson(settingsJson);
|
||||
jsonDirty |= !map_settings().ReadJson(settingsJson);
|
||||
jsonDirty |= !palette_settings().ReadJson(settingsJson);
|
||||
jsonDirty |= !settings::UiSettings::Instance().ReadJson(settingsJson);
|
||||
|
||||
return jsonDirty;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue