yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
settings_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SHELL_WINDOWS_SETTINGS_PANEL_H_
2#define YAZE_APP_EDITOR_SHELL_WINDOWS_SETTINGS_PANEL_H_
3
4#include <array>
5#include <functional>
6#include <string>
7#include <utility>
8
9#include "absl/status/status.h"
10#include "app/editor/editor.h"
15#include "core/project.h"
16
17namespace yaze {
18
19class Rom;
20
21namespace editor {
22
23class WorkspaceWindowManager;
24class ShortcutManager;
25class SettingsPanelTestPeer;
26
40class SettingsPanel : public Editor {
41 public:
42 using OpenMinecartTracksCallback = std::function<absl::Status()>;
43
45
46 void SetDependencies(const EditorDependencies& deps) override;
47
48 void Initialize() override {}
49 absl::Status Load() override { return absl::OkStatus(); }
50 absl::Status Save() override { return absl::OkStatus(); }
51 absl::Status Update() override {
52 Draw();
53 return absl::OkStatus();
54 }
55
56 absl::Status Undo() override { return absl::OkStatus(); }
57 absl::Status Redo() override { return absl::OkStatus(); }
58 absl::Status Cut() override { return absl::OkStatus(); }
59 absl::Status Copy() override { return absl::OkStatus(); }
60 absl::Status Paste() override { return absl::OkStatus(); }
61 absl::Status Find() override { return absl::OkStatus(); }
62
63 void SetUserSettings(UserSettings* settings) { user_settings_ = settings; }
65 window_manager_ = registry;
66 }
68 shortcut_manager_ = manager;
69 }
70 void SetStatusBar(StatusBar* bar) { status_bar_ = bar; }
71 void SetRom(Rom* rom) { rom_ = rom; }
76
77 // Main draw entry point
78 void Draw();
79
80 private:
82
83 using DungeonOverlaySummary = std::array<std::pair<std::string, bool>, 5>;
84
87 // Switches the active theme to `preset` density. Lives outside the combo
88 // callback so it can be tested: the combo is one line, but the behaviour
89 // that matters — routing through ReapplyTheme so Classic YAZE repaints via
90 // ColorsYaze() rather than its struct — is not reachable from a unit test
91 // while it is buried in an ImGui interaction.
94 // Loads `name` from UserSettings::named_layouts, validates the
95 // serialized DockTree, and applies it to the live main dockspace via
96 // LayoutManager. Surface for the Workspace section's combo + Re-apply
97 // button. On success, persists `last_applied_layout_name = name` so a
98 // subsequent startup reapplies the same layout (mirrors the
99 // theme-persistence pattern shipped in Phase 5.1). Status is reported
100 // via workspace_status_message_.
101 void ApplyNamedLayoutToDockspace(const std::string& name);
102 void DrawEditorBehavior();
104 void DrawAIAgentSettings();
107 void DrawGlobalShortcuts();
108 void DrawEditorShortcuts();
109 void DrawPanelShortcuts();
110 bool MatchesShortcutFilter(const std::string& text) const;
111 void DrawPatchSettings();
112 void DrawProjectSettings(); // New method
113 void DrawPatchList(const std::string& folder);
114 void DrawPatchDetails();
117 const project::DungeonOverlaySettings& overlay);
118 absl::Status RequestOpenMinecartTracks();
119
124 Rom* rom_ = nullptr;
125 project::YazeProject* project_ = nullptr; // Project reference
126
127 // Shortcut editing state
129 std::string editing_card_id_;
131 std::string shortcut_filter_;
132
133 // Patch system state
135 std::string selected_folder_;
137 bool patches_loaded_ = false;
138
139 // Workspace layout picker transient status — last apply attempt's
140 // outcome, drawn beneath the section. Persists across frames within a
141 // session; cleared on the next apply attempt.
144
147};
148
149} // namespace editor
150} // namespace yaze
151
152#endif // YAZE_APP_EDITOR_SHELL_WINDOWS_SETTINGS_PANEL_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Represents a ZScream-compatible ASM patch file.
Definition asm_patch.h:74
Manages a collection of ZScream-compatible ASM patches.
Interface for editor classes.
Definition editor.h:245
project::YazeProject * project() const
Definition editor.h:326
Rom * rom() const
Definition editor.h:324
EditorType type_
Definition editor.h:337
Manages the settings UI displayed in the right sidebar.
void SetOpenMinecartTracksCallback(OpenMinecartTracksCallback callback)
void SetStatusBar(StatusBar *bar)
void DrawPatchList(const std::string &folder)
void SetWindowManager(WorkspaceWindowManager *registry)
absl::Status Paste() override
ShortcutManager * shortcut_manager_
void SetDependencies(const EditorDependencies &deps) override
absl::Status Copy() override
void ApplyNamedLayoutToDockspace(const std::string &name)
bool MatchesShortcutFilter(const std::string &text) const
void DrawParameterWidget(core::PatchParameter *param)
absl::Status Redo() override
static DungeonOverlaySummary BuildDungeonOverlaySummary(const project::DungeonOverlaySettings &overlay)
absl::Status Undo() override
core::AsmPatch * selected_patch_
core::PatchManager patch_manager_
OpenMinecartTracksCallback open_minecart_tracks_callback_
project::YazeProject * project_
void SetShortcutManager(ShortcutManager *manager)
void SetUserSettings(UserSettings *settings)
std::array< std::pair< std::string, bool >, 5 > DungeonOverlaySummary
absl::Status Find() override
void SetProject(project::YazeProject *project)
void ApplyDisplayDensity(gui::DensityPreset preset)
absl::Status RequestOpenMinecartTracks()
absl::Status Save() override
absl::Status Update() override
absl::Status Load() override
WorkspaceWindowManager * window_manager_
absl::Status Cut() override
std::function< absl::Status()> OpenMinecartTracksCallback
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:57
Manages user preferences and settings persistence.
Central registry for all editor cards with session awareness and dependency injection.
DensityPreset
Typography and spacing density presets.
Represents a configurable parameter within an ASM patch.
Definition asm_patch.h:33
Unified dependency container for all editor types.
Definition editor.h:169
Dungeon overlay configuration (per-project).
Definition project.h:93
Modern project structure with comprehensive settings consolidation.
Definition project.h:172