yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
user_settings.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_USER_SETTINGS_H_
2#define YAZE_APP_EDITOR_SYSTEM_USER_SETTINGS_H_
3
4#include <string>
5#include <unordered_map>
6
7#include "absl/status/status.h"
8
9namespace yaze {
10namespace editor {
11
16 public:
17 struct Preferences {
18 // General
19 float font_global_scale = 1.0f;
20 bool backup_rom = false;
21 bool save_new_auto = true;
22 bool autosave_enabled = true;
23 float autosave_interval = 300.0f;
25 std::string last_rom_path;
26 std::string last_project_path;
30
31 // Editor Behavior
32 bool backup_before_save = true;
33 int default_editor = 0; // 0=None, 1=Overworld, 2=Dungeon, 3=Graphics
34
35 // Performance
36 bool vsync = true;
37 int target_fps = 60;
38 int cache_size_mb = 512;
40
41 // AI Agent
42 int ai_provider = 0; // 0=Ollama, 1=Gemini, 2=Mock
43 std::string ollama_url = "http://localhost:11434";
44 std::string gemini_api_key;
45 float ai_temperature = 0.7f;
46 int ai_max_tokens = 2048;
47 bool ai_proactive = true;
48 bool ai_auto_learn = true;
49 bool ai_multimodal = true;
50
51 // CLI Logging
52 int log_level = 1; // 0=Debug, 1=Info, 2=Warning, 3=Error, 4=Fatal
53 bool log_to_file = false;
54 std::string log_file_path;
55 bool log_ai_requests = true;
56 bool log_rom_operations = true;
57 bool log_gui_automation = true;
58 bool log_proposals = true;
59
60 // Shortcut Overrides
61 // Maps panel_id -> shortcut string (e.g., "dungeon.room_selector" -> "Ctrl+Shift+R")
62 std::unordered_map<std::string, std::string> panel_shortcuts;
63 // Maps global action id -> shortcut string (e.g., "Open", "Save")
64 std::unordered_map<std::string, std::string> global_shortcuts;
65 // Maps editor-scoped action id -> shortcut string (keyed by editor namespace)
66 std::unordered_map<std::string, std::string> editor_shortcuts;
67
68 // Sidebar State
69 bool sidebar_visible = true; // Controls Activity Bar visibility
70 bool sidebar_panel_expanded = true; // Controls Side Panel visibility
71 std::string sidebar_active_category; // Last active category
72
73 // Status Bar
74 bool show_status_bar = false; // Show status bar at bottom (disabled by default)
75 };
76
78
79 absl::Status Load();
80 absl::Status Save();
81
82 Preferences& prefs() { return prefs_; }
83 const Preferences& prefs() const { return prefs_; }
84
85 private:
88};
89
90} // namespace editor
91} // namespace yaze
92
93#endif // YAZE_APP_EDITOR_SYSTEM_USER_SETTINGS_H_
Manages user preferences and settings persistence.
const Preferences & prefs() const
std::unordered_map< std::string, std::string > panel_shortcuts
std::unordered_map< std::string, std::string > editor_shortcuts
std::unordered_map< std::string, std::string > global_shortcuts