Mercurial
diff infinite_canvas/dev_ui.c @ 280:49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 18 Aug 2026 19:14:53 -0700 |
| parents | 8d560f50ed4c |
| children | c57149ad216e |
line wrap: on
line diff
--- a/infinite_canvas/dev_ui.c Mon Aug 17 22:22:36 2026 -0700 +++ b/infinite_canvas/dev_ui.c Tue Aug 18 19:14:53 2026 -0700 @@ -5,7 +5,8 @@ #define RAYGUI_IMPLEMENTATION #include "third_party/raylib/include/raygui.h" -static const Rectangle DEV_PANEL = {18.0f, 18.0f, 264.0f, 478.0f}; +static const Rectangle DEV_PANEL = {18.0f, 18.0f, 264.0f, 520.0f}; +static const Rectangle DEV_PANEL_COLLAPSED = {18.0f, 18.0f, 44.0f, 44.0f}; static Rectangle Canvas_Dev_UI_Context_Bounds(void) { @@ -206,6 +207,7 @@ { *p_ui = (Canvas_Dev_UI){ .selected_type = CANVAS_ENTITY_RECTANGLE, + .collapsed = FALSE, .dropdown_open = FALSE, .context_open = FALSE, }; @@ -219,7 +221,11 @@ if (p_ui->dropdown_open) return TRUE; Vector2 pointer = GetMousePosition(); - if (CheckCollisionPointRec(pointer, DEV_PANEL)) return TRUE; + if (CheckCollisionPointRec( + pointer, + p_ui->collapsed ? DEV_PANEL_COLLAPSED : DEV_PANEL)) { + return TRUE; + } if (p_ui->context_open && CheckCollisionPointRec(pointer, Canvas_Dev_UI_Context_Bounds())) { return TRUE; @@ -234,6 +240,35 @@ Font font, Canvas_Theme *p_theme) { + if (p_ui->collapsed) { + Canvas_Theme_Draw_Shadow( + p_theme, + DEV_PANEL_COLLAPSED, + 0.24f, + 12, + 1.0f, + 1.0f); + DrawRectangleRounded( + DEV_PANEL_COLLAPSED, + 0.24f, + 12, + p_theme->surface); + DrawRectangleRoundedLinesEx( + DEV_PANEL_COLLAPSED, + 0.24f, + 12, + 1.0f, + p_theme->border); + if (GuiButtonRounded( + (Rectangle){24.0f, 24.0f, 32.0f, 32.0f}, + ">", + 0.30f, + 10)) { + p_ui->collapsed = FALSE; + } + return; + } + Canvas_Context_Snapshot context = Canvas_Scene_Build_Visible_Context( p_scene, p_camera, @@ -256,6 +291,16 @@ 12.0f, 0.1f, p_theme->text_muted); + if (GuiButtonRounded( + (Rectangle){230.0f, 30.0f, 36.0f, 30.0f}, + "<", + 0.30f, + 10)) { + p_ui->collapsed = TRUE; + p_ui->dropdown_open = FALSE; + p_ui->context_open = FALSE; + return; + } if (p_ui->dropdown_open) GuiLock(); @@ -322,19 +367,28 @@ Canvas_Scene_Show_Lucide_Gallery(p_scene, p_camera); } - DrawTextEx(font, TextFormat("%d FPS", GetFPS()), (Vector2){34.0f, 396.0f}, 12.0f, 0.0f, p_theme->text_muted); - DrawTextEx(font, TextFormat("%.2fx zoom", p_camera->zoom), (Vector2){104.0f, 396.0f}, 12.0f, 0.0f, p_theme->text_muted); + size_t parked_count = Canvas_Scene_Parked_Conversation_Count(p_scene); + if (GuiButtonRounded( + (Rectangle){34.0f, 378.0f, 232.0f, 34.0f}, + TextFormat("Parking lot (%d)", (int)parked_count), + 0.32f, + 10)) { + Canvas_Scene_Show_Parking_Lot(p_scene, p_camera); + } + + DrawTextEx(font, TextFormat("%d FPS", GetFPS()), (Vector2){34.0f, 438.0f}, 12.0f, 0.0f, p_theme->text_muted); + DrawTextEx(font, TextFormat("%.2fx zoom", p_camera->zoom), (Vector2){104.0f, 438.0f}, 12.0f, 0.0f, p_theme->text_muted); DrawTextEx( font, TextFormat("%d objects", (int)Dowa_Array_Length(p_scene->p_entities)), - (Vector2){196.0f, 396.0f}, + (Vector2){196.0f, 438.0f}, 12.0f, 0.0f, p_theme->text_muted); DrawTextEx( font, "Drag objects directly on the canvas", - (Vector2){34.0f, 442.0f}, + (Vector2){34.0f, 484.0f}, 12.0f, 0.0f, p_theme->text_muted);