diff options
Diffstat (limited to 'src/emu/ui/ui.h')
-rw-r--r-- | src/emu/ui/ui.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h index 81034500733..3d2400b08ff 100644 --- a/src/emu/ui/ui.h +++ b/src/emu/ui/ui.h @@ -144,7 +144,7 @@ public: void draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor); void draw_message_window(render_container *container, const char *text); - void CLIB_DECL popup_time(int seconds, const char *text, ...) ATTR_PRINTF(3,4); + template <typename Format, typename... Params> void popup_time(int seconds, Format &&fmt, Params &&... args); void show_fps_temp(double seconds); void set_show_fps(bool show); bool show_fps() const; @@ -205,6 +205,14 @@ private: bool m_load_save_hold; ui_options m_ui_options; + // static variables + static std::string messagebox_text; + static std::string messagebox_poptext; + static rgb_t messagebox_backcolor; + + static slider_state *slider_list; + static slider_state *slider_current; + // text generators std::string &disclaimer_string(std::string &buffer); std::string &warnings_string(std::string &buffer); @@ -227,4 +235,26 @@ private: ***************************************************************************/ rgb_t decode_ui_color(int id, running_machine *machine = nullptr); int get_font_rows(running_machine *machine = nullptr); + + +/*************************************************************************** + MEMBER TEMPLATES +***************************************************************************/ + +//------------------------------------------------- +// popup_time - popup a message for a specific +// amount of time +//------------------------------------------------- + +template <typename Format, typename... Params> +void ui_manager::popup_time(int seconds, Format &&fmt, Params &&... args) +{ + // extract the text + messagebox_poptext = string_format(std::forward<Format>(fmt), std::forward<Params>(args)...); + messagebox_backcolor = UI_BACKGROUND_COLOR; + + // set a timer + m_popup_text_end = osd_ticks() + osd_ticks_per_second() * seconds; +} + #endif /* __USRINTRF_H__ */ |