summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/optsmenu.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-01-14 04:55:29 +1100
committer Vas Crabb <vas@vastheman.com>2019-01-15 03:56:30 +1100
commitae727d2cc640fef650d6c76694b83b159d3065ba (patch)
treec1c5b58eb3a9d51a43737dca62a59b482f7245f2 /src/frontend/mame/ui/optsmenu.h
parent8f330896e2f8b1fc8ec54023fb5d134dc8a5c3d3 (diff)
UI cleanup continues:
* Fix crash on builds with fewer than 16 drivers * Fix "available" filter in internal UI * Get rid of some UI globals that shouldn't be global * Better encapsulation in UI * Clean up favourites manager - in particular kill hidden state and O(n) walks * This breaks adding systems/software to favourites from the main tab menu
Diffstat (limited to 'src/frontend/mame/ui/optsmenu.h')
-rw-r--r--src/frontend/mame/ui/optsmenu.h53
1 files changed, 42 insertions, 11 deletions
diff --git a/src/frontend/mame/ui/optsmenu.h b/src/frontend/mame/ui/optsmenu.h
index e9650e3a95b..2afe9b68a89 100644
--- a/src/frontend/mame/ui/optsmenu.h
+++ b/src/frontend/mame/ui/optsmenu.h
@@ -17,23 +17,27 @@
namespace ui {
-class menu_game_options : public menu
+
+class menu_simple_game_options : public menu
{
public:
- menu_game_options(mame_ui_manager &mui, render_container &container);
- virtual ~menu_game_options() override;
+ menu_simple_game_options(
+ mame_ui_manager &mui,
+ render_container &container,
+ std::function<void ()> &&handler);
+ virtual ~menu_simple_game_options() override;
protected:
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+ virtual void handle() override;
+ virtual void populate(float &customtop, float &custombottom) override;
+
+ void handle_item_event(event const &menu_event);
private:
enum
{
- FILTER_MENU = 1,
- FILTER_ADJUST,
- CONF_DIR,
- DISPLAY_MENU,
- CUSTOM_MENU,
+ DISPLAY_MENU = 1001,
SOUND_MENU,
CONTROLLER_MENU,
MISC_MENU,
@@ -43,12 +47,39 @@ private:
SAVE_CONFIG
};
- virtual void populate(float &customtop, float &custombottom) override;
+ std::function<void ()> const m_handler;
+};
+
+
+class menu_game_options : public menu_simple_game_options
+{
+public:
+ menu_game_options(
+ mame_ui_manager &mui,
+ render_container &container,
+ machine_filter_data &filter_data,
+ std::function<void ()> &&handler);
+ virtual ~menu_game_options() override;
+
+protected:
virtual void handle() override;
+ virtual void populate(float &customtop, float &custombottom) override;
+
+ void handle_item_event(event const &menu_event);
+
+private:
+ enum
+ {
+ FILTER_MENU = 2001,
+ FILTER_ADJUST,
+ CONF_DIR,
+ CUSTOM_MENU
+ };
- machine_filter::type m_main;
+ machine_filter_data &m_filter_data;
+ machine_filter::type m_main_filter;
};
} // namespace ui
-#endif /* MAME_FRONTEND_UI_OPTSMENU_H */
+#endif // MAME_FRONTEND_UI_OPTSMENU_H