4#include "absl/status/status.h"
10#include "imgui/imgui.h"
19using ImGui::BeginTabBar;
20using ImGui::BeginTabItem;
21using ImGui::BeginTable;
22using ImGui::EndTabBar;
23using ImGui::EndTabItem;
25using ImGui::TableHeadersRow;
26using ImGui::TableNextColumn;
27using ImGui::TableSetupColumn;
33 return absl::OkStatus();
37 if (BeginTabBar(
"Settings", ImGuiTabBarFlags_None)) {
69 return absl::OkStatus();
75 if (BeginTable(
"##SettingsTable", 4,
76 ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable |
77 ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
78 TableSetupColumn(
"System Flags", ImGuiTableColumnFlags_WidthStretch);
79 TableSetupColumn(
"Overworld Flags", ImGuiTableColumnFlags_WidthStretch);
80 TableSetupColumn(
"Dungeon Flags", ImGuiTableColumnFlags_WidthStretch);
81 TableSetupColumn(
"Resource Flags", ImGuiTableColumnFlags_WidthStretch,
103 ImGui::Text(
"Keyboard shortcut customization coming soon...");
114 using namespace ImGui;
122 Text(
"Current Theme:");
124 auto current = theme_manager.GetCurrentThemeName();
125 TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
"%s", current.c_str());
130 Text(
"Available Themes:");
131 for (
const auto& theme_name : theme_manager.GetAvailableThemes()) {
132 PushID(theme_name.c_str());
133 bool is_current = (theme_name == current);
136 PushStyleColor(ImGuiCol_Button, ImVec4(0.2f, 0.6f, 0.8f, 1.0f));
139 if (Button(theme_name.c_str(), ImVec2(180, 0))) {
140 theme_manager.LoadTheme(theme_name);
156 if (CollapsingHeader(
ICON_MD_EDIT " Theme Operations")) {
157 TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f),
158 "Theme import/export coming soon");
163 using namespace ImGui;
166 Text(
"No user settings available");
174 if (CollapsingHeader(
ICON_MD_SAVE " Auto-Save", ImGuiTreeNodeFlags_DefaultOpen)) {
181 if (SliderInt(
"Interval (seconds)", &interval, 60, 600)) {
201 Text(
"Editor to open on ROM load:");
202 const char* editors[] = {
"None",
"Overworld",
"Dungeon",
"Graphics" };
210 using namespace ImGui;
213 Text(
"No user settings available");
221 if (CollapsingHeader(
ICON_MD_IMAGE " Graphics", ImGuiTreeNodeFlags_DefaultOpen)) {
243 Text(
"Current FPS: %.1f", ImGui::GetIO().Framerate);
244 Text(
"Frame Time: %.3f ms", 1000.0f / ImGui::GetIO().Framerate);
248 using namespace ImGui;
251 Text(
"No user settings available");
259 if (CollapsingHeader(
ICON_MD_CLOUD " AI Provider", ImGuiTreeNodeFlags_DefaultOpen)) {
260 const char* providers[] = {
"Ollama (Local)",
"Gemini (Cloud)",
"Mock (Testing)" };
268 char url_buffer[256];
270 url_buffer[
sizeof(url_buffer) - 1] =
'\0';
271 if (InputText(
"URL", url_buffer, IM_ARRAYSIZE(url_buffer))) {
276 char key_buffer[128];
278 key_buffer[
sizeof(key_buffer) - 1] =
'\0';
279 if (InputText(
"API Key", key_buffer, IM_ARRAYSIZE(key_buffer), ImGuiInputTextFlags_Password)) {
287 if (CollapsingHeader(
ICON_MD_TUNE " Model Parameters")) {
291 TextDisabled(
"Higher = more creative");
314 if (CollapsingHeader(
ICON_MD_TERMINAL " CLI Logging", ImGuiTreeNodeFlags_DefaultOpen)) {
315 Text(
"Configure z3ed command-line logging behavior");
319 const char* log_levels[] = {
"Debug (Verbose)",
"Info (Normal)",
"Warning (Quiet)",
"Error (Critical)",
"Fatal Only" };
333 std::set<std::string> categories;
342 Text(
"✓ Log level applied");
344 TextDisabled(
"Controls verbosity of YAZE and z3ed output");
353 const char* home = std::getenv(
"HOME");
360 std::set<std::string> categories;
365 std::set<std::string> categories;
374 char path_buffer[512];
376 path_buffer[
sizeof(path_buffer) - 1] =
'\0';
377 if (InputText(
"Log File", path_buffer, IM_ARRAYSIZE(path_buffer))) {
380 std::set<std::string> categories;
386 TextDisabled(
"Log file path (supports ~ for home directory)");
395 TextDisabled(
"Enable/disable specific log categories");
398 bool categories_changed =
false;
405 if (categories_changed) {
407 std::set<std::string> categories;
427 if (std::filesystem::exists(path)) {
428 std::filesystem::remove(path);
437 std::filesystem::path dir = path.parent_path();
441 std::string cmd =
"explorer " + dir.string();
443 std::string cmd =
"open " + dir.string();
445 std::string cmd =
"xdg-open " + dir.string();
456 if (Button(
"Test Debug")) {
457 LOG_DEBUG(
"Settings",
"This is a debug message");
460 if (Button(
"Test Info")) {
461 LOG_INFO(
"Settings",
"This is an info message");
464 if (Button(
"Test Warning")) {
465 LOG_WARN(
"Settings",
"This is a warning message");
468 if (Button(
"Test Error")) {
469 LOG_ERROR(
"Settings",
"This is an error message");
void DrawGeneralSettings()
absl::Status Update() override
void DrawPerformanceSettings()
UserSettings * user_settings_
absl::Status Load() override
void Initialize() override
void DrawKeyboardShortcuts()
void DrawEditorBehavior()
void DrawAIAgentSettings()
RAII timer for automatic timing management.
static ThemeManager & Get()
static LogManager & instance()
void configure(LogLevel level, const std::string &file_path, const std::set< std::string > &categories)
Configures the logging system.
#define ICON_MD_FOLDER_OPEN
#define ICON_MD_FONT_DOWNLOAD
#define ICON_MD_BUG_REPORT
#define ICON_MD_PSYCHOLOGY
#define ICON_MD_FILTER_ALT
#define ICON_MD_SMART_TOY
#define LOG_DEBUG(category, format,...)
#define LOG_ERROR(category, format,...)
#define LOG_WARN(category, format,...)
#define LOG_INFO(category, format,...)
LogLevel
Defines the severity levels for log messages. This allows for filtering messages based on their impor...
Main namespace for the application.
std::string gemini_api_key
std::string log_file_path