12#include "absl/strings/ascii.h"
13#include "absl/strings/match.h"
14#include "absl/strings/str_cat.h"
15#include "absl/strings/str_format.h"
36#include "imgui/imgui.h"
37#include "imgui/misc/cpp/imgui_stdlib.h"
38#include "nlohmann/json.hpp"
61std::string FormatHexList(
const std::vector<uint16_t>& values) {
63 result.reserve(values.size() * 6);
64 for (
size_t i = 0; i < values.size(); ++i) {
65 const uint16_t value = values[i];
66 std::string token = value <= 0xFF ? absl::StrFormat(
"0x%02X", value)
67 : absl::StrFormat(
"0x%04X", value);
68 if (!result.empty()) {
77 std::vector<uint16_t> values;
78 for (uint16_t tile = 0xB0; tile <= 0xBE; ++tile) {
79 values.push_back(tile);
85 return {0xB7, 0xB8, 0xB9, 0xBA};
89 return {0xD0, 0xD1, 0xD2, 0xD3};
100bool IsLocalEndpoint(
const std::string& base_url) {
101 if (base_url.empty()) {
104 std::string lower = absl::AsciiStrToLower(base_url);
105 return absl::StrContains(lower,
"localhost") ||
106 absl::StrContains(lower,
"127.0.0.1") ||
107 absl::StrContains(lower,
"::1") ||
108 absl::StrContains(lower,
"0.0.0.0") ||
109 absl::StrContains(lower,
"192.168.") || absl::StartsWith(lower,
"10.");
112bool IsTailscaleEndpoint(
const std::string& base_url) {
113 if (base_url.empty()) {
116 std::string lower = absl::AsciiStrToLower(base_url);
117 return absl::StrContains(lower,
".ts.net") ||
118 absl::StrContains(lower,
"100.64.");
122 std::vector<std::string> tags;
123 if (IsLocalEndpoint(host.
base_url)) {
124 tags.push_back(
"local");
126 if (IsTailscaleEndpoint(host.
base_url)) {
127 tags.push_back(
"tailscale");
129 if (absl::StartsWith(absl::AsciiStrToLower(host.
base_url),
"https://")) {
130 tags.push_back(
"https");
131 }
else if (absl::StartsWith(absl::AsciiStrToLower(host.
base_url),
134 !IsTailscaleEndpoint(host.
base_url)) {
135 tags.push_back(
"http");
138 tags.push_back(
"vision");
141 tags.push_back(
"tools");
144 tags.push_back(
"stream");
149 std::string result =
"[";
150 for (
size_t i = 0; i < tags.size(); ++i) {
152 if (i + 1 < tags.size()) {
163 if (path.empty() || path.front() !=
'~') {
167 if (home_dir.empty() || home_dir ==
".") {
170 if (path.size() == 1) {
171 return home_dir.string();
173 if (path[1] ==
'/' || path[1] ==
'\\') {
174 return (home_dir / path.substr(2)).string();
176 return (home_dir / path.substr(1)).string();
179bool AddUniquePath(std::vector<std::string>* paths,
const std::string& path) {
180 if (!paths || path.empty()) {
184 auto it = std::find(paths->begin(), paths->end(), expanded);
185 if (it != paths->end()) {
188 paths->push_back(expanded);
192constexpr std::array<SettingsPanel::CategoryDescriptor, 10>
196 "theme font scale density motion colors"},
199 "autosave backup tips editor defaults"},
202 "vsync fps cache undo performance"},
205 "folders roots filesystem icloud sync"},
208 "agent provider model host ollama gemini openai"},
213 "layout dock windows named workspace"},
216 "project rom identity paths build manifest"},
219 "experimental system overworld dungeon resources save flags"},
227 return "Application";
233 return "Application";
239 Scope scope,
const std::string& query) {
240 const std::string needle = absl::AsciiStrToLower(query);
241 std::vector<CategoryDescriptor> result;
243 if (category.scope != scope) {
246 if (!needle.empty()) {
247 const std::string haystack = absl::AsciiStrToLower(absl::StrFormat(
248 "%s %s %s", category.id, category.label, category.keywords));
249 if (haystack.find(needle) == std::string::npos) {
253 result.push_back(category);
260 const auto summarize = [](
const std::vector<uint16_t>& configured,
261 const std::vector<uint16_t>& standard) {
262 const bool uses_standard_values =
263 configured.empty() || configured == standard;
264 return std::pair<std::string, bool>(
265 FormatHexList(configured.empty() ? standard : configured),
266 uses_standard_values);
269 return {summarize(overlay.
track_tiles, DefaultTrackTiles()),
289 return absl::OkStatus();
297 ImGui::TextDisabled(tr(
"Settings not available"));
302 ImGui::SetNextItemWidth(-1.0f);
303 ImGui::InputTextWithHint(
"##SettingsSearch",
307 "input", ImGui::GetItemID());
309 const auto categories =
312 if (categories.empty()) {
314 ImGui::TextDisabled(tr(
"No %s settings match \"%s\"."),
320 const bool wide_layout =
322 if (wide_layout && ImGui::BeginTable(
"##SettingsLayout", 2,
323 ImGuiTableFlags_Resizable |
324 ImGuiTableFlags_BordersInnerV |
325 ImGuiTableFlags_SizingStretchProp)) {
326 ImGui::TableSetupColumn(
"Categories", ImGuiTableColumnFlags_WidthFixed,
327 std::clamp(ImGui::GetContentRegionAvail().x * 0.30f,
330 ImGui::TableSetupColumn(
"Settings", ImGuiTableColumnFlags_WidthStretch);
331 ImGui::TableNextRow();
332 ImGui::TableNextColumn();
334 ImGui::TableNextColumn();
345 if (!ImGui::BeginTabBar(
"##SettingsScopes")) {
348 for (
const Scope scope :
351 const bool tab_open = ImGui::BeginTabItem(ScopeLabel(scope));
353 std::string(
"Settings/tab:") + ScopeLabel(scope),
"tab",
368 const std::vector<CategoryDescriptor>& categories) {
369 if (categories.empty()) {
373 const auto active = std::find_if(categories.begin(), categories.end(),
375 return active_category_ == category.id;
377 if (
active == categories.end()) {
383 const std::vector<CategoryDescriptor>& categories,
bool compact) {
392 const std::string preview =
394 : std::string(
"Select category");
395 ImGui::SetNextItemWidth(-1.0f);
396 if (ImGui::BeginCombo(
"##SettingsCategory", preview.c_str())) {
399 const std::string label =
400 absl::StrFormat(
"%s %s", category.icon, category.label);
401 if (ImGui::Selectable(label.c_str(), selected)) {
405 ImGui::SetItemDefaultFocus();
413 const bool nav_open =
414 ImGui::BeginChild(
"##SettingsCategories", ImVec2(0.0f, 0.0f),
false);
418 const std::string label =
419 absl::StrFormat(
"%s %s", category.icon, category.label);
420 if (ImGui::Selectable(label.c_str(), selected)) {
429 const auto descriptor =
430 std::find_if(kSettingsCategories.begin(), kSettingsCategories.end(),
432 return category_id == category.id;
434 if (descriptor == kSettingsCategories.end()) {
438 const std::string heading =
439 absl::StrFormat(
"%s %s", descriptor->icon, descriptor->label);
440 ImGui::SeparatorText(heading.c_str());
441 if (category_id ==
"appearance") {
443 }
else if (category_id ==
"behavior") {
445 }
else if (category_id ==
"performance") {
447 }
else if (category_id ==
"files") {
449 }
else if (category_id ==
"ai") {
451 }
else if (category_id ==
"shortcuts") {
453 }
else if (category_id ==
"layout") {
455 }
else if (category_id ==
"project") {
457 }
else if (category_id ==
"features") {
459 }
else if (category_id ==
"patches") {
468 ImGui::TextDisabled(tr(
"Feature Flags configuration"));
472 if (ImGui::Checkbox(tr(
"Acknowledge Experimental Editors"),
473 &experiments_enabled)) {
477 if (ImGui::IsItemHovered()) {
479 tr(
"Acknowledges Screen, Music, and Agent editor maturity. Turning "
480 "this off keeps the editors visible but warns and may force a "
481 "backup. Feature-specific write guards remain authoritative."));
483 if (!experiments_enabled) {
486 tr(
"Experimental editors remain available with warnings and defensive "
487 "save safeguards."));
496 if (ImGui::TreeNode(
ICON_MD_MAP " Overworld Flags")) {
519 ImGui::TextDisabled(tr(
"No active project."));
533 const char* roles[] = {
"base",
"dev",
"patched",
"release"};
535 if (ImGui::Combo(tr(
"Role"), &role_index, roles, IM_ARRAYSIZE(roles))) {
540 const char* policies[] = {
"allow",
"warn",
"block"};
542 if (ImGui::Combo(tr(
"Write Policy"), &policy_index, policies,
543 IM_ARRAYSIZE(policies))) {
550 if (ImGui::InputText(tr(
"Expected Hash"), &expected_hash)) {
558 const auto current_hash =
561 ImGui::Text(tr(
"Current ROM Hash: %s"),
562 current_hash.empty() ?
"(unknown)" : current_hash.c_str());
563 const bool use_hash = ImGui::Button(tr(
"Use Current ROM Hash"));
565 "Settings/button:Use Current ROM Hash",
"button", ImGui::GetItemID());
566 if (use_hash && !current_hash.empty()) {
571 ImGui::TextDisabled(tr(
"Current ROM Hash: (no ROM loaded)"));
580 if (ImGui::InputText(tr(
"Output Folder"), &output_folder)) {
587 if (ImGui::InputText(tr(
"Git Repository"), &git_repo)) {
598 if (ImGui::InputText(tr(
"Build Target (ROM)"), &build_target)) {
605 if (ImGui::InputText(tr(
"Symbols File"), &symbols_file)) {
611 ImGui::Text(tr(
"%s ASM / Hack Manifest"),
ICON_MD_CODE);
613 ImGui::TextWrapped(tr(
614 "Optional: load a hack manifest JSON (generated by an ASM project) to "
615 "annotate room tags, show feature flags, and surface which ROM regions "
616 "are owned by ASM vs safe to edit in yaze."));
619 if (ImGui::InputText(tr(
"Hack Manifest File"), &manifest_file)) {
627 ImGui::TextDisabled(manifest_loaded ?
"(loaded)" :
"(not loaded)");
628 if (ImGui::Button(tr(
"Reload Manifest"))) {
632 if (manifest_loaded) {
635 ImGui::Text(tr(
"Manifest Version: %d"),
640 if (!pipeline.dev_rom.empty()) {
641 ImGui::Text(tr(
"Dev ROM: %s"), pipeline.dev_rom.c_str());
643 if (!pipeline.patched_rom.empty()) {
644 ImGui::Text(tr(
"Patched ROM: %s"), pipeline.patched_rom.c_str());
646 if (!pipeline.build_script.empty()) {
647 ImGui::Text(tr(
"Build Script: %s"), pipeline.build_script.c_str());
651 if (msg_layout.first_expanded_id != 0 || msg_layout.last_expanded_id != 0) {
652 ImGui::Text(tr(
"Expanded Messages: 0x%03X-0x%03X (%d)"),
653 msg_layout.first_expanded_id, msg_layout.last_expanded_id,
654 msg_layout.expanded_count);
657 if (ImGui::TreeNode(
ICON_MD_FLAG " Hack Feature Flags")) {
659 ImGui::BulletText(
"%s = %d (%s)", flag.name.c_str(), flag.value,
660 flag.enabled ?
"enabled" :
"disabled");
661 if (!flag.source.empty()) {
663 ImGui::TextDisabled(
"%s", flag.source.c_str());
669 if (ImGui::TreeNode(
ICON_MD_LABEL " Room Tags (Dispatch)")) {
671 ImGui::BulletText(tr(
"0x%02X: %s"), tag.tag_id, tag.name.c_str());
672 if (!tag.enabled && !tag.feature_flag.empty()) {
674 ImGui::TextDisabled(tr(
"(disabled by %s)"), tag.feature_flag.c_str());
676 if (!tag.purpose.empty() && ImGui::IsItemHovered()) {
677 ImGui::SetTooltip(
"%s", tag.purpose.c_str());
689 if (ImGui::InputText(tr(
"Backup Folder"), &backup_folder)) {
702 {.min = 0, .max = 10000})) {
715 {.min = 1, .max = 3650})) {
724 tr(
"Read-only here. Edit collision and object IDs in Minecart Tracks > "
727 constexpr std::array<const char*, 5> kLabels = {
728 "Track Tiles",
"Stop Tiles",
"Switch Tiles",
"Track Object IDs",
729 "Minecart Sprite IDs"};
732 if (ImGui::BeginTable(
"DungeonOverlaySummary", 2,
733 ImGuiTableFlags_SizingStretchProp)) {
734 ImGui::TableSetupColumn(
"Field", ImGuiTableColumnFlags_WidthFixed, 132.0f);
735 ImGui::TableSetupColumn(
"Value", ImGuiTableColumnFlags_WidthStretch);
736 for (
size_t i = 0; i < summary.size(); ++i) {
737 ImGui::TableNextRow();
738 ImGui::TableSetColumnIndex(0);
739 ImGui::TextDisabled(
"%s", tr(kLabels[i]));
740 ImGui::TableSetColumnIndex(1);
741 ImGui::TextWrapped(
"%s", summary[i].first.c_str());
742 ImGui::TextDisabled(
"%s", summary[i].second
743 ? tr(
"Standard values")
744 : tr(
"Custom project values"));
750 const bool custom_objects_enabled =
752 const bool can_open = custom_objects_enabled &&
754 ImGui::BeginDisabled(!can_open);
758 ImGui::EndDisabled();
760 if (!custom_objects_enabled) {
762 tr(
"Enable Custom Dungeon Objects in General Settings first."));
764 ImGui::TextDisabled(tr(
"Minecart Tracks navigation is unavailable."));
780 static int selected_root_index = -1;
781 static std::string new_root_path;
787 ImGui::TextDisabled(tr(
"No project roots configured."));
790 const float roots_height = std::clamp(
791 ImGui::GetContentRegionAvail().y * 0.28f,
gui::ScaledSize(0.0f, 100.0f).y,
793 if (ImGui::BeginChild(
"ProjectRootsList", ImVec2(0, roots_height),
true)) {
794 for (
size_t i = 0; i < roots.size(); ++i) {
795 const bool is_default = roots[i] == prefs.default_project_root;
799 label +=
" (default)";
801 if (ImGui::Selectable(label.c_str(),
802 selected_root_index ==
static_cast<int>(i))) {
803 selected_root_index =
static_cast<int>(i);
809 const bool has_selection =
810 selected_root_index >= 0 &&
811 selected_root_index < static_cast<int>(roots.size());
813 if (ImGui::Button(tr(
"Set Default"))) {
814 prefs.default_project_root = roots[selected_root_index];
819 const std::string removed = roots[selected_root_index];
820 roots.erase(roots.begin() + selected_root_index);
821 if (prefs.default_project_root == removed) {
822 prefs.default_project_root = roots.empty() ?
"" : roots.front();
824 selected_root_index = roots.empty()
826 : std::min(selected_root_index,
827 static_cast<int>(roots.size() - 1));
836 ImGui::InputTextWithHint(
"##project_root_add",
"Add folder path...",
839 const std::string trimmed =
840 std::string(absl::StripAsciiWhitespace(new_root_path));
841 if (!trimmed.empty()) {
842 if (AddUniquePath(&roots, trimmed) &&
843 prefs.default_project_root.empty()) {
844 prefs.default_project_root = trimmed;
852 if (!folder.empty()) {
853 if (AddUniquePath(&roots, folder) && prefs.default_project_root.empty()) {
854 prefs.default_project_root = folder;
867 if (AddUniquePath(&roots, docs_dir->string()) &&
868 prefs.default_project_root.empty()) {
869 prefs.default_project_root = docs_dir->string();
878 if (icloud_dir.ok()) {
879 if (AddUniquePath(&roots, icloud_dir->string())) {
880 prefs.default_project_root = icloud_dir->string();
886 tr(
"iCloud projects live in Documents/Yaze/iCloud on this Mac."));
892 bool use_icloud_sync = prefs.use_icloud_sync;
893 if (ImGui::Checkbox(tr(
"Use iCloud sync (Documents)"), &use_icloud_sync)) {
894 prefs.use_icloud_sync = use_icloud_sync;
895 if (use_icloud_sync) {
898 if (icloud_dir.ok()) {
899 AddUniquePath(&roots, icloud_dir->string());
900 prefs.default_project_root = icloud_dir->string();
906 bool use_files_app = prefs.use_files_app;
907 if (ImGui::Checkbox(tr(
"Prefer Files app on iOS"), &use_files_app)) {
908 prefs.use_files_app = use_files_app;
915 auto theme = theme_manager.GetCurrentTheme();
916 theme.ApplyDensityPreset(preset);
919 theme_manager.ReapplyTheme(theme);
928 const std::string current = theme_manager.GetCurrentThemeName();
929 const auto& current_theme = theme_manager.GetCurrentTheme();
931 ImGui::SetNextItemWidth(-1.0f);
932 if (ImGui::BeginCombo(
"##AppearanceTheme", current.c_str())) {
933 for (
const auto& theme_name : theme_manager.GetAvailableThemes()) {
934 const bool is_current = theme_name == current;
935 if (ImGui::Selectable(theme_name.c_str(), is_current)) {
936 if (theme_manager.IsPreviewActive()) {
937 theme_manager.EndPreview();
939 theme_manager.ApplyTheme(theme_name);
942 ImGui::SetItemDefaultFocus();
948 const ImGuiColorEditFlags swatch_flags = ImGuiColorEditFlags_NoTooltip |
949 ImGuiColorEditFlags_NoDragDrop |
950 ImGuiColorEditFlags_NoPicker;
951 const float swatch_size = std::max(12.0f, ImGui::GetFrameHeight() * 0.62f);
952 ImGui::TextDisabled(
"%s", tr(
"Palette"));
953 ImGui::SameLine(0.0f, 6.0f);
954 ImGui::PushID(
"CurrentThemeSwatches");
955 ImGui::ColorButton(
"Primary",
957 swatch_flags, ImVec2(swatch_size, swatch_size));
958 ImGui::SameLine(0.0f, 3.0f);
959 ImGui::ColorButton(
"Surface",
961 swatch_flags, ImVec2(swatch_size, swatch_size));
962 ImGui::SameLine(0.0f, 3.0f);
964 swatch_flags, ImVec2(swatch_size, swatch_size));
966 if (!current_theme.description.empty()) {
967 ImGui::PushTextWrapPos(0.0f);
968 ImGui::TextDisabled(
"%s", current_theme.description.c_str());
969 ImGui::PopTextWrapPos();
973 theme_manager.RefreshAvailableThemes();
975 if (ImGui::IsItemHovered()) {
976 ImGui::SetTooltip(tr(
"Re-scan theme folders for new or changed themes"));
980 ImGui::SeparatorText(tr(
"Density"));
983 auto preset = theme_manager.GetCurrentTheme().density_preset;
984 int density =
static_cast<int>(preset);
985 const char* density_labels[] = {tr(
"Compact"), tr(
"Normal"),
987 ImGui::SetNextItemWidth(-1.0f);
988 if (ImGui::Combo(
"##DisplayDensity", &density, density_labels,
989 IM_ARRAYSIZE(density_labels))) {
993 "%s", density == 0 ? tr(
"Tighter controls and more visible content")
994 : density == 2 ? tr(
"Larger controls with more breathing room")
995 : tr(
"Balanced spacing for everyday editing"));
999 ImGui::SeparatorText(tr(
"Motion"));
1003 if (ImGui::Checkbox(tr(
"Reduced Motion"), &reduced_motion)) {
1004 prefs.reduced_motion = reduced_motion;
1006 prefs.reduced_motion,
1010 if (ImGui::IsItemHovered()) {
1012 tr(
"Disable panel/editor transition animations for a calmer editing "
1016 int switch_profile = std::clamp(prefs.switch_motion_profile, 0, 2);
1017 const char* switch_profile_labels[] = {
"Snappy",
"Standard",
"Relaxed"};
1018 if (ImGui::Combo(tr(
"Switch Motion Profile"), &switch_profile,
1019 switch_profile_labels,
1020 IM_ARRAYSIZE(switch_profile_labels))) {
1021 prefs.switch_motion_profile = switch_profile;
1023 prefs.reduced_motion,
1027 if (ImGui::IsItemHovered()) {
1029 tr(
"Controls editor/workspace switch timing and easing for panel fades "
1030 "and sidebar slides."));
1045 ImGui::Text(tr(
"Global Font Scale"));
1047 if (ImGui::SliderFloat(
"##global_font_scale", &scale, 0.5f, 2.0f,
"%.2f")) {
1049 ImGui::GetIO().FontGlobalScale = scale;
1059 if (ImGui::Checkbox(tr(
"Show Status Bar"), &show_status_bar)) {
1067 if (ImGui::IsItemHovered()) {
1069 tr(
"Display ROM, session, cursor, and zoom info at bottom of window"));
1078 if (ImGui::Checkbox(tr(
"Keep Emulator Running in Background"),
1083 if (ImGui::IsItemHovered()) {
1084 ImGui::SetTooltip(tr(
1085 "When off (default), hiding emulator panels pauses the SNES tick and "
1086 "audio. Music playback still drives its own frames."));
1092 ImGui::TextDisabled(tr(
"UserSettings unavailable."));
1101 if (prefs.named_layouts.empty()) {
1102 ImGui::TextDisabled(
1103 tr(
"No saved layouts yet. Open the Layout Designer to capture one."));
1107 std::vector<std::string> names;
1108 names.reserve(prefs.named_layouts.size());
1109 for (
const auto& entry : prefs.named_layouts) {
1110 names.push_back(entry.first);
1112 std::sort(names.begin(), names.end());
1114 const std::string&
active = prefs.last_applied_layout_name;
1115 const char* preview =
1116 active.empty() ?
"(select a layout…)" :
active.c_str();
1118 if (ImGui::BeginCombo(tr(
"Active Layout"), preview)) {
1119 for (
const auto& name : names) {
1120 const bool is_selected = (name ==
active);
1121 if (ImGui::Selectable(name.c_str(), is_selected)) {
1130 ImGui::SetItemDefaultFocus();
1137 ImGui::BeginDisabled(
active.empty() ||
1138 prefs.named_layouts.count(
active) == 0);
1139 if (ImGui::SmallButton(tr(
"Re-apply"))) {
1142 ImGui::EndDisabled();
1143 if (ImGui::IsItemHovered()) {
1145 tr(
"Re-apply the active layout (useful after closing or rearranging "
1146 "panels manually)."));
1162 "Open failed: \"layout.designer\" panel is not registered.";
1170 if (ImGui::IsItemHovered()) {
1172 tr(
"Open the Layout Designer panel to author or capture a workspace "
1197 if (it == prefs.named_layouts.end()) {
1199 absl::StrCat(
"Apply failed: \"", name,
"\" not found.");
1204 nlohmann::json parsed;
1206 parsed = nlohmann::json::parse(it->second);
1207 }
catch (
const nlohmann::json::parse_error& e) {
1209 absl::StrCat(
"Apply failed: invalid JSON (", e.what(),
").");
1215 if (!tree_or.ok()) {
1217 absl::StrCat(
"Apply failed: ", tree_or.status().message());
1222 std::string validation_error;
1223 if (!tree_or->Validate(&validation_error)) {
1225 absl::StrCat(
"Apply failed: invalid layout (", validation_error,
").");
1231 if (manager ==
nullptr) {
1237 if (dockspace_id == 0) {
1243 const absl::Status apply_status =
1245 if (!apply_status.ok()) {
1247 absl::StrCat(
"Apply failed: ", apply_status.message());
1252 prefs.last_applied_layout_name = name;
1265 if (ImGui::Checkbox(tr(
"Enable Auto-Save"),
1273 if (ImGui::SliderInt(tr(
"Interval (sec)"), &interval, 60, 600)) {
1278 if (ImGui::Checkbox(tr(
"Backup Before Save"),
1298 const char* editors[] = {
"None",
"Overworld",
"Dungeon",
"Graphics"};
1300 editors, IM_ARRAYSIZE(editors))) {
1307 if (ImGui::Checkbox(tr(
"Use HMagic sprite names (expanded)"),
1320 if (ImGui::IsItemHovered()) {
1322 tr(
"From the next launch: no welcome screen, no editor picker, and "
1323 "the local test server starts on port 50052 (builds with gRPC)."));
1329 if (ImGui::Checkbox(tr(
"Show feature tips (ZScream migration, etc.)"),
1333 ImGui::TextDisabled(tr(
"%zu tip(s) already dismissed"),
1335 if (ImGui::Button(tr(
"Reset dismissed tips"))) {
1361 if (ImGui::SliderInt(tr(
"Cache Size (MB)"),
1366 if (ImGui::SliderInt(tr(
"Undo History"),
1373 ImGui::Text(tr(
"Current FPS: %.1f"), ImGui::GetIO().Framerate);
1374 ImGui::Text(tr(
"Frame Time: %.3f ms"), 1000.0f / ImGui::GetIO().Framerate);
1383 static int selected_host_index = -1;
1385 auto draw_key_row = [&](
const char* label, std::string* key,
1386 const char* env_var,
const char* id) {
1388 ImGui::Text(
"%s", label);
1389 const ImVec2 button_size = ImGui::CalcTextSize(
ICON_MD_SYNC " Env");
1390 float env_button_width =
1391 button_size.x + ImGui::GetStyle().FramePadding.x * 2.0f;
1392 float input_width = ImGui::GetContentRegionAvail().x - env_button_width -
1393 ImGui::GetStyle().ItemSpacing.x;
1394 bool stack = input_width < 160.0f;
1395 ImGui::SetNextItemWidth(stack ? -1.0f : input_width);
1396 if (ImGui::InputTextWithHint(
"##key",
"API key...", key,
1397 ImGuiInputTextFlags_Password)) {
1404 const char* env_key = std::getenv(env_var);
1416 draw_key_row(
"OpenAI", &prefs.openai_api_key,
"OPENAI_API_KEY",
"openai_key");
1417 draw_key_row(
"Anthropic", &prefs.anthropic_api_key,
"ANTHROPIC_API_KEY",
1419 draw_key_row(
"Google (Gemini)", &prefs.gemini_api_key,
"GEMINI_API_KEY",
1424 ImGui::Text(tr(
"%s Provider Defaults (legacy)"),
ICON_MD_CLOUD);
1427 const char* providers[] = {
"Ollama (Local)",
"Gemini (Cloud)",
1429 if (ImGui::Combo(
"##Provider", &prefs.ai_provider, providers,
1430 IM_ARRAYSIZE(providers))) {
1438 const char* active_preview =
"None";
1439 const char* remote_preview =
"None";
1440 for (
const auto& host : hosts) {
1441 if (!prefs.active_ai_host_id.empty() &&
1442 host.id == prefs.active_ai_host_id) {
1443 active_preview = host.label.c_str();
1445 if (!prefs.remote_build_host_id.empty() &&
1446 host.id == prefs.remote_build_host_id) {
1447 remote_preview = host.label.c_str();
1451 if (ImGui::BeginCombo(tr(
"Active Host"), active_preview)) {
1452 for (
size_t i = 0; i < hosts.size(); ++i) {
1453 const bool is_selected = (!prefs.active_ai_host_id.empty() &&
1454 hosts[i].id == prefs.active_ai_host_id);
1455 if (ImGui::Selectable(hosts[i].label.c_str(), is_selected)) {
1456 prefs.active_ai_host_id = hosts[i].id;
1457 if (prefs.remote_build_host_id.empty()) {
1458 prefs.remote_build_host_id = hosts[i].id;
1463 ImGui::SetItemDefaultFocus();
1469 if (ImGui::BeginCombo(tr(
"Remote Build Host"), remote_preview)) {
1470 for (
size_t i = 0; i < hosts.size(); ++i) {
1471 const bool is_selected = (!prefs.remote_build_host_id.empty() &&
1472 hosts[i].id == prefs.remote_build_host_id);
1473 if (ImGui::Selectable(hosts[i].label.c_str(), is_selected)) {
1474 prefs.remote_build_host_id = hosts[i].id;
1478 ImGui::SetItemDefaultFocus();
1488 if (selected_host_index >=
static_cast<int>(hosts.size())) {
1489 selected_host_index = hosts.empty() ? -1 : 0;
1491 if (selected_host_index < 0 && !hosts.empty()) {
1492 for (
size_t i = 0; i < hosts.size(); ++i) {
1493 if (!prefs.active_ai_host_id.empty() &&
1494 hosts[i].id == prefs.active_ai_host_id) {
1495 selected_host_index =
static_cast<int>(i);
1499 if (selected_host_index < 0) {
1500 selected_host_index = 0;
1504 const float hosts_height = std::clamp(
1505 ImGui::GetContentRegionAvail().y * 0.32f,
gui::ScaledSize(0.0f, 120.0f).y,
1507 ImGui::BeginChild(
"##ai_host_list", ImVec2(0, hosts_height),
true);
1508 for (
size_t i = 0; i < hosts.size(); ++i) {
1509 const bool is_selected =
static_cast<int>(i) == selected_host_index;
1510 std::string label = hosts[i].label;
1511 if (hosts[i].
id == prefs.active_ai_host_id) {
1512 label +=
" (active)";
1514 if (hosts[i].
id == prefs.remote_build_host_id) {
1515 label +=
" (build)";
1517 if (ImGui::Selectable(label.c_str(), is_selected)) {
1518 selected_host_index =
static_cast<int>(i);
1520 std::string tags = BuildHostTagString(hosts[i]);
1521 if (!tags.empty()) {
1523 ImGui::TextDisabled(
"%s", tags.c_str());
1529 if (host.id.empty()) {
1530 host.id = absl::StrFormat(
"host-%zu", hosts.size() + 1);
1532 hosts.push_back(host);
1533 selected_host_index =
static_cast<int>(hosts.size() - 1);
1534 if (prefs.active_ai_host_id.empty()) {
1535 prefs.active_ai_host_id = host.id;
1537 if (prefs.remote_build_host_id.empty()) {
1538 prefs.remote_build_host_id = host.id;
1545 host.
label =
"New Host";
1546 host.
base_url =
"http://localhost:1234";
1551 if (ImGui::Button(
ICON_MD_DELETE " Remove") && selected_host_index >= 0 &&
1552 selected_host_index <
static_cast<int>(hosts.size())) {
1553 const std::string removed_id = hosts[selected_host_index].id;
1554 hosts.erase(hosts.begin() + selected_host_index);
1555 if (prefs.active_ai_host_id == removed_id) {
1556 prefs.active_ai_host_id = hosts.empty() ?
"" : hosts.front().id;
1558 if (prefs.remote_build_host_id == removed_id) {
1559 prefs.remote_build_host_id = prefs.active_ai_host_id;
1561 selected_host_index =
1564 : std::min(selected_host_index,
static_cast<int>(hosts.size() - 1));
1569 if (ImGui::Button(tr(
"Add LM Studio"))) {
1571 host.
label =
"LM Studio (local)";
1572 host.
base_url =
"http://localhost:1234";
1579 if (ImGui::Button(tr(
"Add AFS Bridge"))) {
1581 host.
label =
"halext AFS Bridge";
1582 host.
base_url =
"https://halext.org";
1589 if (ImGui::Button(tr(
"Add Ollama"))) {
1591 host.
label =
"Ollama (local)";
1592 host.
base_url =
"http://localhost:11434";
1599 static std::string tailscale_host;
1600 ImGui::InputTextWithHint(
"##tailscale_host",
"host.ts.net:1234",
1603 if (ImGui::Button(tr(
"Add Tailscale Host"))) {
1604 std::string trimmed =
1605 std::string(absl::StripAsciiWhitespace(tailscale_host));
1606 if (!trimmed.empty()) {
1608 host.
label =
"Tailscale Host";
1609 if (absl::StrContains(trimmed,
"://")) {
1612 host.
base_url =
"http://" + trimmed;
1619 tailscale_host.clear();
1623 if (selected_host_index >= 0 &&
1624 selected_host_index <
static_cast<int>(hosts.size())) {
1625 auto& host = hosts[
static_cast<size_t>(selected_host_index)];
1627 ImGui::Text(tr(
"Host Details"));
1629 if (ImGui::InputText(tr(
"Label"), &host.label)) {
1632 if (ImGui::InputText(tr(
"Base URL"), &host.base_url)) {
1636 const char* api_types[] = {
"openai",
"ollama",
"gemini",
1637 "anthropic",
"lmstudio",
"grpc"};
1639 for (
int i = 0; i < IM_ARRAYSIZE(api_types); ++i) {
1640 if (host.api_type == api_types[i]) {
1645 if (ImGui::Combo(tr(
"API Type"), &api_index, api_types,
1646 IM_ARRAYSIZE(api_types))) {
1647 host.api_type = api_types[api_index];
1651 if (ImGui::InputText(tr(
"API Key"), &host.api_key,
1652 ImGuiInputTextFlags_Password)) {
1655 if (ImGui::InputText(tr(
"Keychain ID"), &host.credential_id)) {
1659 if (ImGui::SmallButton(tr(
"Use Host ID"))) {
1660 host.credential_id = host.id;
1663 if (!host.credential_id.empty() && host.api_key.empty()) {
1664 ImGui::TextDisabled(tr(
"Keychain lookup enabled (leave API key empty)."));
1667 if (ImGui::Checkbox(tr(
"Supports Vision"), &host.supports_vision)) {
1671 if (ImGui::Checkbox(tr(
"Supports Tools"), &host.supports_tools)) {
1675 if (ImGui::Checkbox(tr(
"Supports Streaming"), &host.supports_streaming)) {
1678 if (ImGui::Checkbox(tr(
"Allow Insecure HTTP"), &host.allow_insecure)) {
1687 auto& model_paths = prefs.ai_model_paths;
1688 static int selected_model_path = -1;
1689 static std::string new_model_path;
1691 if (model_paths.empty()) {
1692 ImGui::TextDisabled(tr(
"No model paths configured."));
1695 const float model_paths_height = std::clamp(
1696 ImGui::GetContentRegionAvail().y * 0.24f,
gui::ScaledSize(0.0f, 96.0f).y,
1698 if (ImGui::BeginChild(
"ModelPathsList", ImVec2(0, model_paths_height),
1700 for (
size_t i = 0; i < model_paths.size(); ++i) {
1703 if (ImGui::Selectable(label.c_str(),
1704 selected_model_path ==
static_cast<int>(i))) {
1705 selected_model_path =
static_cast<int>(i);
1711 const bool has_model_selection =
1712 selected_model_path >= 0 &&
1713 selected_model_path < static_cast<int>(model_paths.size());
1714 if (has_model_selection) {
1716 model_paths.erase(model_paths.begin() + selected_model_path);
1717 selected_model_path =
1720 : std::min(selected_model_path,
1721 static_cast<int>(model_paths.size() - 1));
1727 ImGui::InputTextWithHint(
"##model_path_add",
"Add folder path...",
1730 const std::string trimmed =
1731 std::string(absl::StripAsciiWhitespace(new_model_path));
1732 if (!trimmed.empty() && AddUniquePath(&model_paths, trimmed)) {
1734 new_model_path.clear();
1740 if (!folder.empty() && AddUniquePath(&model_paths, folder)) {
1750 if (!home_dir.empty() && home_dir !=
".") {
1751 if (AddUniquePath(&model_paths, (home_dir /
"models").
string())) {
1757 if (ImGui::Button(tr(
"Add ~/.lmstudio/models"))) {
1758 if (!home_dir.empty() && home_dir !=
".") {
1759 if (AddUniquePath(&model_paths,
1760 (home_dir /
".lmstudio" /
"models").
string())) {
1766 if (ImGui::Button(tr(
"Add ~/.ollama/models"))) {
1767 if (!home_dir.empty() && home_dir !=
".") {
1768 if (AddUniquePath(&model_paths,
1769 (home_dir /
".ollama" /
"models").
string())) {
1779 if (ImGui::SliderFloat(tr(
"Temperature"),
1783 ImGui::TextDisabled(tr(
"Higher = more creative"));
1794 if (ImGui::Checkbox(tr(
"Proactive Suggestions"),
1799 if (ImGui::Checkbox(tr(
"Auto-Learn Preferences"),
1804 if (ImGui::Checkbox(tr(
"Enable Vision"),
1813 const char* log_levels[] = {
"Debug",
"Info",
"Warning",
"Error",
"Fatal"};
1815 log_levels, IM_ARRAYSIZE(log_levels))) {
1823 ImGuiTreeNodeFlags_DefaultOpen)) {
1824 ImGui::InputTextWithHint(
"##shortcut_filter",
"Filter shortcuts...",
1826 if (ImGui::IsItemHovered()) {
1827 ImGui::SetTooltip(tr(
"Filter by action name or key combo"));
1831 if (ImGui::TreeNode(
"Global Shortcuts")) {
1835 if (ImGui::TreeNode(
"Editor Shortcuts")) {
1839 if (ImGui::TreeNode(
"Panel Shortcuts")) {
1843 ImGui::TextDisabled(
1844 tr(
"Tip: Use Cmd/Opt labels on macOS or Ctrl/Alt on Windows/Linux. "
1845 "Function keys and symbols (/, -) are supported."));
1854 std::string haystack = absl::AsciiStrToLower(text);
1856 return absl::StrContains(haystack, needle);
1868 std::unordered_map<std::string, std::string>& overrides) {
1869 ImGui::PushID(sc.
name.c_str());
1870 ImGui::Text(
"%s", sc.
name.c_str());
1872 ImGui::SetNextItemWidth(std::clamp(ImGui::GetContentRegionAvail().x * 0.45f,
1875 if (ImGui::InputText(
"##binding", &value,
1876 ImGuiInputTextFlags_EnterReturnsTrue |
1877 ImGuiInputTextFlags_AutoSelectAll)) {
1879 if (!parsed.empty() || value.empty()) {
1882 overrides[sc.
name] = value;
1884 user_settings->
Save();
1891 if (!conflicts.empty()) {
1894 if (ImGui::IsItemHovered()) {
1895 std::string tip =
"Also bound to:";
1896 for (
const auto& other : conflicts) {
1897 tip +=
"\n " + other;
1899 ImGui::SetTooltip(
"%s", tip.c_str());
1904 if (ImGui::SmallButton(tr(
"Reset"))) {
1906 overrides.erase(sc.
name);
1908 user_settings->
Save();
1910 if (ImGui::IsItemHovered()) {
1911 ImGui::SetTooltip(
"Default: %s",
1925 ImGui::TextDisabled(tr(
"Not available"));
1931 if (shortcuts.empty()) {
1932 ImGui::TextDisabled(tr(
"No global shortcuts registered."));
1936 shortcuts.begin(), shortcuts.end(),
1939 static std::unordered_map<std::string, std::string> editing;
1941 bool has_match =
false;
1942 for (
const auto& sc : shortcuts) {
1943 if (sc.keys.empty() && sc.default_keys.empty()) {
1951 auto it = editing.find(sc.name);
1952 if (it == editing.end()) {
1953 it = editing.emplace(sc.name, keys).first;
1959 ImGui::TextDisabled(tr(
"No shortcuts match the current filter."));
1965 ImGui::TextDisabled(tr(
"Not available"));
1971 std::map<std::string, std::vector<Shortcut>> grouped;
1972 static std::unordered_map<std::string, std::string> editing;
1974 for (
const auto& sc : shortcuts) {
1975 if (sc.keys.empty() && sc.default_keys.empty()) {
1978 auto pos = sc.name.find(
".");
1980 pos != std::string::npos ? sc.name.substr(0, pos) :
"general";
1981 grouped[group].push_back(sc);
1983 bool has_match =
false;
1984 for (
auto& [group, list] : grouped) {
1986 list.begin(), list.end(),
1988 std::vector<Shortcut> filtered;
1989 filtered.reserve(list.size());
1990 for (
const auto& sc : list) {
1993 filtered.push_back(sc);
1996 if (filtered.empty()) {
2000 if (ImGui::TreeNode(group.c_str())) {
2001 for (
const auto& sc : filtered) {
2002 auto it = editing.find(sc.name);
2003 if (it == editing.end()) {
2004 it = editing.emplace(sc.name,
PrintShortcut(sc.keys)).first;
2014 ImGui::TextDisabled(tr(
"No shortcuts match the current filter."));
2020 ImGui::TextDisabled(tr(
"Registry not available"));
2027 bool has_match =
false;
2028 for (
const auto& category : categories) {
2030 std::vector<
decltype(cards)::value_type> filtered_cards;
2031 filtered_cards.reserve(cards.size());
2032 for (
const auto& card : cards) {
2035 filtered_cards.push_back(card);
2038 if (filtered_cards.empty()) {
2042 if (ImGui::TreeNode(category.c_str())) {
2044 for (
const auto& card : filtered_cards) {
2045 ImGui::PushID(card.card_id.c_str());
2047 ImGui::Text(
"%s %s", card.icon.c_str(), card.display_name.c_str());
2049 std::string current_shortcut;
2052 current_shortcut = it->second;
2053 }
else if (!card.shortcut_hint.empty()) {
2054 current_shortcut = card.shortcut_hint;
2056 current_shortcut =
"None";
2060 std::string display_shortcut = current_shortcut;
2062 if (!parsed.empty()) {
2067 ImGui::SetNextItemWidth(
2068 std::clamp(ImGui::GetContentRegionAvail().x * 0.40f,
2071 ImGui::SetKeyboardFocusHere();
2074 ImGuiInputTextFlags_EnterReturnsTrue)) {
2091 if (ImGui::Button(display_shortcut.c_str(), ImVec2(120, 0))) {
2097 if (ImGui::IsItemHovered()) {
2098 ImGui::SetTooltip(tr(
"Click to edit shortcut"));
2109 ImGui::TextDisabled(tr(
"No shortcuts match the current filter."));
2118 if (patches_dir_status.ok()) {
2133 ImGui::TextDisabled(tr(
"No patches loaded"));
2134 ImGui::TextDisabled(tr(
"Place .asm patches in assets/patches/"));
2136 if (ImGui::Button(tr(
"Browse for Patches Folder..."))) {
2145 ImGui::Text(tr(
"Loaded: %d patches (%d enabled)"), total_count,
2152 ImGuiTabBarFlags_FittingPolicyScroll)) {
2154 if (ImGui::BeginTabItem(folder.c_str())) {
2157 ImGui::EndTabItem();
2170 ImGui::TextDisabled(tr(
"Select a patch to view details"));
2179#ifdef YAZE_WITH_Z3DK
2197 for (
const auto& range :
z3dk.prohibited_memory_ranges) {
2199 {.start = range.start, .end = range.end, .reason = range.reason});
2207 if (!
z3dk.rom_path.empty()) {
2218 LOG_ERROR(
"Settings",
"Failed to apply patches: %s", status.message());
2220 LOG_INFO(
"Settings",
"Applied %d patches successfully", enabled_count);
2223 LOG_WARN(
"Settings",
"No ROM loaded");
2226 if (ImGui::IsItemHovered()) {
2227 ImGui::SetTooltip(tr(
"Apply all enabled patches to the loaded ROM"));
2234 LOG_ERROR(
"Settings",
"Failed to save patches: %s", status.message());
2247 if (patches.empty()) {
2248 ImGui::TextDisabled(tr(
"No patches in this folder"));
2253 float available_height = std::min(200.0f, patches.size() * 25.0f + 10.0f);
2254 if (ImGui::BeginChild(
"##PatchList", ImVec2(0, available_height),
true)) {
2255 for (
auto* patch : patches) {
2256 ImGui::PushID(patch->filename().c_str());
2258 bool enabled = patch->enabled();
2259 if (ImGui::Checkbox(
"##Enabled", &enabled)) {
2260 patch->set_enabled(enabled);
2267 if (ImGui::Selectable(patch->name().c_str(), is_selected)) {
2300 if (!params.empty()) {
2305 for (
auto& param : params) {
2317 switch (param->
type) {
2321 int value = param->
value;
2322 const char* format = param->
use_decimal ?
"%d" :
"$%X";
2325 ImGui::SetNextItemWidth(std::clamp(
2326 ImGui::GetContentRegionAvail().x * 0.50f,
2328 if (ImGui::InputInt(
"##Value", &value, 1, 16)) {
2342 if (ImGui::Checkbox(param->
display_name.c_str(), &checked)) {
2350 for (
size_t i = 0; i < param->
choices.size(); ++i) {
2351 bool selected = (param->
value ==
static_cast<int>(i));
2352 if (ImGui::RadioButton(param->
choices[i].c_str(), selected)) {
2353 param->
value =
static_cast<int>(i);
2361 for (
size_t i = 0; i < param->
choices.size(); ++i) {
2362 if (param->
choices[i].empty() || param->
choices[i] ==
"_EMPTY") {
2365 bool bit_set = (param->
value & (1 << i)) != 0;
2366 if (ImGui::Checkbox(param->
choices[i].c_str(), &bit_set)) {
2368 param->
value |= (1 << i);
2370 param->
value &= ~(1 << i);
2380 ImGui::SetNextItemWidth(-1.0f);
2381 if (ImGui::InputInt(tr(
"Item ID"), ¶m->
value)) {
2382 param->
value = std::clamp(param->
value, 0, 255);
const std::string & version() const
std::vector< PatchParameter > & mutable_parameters()
const std::string & author() const
const std::string & description() const
const std::string & name() const
const std::vector< FeatureFlag > & feature_flags() const
const MessageLayout & message_layout() const
const std::vector< RoomTagEntry > & room_tags() const
Get all room tags.
const std::string & hack_name() const
bool loaded() const
Check if the manifest has been loaded.
int manifest_version() const
const BuildPipeline & build_pipeline() const
absl::Status ApplyEnabledPatches(Rom *rom)
Apply all enabled patches to a ROM.
absl::Status SaveAllPatches()
Save all patches to their files.
const std::vector< std::string > & folders() const
Get list of patch folder names.
int GetEnabledPatchCount() const
Get count of enabled patches.
std::vector< AsmPatch * > GetPatchesInFolder(const std::string &folder)
Get all patches in a specific folder.
const std::vector< std::unique_ptr< AsmPatch > > & patches() const
Get all loaded patches.
absl::Status LoadPatches(const std::string &patches_dir)
Load all patches from a directory structure.
virtual void SetDependencies(const EditorDependencies &deps)
Manages ImGui DockBuilder layouts for each editor type.
absl::Status ApplyDockTree(const layout_designer::DockTree &tree, ImGuiID dockspace_id)
Apply a DockTree to the given dockspace.
ImGuiID GetMainDockspaceId() const
Get the cached main dockspace ID.
void DrawPerformanceSettings()
std::string editing_card_id_
void SetStatusBar(StatusBar *bar)
std::function< project::YazeProject *()> project_provider_
void DrawProjectSettings()
void DrawPatchList(const std::string &folder)
void DrawFilesystemSettings()
void SetWindowManager(WorkspaceWindowManager *registry)
std::array< char, 128 > settings_search_
void DrawAppearanceSettings()
std::string active_category_
void DrawCategoryNavigation(const std::vector< CategoryDescriptor > &categories, bool compact)
char shortcut_edit_buffer_[64]
ShortcutManager * shortcut_manager_
void EnsureActiveCategory(const std::vector< CategoryDescriptor > &categories)
std::function< std::string()> rom_hash_provider_
void SetDependencies(const EditorDependencies &deps) override
void DrawEditorShortcuts()
void DrawGlobalShortcuts()
void ApplyNamedLayoutToDockspace(const std::string &name)
bool MatchesShortcutFilter(const std::string &text) const
void DrawParameterWidget(core::PatchParameter *param)
void DrawEditorBehavior()
static DungeonOverlaySummary BuildDungeonOverlaySummary(const project::DungeonOverlaySettings &overlay)
core::AsmPatch * selected_patch_
void DrawGeneralSettings()
void DrawWorkspaceSettings()
core::PatchManager patch_manager_
OpenMinecartTracksCallback open_minecart_tracks_callback_
project::YazeProject * project_
void SetShortcutManager(ShortcutManager *manager)
void DrawCategoryContent(const std::string &category_id)
void SetUserSettings(UserSettings *settings)
std::string selected_folder_
UserSettings * user_settings_
void DrawKeyboardShortcuts()
bool is_editing_shortcut_
std::array< std::pair< std::string, bool >, 5 > DungeonOverlaySummary
std::string workspace_status_message_
std::string shortcut_filter_
static std::vector< CategoryDescriptor > FilterCategories(Scope scope, const std::string &query)
void SetProject(project::YazeProject *project)
void ApplyDisplayDensity(gui::DensityPreset preset)
absl::Status RequestOpenMinecartTracks()
WorkspaceWindowManager * window_manager_
bool workspace_status_is_error_
void DrawPanelShortcuts()
void DrawAIAgentSettings()
std::string project_status_message_
const Shortcut * FindShortcut(const std::string &name) const
std::vector< Shortcut > GetShortcutsByScope(Shortcut::Scope scope) const
bool ResetShortcutKeys(const std::string &name)
Restore the keys the shortcut was registered with.
std::vector< std::string > FindConflicts(const std::string &name) const
Names of other shortcuts bound to the same chord that can be active at the same time (same editor own...
bool UpdateShortcutKeys(const std::string &name, const std::vector< ImGuiKey > &keys)
void SetEnabled(bool enabled)
Enable or disable the status bar.
Manages user preferences and settings persistence.
std::vector< WindowDescriptor > GetWindowsInCategory(size_t session_id, const std::string &category) const
void SetWindowPinned(size_t session_id, const std::string &base_window_id, bool pinned)
bool IsWindowOpen(size_t session_id, const std::string &base_window_id) const
bool OpenWindow(size_t session_id, const std::string &base_window_id)
std::vector< std::string > GetAllCategories(size_t session_id) const
static MotionProfile ClampMotionProfile(int raw_profile)
void SetMotionPreferences(bool reduced_motion, MotionProfile profile)
static ThemeManager & Get()
static std::string ShowOpenFolderDialog()
ShowOpenFolderDialog opens a file dialog and returns the selected folder path. Uses global feature fl...
#define ICON_MD_FOLDER_OPEN
#define ICON_MD_FOLDER_SPECIAL
#define ICON_MD_LIGHTBULB
#define ICON_MD_TEXT_FIELDS
#define ICON_MD_VIDEOGAME_ASSET
#define ICON_MD_EXTENSION
#define ICON_MD_DASHBOARD_CUSTOMIZE
#define ICON_MD_PSYCHOLOGY
#define ICON_MD_HORIZONTAL_RULE
#define ICON_MD_DASHBOARD
#define ICON_MD_SMART_TOY
#define LOG_ERROR(category, format,...)
#define LOG_WARN(category, format,...)
#define LOG_INFO(category, format,...)
constexpr char kProviderOpenAi[]
constexpr char kProviderOllama[]
constexpr char kProviderLmStudio[]
LayoutManager * layout_manager()
Get the shared LayoutManager instance.
std::vector< uint16_t > DefaultTrackTiles()
std::string ExpandLeadingTilde(const std::string &path)
bool AddUniquePath(std::vector< std::string > *paths, const std::string &path)
std::vector< uint16_t > DefaultSwitchTiles()
std::vector< uint16_t > DefaultStopTiles()
void DrawShortcutBindingRow(const Shortcut &sc, std::string &value, ShortcutManager *shortcut_manager, UserSettings *user_settings, std::unordered_map< std::string, std::string > &overrides)
constexpr std::array< SettingsPanel::CategoryDescriptor, 10 > kSettingsCategories
std::string BuildHostTagString(const UserSettings::Preferences::AiHost &host)
const char * ScopeLabel(SettingsPanel::Scope scope)
std::vector< uint16_t > DefaultMinecartSpriteIds()
std::vector< uint16_t > DefaultTrackObjectIds()
absl::StatusOr< DockTree > DockTreeFromJson(const nlohmann::json &j)
std::vector< ImGuiKey > ParseShortcut(const std::string &shortcut)
std::string PrintShortcut(const std::vector< ImGuiKey > &keys)
bool DrawProperty(const char *label, bool *value, const PropertyOptions &opts)
ImVec4 ConvertColorToImVec4(const Color &color)
bool BeginThemedTabBar(const char *id, ImGuiTabBarFlags flags)
A stylized tab bar with "Mission Control" branding.
ImVec2 ScaledSize(float base_width, float base_height)
Returns a DPI-scaled version of a fixed pixel size.
DensityPreset
Typography and spacing density presets.
bool FontPicker(const char *label, int *index)
std::string ComputeRomHash(const uint8_t *data, size_t size)
void SetPreferHmagicSpriteNames(bool prefer)
void SetActiveFontIndex(int index)
bool kEnableCustomObjects
Represents a configurable parameter within an ASM patch.
std::vector< std::string > choices
bool warn_branch_outside_bank
std::vector< Z3dkMemoryRange > prohibited_memory_ranges
bool capture_nocash_symbols
std::vector< std::string > include_paths
std::vector< std::pair< std::string, std::string > > defines
std::string std_defines_path
bool warn_unauthorized_hook
std::string std_includes_path
std::string hooks_rom_path
Unified dependency container for all editor types.
project::YazeProject * project
ShortcutManager * shortcut_manager
UserSettings * user_settings
WorkspaceWindowManager * window_manager
std::vector< ImGuiKey > keys
std::vector< ImGuiKey > default_keys
std::vector< std::string > project_root_paths
std::unordered_map< std::string, std::string > panel_shortcuts
bool show_experimental_editors
bool feature_hints_enabled
std::unordered_map< std::string, std::string > named_layouts
std::unordered_map< std::string, std::string > editor_shortcuts
std::vector< AiHost > ai_hosts
std::unordered_map< std::string, std::string > global_shortcuts
bool emulator_keep_running_in_background
std::unordered_set< std::string > dismissed_feature_hints
bool prefer_hmagic_sprite_names
Dungeon overlay configuration (per-project).
std::vector< uint16_t > track_object_ids
std::vector< uint16_t > minecart_sprite_ids
std::vector< uint16_t > track_stop_tiles
std::vector< uint16_t > track_tiles
std::vector< uint16_t > track_switch_tiles
int backup_keep_daily_days
int backup_retention_count
std::string rom_backup_folder
std::string git_repository
core::HackManifest hack_manifest
void ReloadHackManifest()
std::string hack_manifest_file
WorkspaceSettings workspace_settings
std::string output_folder
DungeonOverlaySettings dungeon_overlay
std::string symbols_filename
Z3dkSettings z3dk_settings