Support selecting a menu and terminate execution if so
This commit is contained in:
@@ -11,17 +11,20 @@ namespace Menu {
|
||||
const char* name;
|
||||
};
|
||||
|
||||
typedef void (*Callback)(uint32_t selection);
|
||||
|
||||
private:
|
||||
Callback selection_callback;
|
||||
const Entry* entries;
|
||||
size_t size;
|
||||
uint8_t cur_selection;
|
||||
|
||||
public:
|
||||
void setup(const Entry* entries, size_t size);
|
||||
void setup(Callback callback, const Entry* entries, size_t size);
|
||||
|
||||
template<size_t N>
|
||||
void setup(const Entry (&entries)[N]) {
|
||||
SimpleMenu::setup(entries, N);
|
||||
void setup(Callback callback, const Entry (&entries)[N]) {
|
||||
SimpleMenu::setup(callback, entries, N);
|
||||
}
|
||||
|
||||
void update(JabyEngine::FontWriter& font_writer, State& cursor, const GPU::PositionI16& start);
|
||||
|
Reference in New Issue
Block a user