summaryrefslogtreecommitdiff
path: root/src/ui_elements/UI.c
diff options
context:
space:
mode:
authorphysick <mynameisgennadiy@vk.com>2026-08-29 14:12:24 +0500
committerphysick <mynameisgennadiy@vk.com>2026-08-29 14:12:24 +0500
commitd51d95b66dee211ef654693fb23238d5a234f48c (patch)
treef225999b981091944a1e7442e22fb0a0af2f4003 /src/ui_elements/UI.c
parent52ab86e5f55b189aea4198fe4d15a29c4d3c9d57 (diff)
merged branches
Diffstat (limited to 'src/ui_elements/UI.c')
-rw-r--r--src/ui_elements/UI.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ui_elements/UI.c b/src/ui_elements/UI.c
index e3a0048..9daed74 100644
--- a/src/ui_elements/UI.c
+++ b/src/ui_elements/UI.c
@@ -1,5 +1,6 @@
#include "UI.h"
#include <raylib.h>
+#include "../resources/resources.h"
const int MAX_LINES = 8192;
const int SPACING_H = 1;
@@ -106,3 +107,32 @@ void GetPanesSplit(Rectangle *pane1, Rectangle *pane2, Rectangle body, float pro
pane2->width = (body.width - PADDING) * (1 - proportion_h);
}
+void DrawPageView(int y, unsigned int pages, unsigned int current_page) {
+ if (pages == 0) return;
+ float width = 2 * PAGE_DOTS_PADDING
+ + PAGE_DOTS_RADIUS * 2 * pages
+ + PAGE_DOTS_SPACING * (pages - 1);
+
+ Rectangle rec = {
+ .x = (GetScreenWidth() - width) / 2, // TODO
+ .y = y,
+ .height = PAGE_DOTS_RADIUS * 2 + 2 * PAGE_DOTS_PADDING,
+ .width = width,
+ };
+
+ Color color = {
+ .r = COLORSCHEME_WHITE.r,
+ .g = COLORSCHEME_WHITE.g,
+ .b = COLORSCHEME_WHITE.b,
+ .a = COLORSCHEME_WHITE.a & PAGE_DOTS_TRANSPARENCY };
+
+ DrawRectangleRounded(rec, 0.15f, 8, color);
+
+ int x_pos = (int)rec.x + PAGE_DOTS_PADDING + PAGE_DOTS_RADIUS;
+ int y_pos = (int)rec.y + PAGE_DOTS_PADDING + PAGE_DOTS_RADIUS;
+ for (int i = 0; i < pages; ++i) {
+ Color color = i == current_page ? COLORSCHEME_ORANGE : COLORSCHEME_BROWN;
+ DrawCircle(x_pos, y_pos, PAGE_DOTS_RADIUS, color);
+ x_pos += PAGE_DOTS_SPACING + PAGE_DOTS_RADIUS * 2;
+ }
+}