Poke_Transporter_GB/include/select_menu.h
Philippe Symons b0abeaf5f6 Create vertical_menu widget
This commit implements a vertical menu widget, which should be quite a bit more flexible than
what we currently have.

It defines interfaces in order to respond to selection changes, show and hide. And has a i_item_widget
interface class to allow you to use custom item widgets.

This is done in preparation for adding a debug menu, in which I kinda want to add toggle options
while using the same vertical_menu widget.

Right now, vertical_menu is only used in Select_Menu. Needless to say that Select_Menu was reworked quite a bit.
Still, in terms of visuals or functionality, the changes should be invisible for now. I mean, I didn't do anything *new* with it yet.
2026-03-03 00:15:18 +01:00

29 lines
703 B
C++

#ifndef SELECT_MENU_H
#define SELECT_MENU_H
#include "vertical_menu.h"
#define LANG_MENU 1
#define CART_MENU 2
class Select_Menu : public i_vertical_menu_state_changed_handler, public i_run_cycle_handler
{
public:
Select_Menu(bool enable_cancel, u8 nMenu_type, unsigned nStartX, unsigned nStartY);
int select_menu_main();
void add_option(const u8 option, u8 return_value);
void clear_options();
void set_lang(u8 nLang);
void on_show() override;
void on_hide() override;
void on_selection_changed(unsigned new_index, unsigned x, unsigned y) override;
void on_run_cycle() override;
private:
vertical_menu menu_widget_;
u8 menu_type;
u8 lang;
};
#endif