diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-08-31 03:46:59 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-08-31 03:46:59 +0500 |
| commit | b45620544427306854a28a5163fafd45b007acc2 (patch) | |
| tree | dff055ee4a0af559ba7559349d98507710d35631 /src/puzzles/puzzle.h | |
| parent | e515240297e1d8dd6f23308f0bffcda7464486e7 (diff) | |
puzzle collection selection
Diffstat (limited to 'src/puzzles/puzzle.h')
| -rw-r--r-- | src/puzzles/puzzle.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h index 21d8944..5af6d6e 100644 --- a/src/puzzles/puzzle.h +++ b/src/puzzles/puzzle.h @@ -100,17 +100,27 @@ typedef enum { } CollectionElementType; +/// A collection node. Corresponds to either a directory in the FS or a .pz file typedef struct CollectionElement { + /// The icon used for the puzzles in the collection Texture2D icon; + /// Used in the click detection. Do not modify from user space Rectangle _previousFramePosition; + /// The path to the directory/puzzle char *path; + /// The display name of an element char *name; + /// The tree child nodes array struct CollectionElement *children; - void (*callback)(struct CollectionElement *); + /// The tree child nodes count size_t childCount; + /// OnClick callback + void (*callback)(struct CollectionElement *); + /// If the element is initialized it has children and an icon loaded into mem bool IsInitialized; + /// The element has an icon bool hasIcon; - bool isPressed; + /// The type of the element CollectionElementType type; } CollectionElement; @@ -120,5 +130,6 @@ typedef struct CollectionElement { void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElement *)); void DrawCollectionElement(CollectionElement *el, CollectionElement *parent, Rectangle rec); void UpdateCollectionElement(CollectionElement *el); +void DeinitCollectionElement(CollectionElement *el); #endif // PUZZLE_H |
