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 BeginCanvasContainer(const char* id, bool scrollable) {
431 ImGuiWindowFlags flags = scrollable ? ImGuiWindowFlags_AlwaysVerticalScrollbar
432 : ImGuiWindowFlags_None;
433 ImGui::BeginChild(id, ImVec2(0, 0), true, flags);
434}
435
437 ImGui::EndChild();
438}
439
440bool EditorTabItem(const char* icon, const char* label, bool* p_open) {
441 char tab_label[256];
442 snprintf(tab_label, sizeof(tab_label), "%s %s", icon, label);
443 return ImGui::BeginTabItem(tab_label, p_open);
444}
445
446bool ConfirmationDialog(const char* id, const char* title, const char* message,
447 const char* confirm_text, const char* cancel_text) {
448 bool confirmed = false;
449
450 if (ImGui::BeginPopupModal(id, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
451 ImGui::Text("%s", title);
452 ImGui::Separator();
453 ImGui::TextWrapped("%s", message);
454 ImGui::Separator();
455
456 if (ColoredButton(confirm_text, ButtonType::Warning, ImVec2(120, 0))) {
457 confirmed = true;
458 ImGui::CloseCurrentPopup();
459 }
460
461 ImGui::SameLine();
462 if (ImGui::Button(cancel_text, ImVec2(120, 0))) {
463 ImGui::CloseCurrentPopup();
464 }
465
466 ImGui::EndPopup();
467 }
468
469 return confirmed;
470}
471
472// ============================================================================
473// Visual Indicators
474// ============================================================================
475
476void StatusIndicator(const char* label, bool active, const char* tooltip) {
477 ImVec4 color =
478 active ? GetSuccessColor() : GetThemeColor(ImGuiCol_TextDisabled);
479
480 ImDrawList* draw_list = ImGui::GetWindowDrawList();
481 ImVec2 pos = ImGui::GetCursorScreenPos();
482 float radius = 5.0f;
483
484 pos.x += radius + 3;
485 pos.y += ImGui::GetTextLineHeight() * 0.5f;
486
487 draw_list->AddCircleFilled(pos, radius, ImGui::GetColorU32(color));
488
489 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + radius * 2 + 8);
490 ImGui::Text("%s", label);
491
492 if (tooltip && ImGui::IsItemHovered()) {
493 ImGui::SetTooltip("%s", tooltip);
494 }
495}
496
497void RenderProviderBadge(const char* provider) {
498 const auto& theme = ThemeManager::Get().GetCurrentTheme();
499 ImVec4 color = ConvertColorToImVec4(theme.agent.provider_mock);
500
501 if (strcmp(provider, "ollama") == 0) {
502 color = ConvertColorToImVec4(theme.agent.provider_ollama);
503 } else if (strcmp(provider, "gemini") == 0) {
504 color = ConvertColorToImVec4(theme.agent.provider_gemini);
505 } else if (strcmp(provider, "anthropic") == 0) {
506 color = ConvertColorToImVec4(theme.agent.provider_openai);
507 } else if (strcmp(provider, "openai") == 0) {
508 color = ConvertColorToImVec4(theme.agent.provider_openai);
509 }
510
511 ImGui::PushStyleColor(ImGuiCol_Text, color);
512 ImGui::Text("[%s]", provider);
513 ImGui::PopStyleColor();
514}
515
516void RomVersionBadge(const char* version, bool is_vanilla) {
517 ImVec4 color = is_vanilla ? GetWarningColor() : GetSuccessColor();
518 const char* icon = is_vanilla ? ICON_MD_INFO : ICON_MD_CHECK_CIRCLE;
519
520 ImGui::PushStyleColor(ImGuiCol_Text, color);
521 ImGui::Text("%s %s", icon, version);
522 ImGui::PopStyleColor();
523}
524
525void LockIndicator(bool locked, const char* label) {
526 if (locked) {
527 ImGui::TextColored(GetLockedColor(), ICON_MD_LOCK " %s (Locked)", label);
528 } else {
529 ImGui::Text(ICON_MD_LOCK_OPEN " %s", label);
530 }
531}
532
533// ============================================================================
534// Spacing and Alignment
535// ============================================================================
536
537void VerticalSpacing(float pixels) {
538 ImGui::Dummy(ImVec2(0, pixels));
539}
540
541void HorizontalSpacing(float pixels) {
542 ImGui::Dummy(ImVec2(pixels, 0));
543 ImGui::SameLine();
544}
545
546void CenterText(const char* text) {
547 float text_width = ImGui::CalcTextSize(text).x;
548 ImGui::SetCursorPosX((ImGui::GetContentRegionAvail().x - text_width) * 0.5f);
549 ImGui::Text("%s", text);
550}
551
552void RightAlign(float width) {
553 ImGui::SetCursorPosX(ImGui::GetCursorPosX() +
554 ImGui::GetContentRegionAvail().x - width);
555}
556
557// ============================================================================
558// Animation Helpers
559// ============================================================================
560
561float GetPulseAlpha(float speed) {
562 return 0.5f +
563 0.5f * sinf(static_cast<float>(ImGui::GetTime()) * speed * 2.0f);
564}
565
566float GetFadeIn(float duration) {
567 static double start_time = 0.0;
568 double current_time = ImGui::GetTime();
569
570 if (start_time == 0.0) {
571 start_time = current_time;
572 }
573
574 float elapsed = static_cast<float>(current_time - start_time);
575 float alpha = ImClamp(elapsed / duration, 0.0f, 1.0f);
576
577 // Reset after complete
578 if (alpha >= 1.0f) {
579 start_time = 0.0;
580 }
581
582 return alpha;
583}
584
585void PushPulseEffect(float speed) {
586 ImGui::PushStyleVar(ImGuiStyleVar_Alpha,
587 ImGui::GetStyle().Alpha * GetPulseAlpha(speed));
588}
589
591 ImGui::PopStyleVar();
592}
593
594void LoadingSpinner(const char* label, float radius) {
595 ImDrawList* draw_list = ImGui::GetWindowDrawList();
596 ImVec2 pos = ImGui::GetCursorScreenPos();
597 pos.x += radius + 4;
598 pos.y += radius + 4;
599
600 const float rotation = static_cast<float>(ImGui::GetTime()) * 3.0f;
601 const int segments = 16;
602 const float thickness = 3.0f;
603
604 const float start_angle = rotation;
605 const float end_angle = rotation + IM_PI * 1.5f;
606
607 draw_list->PathArcTo(pos, radius, start_angle, end_angle, segments);
608 draw_list->PathStroke(ImGui::GetColorU32(GetAccentColor()), thickness);
609
610 if (label) {
611 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + radius * 2 + 8);
612 ImGui::Text("%s", label);
613 } else {
614 ImGui::Dummy(ImVec2(radius * 2 + 8, radius * 2 + 8));
615 }
616}
617
618// ============================================================================
619// Responsive Layout Helpers
620// ============================================================================
621
622float GetResponsiveWidth(float min_width, float max_width, float ratio) {
623 float available = ImGui::GetContentRegionAvail().x;
624 float target = available * ratio;
625
626 if (target < min_width)
627 return min_width;
628 if (target > max_width)
629 return max_width;
630 return target;
631}
632
633void SetupResponsiveColumns(int count, float min_col_width) {
634 float available = ImGui::GetContentRegionAvail().x;
635 float col_width = available / count;
636
637 if (col_width < min_col_width) {
638 col_width = min_col_width;
639 }
640
641 for (int i = 0; i < count; ++i) {
642 ImGui::TableSetupColumn("##col", ImGuiTableColumnFlags_WidthFixed,
643 col_width);
644 }
645}
646
647static int g_two_col_table_active = 0;
648
649void BeginTwoColumns(const char* id, float split_ratio) {
650 ImGuiTableFlags flags = ImGuiTableFlags_Resizable |
651 ImGuiTableFlags_BordersInnerV |
652 ImGuiTableFlags_SizingStretchProp;
653
654 if (ImGui::BeginTable(id, 2, flags)) {
655 float available = ImGui::GetContentRegionAvail().x;
656 ImGui::TableSetupColumn("##left", ImGuiTableColumnFlags_None,
657 available * split_ratio);
658 ImGui::TableSetupColumn("##right", ImGuiTableColumnFlags_None,
659 available * (1.0f - split_ratio));
660 ImGui::TableNextRow();
661 ImGui::TableNextColumn();
662 g_two_col_table_active++;
663 }
664}
665
667 ImGui::TableNextColumn();
668}
669
671 ImGui::EndTable();
672 g_two_col_table_active--;
673}
674
675// ============================================================================
676// Input Helpers
677// ============================================================================
678
679bool LabeledInputHex(const char* label, uint8_t* value) {
680 BeginField(label);
681 ImGui::PushItemWidth(60);
682 bool changed =
683 ImGui::InputScalar("##hex", ImGuiDataType_U8, value, nullptr, nullptr,
684 "%02X", ImGuiInputTextFlags_CharsHexadecimal);
685 ImGui::PopItemWidth();
686 EndField();
687 return changed;
688}
689
690bool LabeledInputHex(const char* label, uint16_t* value) {
691 BeginField(label);
692 ImGui::PushItemWidth(80);
693 bool changed =
694 ImGui::InputScalar("##hex", ImGuiDataType_U16, value, nullptr, nullptr,
695 "%04X", ImGuiInputTextFlags_CharsHexadecimal);
696 ImGui::PopItemWidth();
697 EndField();
698 return changed;
699}
700
701bool IconCombo(const char* icon, const char* label, int* current,
702 const char* const items[], int count) {
703 ImGui::Text("%s", icon);
704 ImGui::SameLine();
705 return ImGui::Combo(label, current, items, count);
706}
707
708std::string MakePanelTitle(const std::string& title) {
709 return title;
710}
711
712} // namespace gui
713} // 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()
ImVec4 ConvertColorToImVec4(const Color &color)
Definition color.h:140
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)
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
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