summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-10-15 09:42:35 +1100
committer Vas Crabb <vas@vastheman.com>2021-10-15 10:12:56 +1100
commit22bc3486c3ef8f2230e99daf49785a89ac8a1182 (patch)
tree4f10f7386b7b0a32c9d560395399e8b7632df34c /src/frontend/mame/ui/ui.cpp
parent3e8763bea5a93f3139204fcb8a0c74c2ac364af5 (diff)
More user experience improvements:
frontend: Made it possible to cancel a media audit while it's in progress. Also made the media audit multi-threaded so it's faster. frontend: Made the DIP switches in the DIP switch preview clickable. frontend: Made the system and software selection menus leave focus on the same system when clearing the search rather than jumping to the first item. Also fixed a couple of bugs in the logic for keeping the selected item visible. frontend: Fixed a few places that weren't showing localised system names. frontend: Made UI Cancel clear a search in the file manager the same way it does on the system and sofware selection menus. frontend: Made it possible for plugin menus to handle UI Cancel more naturally, backing up to the previous plugin menu rather than dropping straight back to the list of plugins. Updated the autofire, cheat and cheatfind plugins, and fixed a few other issues in the cheatfind plugin. debugger: Made the mount and unmount commands accept instance names as well as brief instance names. Also updated another page of debugger documentation.
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r--src/frontend/mame/ui/ui.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 2e5f999da08..c2f50d8c33a 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -21,6 +21,7 @@
#include "ui/menu.h"
#include "ui/sliders.h"
#include "ui/state.h"
+#include "ui/systemlist.h"
#include "ui/viewgfx.h"
#include "imagedev/cassette.h"
@@ -194,6 +195,9 @@ void mame_ui_manager::init()
{
load_ui_options();
+ // start loading system names as early as possible
+ ui::system_list::instance().cache_data(options());
+
// initialize the other UI bits
ui::menu::init(machine(), options());
ui_gfx_init(machine());
@@ -1259,7 +1263,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
machine().set_ui_active(!machine().ui_active());
// display a popup indicating the new status
- std::string const name = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_TOGGLE_UI));
+ std::string const name = get_general_input_setting(IPT_UI_TOGGLE_UI);
if (machine().ui_active())
popup_time(2, _("UI controls enabled\nUse %1$s to toggle"), name);
else
@@ -1450,13 +1454,14 @@ uint32_t mame_ui_manager::handler_confirm_quit(render_container &container)
uint32_t state = 0;
// get the text for 'UI Select'
- std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
+ std::string ui_select_text = get_general_input_setting(IPT_UI_SELECT);
// get the text for 'UI Cancel'
- std::string ui_cancel_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_CANCEL, 0, SEQ_TYPE_STANDARD));
+ std::string ui_cancel_text = get_general_input_setting(IPT_UI_CANCEL);
// assemble the quit message
- std::string quit_message = string_format(_("Are you sure you want to quit?\n\n"
+ std::string quit_message = string_format(
+ _("Are you sure you want to quit?\n\n"
"Press ''%1$s'' to quit,\n"
"Press ''%2$s'' to return to emulation."),
ui_select_text,
@@ -2252,6 +2257,19 @@ void mame_ui_manager::menu_reset()
ui::menu::stack_reset(machine());
}
+
+//-------------------------------------------------
+// get_general_input_setting - get the current
+// default setting for an input type (useful for
+// prompting the user)
+//-------------------------------------------------
+
+std::string mame_ui_manager::get_general_input_setting(ioport_type type, int player, input_seq_type seqtype)
+{
+ return machine().input().seq_name(machine().ioport().type_seq(type, player, seqtype));
+}
+
+
void ui_colors::refresh(const ui_options &options)
{
m_border_color = options.border_color();