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