From d64ea5331b2312f81df464fb22dcef0191216d86 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 31 Oct 2021 12:31:16 +1100 Subject: -frontend: Refactored menu event handling and fixed a number of issues. (#8777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Moved common code for drawing about box, info viewer, and other text box menus to a base class; removed the last of the info viewer logic and the multi-line item hack from the base menu class. * Added previous/next group navigation for general inputs and plugin input selection menus. * Moved message catalog logic to lib/util, allowing osd and emu to use localised messages. * Made the base menu class use the UI manager’s feature for holding session state rather than a static map and mutex. * Improved menu event handling model, and fixed many issues, particularly with menus behaving badly when hidden/shown. * Added better support for menus that don’t participate in the usual menu stack, like the menuless sliders and the save/load state menus. * Made a number of menus refresh state when being shown after being hidden (fixes MT08121 among other issues). * Fixed indication of mounted slot option in the slot option details menu. * Improved appearance of background menus when emulation isn't running - draw all menus in the stack, and darken the background menus to make the edges of the active menu clearer. * Fixed locale issues in -listxml. -debugger: Made GUI debuggers more uniform. * Added new memory view features to Win32 debugger. * Fixed spelling of hexadecimal in Cocoa debugger and added decimal address option. * Fixed duplicate keyboard shortcut in Cocoa debugger (Shift-Cmd-D was both new device window and 64-bit float format). * Made keyboard shortcuts slightly more consistent across debuggers. -plugins: Moved input selection menu and sequence polling code to a common library. Fixed the issue that prevented keyboard inputs being mapped with -steadykey on. -docs: Started adding some documentation for MAME's internal UI, and updated the list of example front-ends. -Regenerated message catalog sources. For translators, the new strings are mostly: * The names of the inputs provided by the OS-dependent layer for things like fullscreen and video features. These show up in the user interface inputs menu. * The names for automatically generated views. These show up in the video options menu - test with a system with a lot of screens to see more variants. * The input macro plugin UI. * A few format strings for analog input assignments. * A few strings for the about box header. --- src/emu/render.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/emu/render.cpp') diff --git a/src/emu/render.cpp b/src/emu/render.cpp index ec718d25df5..0fef6bafe41 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -51,6 +51,7 @@ #include "ui/uimain.h" #include "util/ioprocsfilter.h" +#include "util/language.h" #include "util/path.h" #include "util/xmlfile.h" @@ -1693,6 +1694,8 @@ void render_target::load_layout_files(util::xml::data_node const &rootnode, bool void render_target::load_additional_layout_files(const char *basename, bool have_artwork) { + using util::lang_translate; + m_external_artwork = false; // if override_artwork defined, load that and skip artwork other than default @@ -1841,7 +1844,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have viewnode->set_attribute( "name", util::string_format( - "Screen %1$u Standard (%2$u:%3$u)", + _("view-name", "Screen %1$u Standard (%2$u:%3$u)"), i, screens[i].physical_x(), screens[i].physical_y()).c_str()); util::xml::data_node *const screennode(viewnode->add_child("screen", nullptr)); if (!screennode) @@ -1867,7 +1870,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have viewnode->set_attribute( "name", util::string_format( - "Screen %1$u Pixel Aspect (%2$u:%3$u)", + _("view-name", "Screen %1$u Pixel Aspect (%2$u:%3$u)"), i, screens[i].native_x(), screens[i].native_y()).c_str()); util::xml::data_node *const screennode(viewnode->add_child("screen", nullptr)); if (!screennode) @@ -1889,7 +1892,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have util::xml::data_node *const viewnode(layoutnode->add_child("view", nullptr)); if (!viewnode) throw emu_fatalerror("Couldn't create XML node??"); - viewnode->set_attribute("name", "Cocktail"); + viewnode->set_attribute("name", _("view-name", "Cocktail")); util::xml::data_node *const mirrornode(viewnode->add_child("screen", nullptr)); if (!mirrornode) @@ -2009,10 +2012,10 @@ void render_target::load_additional_layout_files(const char *basename, bool have }; // generate linear views - generate_view("Left-to-Right", screens.size(), false, [] (unsigned x, unsigned y) { return x; }); - generate_view("Left-to-Right (Gapless)", screens.size(), true, [] (unsigned x, unsigned y) { return x; }); - generate_view("Top-to-Bottom", 1U, false, [] (unsigned x, unsigned y) { return y; }); - generate_view("Top-to-Bottom (Gapless)", 1U, true, [] (unsigned x, unsigned y) { return y; }); + generate_view(_("view-name", "Left-to-Right"), screens.size(), false, [] (unsigned x, unsigned y) { return x; }); + generate_view(_("view-name", "Left-to-Right (Gapless)"), screens.size(), true, [] (unsigned x, unsigned y) { return x; }); + generate_view(_("view-name", "Top-to-Bottom"), 1U, false, [] (unsigned x, unsigned y) { return y; }); + generate_view(_("view-name", "Top-to-Bottom (Gapless)"), 1U, true, [] (unsigned x, unsigned y) { return y; }); // generate fake cocktail view for systems with two screens if (screens.size() == 2U) @@ -2024,7 +2027,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have util::xml::data_node *const viewnode(layoutnode->add_child("view", nullptr)); if (!viewnode) throw emu_fatalerror("Couldn't create XML node??"); - viewnode->set_attribute("name", "Cocktail"); + viewnode->set_attribute("name", _("view-name", "Cocktail")); util::xml::data_node *const mirrornode(viewnode->add_child("screen", nullptr)); if (!mirrornode) @@ -2063,7 +2066,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have if (!remainder || (((majdim + 1) / 2) <= remainder)) { generate_view( - util::string_format("%1$u\xC3\x97%2$u Left-to-Right, Top-to-Bottom", majdim, mindim).c_str(), + util::string_format(_("view-name", u8"%1$u×%2$u Left-to-Right, Top-to-Bottom"), majdim, mindim).c_str(), majdim, false, [&screens, majdim] (unsigned x, unsigned y) @@ -2072,7 +2075,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have return (screens.size() > i) ? int(i) : -1; }); generate_view( - util::string_format("%1$u\xC3\x97%2$u Left-to-Right, Top-to-Bottom (Gapless)", majdim, mindim).c_str(), + util::string_format(_("view-name", u8"%1$u×%2$u Left-to-Right, Top-to-Bottom (Gapless)"), majdim, mindim).c_str(), majdim, true, [&screens, majdim] (unsigned x, unsigned y) @@ -2081,7 +2084,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have return (screens.size() > i) ? int(i) : -1; }); generate_view( - util::string_format("%1$u\xC3\x97%2$u Top-to-Bottom, Left-to-Right", mindim, majdim).c_str(), + util::string_format(_("view-name", u8"%1$u×%2$u Top-to-Bottom, Left-to-Right"), mindim, majdim).c_str(), mindim, false, [&screens, majdim] (unsigned x, unsigned y) @@ -2090,7 +2093,7 @@ void render_target::load_additional_layout_files(const char *basename, bool have return (screens.size() > i) ? int(i) : -1; }); generate_view( - util::string_format("%1$u\xC3\x97%2$u Top-to-Bottom, Left-to-Right (Gapless)", mindim, majdim).c_str(), + util::string_format(_("view-name", u8"%1$u×%2$u Top-to-Bottom, Left-to-Right (Gapless)"), mindim, majdim).c_str(), mindim, true, [&screens, majdim] (unsigned x, unsigned y) -- cgit v1.2.3-70-g09d2