diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-08-31 02:13:58 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-08-31 02:13:58 +0500 |
| commit | e515240297e1d8dd6f23308f0bffcda7464486e7 (patch) | |
| tree | 3f684236b27b99a8712456f844cba01503d2b360 /src/scenes/collectionScene.c | |
| parent | ce9cbb6c0dbd8c920fdb87389332028cdd60ccc1 (diff) | |
collection element callback
Diffstat (limited to 'src/scenes/collectionScene.c')
| -rw-r--r-- | src/scenes/collectionScene.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/scenes/collectionScene.c b/src/scenes/collectionScene.c index 17d36c9..fff814a 100644 --- a/src/scenes/collectionScene.c +++ b/src/scenes/collectionScene.c @@ -24,6 +24,11 @@ CollectionSceneData *getData(void *self) { return ((Scene *)self)->data; } +void collectionElement_onSelect(CollectionElement *caller) { + if (caller == NULL) return; + TraceLog(LOG_INFO, "Selected element %s", caller->name); +} + void DrawCollectionName(char *name) { Vector2 width = MeasureTextEx(*GetMainFont(), name, 50, 1); int screen_width = GetScreenWidth(); @@ -44,6 +49,11 @@ char *getCollectionName(char *path) { } bool updateCollectionScene(void *self) { + CollectionSceneData *data = getData(self); + if (data->collection != NULL) + for (size_t i = 0; i < data->collection->childCount; ++i) { + UpdateCollectionElement(&data->collection->children[i]); + } return true; } @@ -93,7 +103,7 @@ Scene *CreatePuzzleCollectionScene(char *path, CollectionElement *el) { data->DirPath = ArenaStrdup(&data->arena, path); data->Name = getCollectionName(path); - if (!el->IsInitialized) InitializeCollection(el); + if (!el->IsInitialized) InitializeCollection(el, collectionElement_onSelect); data->collection = el; outp->data = data; |
