diff options
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index e3d48c13be1..ce1ea2855c1 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -274,6 +274,26 @@ void mame_ui_manager::set_handler(ui_callback_type callback_type, const std::fun //------------------------------------------------- +// output_joined_collection +//------------------------------------------------- + +template<typename TColl, typename TEmitMemberFunc, typename TEmitDelimFunc> +static void output_joined_collection(const TColl &collection, TEmitMemberFunc emit_member, TEmitDelimFunc emit_delim) +{ + bool is_first = true; + + for (const auto &member : collection) + { + if (is_first) + is_first = false; + else + emit_delim(); + emit_member(member); + } +} + + +//------------------------------------------------- // display_startup_screens - display the // various startup screens //------------------------------------------------- @@ -283,13 +303,13 @@ void mame_ui_manager::display_startup_screens(bool first_time) const int maxstate = 3; int str = machine().options().seconds_to_run(); bool show_gameinfo = !machine().options().skip_gameinfo(); - bool show_warnings = true, show_mandatory_fileman = !machine().options().skip_mandatory_fileman(); + bool show_warnings = true; bool video_none = strcmp(downcast<osd_options &>(machine().options()).video(), "none") == 0; // disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver, // or if we are debugging, or if there's no mame window to send inputs to if (!first_time || (str > 0 && str < 60*5) || &machine().system() == &GAME_NAME(___empty) || (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0 || video_none) - show_gameinfo = show_warnings = show_mandatory_fileman = false; + show_gameinfo = show_warnings = false; #if defined(EMSCRIPTEN) // also disable for the JavaScript port since the startup screens do not run asynchronously @@ -326,12 +346,17 @@ void mame_ui_manager::display_startup_screens(bool first_time) break; case 2: - if (show_mandatory_fileman) - messagebox_text = machine_info().mandatory_images(); - if (!messagebox_text.empty()) + std::vector<std::reference_wrapper<const std::string>> mandatory_images = mame_machine_manager::instance()->missing_mandatory_images(); + if (!mandatory_images.empty()) { - std::string warning = std::string(_("This driver requires images to be loaded in the following device(s): ")) + messagebox_text; - ui::menu_file_manager::force_file_manager(*this, machine().render().ui_container(), warning.c_str()); + std::ostringstream warning; + warning << _("This driver requires images to be loaded in the following device(s): "); + + output_joined_collection(mandatory_images, + [&warning](const std::reference_wrapper<const std::string> &img) { warning << "\"" << img.get() << "\""; }, + [&warning]() { warning << ","; }); + + ui::menu_file_manager::force_file_manager(*this, machine().render().ui_container(), warning.str().c_str()); } break; } |