Manages user preferences and settings persistence. More...
#include <user_settings.h>

Classes | |
| struct | Preferences |
Public Member Functions | |
| UserSettings () | |
| absl::Status | Load () |
| absl::Status | Save () |
| bool | ApplyPanelLayoutDefaultsRevision (int target_revision) |
| Preferences & | prefs () |
| const Preferences & | prefs () const |
| std::string | GetDungeonInspectorSide () const |
| void | SetDungeonInspectorSide (std::string side) |
| void | SetSettingsFilePathForTesting (std::string path) |
Static Public Attributes | |
| static constexpr int | kLatestPanelLayoutDefaultsRevision = 21 |
Private Attributes | |
| Preferences | prefs_ |
| std::string | settings_file_path_ |
| std::string | legacy_settings_file_path_ |
Manages user preferences and settings persistence.
Definition at line 18 of file user_settings.h.
| yaze::editor::UserSettings::UserSettings | ( | ) |
Definition at line 1202 of file user_settings.cc.
References yaze::util::PlatformPaths::GetConfigDirectory(), yaze::util::PlatformPaths::GetUserDocumentsDirectory(), legacy_settings_file_path_, LOG_WARN, and settings_file_path_.

| absl::Status yaze::editor::UserSettings::Load | ( | ) |
Definition at line 1224 of file user_settings.cc.
References yaze::util::PlatformPaths::Exists(), yaze::editor::UserSettings::Preferences::font_global_scale, legacy_settings_file_path_, LOG_INFO, LOG_WARN, prefs_, Save(), settings_file_path_, yaze::editor::UserSettings::Preferences::sidebar_panel_expanded, yaze::editor::UserSettings::Preferences::sidebar_visible, and yaze::editor::UserSettings::Preferences::switch_motion_profile.
Referenced by yaze::editor::EditorManager::InitializeServices().

| absl::Status yaze::editor::UserSettings::Save | ( | ) |
Definition at line 1619 of file user_settings.cc.
References legacy_settings_file_path_, prefs_, and settings_file_path_.
Referenced by yaze::editor::MenuOrchestrator::AddAppearanceMenuItems(), yaze::editor::layout_designer::LayoutDesignerPanel::ApplyCurrentTreeToLiveDockspace(), yaze::editor::SettingsPanel::ApplyNamedLayoutToDockspace(), yaze::editor::SettingsPanel::DrawAIAgentSettings(), yaze::editor::SettingsPanel::DrawAppearanceSettings(), yaze::editor::SettingsPanel::DrawEditorBehavior(), yaze::editor::SettingsPanel::DrawEditorShortcuts(), yaze::editor::SettingsPanel::DrawFilesystemSettings(), yaze::editor::SettingsPanel::DrawGlobalShortcuts(), yaze::editor::SettingsPanel::DrawPanelShortcuts(), yaze::editor::SettingsPanel::DrawPerformanceSettings(), yaze::editor::DungeonEditorV2::Initialize(), Load(), yaze::editor::WelcomeScreen::PersistAnimationSettings(), yaze::editor::anonymous_namespace{activity_bar.cc}::PersistSettings(), yaze::editor::SidebarCommandsProvider::Provide(), yaze::editor::layout_designer::LayoutDesignerPanel::SaveCurrentTreeToNamedLayouts(), yaze::editor::EditorManager::SetFontGlobalScale(), and yaze::editor::EditorManager::UpdateEditorState().
| bool yaze::editor::UserSettings::ApplyPanelLayoutDefaultsRevision | ( | int | target_revision | ) |
Definition at line 1296 of file user_settings.cc.
References yaze::editor::layout_designer::DockTreeToJson(), yaze::editor::UserSettings::Preferences::dungeon_inspector_side, yaze::editor::UserSettings::Preferences::last_theme_name, yaze::editor::layout_designer::DockNode::MakeLeaf(), yaze::editor::UserSettings::Preferences::named_layouts, yaze::editor::UserSettings::Preferences::panel_browser_category_width, yaze::editor::UserSettings::Preferences::panel_layout_defaults_revision, yaze::editor::UserSettings::Preferences::panel_visibility_state, yaze::editor::UserSettings::Preferences::pinned_panels, prefs_, yaze::editor::UserSettings::Preferences::right_panel_widths, yaze::editor::layout_designer::DockTree::root, yaze::editor::UserSettings::Preferences::saved_layouts, yaze::editor::UserSettings::Preferences::sidebar_active_category, yaze::editor::UserSettings::Preferences::sidebar_panel_expanded, yaze::editor::UserSettings::Preferences::sidebar_panel_width, and yaze::editor::UserSettings::Preferences::sidebar_visible.
Referenced by yaze::editor::EditorManager::ApplyLayoutDefaultsMigrationIfNeeded().

|
inline |
Definition at line 198 of file user_settings.h.
References prefs_.
Referenced by yaze::editor::MenuOrchestrator::AddAppearanceMenuItems(), yaze::editor::anonymous_namespace{shortcut_configurator.cc}::AdjustUiFontScaleBy(), yaze::editor::EditorManager::ApplyCurrentProjectRuntimeContext(), yaze::editor::layout_designer::LayoutDesignerPanel::ApplyCurrentTreeToLiveDockspace(), yaze::editor::EditorManager::ApplyDefaultBackupPolicy(), yaze::editor::SettingsPanel::ApplyNamedLayoutToDockspace(), yaze::editor::AgentEditor::ApplyUserSettingsDefaults(), yaze::editor::EditorManager::CaptureActiveProjectContext(), yaze::editor::ConfigurePanelShortcuts(), yaze::editor::ActivityBar::DrawActivityBarStrip(), yaze::editor::SettingsPanel::DrawAIAgentSettings(), yaze::editor::SettingsPanel::DrawAppearanceSettings(), yaze::editor::ActivityBar::DrawCategoryContextMenu(), yaze::editor::AgentEditor::DrawConfigurationPanel(), yaze::editor::SettingsPanel::DrawEditorBehavior(), yaze::editor::SettingsPanel::DrawEditorShortcuts(), yaze::editor::layout_designer::LayoutDesignerPanel::DrawFileRow(), yaze::editor::SettingsPanel::DrawFilesystemSettings(), yaze::editor::SettingsPanel::DrawGlobalShortcuts(), yaze::editor::EditorManager::DrawInterface(), yaze::editor::layout_designer::LayoutDesignerPanel::DrawOpenPopup(), yaze::editor::SettingsPanel::DrawPanelShortcuts(), yaze::editor::SettingsPanel::DrawPerformanceSettings(), yaze::editor::SettingsPanel::DrawWorkspaceSettings(), yaze::editor::EditorManager::FinalizeNewProject(), yaze::editor::ActivityBar::GetBottomReservedHeight(), yaze::editor::ActivityBar::HandleReorderDragAndDrop(), yaze::editor::EditorManager::HandleSessionCreated(), yaze::editor::EditorManager::HandleSessionSwitched(), yaze::editor::EditorManager::Initialize(), yaze::editor::EditorManager::InitializeServices(), yaze::editor::EditorManager::LoadAssets(), yaze::editor::EditorManager::LoadAssetsLazy(), yaze::editor::layout_designer::LayoutDesignerPanel::LoadNamedLayoutIntoTree(), yaze::editor::EditorManager::LoadProjectWithRom(), yaze::editor::AgentEditor::MaybeAutoDetectLocalProviders(), yaze::editor::LayoutManager::MaybeReapplyStartupLayout(), yaze::editor::WelcomeScreen::PersistAnimationSettings(), yaze::editor::SidebarCommandsProvider::Provide(), yaze::editor::AgentEditor::RefreshModelCache(), yaze::editor::EditorManager::RefreshResourceLabelProvider(), yaze::editor::layout_designer::LayoutDesignerPanel::SaveCurrentTreeToNamedLayouts(), yaze::editor::EditorManager::SaveProject(), yaze::editor::EditorManager::SaveRomInternal(), yaze::editor::EditorManager::SetFontGlobalScale(), yaze::editor::EditorManager::SetupSidebarCallbacks(), yaze::editor::EditorManager::SetupWelcomeScreenCallbacks(), yaze::editor::WelcomeScreen::SetUserSettings(), yaze::editor::EditorManager::SubscribeToEvents(), and yaze::editor::EditorManager::UpdateEditorState().
|
inline |
Definition at line 199 of file user_settings.h.
References prefs_.
| std::string yaze::editor::UserSettings::GetDungeonInspectorSide | ( | ) | const |
Definition at line 1607 of file user_settings.cc.
References yaze::editor::UserSettings::Preferences::dungeon_inspector_side, and prefs_.
Referenced by yaze::editor::DungeonEditorV2::Update().
| void yaze::editor::UserSettings::SetDungeonInspectorSide | ( | std::string | side | ) |
Definition at line 1615 of file user_settings.cc.
References yaze::editor::UserSettings::Preferences::dungeon_inspector_side, and prefs_.
Referenced by yaze::editor::DungeonEditorV2::Initialize().
|
inline |
Definition at line 212 of file user_settings.h.
References settings_file_path_.
|
staticconstexpr |
Definition at line 196 of file user_settings.h.
Referenced by yaze::editor::EditorManager::ApplyLayoutDefaultsMigrationIfNeeded().
|
private |
Definition at line 217 of file user_settings.h.
Referenced by ApplyPanelLayoutDefaultsRevision(), GetDungeonInspectorSide(), Load(), prefs(), prefs(), Save(), and SetDungeonInspectorSide().
|
private |
Definition at line 218 of file user_settings.h.
Referenced by Load(), Save(), SetSettingsFilePathForTesting(), and UserSettings().
|
private |
Definition at line 219 of file user_settings.h.
Referenced by Load(), Save(), and UserSettings().