39 lines
766 B
C
39 lines
766 B
C
/**
|
|
* Copyright (c) 2021 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "../libs.h"
|
|
|
|
#define MENU_ITEMS_COLUMNS_MAX 16
|
|
#define MENU_ITEMS_ROWS_MAX 128
|
|
#define MENU_ITEMS_MAX MENU_ITEMS_COLUMNS_MAX * MENU_ITEMS_ROWS_MAX
|
|
|
|
#define MENU_DIRECTION_DOWN 0x01
|
|
#define MENU_DIRECTION_UP 0x02
|
|
#define MENU_DIRECTION_LEFT 0x03
|
|
#define MENU_DIRECTION_RIGHT 0x04
|
|
|
|
#define MENU_HOLD_DURATION 1.0
|
|
|
|
typedef struct {
|
|
int32_t x;
|
|
int32_t y;
|
|
int32_t width;
|
|
int32_t height;
|
|
int32_t i;
|
|
} menuitem_t;
|
|
|
|
typedef struct {
|
|
menuitem_t items[MENU_ITEMS_MAX];
|
|
int32_t itemCount;
|
|
int32_t selected;
|
|
int32_t cursorX;
|
|
int32_t cursorY;
|
|
|
|
// bool holdAllow;
|
|
// float holdLast;
|
|
} menu_t; |