diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2016-04-23 11:25:03 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2016-04-23 11:26:47 +0200 |
commit | 1c726824f2b2cc7c6c03ff975e548b72f9b2c0a9 (patch) | |
tree | 020f20da5a8cd822065c1839bc7a53f826803a3d /src/frontend/mame/ui/simpleselgame.h | |
parent | 01657a63c13c79c5f045ba4ecb4c2fd7f7c5a1f8 (diff) |
Split UI and frontend part from core [Miodrag Milanovic]
Diffstat (limited to 'src/frontend/mame/ui/simpleselgame.h')
-rw-r--r-- | src/frontend/mame/ui/simpleselgame.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h new file mode 100644 index 00000000000..316e3747b2f --- /dev/null +++ b/src/frontend/mame/ui/simpleselgame.h @@ -0,0 +1,48 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods +/*************************************************************************** + + ui/selgame.h + + Game selector + +***************************************************************************/ + +#pragma once + +#ifndef __UI_SIMPLESELGAME_H__ +#define __UI_SIMPLESELGAME_H__ + +#include "drivenum.h" +#include "menu.h" + +class ui_simple_menu_select_game : public ui_menu { +public: + ui_simple_menu_select_game(running_machine &machine, render_container *container, const char *gamename); + virtual ~ui_simple_menu_select_game(); + virtual void populate() override; + virtual void handle() override; + virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; + + // force game select menu + static void force_game_select(running_machine &machine, render_container *container); + + virtual bool menu_has_search_active() override { return (m_search[0] != 0); } +private: + // internal state + enum { VISIBLE_GAMES_IN_LIST = 15 }; + UINT8 m_error; + bool m_rerandomize; + char m_search[40]; + int m_matchlist[VISIBLE_GAMES_IN_LIST]; + std::vector<const game_driver *> m_driverlist; + std::unique_ptr<driver_enumerator> m_drivlist; + + // internal methods + void build_driver_list(); + void inkey_select(const ui_menu_event *menu_event); + void inkey_cancel(const ui_menu_event *menu_event); + void inkey_special(const ui_menu_event *menu_event); +}; + +#endif /* __UI_SELGAME_H__ */ |