yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
ui_helpers.cc
Go to the documentation of this file.
2
3#include <cstdarg>
4
5#include "absl/strings/str_format.h"
9#include "imgui/imgui.h"
10#include "imgui/imgui_internal.h"
11
12namespace yaze {
13namespace gui {
14
15// ============================================================================
16// Theme and Semantic Colors
17// ============================================================================
18
20 const auto& theme = ThemeManager::Get().GetCurrentTheme();
21 switch (color) {
23 return ConvertColorToImVec4(theme.primary);
25 return ConvertColorToImVec4(theme.secondary);
27 return ConvertColorToImVec4(theme.text_disabled);
29 return ConvertColorToImVec4(theme.error);
31 return ConvertColorToImVec4(theme.warning);
33 return ConvertColorToImVec4(theme.success);
35 return ConvertColorToImVec4(theme.info);
37 return ConvertColorToImVec4(theme.text_primary);
39 return ConvertColorToImVec4(theme.text_secondary);
40 }
41 return ConvertColorToImVec4(theme.text_primary);
42}
43
44ImVec4 GetThemeColor(ImGuiCol idx) {
45 return ImGui::GetStyle().Colors[idx];
46}
47
49 const auto& theme = ThemeManager::Get().GetCurrentTheme();
50 return ConvertColorToImVec4(theme.success);
51}
52
54 const auto& theme = ThemeManager::Get().GetCurrentTheme();
55 return ConvertColorToImVec4(theme.warning);
56}
57
58ImVec4 GetErrorColor() {
59 const auto& theme = ThemeManager::Get().GetCurrentTheme();
60 return ConvertColorToImVec4(theme.error);
61}
62
63ImVec4 GetInfoColor() {
64 const auto& theme = ThemeManager::Get().GetCurrentTheme();
65 return ConvertColorToImVec4(theme.info);
66}
67
69 const auto& theme = ThemeManager::Get().GetCurrentTheme();
70 return ConvertColorToImVec4(theme.accent);
71}
72
76
77// Entity/Map marker colors (vibrant with good visibility)
79 // Bright yellow with strong visibility
80 return ImVec4(1.0f, 0.9f, 0.0f, 0.85f); // Yellow-gold, high visibility
81}
82
83ImVec4 GetExitColor() {
84 // Bright cyan-white for contrast
85 return ImVec4(0.9f, 1.0f, 1.0f, 0.85f); // Cyan-white, high visibility
86}
87
88ImVec4 GetItemColor() {
89 // Vibrant red for items
90 return ImVec4(1.0f, 0.2f, 0.2f, 0.85f); // Bright red, high visibility
91}
92
94 // Bright magenta for sprites
95 return ImVec4(1.0f, 0.3f, 1.0f, 0.85f); // Bright magenta, high visibility
96}
97
99 const auto& theme = ThemeManager::Get().GetCurrentTheme();
100 return ConvertColorToImVec4(theme.accent);
101}
102
104 return ImVec4(1.0f, 0.5f, 0.0f, 1.0f); // Orange for locked items
105}
106
107// Status colors
109 return GetWarningColor(); // Yellow from theme
110}
111
113 return GetSuccessColor(); // Green from theme
114}
115
117 const auto& theme = ThemeManager::Get().GetCurrentTheme();
118 return ConvertColorToImVec4(theme.accent);
119}
120
121// ============================================================================
122// Colored Text Shortcuts
123// ============================================================================
124
125void ColoredText(const char* text, const ImVec4& color) {
126 ImGui::PushStyleColor(ImGuiCol_Text, color);
127 ImGui::TextUnformatted(text);
128 ImGui::PopStyleColor();
129}
130
131void ColoredTextF(const ImVec4& color, const char* fmt, ...) {
132 ImGui::PushStyleColor(ImGuiCol_Text, color);
133 va_list args;
134 va_start(args, fmt);
135 ImGui::TextV(fmt, args);
136 va_end(args);
137 ImGui::PopStyleColor();
138}
139
140void ThemedText(const char* text, SemanticColor color) {
141 ColoredText(text, ResolveSemanticColor(color));
142}
143
144void ThemedTextF(SemanticColor color, const char* fmt, ...) {
145 ImGui::PushStyleColor(ImGuiCol_Text, ResolveSemanticColor(color));
146 va_list args;
147 va_start(args, fmt);
148 ImGui::TextV(fmt, args);
149 va_end(args);
150 ImGui::PopStyleColor();
151}
152
153// ============================================================================
154// Button Color Sets
155// ============================================================================
156
158 const auto& theme = ThemeManager::Get().GetCurrentTheme();
159 ImVec4 base = ConvertColorToImVec4(theme.primary);
160 return {
161 base,
162 ImVec4(base.x * 1.2f, base.y * 1.2f, base.z * 1.2f, base.w),
163 ImVec4(base.x * 0.8f, base.y * 0.8f, base.z * 0.8f, base.w),
164 };
165}
166
168 const auto& theme = ThemeManager::Get().GetCurrentTheme();
169 ImVec4 base = ConvertColorToImVec4(theme.error);
170 return {
171 base,
172 ImVec4(base.x * 1.2f, base.y * 1.2f, base.z * 1.2f, base.w),
173 ImVec4(base.x * 0.8f, base.y * 0.8f, base.z * 0.8f, base.w),
174 };
175}
176
178 const auto& theme = ThemeManager::Get().GetCurrentTheme();
179 ImVec4 base = ConvertColorToImVec4(theme.success);
180 return {
181 base,
182 ImVec4(base.x * 1.2f, base.y * 1.2f, base.z * 1.2f, base.w),
183 ImVec4(base.x * 0.8f, base.y * 0.8f, base.z * 0.8f, base.w),
184 };
185}
186
188 const auto& theme = ThemeManager::Get().GetCurrentTheme();
189 ImVec4 base = ConvertColorToImVec4(theme.warning);
190 return {
191 base,
192 ImVec4(base.x * 1.2f, base.y * 1.2f, base.z * 1.2f, base.w),
193 ImVec4(base.x * 0.8f, base.y * 0.8f, base.z * 0.8f, base.w),
194 };
195}
196
197// ============================================================================
198// Themed Separator
199// ============================================================================
200
202 const auto& theme = ThemeManager::Get().GetCurrentTheme();
203 ImGui::PushStyleColor(ImGuiCol_Separator, ConvertColorToImVec4(theme.border));
204 ImGui::Separator();
205 ImGui::PopStyleColor();
206}
207
208// ============================================================================
209// Layout Helpers
210// ============================================================================
211
212void BeginField(const char* label, float label_width) {
213 ImGui::BeginGroup();
214 if (label_width > 0.0f) {
215 ImGui::Text("%s:", label);
216 ImGui::SameLine(label_width);
217 } else {
218 ImGui::TextUnformatted(label);
219 ImGui::SameLine();
220 }
221 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.6f);
222}
223
224void EndField() {
225 ImGui::PopItemWidth();
226 ImGui::EndGroup();
227}
228
229bool BeginPropertyTable(const char* id, int columns,
230 ImGuiTableFlags extra_flags) {
231 ImGuiTableFlags flags =
232 ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | extra_flags;
233 if (ImGui::BeginTable(id, columns, flags)) {
234 ImGui::TableSetupColumn("Property", ImGuiTableColumnFlags_WidthFixed, 150);
235 ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_WidthStretch);
236 return true;
237 }
238 return false;
239}
240
242 ImGui::EndTable();
243}
244
245void PropertyRow(const char* label, const char* value) {
246 ImGui::TableNextColumn();
247 ImGui::Text("%s", label);
248 ImGui::TableNextColumn();
249 ImGui::TextWrapped("%s", value);
250}
251
252void PropertyRow(const char* label, int value) {
253 ImGui::TableNextColumn();
254 ImGui::Text("%s", label);
255 ImGui::TableNextColumn();
256 ImGui::Text("%d", value);
257}
258
259void PropertyRowHex(const char* label, uint8_t value) {
260 ImGui::TableNextColumn();
261 ImGui::Text("%s", label);
262 ImGui::TableNextColumn();
263 ImGui::Text("0x%02X", value);
264}
265
266void PropertyRowHex(const char* label, uint16_t value) {
267 ImGui::TableNextColumn();
268 ImGui::Text("%s", label);
269 ImGui::TableNextColumn();
270 ImGui::Text("0x%04X", value);
271}
272
273void SectionHeader(const char* icon, const char* label, const ImVec4& color) {
274 ImGui::TextColored(color, "%s %s", icon, label);
275 ImGui::Separator();
276}
277
278// ============================================================================
279// Common Widget Patterns
280// ============================================================================
281
282bool IconButton(const char* icon, const char* label, const ImVec2& size) {
283 std::string button_text = std::string(icon) + " " + std::string(label);
284 return ImGui::Button(button_text.c_str(), size);
285}
286
287bool IconButton(const char* icon, const char* tooltip) {
288 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
289 bool clicked = ImGui::Button(icon);
290 ImGui::PopStyleColor();
291
292 if (tooltip && ImGui::IsItemHovered()) {
293 ImGui::SetTooltip("%s", tooltip);
294 }
295 return clicked;
296}
297
298bool ColoredButton(const char* label, ButtonType type, const ImVec2& size) {
299 ImVec4 color;
300 switch (type) {
302 color = GetSuccessColor();
303 break;
305 color = GetWarningColor();
306 break;
308 color = GetErrorColor();
309 break;
310 case ButtonType::Info:
311 color = GetInfoColor();
312 break;
313 default:
314 color = GetThemeColor(ImGuiCol_Button);
315 break;
316 }
317
318 ImGui::PushStyleColor(ImGuiCol_Button, color);
319 ImGui::PushStyleColor(
320 ImGuiCol_ButtonHovered,
321 ImVec4(color.x * 1.2f, color.y * 1.2f, color.z * 1.2f, color.w));
322 ImGui::PushStyleColor(
323 ImGuiCol_ButtonActive,
324 ImVec4(color.x * 0.8f, color.y * 0.8f, color.z * 0.8f, color.w));
325
326 bool result = ImGui::Button(label, size);
327
328 ImGui::PopStyleColor(3);
329 return result;
330}
331
332bool StyledButton(const char* label, const ImVec4& color, const ImVec2& size) {
333 ImGui::PushStyleColor(ImGuiCol_Button, color);
334 ImGui::PushStyleColor(
335 ImGuiCol_ButtonHovered,
336 ImVec4(color.x * 1.2f, color.y * 1.2f, color.z * 1.2f, color.w));
337 ImGui::PushStyleColor(
338 ImGuiCol_ButtonActive,
339 ImVec4(color.x * 0.8f, color.y * 0.8f, color.z * 0.8f, color.w));
340
341 bool result = ImGui::Button(label, size);
342
343 ImGui::PopStyleColor(3);
344 return result;
345}
346
347bool ToggleIconButton(const char* icon_on, const char* icon_off, bool* state,
348 const char* tooltip) {
349 const char* icon = *state ? icon_on : icon_off;
350 ImVec4 color = *state ? GetSuccessColor() : GetThemeColor(ImGuiCol_Button);
351
352 ImGui::PushStyleColor(ImGuiCol_Button, color);
353 bool result = ImGui::SmallButton(icon);
354 ImGui::PopStyleColor();
355
356 if (result)
357 *state = !*state;
358
359 if (tooltip && ImGui::IsItemHovered()) {
360 ImGui::SetTooltip("%s", tooltip);
361 }
362
363 return result;
364}
365
366bool ToggleButton(const char* label, bool active, const ImVec2& size) {
367 if (active) {
368 ImGui::PushStyleColor(ImGuiCol_Button, GetAccentColor());
369 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, GetAccentColor());
370 ImGui::PushStyleColor(ImGuiCol_ButtonActive, GetAccentColor());
371 }
372
373 bool result = ImGui::Button(label, size);
374
375 if (active) {
376 ImGui::PopStyleColor(3);
377 }
378
379 return result;
380}
381
382void HelpMarker(const char* desc) {
383 ImGui::TextDisabled(ICON_MD_HELP_OUTLINE);
384 if (ImGui::IsItemHovered()) {
385 ImGui::BeginTooltip();
386 ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
387 ImGui::TextUnformatted(desc);
388 ImGui::PopTextWrapPos();
389 ImGui::EndTooltip();
390 }
391}
392
393void SeparatorText(const char* label) {
394 ImGui::SeparatorText(label);
395}
396
397void StatusBadge(const char* text, ButtonType type) {
398 ImVec4 color;
399 switch (type) {
401 color = GetSuccessColor();
402 break;
404 color = GetWarningColor();
405 break;
407 color = GetErrorColor();
408 break;
409 case ButtonType::Info:
410 color = GetInfoColor();
411 break;
412 default:
413 color = GetThemeColor(ImGuiCol_Text);
414 break;
415 }
416
417 ImGui::PushStyleColor(ImGuiCol_Button, color);
418 ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 10.0f);
419 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(8, 3));
420 ImGui::SmallButton(text);
421 ImGui::PopStyleVar(2);
422 ImGui::PopStyleColor();
423}
424
425// ============================================================================
426// Editor-Specific Patterns
427// ============================================================================
428
429void BeginToolset(const char* id) {
430 ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(2, 2));
431 ImGui::BeginTable(id, 32, ImGuiTableFlags_SizingFixedFit);
432}
433
435 ImGui::EndTable();
436 ImGui::PopStyleVar();
437}
438
439void ToolsetButton(const char* icon, bool selected, const char* tooltip,
440 std::function<void()> on_click) {
441 ImGui::TableNextColumn();
442
443 if (selected) {
444 ImGui::PushStyleColor(ImGuiCol_Button, GetAccentColor());
445 }
446
447 if (ImGui::Button(icon)) {
448 if (on_click)
449 on_click();
450 }
451
452 if (selected) {
453 ImGui::PopStyleColor();
454 }
455
456 if (tooltip && ImGui::IsItemHovered()) {
457 ImGui::SetTooltip("%s", tooltip);
458 }
459}
460
461void BeginCanvasContainer(const char* id, bool scrollable) {
462 ImGuiWindowFlags flags = scrollable ? ImGuiWindowFlags_AlwaysVerticalScrollbar
463 : ImGuiWindowFlags_None;
464 ImGui::BeginChild(id, ImVec2(0, 0), true, flags);
465}
466
468 ImGui::EndChild();
469}
470
471bool EditorTabItem(const char* icon, const char* label, bool* p_open) {
472 char tab_label[256];
473 snprintf(tab_label, sizeof(tab_label), "%s %s", icon, label);
474 return ImGui::BeginTabItem(tab_label, p_open);
475}
476
477bool ConfirmationDialog(const char* id, const char* title, const char* message,
478 const char* confirm_text, const char* cancel_text) {
479 bool confirmed = false;
480
481 if (ImGui::BeginPopupModal(id, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
482 ImGui::Text("%s", title);
483 ImGui::Separator();
484 ImGui::TextWrapped("%s", message);
485 ImGui::Separator();
486
487 if (ColoredButton(confirm_text, ButtonType::Warning, ImVec2(120, 0))) {
488 confirmed = true;
489 ImGui::CloseCurrentPopup();
490 }
491
492 ImGui::SameLine();
493 if (ImGui::Button(cancel_text, ImVec2(120, 0))) {
494 ImGui::CloseCurrentPopup();
495 }
496
497 ImGui::EndPopup();
498 }
499
500 return confirmed;
501}
502
503// ============================================================================
504// Visual Indicators
505// ============================================================================
506
507void StatusIndicator(const char* label, bool active, const char* tooltip) {
508 ImVec4 color =
509 active ? GetSuccessColor() : GetThemeColor(ImGuiCol_TextDisabled);
510
511 ImDrawList* draw_list = ImGui::GetWindowDrawList();
512 ImVec2 pos = ImGui::GetCursorScreenPos();
513 float radius = 5.0f;
514
515 pos.x += radius + 3;
516 pos.y += ImGui::GetTextLineHeight() * 0.5f;
517
518 draw_list->AddCircleFilled(pos, radius, ImGui::GetColorU32(color));
519
520 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + radius * 2 + 8);
521 ImGui::Text("%s", label);
522
523 if (tooltip && ImGui::IsItemHovered()) {
524 ImGui::SetTooltip("%s", tooltip);
525 }
526}
527
528void RenderProviderBadge(const char* provider) {
529 const auto& theme = ThemeManager::Get().GetCurrentTheme();
530 ImVec4 color = ConvertColorToImVec4(theme.agent.provider_mock);
531
532 if (strcmp(provider, "ollama") == 0) {
533 color = ConvertColorToImVec4(theme.agent.provider_ollama);
534 } else if (strcmp(provider, "gemini") == 0) {
535 color = ConvertColorToImVec4(theme.agent.provider_gemini);
536 } else if (strcmp(provider, "anthropic") == 0) {
537 color = ConvertColorToImVec4(theme.agent.provider_openai);
538 } else if (strcmp(provider, "openai") == 0) {
539 color = ConvertColorToImVec4(theme.agent.provider_openai);
540 }
541
542 ImGui::PushStyleColor(ImGuiCol_Text, color);
543 ImGui::Text("[%s]", provider);
544 ImGui::PopStyleColor();
545}
546
547void RomVersionBadge(const char* version, bool is_vanilla) {
548 ImVec4 color = is_vanilla ? GetWarningColor() : GetSuccessColor();
549 const char* icon = is_vanilla ? ICON_MD_INFO : ICON_MD_CHECK_CIRCLE;
550
551 ImGui::PushStyleColor(ImGuiCol_Text, color);
552 ImGui::Text("%s %s", icon, version);
553 ImGui::PopStyleColor();
554}
555
556void LockIndicator(bool locked, const char* label) {
557 if (locked) {
558 ImGui::TextColored(GetLockedColor(), ICON_MD_LOCK " %s (Locked)", label);
559 } else {
560 ImGui::Text(ICON_MD_LOCK_OPEN " %s", label);
561 }
562}
563
564// ============================================================================
565// Spacing and Alignment
566// ============================================================================
567
568void VerticalSpacing(float pixels) {
569 ImGui::Dummy(ImVec2(0, pixels));
570}
571
572void HorizontalSpacing(float pixels) {
573 ImGui::Dummy(ImVec2(pixels, 0));
574 ImGui::SameLine();
575}
576
577void CenterText(const char* text) {
578 float text_width = ImGui::CalcTextSize(text).x;
579 ImGui::SetCursorPosX((ImGui::GetContentRegionAvail().x - text_width) * 0.5f);
580 ImGui::Text("%s", text);
581}
582
583void RightAlign(float width) {
584 ImGui::SetCursorPosX(ImGui::GetCursorPosX() +
585 ImGui::GetContentRegionAvail().x - width);
586}
587
588// ============================================================================
589// Animation Helpers
590// ============================================================================
591
592float GetPulseAlpha(float speed) {
593 return 0.5f +
594 0.5f * sinf(static_cast<float>(ImGui::GetTime()) * speed * 2.0f);
595}
596
597float GetFadeIn(float duration) {
598 static double start_time = 0.0;
599 double current_time = ImGui::GetTime();
600
601 if (start_time == 0.0) {
602 start_time = current_time;
603 }
604
605 float elapsed = static_cast<float>(current_time - start_time);
606 float alpha = ImClamp(elapsed / duration, 0.0f, 1.0f);
607
608 // Reset after complete
609 if (alpha >= 1.0f) {
610 start_time = 0.0;
611 }
612
613 return alpha;
614}
615
616void PushPulseEffect(float speed) {
617 ImGui::PushStyleVar(ImGuiStyleVar_Alpha,
618 ImGui::GetStyle().Alpha * GetPulseAlpha(speed));
619}
620
622 ImGui::PopStyleVar();
623}
624
625void LoadingSpinner(const char* label, float radius) {
626 ImDrawList* draw_list = ImGui::GetWindowDrawList();
627 ImVec2 pos = ImGui::GetCursorScreenPos();
628 pos.x += radius + 4;
629 pos.y += radius + 4;
630
631 const float rotation = static_cast<float>(ImGui::GetTime()) * 3.0f;
632 const int segments = 16;
633 const float thickness = 3.0f;
634
635 const float start_angle = rotation;
636 const float end_angle = rotation + IM_PI * 1.5f;
637
638 draw_list->PathArcTo(pos, radius, start_angle, end_angle, segments);
639 draw_list->PathStroke(ImGui::GetColorU32(GetAccentColor()), 0, thickness);
640
641 if (label) {
642 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + radius * 2 + 8);
643 ImGui::Text("%s", label);
644 } else {
645 ImGui::Dummy(ImVec2(radius * 2 + 8, radius * 2 + 8));
646 }
647}
648
649// ============================================================================
650// Responsive Layout Helpers
651// ============================================================================
652
653float GetResponsiveWidth(float min_width, float max_width, float ratio) {
654 float available = ImGui::GetContentRegionAvail().x;
655 float target = available * ratio;
656
657 if (target < min_width)
658 return min_width;
659 if (target > max_width)
660 return max_width;
661 return target;
662}
663
664void SetupResponsiveColumns(int count, float min_col_width) {
665 float available = ImGui::GetContentRegionAvail().x;
666 float col_width = available / count;
667
668 if (col_width < min_col_width) {
669 col_width = min_col_width;
670 }
671
672 for (int i = 0; i < count; ++i) {
673 ImGui::TableSetupColumn("##col", ImGuiTableColumnFlags_WidthFixed,
674 col_width);
675 }
676}
677
678static int g_two_col_table_active = 0;
679
680void BeginTwoColumns(const char* id, float split_ratio) {
681 ImGuiTableFlags flags = ImGuiTableFlags_Resizable |
682 ImGuiTableFlags_BordersInnerV |
683 ImGuiTableFlags_SizingStretchProp;
684
685 if (ImGui::BeginTable(id, 2, flags)) {
686 float available = ImGui::GetContentRegionAvail().x;
687 ImGui::TableSetupColumn("##left", ImGuiTableColumnFlags_None,
688 available * split_ratio);
689 ImGui::TableSetupColumn("##right", ImGuiTableColumnFlags_None,
690 available * (1.0f - split_ratio));
691 ImGui::TableNextRow();
692 ImGui::TableNextColumn();
693 g_two_col_table_active++;
694 }
695}
696
698 ImGui::TableNextColumn();
699}
700
702 ImGui::EndTable();
703 g_two_col_table_active--;
704}
705
706// ============================================================================
707// Input Helpers
708// ============================================================================
709
710bool LabeledInputHex(const char* label, uint8_t* value) {
711 BeginField(label);
712 ImGui::PushItemWidth(60);
713 bool changed =
714 ImGui::InputScalar("##hex", ImGuiDataType_U8, value, nullptr, nullptr,
715 "%02X", ImGuiInputTextFlags_CharsHexadecimal);
716 ImGui::PopItemWidth();
717 EndField();
718 return changed;
719}
720
721bool LabeledInputHex(const char* label, uint16_t* value) {
722 BeginField(label);
723 ImGui::PushItemWidth(80);
724 bool changed =
725 ImGui::InputScalar("##hex", ImGuiDataType_U16, value, nullptr, nullptr,
726 "%04X", ImGuiInputTextFlags_CharsHexadecimal);
727 ImGui::PopItemWidth();
728 EndField();
729 return changed;
730}
731
732bool IconCombo(const char* icon, const char* label, int* current,
733 const char* const items[], int count) {
734 ImGui::Text("%s", icon);
735 ImGui::SameLine();
736 return ImGui::Combo(label, current, items, count);
737}
738
739std::string MakePanelTitle(const std::string& title) {
740 return title;
741}
742
743} // namespace gui
744} // namespace yaze
const Theme & GetCurrentTheme() const
static ThemeManager & Get()
#define ICON_MD_INFO
Definition icons.h:993
#define ICON_MD_LOCK_OPEN
Definition icons.h:1142
#define ICON_MD_LOCK
Definition icons.h:1140
#define ICON_MD_CHECK_CIRCLE
Definition icons.h:400
#define ICON_MD_HELP_OUTLINE
Definition icons.h:935
void RightAlign(float width)
void VerticalSpacing(float pixels)
void EndCanvasContainer()
void BeginToolset(const char *id)
ImVec4 ConvertColorToImVec4(const Color &color)
Definition color.h:134
std::string MakePanelTitle(const std::string &title)
ImVec4 GetVanillaRomColor()
void EndPropertyTable()
void PropertyRow(const char *label, const char *value)
void ColoredText(const char *text, const ImVec4 &color)
ButtonColorSet GetWarningButtonColors()
ButtonColorSet GetDangerButtonColors()
bool ToggleIconButton(const char *icon_on, const char *icon_off, bool *state, const char *tooltip)
ImVec4 GetSuccessColor()
Definition ui_helpers.cc:48
void BeginField(const char *label, float label_width)
void SeparatorText(const char *label)
void EndField()
ImVec4 GetLockedColor()
void StatusIndicator(const char *label, bool active, const char *tooltip)
ImVec4 GetSelectedColor()
Definition ui_helpers.cc:98
void BeginTwoColumns(const char *id, float split_ratio)
void RomVersionBadge(const char *version, bool is_vanilla)
bool EditorTabItem(const char *icon, const char *label, bool *p_open)
ImVec4 GetEntranceColor()
Definition ui_helpers.cc:78
void CenterText(const char *text)
bool LabeledInputHex(const char *label, uint8_t *value)
void SectionHeader(const char *icon, const char *label, const ImVec4 &color)
void LockIndicator(bool locked, const char *label)
bool IconButton(const char *icon, const char *label, const ImVec2 &size)
void EndToolset()
ImVec4 GetSpriteColor()
Definition ui_helpers.cc:93
void PropertyRowHex(const char *label, uint8_t value)
bool ToggleButton(const char *label, bool active, const ImVec2 &size)
float GetResponsiveWidth(float min_width, float max_width, float ratio)
void SwitchColumn()
void SetupResponsiveColumns(int count, float min_col_width)
ButtonColorSet GetSuccessButtonColors()
bool ColoredButton(const char *label, ButtonType type, const ImVec2 &size)
bool BeginPropertyTable(const char *id, int columns, ImGuiTableFlags extra_flags)
void BeginCanvasContainer(const char *id, bool scrollable)
ImVec4 GetItemColor()
Definition ui_helpers.cc:88
bool IconCombo(const char *icon, const char *label, int *current, const char *const items[], int count)
void LoadingSpinner(const char *label, float radius)
ImVec4 GetDisabledColor()
Definition ui_helpers.cc:73
void ColoredTextF(const ImVec4 &color, const char *fmt,...)
ImVec4 GetErrorColor()
Definition ui_helpers.cc:58
void ToolsetButton(const char *icon, bool selected, const char *tooltip, std::function< void()> on_click)
ImVec4 GetWarningColor()
Definition ui_helpers.cc:53
bool ConfirmationDialog(const char *id, const char *title, const char *message, const char *confirm_text, const char *cancel_text)
void EndTwoColumns()
ImVec4 GetModifiedColor()
bool StyledButton(const char *label, const ImVec4 &color, const ImVec2 &size)
void PopPulseEffect()
ImVec4 GetInfoColor()
Definition ui_helpers.cc:63
float GetFadeIn(float duration)
float GetPulseAlpha(float speed)
void PushPulseEffect(float speed)
ImVec4 GetExitColor()
Definition ui_helpers.cc:83
void ThemedSeparator()
void HelpMarker(const char *desc)
Color GetThemeColor(const std::string &color_name)
void RenderProviderBadge(const char *provider)
void StatusBadge(const char *text, ButtonType type)
void ThemedText(const char *text, SemanticColor color)
void HorizontalSpacing(float pixels)
void ThemedTextF(SemanticColor color, const char *fmt,...)
ImVec4 GetAccentColor()
Definition ui_helpers.cc:68
ImVec4 GetCustomRomColor()
ButtonColorSet GetPrimaryButtonColors()
ImVec4 ResolveSemanticColor(SemanticColor color)
Definition ui_helpers.cc:19
#define IM_PI