mirror of
https://github.com/holub/mame
synced 2025-07-06 10:29:38 +03:00
Merge pull request #967 from npwoods/miscellaneous_text_fixes_and_cleanups
Miscellaneous text fixes and cleanups
This commit is contained in:
commit
ba3eba5690
@ -466,7 +466,7 @@ void palette_device::device_start()
|
||||
for (int color = 0; color < m_indirect_entries; color++)
|
||||
{
|
||||
// alpha = 0 ensures change is detected the first time set_indirect_color() is called
|
||||
m_indirect_colors[color] = rgb_t(0, 0, 0, 0);
|
||||
m_indirect_colors[color] = rgb_t::transparent;
|
||||
}
|
||||
|
||||
m_indirect_pens.resize(m_entries);
|
||||
|
@ -430,12 +430,12 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
|
||||
|
||||
// extract other attributes
|
||||
m_line = xml_get_attribute_int(&entrynode, "line", 0);
|
||||
m_justify = JUSTIFY_LEFT;
|
||||
m_justify = ui::text_layout::LEFT;
|
||||
const char *align = xml_get_attribute_string(&entrynode, "align", "left");
|
||||
if (strcmp(align, "center") == 0)
|
||||
m_justify = JUSTIFY_CENTER;
|
||||
m_justify = ui::text_layout::CENTER;
|
||||
else if (strcmp(align, "right") == 0)
|
||||
m_justify = JUSTIFY_RIGHT;
|
||||
m_justify = ui::text_layout::RIGHT;
|
||||
else if (strcmp(align, "left") != 0)
|
||||
throw emu_fatalerror("%s.xml(%d): invalid alignment '%s' specified\n", filename, entrynode.line, align);
|
||||
|
||||
@ -509,7 +509,7 @@ void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &arginde
|
||||
curarg += arg->values(argindex, ¶ms[curarg]);
|
||||
|
||||
// generate the astring
|
||||
manager.get_output_astring(m_line, m_justify) = string_format(m_format,
|
||||
manager.get_output_string(m_line, m_justify) = string_format(m_format,
|
||||
(UINT32)params[0], (UINT32)params[1], (UINT32)params[2], (UINT32)params[3],
|
||||
(UINT32)params[4], (UINT32)params[5], (UINT32)params[6], (UINT32)params[7],
|
||||
(UINT32)params[8], (UINT32)params[9], (UINT32)params[10], (UINT32)params[11],
|
||||
@ -545,9 +545,9 @@ void cheat_script::script_entry::save(emu_file &cheatfile) const
|
||||
cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
|
||||
if (m_line != 0)
|
||||
cheatfile.printf(" line=\"%d\"", m_line);
|
||||
if (m_justify == JUSTIFY_CENTER)
|
||||
if (m_justify == ui::text_layout::CENTER)
|
||||
cheatfile.printf(" align=\"center\"");
|
||||
else if (m_justify == JUSTIFY_RIGHT)
|
||||
else if (m_justify == ui::text_layout::RIGHT)
|
||||
cheatfile.printf(" align=\"right\"");
|
||||
if (m_arglist.size() == 0)
|
||||
cheatfile.printf(" />\n");
|
||||
@ -1236,19 +1236,19 @@ void cheat_manager::render_text(mame_ui_manager &mui, render_container &containe
|
||||
// output the text
|
||||
mui.draw_text_full(&container, m_output[linenum].c_str(),
|
||||
0.0f, (float)linenum * mui.get_line_height(), 1.0f,
|
||||
m_justify[linenum], WRAP_NEVER, DRAW_OPAQUE,
|
||||
m_justify[linenum], ui::text_layout::NEVER, mame_ui_manager::OPAQUE,
|
||||
rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// get_output_astring - return a reference to
|
||||
// get_output_string - return a reference to
|
||||
// the given row's string, and set the
|
||||
// justification
|
||||
//-------------------------------------------------
|
||||
|
||||
std::string &cheat_manager::get_output_astring(int row, int justify)
|
||||
std::string &cheat_manager::get_output_string(int row, ui::text_layout::text_justify justify)
|
||||
{
|
||||
// if the row is not specified, grab the next one
|
||||
if (row == 0)
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "debug/express.h"
|
||||
#include "debug/debugcpu.h"
|
||||
#include "ui/text.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -174,12 +175,12 @@ private:
|
||||
void validate_format(const char *filename, int line);
|
||||
|
||||
// internal state
|
||||
parsed_expression m_condition; // condition under which this is executed
|
||||
parsed_expression m_expression; // expression to execute
|
||||
std::string m_format; // string format to print
|
||||
std::vector<std::unique_ptr<output_argument>> m_arglist; // list of arguments
|
||||
INT8 m_line; // which line to print on
|
||||
UINT8 m_justify; // justification when printing
|
||||
parsed_expression m_condition; // condition under which this is executed
|
||||
parsed_expression m_expression; // expression to execute
|
||||
std::string m_format; // string format to print
|
||||
std::vector<std::unique_ptr<output_argument>> m_arglist; // list of arguments
|
||||
INT8 m_line; // which line to print on
|
||||
ui::text_layout::text_justify m_justify; // justification when printing
|
||||
|
||||
// constants
|
||||
static const int MAX_ARGUMENTS = 32;
|
||||
@ -288,7 +289,7 @@ public:
|
||||
void render_text(mame_ui_manager &mui, render_container &container);
|
||||
|
||||
// output helpers
|
||||
std::string &get_output_astring(int row, int justify);
|
||||
std::string &get_output_string(int row, ui::text_layout::text_justify justify);
|
||||
|
||||
// global helpers
|
||||
static std::string quote_expression(const parsed_expression &expression);
|
||||
@ -305,7 +306,7 @@ private:
|
||||
std::vector<std::unique_ptr<cheat_entry>> m_cheatlist; // cheat list
|
||||
UINT64 m_framecount; // frame count
|
||||
std::vector<std::string> m_output; // array of output strings
|
||||
std::vector<UINT8> m_justify; // justification for each string
|
||||
std::vector<ui::text_layout::text_justify> m_justify; // justification for each string
|
||||
UINT8 m_numlines; // number of lines available for output
|
||||
INT8 m_lastline; // last line used for output
|
||||
bool m_disabled; // true if the cheat engine is disabled
|
||||
|
@ -1490,7 +1490,7 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
|
||||
// retrieve all parameters
|
||||
int sc_width = sc->visible_area().width();
|
||||
int sc_height = sc->visible_area().height();
|
||||
int justify = JUSTIFY_LEFT;
|
||||
auto justify = ui::text_layout::LEFT;
|
||||
float y, x = 0;
|
||||
if(lua_isnumber(L, 2))
|
||||
{
|
||||
@ -1501,9 +1501,9 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
|
||||
{
|
||||
std::string just_str = lua_tostring(L, 2);
|
||||
if(just_str == "right")
|
||||
justify = JUSTIFY_RIGHT;
|
||||
justify = ui::text_layout::RIGHT;
|
||||
else if(just_str == "center")
|
||||
justify = JUSTIFY_CENTER;
|
||||
justify = ui::text_layout::CENTER;
|
||||
y = lua_tonumber(L, 3);
|
||||
}
|
||||
const char *msg = luaL_checkstring(L,4);
|
||||
@ -1516,7 +1516,7 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
|
||||
// draw the text
|
||||
render_container &rc = sc->container();
|
||||
mame_machine_manager::instance()->ui().draw_text_full(&rc, msg, x, y, (1.0f - x),
|
||||
justify, WRAP_WORD, DRAW_NORMAL, textcolor,
|
||||
justify, ui::text_layout::WORD, mame_ui_manager::NORMAL, textcolor,
|
||||
bgcolor, nullptr, nullptr);
|
||||
return 0;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ void menu_audit::handle()
|
||||
|
||||
if (m_first)
|
||||
{
|
||||
ui().draw_text_box(container, _("Audit in progress..."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
|
||||
ui().draw_text_box(container, _("Audit in progress..."), ui::text_layout::CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
|
||||
m_first = false;
|
||||
return;
|
||||
}
|
||||
|
@ -210,8 +210,8 @@ void menu_custom_filter::custom_render(void *selectedref, float top, float botto
|
||||
float width;
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
float maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -230,8 +230,8 @@ void menu_custom_filter::custom_render(void *selectedref, float top, float botto
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -525,8 +525,8 @@ void menu_swcustom_filter::custom_render(void *selectedref, float top, float bot
|
||||
float width;
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
float maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -545,8 +545,8 @@ void menu_swcustom_filter::custom_render(void *selectedref, float top, float bot
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -165,8 +165,8 @@ void menu_custom_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
{
|
||||
float width;
|
||||
|
||||
ui().draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -185,8 +185,8 @@ void menu_custom_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -381,8 +381,8 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
|
||||
// top text
|
||||
std::string topbuf(_("UI Fonts Settings"));
|
||||
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -401,15 +401,15 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
if ((FPTR)selectedref == INFOS_SIZE)
|
||||
{
|
||||
topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
|
||||
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr, m_info_size);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr, m_info_size);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -428,8 +428,8 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -539,8 +539,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
// top text
|
||||
std::string topbuf(_("UI Colors Settings"));
|
||||
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -559,16 +559,16 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// bottom text
|
||||
// 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));
|
||||
topbuf = string_format(_("Double click or press %1$s to change the color value"), ui_select_text);
|
||||
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -587,14 +587,14 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// compute maxwidth
|
||||
topbuf = _("Menu Preview");
|
||||
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
maxwidth = width + 2.0f * UI_BOX_LR_BORDER;
|
||||
|
||||
std::string sampletxt[5];
|
||||
@ -607,8 +607,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
|
||||
for (auto & elem: sampletxt)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
@ -629,8 +629,8 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
y2 -= UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// compute our bounds for menu preview
|
||||
x1 -= UI_BOX_LR_BORDER;
|
||||
@ -647,30 +647,30 @@ void menu_colors_ui::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw normal text
|
||||
ui().draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
y1 += line_height;
|
||||
|
||||
// draw subitem text
|
||||
ui().draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
y1 += line_height;
|
||||
|
||||
// draw selected text
|
||||
highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_SELECTED_BG_COLOR].color);
|
||||
ui().draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr);
|
||||
y1 += line_height;
|
||||
|
||||
// draw mouse over text
|
||||
highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_MOUSEOVER_BG_COLOR].color);
|
||||
ui().draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr);
|
||||
y1 += line_height;
|
||||
|
||||
// draw clone text
|
||||
ui().draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
|
||||
|
||||
}
|
||||
|
||||
@ -880,8 +880,8 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
|
||||
|
||||
// top text
|
||||
std::string topbuf = std::string(m_title).append(_(" - ARGB Settings"));
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -900,13 +900,13 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
std::string sampletxt(_("Color preview ="));
|
||||
maxwidth = origx2 - origx1;
|
||||
ui().draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -925,8 +925,8 @@ void menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, floa
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the normal text
|
||||
ui().draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
ui().draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
|
||||
float t_x2 = x1 - UI_BOX_LR_BORDER + maxwidth;
|
||||
x1 = x2 + 2.0f * UI_BOX_LR_BORDER;
|
||||
|
@ -129,8 +129,8 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
|
||||
float width;
|
||||
std::string driver = (m_issoft == true) ? m_swinfo->longname : m_driver->description;
|
||||
|
||||
ui().draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -148,14 +148,14 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
|
||||
x2 -= UI_BOX_LR_BORDER;
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
ui().draw_text_full(container, driver.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, driver.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
maxwidth = 0;
|
||||
for (auto & elem : m_items_list)
|
||||
{
|
||||
ui().draw_text_full(container, elem.label.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.label.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
maxwidth += width;
|
||||
}
|
||||
|
||||
@ -180,13 +180,13 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
|
||||
x1 += space;
|
||||
rgb_t fcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0x00) : UI_TEXT_COLOR;
|
||||
rgb_t bcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0xff) : UI_TEXT_BG_COLOR;
|
||||
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NONE, fcolor, bcolor, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NONE, fcolor, bcolor, &width, nullptr);
|
||||
|
||||
if (bcolor != UI_TEXT_BG_COLOR)
|
||||
ui().draw_textured_box(container, x1 - (space / 2), y1, x1 + width + (space / 2), y2, bcolor, rgb_t(255, 43, 43, 43),
|
||||
hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NORMAL, fcolor, bcolor, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fcolor, bcolor, &width, nullptr);
|
||||
x1 += width + space;
|
||||
++x;
|
||||
}
|
||||
@ -194,7 +194,7 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
|
||||
// bottom
|
||||
std::string revision;
|
||||
revision.assign(_("Revision: ")).append(m_items_list[m_actual].revision);
|
||||
ui().draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -213,8 +213,8 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -118,8 +118,8 @@ void menu_directory::custom_render(void *selectedref, float top, float bottom, f
|
||||
float width;
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
float maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -138,8 +138,8 @@ void menu_directory::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
@ -217,13 +217,13 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
|
||||
|
||||
for (auto & elem : m_folders)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
maxwidth = MAX(width, maxwidth);
|
||||
|
||||
@ -242,8 +242,8 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// compute our bounds
|
||||
x1 = 0.5f - 0.5f * maxwidth;
|
||||
@ -262,8 +262,8 @@ void menu_display_actual::custom_render(void *selectedref, float top, float bott
|
||||
// draw the text within it
|
||||
for (auto & elem : m_folders)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
y1 += lineh;
|
||||
}
|
||||
|
||||
@ -506,8 +506,8 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
|
||||
// get the size of the text
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
maxwidth = MAX(width, maxwidth);
|
||||
}
|
||||
@ -529,16 +529,16 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
|
||||
// draw the text within it
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
y1 = y1 + ui().get_line_height();
|
||||
}
|
||||
|
||||
// bottom text
|
||||
tempbuf[0] = _("Press TAB to set");
|
||||
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -557,8 +557,8 @@ void menu_add_change_folder::custom_render(void *selectedref, float top, float b
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
}
|
||||
|
||||
@ -643,7 +643,7 @@ void menu_remove_folder::custom_render(void *selectedref, float top, float botto
|
||||
std::string tempbuf = string_format(_("Remove %1$s Folder"), _(s_folders[m_ref].name));
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
float maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -662,7 +662,7 @@ void menu_remove_folder::custom_render(void *selectedref, float top, float botto
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL,
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL,
|
||||
UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
@ -694,9 +694,9 @@ void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2,
|
||||
0,
|
||||
y1 + (DIP_SWITCH_HEIGHT - UI_TARGET_FONT_HEIGHT) / 2,
|
||||
x1 - ui().get_string_width(" "),
|
||||
JUSTIFY_RIGHT,
|
||||
WRAP_NEVER,
|
||||
DRAW_NORMAL,
|
||||
ui::text_layout::RIGHT,
|
||||
ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL,
|
||||
UI_TEXT_COLOR,
|
||||
PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA),
|
||||
nullptr ,
|
||||
|
@ -503,7 +503,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
if (ui().show_fps_counter())
|
||||
{
|
||||
ui().draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
|
||||
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
|
||||
bool const customonly = (flags & PROCESS_CUSTOM_ONLY);
|
||||
@ -695,7 +695,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
container->add_line(visible_left + visible_width - ((visible_width - heading_width) / 2) + UI_BOX_LR_BORDER, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
|
||||
}
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// otherwise, draw the item on the left and the subitem text on the right
|
||||
@ -707,7 +707,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
|
||||
// draw the left-side text
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
|
||||
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, nullptr);
|
||||
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, &item_width, nullptr);
|
||||
|
||||
// give 2 spaces worth of padding
|
||||
item_width += 2.0f * gutter_width;
|
||||
@ -732,7 +732,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
|
||||
// draw the subitem right-justified
|
||||
ui().draw_text_full(container, subitem_text, effective_left + item_width, line_y, effective_width - item_width,
|
||||
JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, nullptr);
|
||||
ui::text_layout::RIGHT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor, &subitem_width, nullptr);
|
||||
|
||||
// apply arrows
|
||||
if (itemnum == selected && (pitem.flags & FLAG_LEFT_ARROW))
|
||||
@ -771,7 +771,7 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
|
||||
// compute the multi-line target width/height
|
||||
ui().draw_text_full(container, pitem.subtext, 0, 0, visible_width * 0.75f,
|
||||
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
|
||||
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
|
||||
|
||||
// determine the target location
|
||||
target_x = visible_left + visible_width - target_width - UI_BOX_LR_BORDER;
|
||||
@ -785,8 +785,9 @@ void menu::draw(UINT32 flags, float origx0, float origy0)
|
||||
target_x + target_width + UI_BOX_LR_BORDER,
|
||||
target_y + target_height + UI_BOX_TB_BORDER,
|
||||
subitem_invert ? UI_SELECTED_BG_COLOR : UI_BACKGROUND_COLOR);
|
||||
|
||||
ui().draw_text_full(container, pitem.subtext, target_x, target_y, target_width,
|
||||
JUSTIFY_RIGHT, WRAP_WORD, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
|
||||
ui::text_layout::RIGHT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// if there is something special to add, do it by calling the virtual method
|
||||
@ -815,7 +816,7 @@ void menu::draw_text_box()
|
||||
|
||||
// compute the multi-line target width/height
|
||||
ui().draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER - 2.0f * gutter_width,
|
||||
JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
|
||||
ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &target_width, &target_height);
|
||||
target_height += 2.0f * line_height;
|
||||
if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
|
||||
target_height = floorf((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
|
||||
@ -845,7 +846,7 @@ void menu::draw_text_box()
|
||||
target_y + target_height + UI_BOX_TB_BORDER,
|
||||
(item[0].flags & FLAG_REDTEXT) ? UI_RED_COLOR : UI_BACKGROUND_COLOR);
|
||||
ui().draw_text_full(container, text, target_x, target_y, target_width,
|
||||
JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// draw the "return to prior menu" text with a hilight behind it
|
||||
highlight(container,
|
||||
@ -855,7 +856,7 @@ void menu::draw_text_box()
|
||||
target_y + target_height,
|
||||
UI_SELECTED_BG_COLOR);
|
||||
ui().draw_text_full(container, backtext, target_x, target_y + target_height - line_height, target_width,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
|
||||
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// artificially set the hover to the last item so a double-click exits
|
||||
hover = item.size() - 1;
|
||||
@ -1592,8 +1593,8 @@ void menu::draw_select_game(UINT32 flags)
|
||||
|
||||
space = ud_arrow_width * 1.5f;
|
||||
}
|
||||
ui().draw_text_full(container, pitem.text, effective_left + space, line_y, effective_width - space, JUSTIFY_LEFT, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui().draw_text_full(container, pitem.text, effective_left + space, line_y, effective_width - space, ui::text_layout::LEFT, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1602,16 +1603,16 @@ void menu::draw_select_game(UINT32 flags)
|
||||
|
||||
// compute right space for subitem
|
||||
ui().draw_text_full(container, pitem.subtext, effective_left, line_y, ui().get_string_width(pitem.subtext),
|
||||
JUSTIFY_RIGHT, WRAP_NEVER, DRAW_NONE, item_invert ? fgcolor3 : fgcolor, bgcolor, &subitem_width, nullptr);
|
||||
ui::text_layout::RIGHT, ui::text_layout::NEVER, mame_ui_manager::NONE, item_invert ? fgcolor3 : fgcolor, bgcolor, &subitem_width, nullptr);
|
||||
subitem_width += gutter_width;
|
||||
|
||||
// draw the item left-justified
|
||||
ui().draw_text_full(container, pitem.text, effective_left, line_y, effective_width - subitem_width,
|
||||
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, &item_width, nullptr);
|
||||
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, &item_width, nullptr);
|
||||
|
||||
// draw the subitem right-justified
|
||||
ui().draw_text_full(container, pitem.subtext, effective_left + item_width, line_y, effective_width - item_width,
|
||||
JUSTIFY_RIGHT, WRAP_NEVER, DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui::text_layout::RIGHT, ui::text_layout::NEVER, mame_ui_manager::NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1648,8 +1649,8 @@ void menu::draw_select_game(UINT32 flags)
|
||||
container->add_line(visible_left, line + 0.5f * line_height, visible_left + visible_width, line + 0.5f * line_height,
|
||||
UI_LINE_WIDTH, UI_TEXT_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
|
||||
else
|
||||
ui().draw_text_full(container, pitem.text, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui().draw_text_full(container, pitem.text, effective_left, line, effective_width, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
line += line_height;
|
||||
}
|
||||
|
||||
@ -2199,7 +2200,7 @@ float menu::draw_right_box_title(float x1, float y1, float x2, float y2)
|
||||
bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, buffer[cells].c_str(), x1 + UI_LINE_WIDTH, y1, midl - UI_LINE_WIDTH,
|
||||
JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
x1 += midl;
|
||||
}
|
||||
|
||||
@ -2223,8 +2224,8 @@ std::string menu::arts_render_common(float origx1, float origy1, float origx2, f
|
||||
// apply title to right panel
|
||||
for (int x = FIRST_VIEW; x < LAST_VIEW; x++)
|
||||
{
|
||||
ui().draw_text_full(container, _(arts_info[x].first), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, &txt_lenght, nullptr);
|
||||
ui().draw_text_full(container, _(arts_info[x].first), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &txt_lenght, nullptr);
|
||||
txt_lenght += 0.01f;
|
||||
title_size = MAX(txt_lenght, title_size);
|
||||
}
|
||||
@ -2242,8 +2243,8 @@ std::string menu::arts_render_common(float origx1, float origy1, float origx2, f
|
||||
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
|
||||
origy1 + line_height, bgcolor, rgb_t(43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
|
||||
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curimage_view, FIRST_VIEW, LAST_VIEW, title_size);
|
||||
|
||||
@ -2297,7 +2298,7 @@ void menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software)
|
||||
hover = HOVER_B_FAV + z;
|
||||
color = rgb_t::white;
|
||||
float ypos = y2 + ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER;
|
||||
ui().draw_text_box(container, _(hover_msg[z]), JUSTIFY_CENTER, 0.5f, ypos, UI_BACKGROUND_COLOR);
|
||||
ui().draw_text_box(container, _(hover_msg[z]), ui::text_layout::CENTER, 0.5f, ypos, UI_BACKGROUND_COLOR);
|
||||
}
|
||||
|
||||
container->add_quad(x1, y1, x2, y2, color, t_texture[z], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
|
||||
@ -2732,7 +2733,7 @@ void menu::draw_palette_menu()
|
||||
// if we don't have a subitem, just draw the string centered
|
||||
else if (pitem.subtext == nullptr)
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
|
||||
// otherwise, draw the item on the left and the subitem text on the right
|
||||
else
|
||||
@ -2742,7 +2743,7 @@ void menu::draw_palette_menu()
|
||||
|
||||
// draw the left-side text
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width,
|
||||
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
|
||||
// give 2 spaces worth of padding
|
||||
float subitem_width = ui().get_string_width("FF00FF00");
|
||||
@ -2867,8 +2868,8 @@ void menu::draw_dats_menu()
|
||||
// draw dats text
|
||||
else if (pitem.subtext == nullptr)
|
||||
{
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width, JUSTIFY_LEFT, WRAP_NEVER,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui().draw_text_full(container, itemtext, effective_left, line_y, effective_width, ui::text_layout::LEFT, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2892,8 +2893,8 @@ void menu::draw_dats_menu()
|
||||
else
|
||||
{
|
||||
highlight(container, line_x0, line_y0, line_x1, line_y1, bgcolor);
|
||||
ui().draw_text_full(container, itemtext, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui().draw_text_full(container, itemtext, effective_left, line, effective_width, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
}
|
||||
line += line_height;
|
||||
}
|
||||
|
@ -813,8 +813,8 @@ void menu_machine_configure::custom_render(void *selectedref, float top, float b
|
||||
|
||||
for (auto & elem : text)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
@ -836,8 +836,8 @@ void menu_machine_configure::custom_render(void *selectedref, float top, float b
|
||||
// draw the text within it
|
||||
for (auto & elem : text)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
}
|
||||
@ -957,8 +957,8 @@ void menu_plugins_configure::custom_render(void *selectedref, float top, float b
|
||||
{
|
||||
float width;
|
||||
|
||||
ui().draw_text_full(container, _("Plugins"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Plugins"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -977,8 +977,8 @@ void menu_plugins_configure::custom_render(void *selectedref, float top, float b
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Plugins"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Plugins"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
@ -297,8 +297,8 @@ void menu_game_options::populate()
|
||||
void menu_game_options::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
||||
{
|
||||
float width;
|
||||
ui().draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -317,8 +317,8 @@ void menu_game_options::custom_render(void *selectedref, float top, float bottom
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Settings"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,8 +168,8 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
|
||||
std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_");
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
|
||||
float maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -188,16 +188,16 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// bottom text
|
||||
// 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));
|
||||
tempbuf = string_format(_("Double click or press %1$s to select"), ui_select_text);
|
||||
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
|
||||
@ -216,8 +216,8 @@ void menu_selector::custom_render(void *selectedref, float top, float bottom, fl
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -464,7 +464,7 @@ void menu_select_game::handle()
|
||||
// if we're in an error state, overlay an error message
|
||||
if (ui_error)
|
||||
ui().draw_text_box(container, _("The selected machine is missing one or more required ROM or CHD images. "
|
||||
"Please select a different machine.\n\nPress any key to continue."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
"Please select a different machine.\n\nPress any key to continue."), ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
|
||||
// handle filters selection from key shortcuts
|
||||
if (check_filter)
|
||||
@ -801,8 +801,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
|
||||
// get the size of the text
|
||||
for (int line = 0; line < 2; ++line)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(width, maxwidth);
|
||||
}
|
||||
@ -830,8 +830,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
|
||||
// draw the text within it
|
||||
for (int line = 0; line < 2; ++line)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
|
||||
@ -956,8 +956,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
|
||||
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
@ -989,8 +989,8 @@ void menu_select_game::custom_render(void *selectedref, float top, float bottom,
|
||||
// draw all lines
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
}
|
||||
@ -1905,8 +1905,8 @@ float menu_select_game::draw_left_panel(float x1, float y1, float x2, float y2)
|
||||
convert_command_glyph(str);
|
||||
}
|
||||
|
||||
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
y1 += line_height_max;
|
||||
}
|
||||
|
||||
@ -2014,8 +2014,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
|
||||
for (int x = UI_FIRST_LOAD; x < UI_LAST_LOAD; ++x)
|
||||
{
|
||||
ui().draw_text_full(container, _(dats_info[x]), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_NEVER, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
|
||||
ui().draw_text_full(container, _(dats_info[x]), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::NEVER, mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
|
||||
txt_length += 0.01f;
|
||||
title_size = (std::max)(txt_length, title_size);
|
||||
}
|
||||
@ -2039,8 +2039,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
|
||||
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
|
||||
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curdats_view, UI_FIRST_LOAD, UI_LAST_LOAD, title_size);
|
||||
|
||||
@ -2076,8 +2076,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
|
||||
if (buffer.empty())
|
||||
{
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
else if (ui_globals::curdats_view != UI_STORY_LOAD && ui_globals::curdats_view != UI_COMMAND_LOAD)
|
||||
@ -2115,8 +2115,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
size_t last_underscore = tempbuf.find_last_of("_");
|
||||
if (last_underscore == std::string::npos)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1, oy1, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1, oy1, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2127,11 +2127,11 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
float item_width;
|
||||
|
||||
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width,
|
||||
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &item_width, nullptr, tmp_size2);
|
||||
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &item_width, nullptr, tmp_size2);
|
||||
|
||||
ui().draw_text_full(container, last_part.c_str(), effective_left + item_width, oy1,
|
||||
origx2 - origx1 - 2.0f * gutter_width - item_width, JUSTIFY_RIGHT, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
|
||||
origx2 - origx1 - 2.0f * gutter_width - item_width, ui::text_layout::RIGHT, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2150,19 +2150,19 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
std::string first_part(tempbuf.substr(0, first_dspace));
|
||||
std::string last_part(tempbuf.substr(first_dspace + 1));
|
||||
strtrimspace(last_part);
|
||||
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, JUSTIFY_LEFT,
|
||||
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
ui().draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, ui::text_layout::LEFT,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
|
||||
ui().draw_text_full(container, last_part.c_str(), effective_left, oy1, origx2 - origx1 - 2.0f * gutter_width,
|
||||
JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
ui::text_layout::RIGHT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
}
|
||||
else
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
|
||||
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size3);
|
||||
}
|
||||
else
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
|
||||
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
|
||||
oy1 += (line_height * text_size);
|
||||
}
|
||||
@ -2179,8 +2179,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
// apply title to right panel
|
||||
if (soft->usage.empty())
|
||||
{
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui_globals::cur_sw_dats_view = 0;
|
||||
}
|
||||
else
|
||||
@ -2193,8 +2193,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
|
||||
for (auto & elem: t_text)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr);
|
||||
txt_length += 0.01f;
|
||||
title_size = (std::max)(txt_length, title_size);
|
||||
}
|
||||
@ -2214,7 +2214,7 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
|
||||
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
|
||||
}
|
||||
@ -2237,8 +2237,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
|
||||
if (buffer.empty())
|
||||
{
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -2264,8 +2264,8 @@ void menu_select_game::infos_render(void *selectedref, float origx1, float origy
|
||||
else if (r == r_visible_lines - 1 && itemline != totallines - 1)
|
||||
info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width);
|
||||
else
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT,
|
||||
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, ui::text_layout::LEFT,
|
||||
ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
oy1 += (line_height * text_size);
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ void menu_select_software::handle()
|
||||
if (ui_error)
|
||||
ui().draw_text_box(container, _("The selected software is missing one or more required files. "
|
||||
"Please select a different software.\n\nPress any key to continue."),
|
||||
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
|
||||
// handle filters selection from key shortcuts
|
||||
if (check_filter)
|
||||
@ -688,8 +688,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
|
||||
|
||||
for (int line = 0; line < 3; ++line)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(width, maxwidth);
|
||||
}
|
||||
@ -717,8 +717,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
|
||||
// draw the text within it
|
||||
for (int line = 0; line < 3; ++line)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
|
||||
@ -837,8 +837,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
|
||||
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
@ -870,8 +870,8 @@ void menu_select_software::custom_render(void *selectedref, float top, float bot
|
||||
// draw all lines
|
||||
for (auto & elem : tempbuf)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
}
|
||||
@ -1488,8 +1488,8 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float
|
||||
convert_command_glyph(str);
|
||||
}
|
||||
|
||||
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
ui().draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
|
||||
y1 += line_height;
|
||||
}
|
||||
|
||||
@ -1567,8 +1567,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
{
|
||||
float title_size = 0.0f;
|
||||
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &title_size, nullptr);
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &title_size, nullptr);
|
||||
title_size += 0.01f;
|
||||
|
||||
rgb_t fgcolor = UI_TEXT_COLOR;
|
||||
@ -1585,8 +1585,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
ui().draw_textured_box(container, origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
|
||||
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr);
|
||||
ui_globals::cur_sw_dats_view = 0;
|
||||
}
|
||||
else
|
||||
@ -1599,8 +1599,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
|
||||
for (auto & elem : t_text)
|
||||
{
|
||||
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr);
|
||||
ui().draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr);
|
||||
txt_lenght += 0.01f;
|
||||
title_size = MAX(txt_lenght, title_size);
|
||||
}
|
||||
@ -1625,7 +1625,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
|
||||
|
||||
ui().draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
|
||||
JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
ui::text_layout::CENTER, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fgcolor, bgcolor, nullptr, nullptr, tmp_size);
|
||||
|
||||
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
|
||||
}
|
||||
@ -1648,8 +1648,8 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
|
||||
if (buffer.empty())
|
||||
{
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
|
||||
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, ui::text_layout::CENTER,
|
||||
ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@ -1677,7 +1677,7 @@ void menu_select_software::infos_render(void *selectedref, float origx1, float o
|
||||
info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width);
|
||||
else
|
||||
ui().draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1,
|
||||
JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR,
|
||||
ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR,
|
||||
nullptr, nullptr, text_size);
|
||||
oy1 += (line_height * text_size);
|
||||
}
|
||||
@ -1986,8 +1986,8 @@ void software_parts::handle()
|
||||
void software_parts::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
||||
{
|
||||
float width;
|
||||
ui().draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -2006,8 +2006,8 @@ void software_parts::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -2127,8 +2127,8 @@ void bios_selection::handle()
|
||||
void bios_selection::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
||||
{
|
||||
float width;
|
||||
ui().draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -2147,8 +2147,8 @@ void bios_selection::custom_render(void *selectedref, float top, float bottom, f
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
@ -136,7 +136,7 @@ void simple_menu_select_game::handle()
|
||||
ui().draw_text_box(container,
|
||||
"The selected game is missing one or more required ROM or CHD images. "
|
||||
"Please select a different game.\n\nPress any key to continue.",
|
||||
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
}
|
||||
|
||||
|
||||
@ -298,8 +298,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
|
||||
tempbuf[0] = _("Type name or select: (random)");
|
||||
|
||||
// get the size of the text
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(width, origx2 - origx1);
|
||||
|
||||
@ -318,8 +318,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[0].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
// determine the text to render below
|
||||
driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
|
||||
@ -388,8 +388,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
|
||||
maxwidth = origx2 - origx1;
|
||||
for (line = 0; line < 4; line++)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(maxwidth, width);
|
||||
}
|
||||
@ -418,8 +418,8 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
|
||||
// draw all lines
|
||||
for (line = 0; line < 4; line++)
|
||||
{
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
y1 += ui().get_line_height();
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
|
||||
|
||||
// determine the text height
|
||||
ui().draw_text_full(container, tempstring.c_str(), 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
|
||||
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, rgb_t::white, rgb_t::black, nullptr, &text_height);
|
||||
ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white, rgb_t::black, nullptr, &text_height);
|
||||
|
||||
// draw the thermometer
|
||||
bar_left = x1 + UI_BOX_LR_BORDER;
|
||||
@ -253,7 +253,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo
|
||||
|
||||
// draw the actual text
|
||||
ui().draw_text_full(container, tempstring.c_str(), x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
|
||||
JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, &text_height);
|
||||
ui::text_layout::CENTER, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, &text_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,8 +146,8 @@ void menu_sound_options::populate()
|
||||
void menu_sound_options::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
||||
{
|
||||
float width;
|
||||
ui().draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -166,8 +166,8 @@ void menu_sound_options::custom_render(void *selectedref, float top, float botto
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
@ -414,8 +414,8 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
|
||||
{
|
||||
float width;
|
||||
|
||||
ui().draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
float maxwidth = MAX(origx2 - origx1, width);
|
||||
|
||||
@ -434,16 +434,16 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
|
||||
if (selectedref != nullptr)
|
||||
{
|
||||
option &selected_sm_option = *reinterpret_cast<option *>(selectedref);
|
||||
if (selected_sm_option.entry != nullptr)
|
||||
{
|
||||
ui().draw_text_full(container, selected_sm_option.entry->description(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||
DRAW_NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
ui().draw_text_full(container, selected_sm_option.entry->description(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
|
||||
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
|
||||
|
||||
width += 2 * UI_BOX_LR_BORDER;
|
||||
maxwidth = MAX(origx2 - origx1, width);
|
||||
@ -463,8 +463,8 @@ void submenu::custom_render(void *selectedref, float top, float bottom, float or
|
||||
y1 += UI_BOX_TB_BORDER;
|
||||
|
||||
// draw the text within it
|
||||
ui().draw_text_full(container, selected_sm_option.entry->description(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
||||
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
ui().draw_text_full(container, selected_sm_option.entry->description(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
|
||||
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ CORE IMPLEMENTATION
|
||||
//-------------------------------------------------
|
||||
|
||||
text_layout::text_layout(render_font &font, float xscale, float yscale, float width, text_layout::text_justify justify, text_layout::word_wrapping wrap)
|
||||
: m_font(font), m_xscale(xscale), m_yscale(yscale), m_width(width), m_justify(justify), m_wrap(wrap), m_current_line(nullptr), m_last_break(0), m_text_position(0)
|
||||
: m_font(font), m_xscale(xscale), m_yscale(yscale), m_width(width), m_justify(justify), m_wrap(wrap), m_current_line(nullptr), m_last_break(0), m_text_position(0), m_truncating(false)
|
||||
|
||||
{
|
||||
}
|
||||
@ -90,7 +90,7 @@ text_layout::text_layout(render_font &font, float xscale, float yscale, float wi
|
||||
|
||||
text_layout::text_layout(text_layout &&that)
|
||||
: m_font(that.m_font), m_xscale(that.m_xscale), m_yscale(that.m_yscale), m_width(that.m_width), m_justify(that.m_justify), m_wrap(that.m_wrap), m_lines(std::move(that.m_lines)),
|
||||
m_current_line(that.m_current_line), m_last_break(that.m_last_break), m_text_position(that.m_text_position)
|
||||
m_current_line(that.m_current_line), m_last_break(that.m_last_break), m_text_position(that.m_text_position), m_truncating(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ void text_layout::add_text(const char *text, const char_style &style)
|
||||
update_maximum_line_width();
|
||||
m_current_line = nullptr;
|
||||
}
|
||||
else
|
||||
else if (!m_truncating)
|
||||
{
|
||||
// if we hit a space, remember the location and width *without* the space
|
||||
if (is_space_character(ch))
|
||||
@ -211,6 +211,34 @@ void text_layout::update_maximum_line_width()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// actual_left
|
||||
//-------------------------------------------------
|
||||
|
||||
float text_layout::actual_left() const
|
||||
{
|
||||
float result;
|
||||
if (empty())
|
||||
{
|
||||
// degenerate scenario
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 1.0f;
|
||||
for (const auto &line : m_lines)
|
||||
{
|
||||
result = std::min(result, line->xoffset());
|
||||
|
||||
// take an opportunity to break out easily
|
||||
if (result <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// actual_width
|
||||
//-------------------------------------------------
|
||||
@ -218,7 +246,7 @@ void text_layout::update_maximum_line_width()
|
||||
float text_layout::actual_width() const
|
||||
{
|
||||
float current_line_width = m_current_line ? m_current_line->width() : 0;
|
||||
return MAX(m_maximum_line_width, current_line_width);
|
||||
return std::max(m_maximum_line_width, current_line_width);
|
||||
}
|
||||
|
||||
|
||||
@ -250,6 +278,7 @@ void text_layout::start_new_line(text_layout::text_justify justify, float height
|
||||
update_maximum_line_width();
|
||||
m_current_line = new_line.get();
|
||||
m_last_break = 0;
|
||||
m_truncating = false;
|
||||
|
||||
// append it
|
||||
m_lines.push_back(std::move(new_line));
|
||||
@ -272,6 +301,8 @@ float text_layout::get_char_width(unicode_char ch, float size)
|
||||
|
||||
void text_layout::truncate_wrap()
|
||||
{
|
||||
const unicode_char elipsis = 0x2026;
|
||||
|
||||
// for now, lets assume that we're only truncating the last character
|
||||
size_t truncate_position = m_current_line->character_count() - 1;
|
||||
const auto& truncate_char = m_current_line->character(truncate_position);
|
||||
@ -285,7 +316,7 @@ void text_layout::truncate_wrap()
|
||||
source.span = 0;
|
||||
|
||||
// figure out how wide an elipsis is
|
||||
float elipsis_width = 3 * get_char_width('.', style.size);
|
||||
float elipsis_width = get_char_width(elipsis, style.size);
|
||||
|
||||
// where should we really truncate from?
|
||||
while (truncate_position > 0 && m_current_line->character(truncate_position).xoffset + elipsis_width < width())
|
||||
@ -295,10 +326,10 @@ void text_layout::truncate_wrap()
|
||||
m_current_line->truncate(truncate_position);
|
||||
|
||||
// and append the elipsis
|
||||
m_current_line->add_character('.', style, source);
|
||||
m_current_line->add_character(elipsis, style, source);
|
||||
|
||||
// finally start a new line
|
||||
start_new_line(m_current_line->justify(), style.size);
|
||||
// take note that we are truncating; supress new characters
|
||||
m_truncating = true;
|
||||
}
|
||||
|
||||
|
||||
@ -489,7 +520,7 @@ void text_layout::line::add_character(unicode_char ch, const char_style &style,
|
||||
m_width += chwidth;
|
||||
|
||||
// we might be bigger
|
||||
m_height = MAX(m_height, style.size * m_layout.yscale());
|
||||
m_height = std::max(m_height, style.size * m_layout.yscale());
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,8 +58,10 @@ public:
|
||||
word_wrapping wrap() const { return m_wrap; }
|
||||
|
||||
// methods
|
||||
float actual_left() const;
|
||||
float actual_width() const;
|
||||
float actual_height() const;
|
||||
bool empty() const { return m_lines.size() == 0; }
|
||||
bool hit_test(float x, float y, size_t &start, size_t &span) const;
|
||||
void restyle(size_t start, size_t span, rgb_t *fgcolor, rgb_t *bgcolor);
|
||||
int get_wrap_info(std::vector<int> &xstart, std::vector<int> &xend) const;
|
||||
@ -145,6 +147,7 @@ private:
|
||||
line *m_current_line;
|
||||
size_t m_last_break;
|
||||
size_t m_text_position;
|
||||
bool m_truncating;
|
||||
|
||||
// methods
|
||||
void add_text(const char *text, const char_style &style);
|
||||
|
@ -401,7 +401,7 @@ void mame_ui_manager::update_and_render(render_container *container)
|
||||
|
||||
// display any popup messages
|
||||
if (osd_ticks() < m_popup_text_end)
|
||||
draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
|
||||
draw_text_box(container, messagebox_poptext.c_str(), ui::text_layout::CENTER, 0.5f, 0.9f, messagebox_backcolor);
|
||||
else
|
||||
m_popup_text_end = 0;
|
||||
|
||||
@ -543,7 +543,7 @@ void mame_ui_manager::draw_outlined_box(render_container *container, float x0, f
|
||||
|
||||
void mame_ui_manager::draw_text(render_container *container, const char *buf, float x, float y)
|
||||
{
|
||||
draw_text_full(container, buf, x, y, 1.0f - x, JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
draw_text_full(container, buf, x, y, 1.0f - x, ui::text_layout::LEFT, ui::text_layout::WORD, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
@ -553,20 +553,20 @@ void mame_ui_manager::draw_text(render_container *container, const char *buf, fl
|
||||
// and full size computation
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight, float text_size)
|
||||
void mame_ui_manager::draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth, float *totalheight, float text_size)
|
||||
{
|
||||
// create the layout
|
||||
auto layout = create_layout(container, origwrapwidth, (ui::text_layout::text_justify)justify, (ui::text_layout::word_wrapping)wrap);
|
||||
auto layout = create_layout(container, origwrapwidth, justify, wrap);
|
||||
|
||||
// append text to it
|
||||
layout.add_text(
|
||||
origs,
|
||||
fgcolor,
|
||||
draw == DRAW_OPAQUE ? bgcolor : rgb_t(0, 0, 0, 0),
|
||||
draw == OPAQUE ? bgcolor : rgb_t::transparent,
|
||||
text_size);
|
||||
|
||||
// and emit it (if we are asked to do so)
|
||||
if (draw != DRAW_NONE)
|
||||
if (draw != NONE)
|
||||
layout.emit(container, x, y);
|
||||
|
||||
// return width/height
|
||||
@ -582,51 +582,42 @@ void mame_ui_manager::draw_text_full(render_container *container, const char *or
|
||||
// message with a box around it
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor)
|
||||
void mame_ui_manager::draw_text_box(render_container *container, const char *text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor)
|
||||
{
|
||||
float line_height = get_line_height();
|
||||
float max_width = 2.0f * ((xpos <= 0.5f) ? xpos : 1.0f - xpos) - 2.0f * UI_BOX_LR_BORDER;
|
||||
float target_width = max_width;
|
||||
float target_height = line_height;
|
||||
float target_x = 0, target_y = 0;
|
||||
float last_target_height = 0;
|
||||
// create a layout
|
||||
ui::text_layout layout = create_layout(container, 1.0f, justify);
|
||||
|
||||
// limit this iteration to a finite number of passes
|
||||
for (int pass = 0; pass < 5; pass++)
|
||||
{
|
||||
// determine the target location
|
||||
target_x = xpos - 0.5f * target_width;
|
||||
target_y = ypos - 0.5f * target_height;
|
||||
// add text to it
|
||||
layout.add_text(text);
|
||||
|
||||
// make sure we stay on-screen
|
||||
if (target_x < UI_BOX_LR_BORDER)
|
||||
target_x = UI_BOX_LR_BORDER;
|
||||
if (target_x + target_width + UI_BOX_LR_BORDER > 1.0f)
|
||||
target_x = 1.0f - UI_BOX_LR_BORDER - target_width;
|
||||
if (target_y < UI_BOX_TB_BORDER)
|
||||
target_y = UI_BOX_TB_BORDER;
|
||||
if (target_y + target_height + UI_BOX_TB_BORDER > 1.0f)
|
||||
target_y = 1.0f - UI_BOX_TB_BORDER - target_height;
|
||||
// and draw the result
|
||||
draw_text_box(container, layout, xpos, ypos, backcolor);
|
||||
}
|
||||
|
||||
// compute the multi-line target width/height
|
||||
draw_text_full(container, text, target_x, target_y, target_width + 0.00001f,
|
||||
justify, WRAP_WORD, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &target_width, &target_height);
|
||||
if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER)
|
||||
target_height = floorf((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
|
||||
|
||||
// if we match our last value, we're done
|
||||
if (target_height == last_target_height)
|
||||
break;
|
||||
last_target_height = target_height;
|
||||
}
|
||||
//-------------------------------------------------
|
||||
// draw_text_box - draw a multiline text
|
||||
// message with a box around it
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_text_box(render_container *container, ui::text_layout &layout, float xpos, float ypos, rgb_t backcolor)
|
||||
{
|
||||
// xpos and ypos are where we want to "pin" the layout, but we need to adjust for the actual size of the payload
|
||||
auto actual_left = layout.actual_left();
|
||||
auto actual_width = layout.actual_width();
|
||||
auto actual_height = layout.actual_height();
|
||||
auto x = std::min(std::max(xpos - actual_width / 2, UI_BOX_LR_BORDER), 1.0f - actual_width - UI_BOX_LR_BORDER);
|
||||
auto y = std::min(std::max(ypos - actual_height / 2, UI_BOX_TB_BORDER), 1.0f - actual_height - UI_BOX_TB_BORDER);
|
||||
|
||||
// add a box around that
|
||||
draw_outlined_box(container, target_x - UI_BOX_LR_BORDER,
|
||||
target_y - UI_BOX_TB_BORDER,
|
||||
target_x + target_width + UI_BOX_LR_BORDER,
|
||||
target_y + target_height + UI_BOX_TB_BORDER, backcolor);
|
||||
draw_text_full(container, text, target_x, target_y, target_width + 0.00001f,
|
||||
justify, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||
draw_outlined_box(container,
|
||||
x - UI_BOX_LR_BORDER,
|
||||
y - UI_BOX_TB_BORDER,
|
||||
x + actual_width + UI_BOX_LR_BORDER,
|
||||
y + actual_height + UI_BOX_TB_BORDER, backcolor);
|
||||
|
||||
// emit the text
|
||||
layout.emit(container, x - actual_left, y);
|
||||
}
|
||||
|
||||
|
||||
@ -637,7 +628,7 @@ void mame_ui_manager::draw_text_box(render_container *container, const char *tex
|
||||
|
||||
void mame_ui_manager::draw_message_window(render_container *container, const char *text)
|
||||
{
|
||||
draw_text_box(container, text, JUSTIFY_LEFT, 0.5f, 0.5f, UI_BACKGROUND_COLOR);
|
||||
draw_text_box(container, text, ui::text_layout::text_justify::LEFT, 0.5f, 0.5f, UI_BACKGROUND_COLOR);
|
||||
}
|
||||
|
||||
|
||||
@ -1010,7 +1001,7 @@ std::string &mame_ui_manager::game_info_astring(std::string &str)
|
||||
|
||||
UINT32 mame_ui_manager::handler_messagebox(render_container *container)
|
||||
{
|
||||
draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
|
||||
draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1026,7 +1017,7 @@ UINT32 mame_ui_manager::handler_messagebox_anykey(render_container *container)
|
||||
UINT32 state = 0;
|
||||
|
||||
// draw a standard message window
|
||||
draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
|
||||
draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor);
|
||||
|
||||
// if the user cancels, exit out completely
|
||||
if (machine().ui_input().pressed(IPT_UI_CANCEL))
|
||||
@ -1169,6 +1160,52 @@ void mame_ui_manager::paste()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw_fps_counter
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_fps_counter(render_container *container)
|
||||
{
|
||||
draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
|
||||
ui::text_layout::RIGHT, ui::text_layout::WORD, OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw_timecode_counter
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_timecode_counter(render_container *container)
|
||||
{
|
||||
std::string tempstring;
|
||||
draw_text_full(container, machine().video().timecode_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
|
||||
ui::text_layout::RIGHT, ui::text_layout::WORD, OPAQUE, rgb_t(0xf0, 0xf0, 0x10, 0x10), rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw_timecode_total
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_timecode_total(render_container *container)
|
||||
{
|
||||
std::string tempstring;
|
||||
draw_text_full(container, machine().video().timecode_total_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
|
||||
ui::text_layout::LEFT, ui::text_layout::WORD, OPAQUE, rgb_t(0xf0, 0x10, 0xf0, 0x10), rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// draw_profiler
|
||||
//-------------------------------------------------
|
||||
|
||||
void mame_ui_manager::draw_profiler(render_container *container)
|
||||
{
|
||||
const char *text = g_profiler.text(machine());
|
||||
draw_text_full(container, text, 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::WORD, OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// image_handler_ingame - execute display
|
||||
// callback function for each image device
|
||||
@ -1188,7 +1225,7 @@ void mame_ui_manager::image_handler_ingame()
|
||||
y = 0.5f + idx;
|
||||
y *= get_line_height() + 2.0f * UI_BOX_TB_BORDER;
|
||||
|
||||
draw_text_box(&machine().render().ui_container(), str.c_str(), JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
|
||||
draw_text_box(&machine().render().ui_container(), str.c_str(), ui::text_layout::LEFT, x, y, UI_BACKGROUND_COLOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1204,31 +1241,19 @@ UINT32 mame_ui_manager::handler_ingame(render_container *container)
|
||||
|
||||
// first draw the FPS counter
|
||||
if (show_fps_counter())
|
||||
{
|
||||
draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
|
||||
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
draw_fps_counter(container);
|
||||
|
||||
// Show the duration of current part (intro or gameplay or extra)
|
||||
if (show_timecode_counter()) {
|
||||
std::string tempstring;
|
||||
draw_text_full(container, machine().video().timecode_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
|
||||
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0xf0,0x10,0x10), rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
// Show the total time elapsed for the video preview (all parts intro, gameplay, extras)
|
||||
if (show_timecode_total()) {
|
||||
std::string tempstring;
|
||||
draw_text_full(container, machine().video().timecode_total_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f,
|
||||
JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0x10,0xf0,0x10), rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
if (show_timecode_counter())
|
||||
draw_timecode_counter(container);
|
||||
|
||||
// Show the total time elapsed for the video preview (all parts intro, gameplay, extras)
|
||||
if (show_timecode_total())
|
||||
draw_timecode_total(container);
|
||||
|
||||
// draw the profiler if visible
|
||||
if (show_profiler())
|
||||
{
|
||||
const char *text = g_profiler.text(machine());
|
||||
draw_text_full(container, text, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, rgb_t::white, rgb_t::black, nullptr, nullptr);
|
||||
}
|
||||
draw_profiler(container);
|
||||
|
||||
// if we're single-stepping, pause now
|
||||
if (single_step())
|
||||
@ -1575,7 +1600,7 @@ UINT32 mame_ui_manager::handler_confirm_quit(render_container *container)
|
||||
ui_select_text,
|
||||
ui_cancel_text);
|
||||
|
||||
draw_text_box(container, quit_message.c_str(), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
draw_text_box(container, quit_message.c_str(), ui::text_layout::CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||
machine().pause();
|
||||
|
||||
// if the user press ENTER, quit the game
|
||||
|
@ -70,30 +70,6 @@ class menu_item;
|
||||
/* cancel return value for a UI handler */
|
||||
#define UI_HANDLER_CANCEL ((UINT32)~0)
|
||||
|
||||
/* justification options for ui_draw_text_full */
|
||||
enum
|
||||
{
|
||||
JUSTIFY_LEFT = 0,
|
||||
JUSTIFY_CENTER,
|
||||
JUSTIFY_RIGHT
|
||||
};
|
||||
|
||||
/* word wrapping options for ui_draw_text_full */
|
||||
enum
|
||||
{
|
||||
WRAP_NEVER,
|
||||
WRAP_TRUNCATE,
|
||||
WRAP_WORD
|
||||
};
|
||||
|
||||
/* drawing options for ui_draw_text_full */
|
||||
enum
|
||||
{
|
||||
DRAW_NONE,
|
||||
DRAW_NORMAL,
|
||||
DRAW_OPAQUE
|
||||
};
|
||||
|
||||
#define SLIDER_DEVICE_SPACING 0x0ff
|
||||
#define SLIDER_SCREEN_SPACING 0x0f
|
||||
#define SLIDER_INPUT_SPACING 0x0f
|
||||
@ -167,6 +143,13 @@ enum ui_callback_type
|
||||
class mame_ui_manager : public ui_manager, public slider_changed_notifier
|
||||
{
|
||||
public:
|
||||
enum draw_mode
|
||||
{
|
||||
NONE,
|
||||
NORMAL,
|
||||
OPAQUE
|
||||
};
|
||||
|
||||
// construction/destruction
|
||||
mame_ui_manager(running_machine &machine);
|
||||
|
||||
@ -222,8 +205,9 @@ public:
|
||||
void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor);
|
||||
void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor);
|
||||
void draw_text(render_container *container, const char *buf, float x, float y);
|
||||
void draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f);
|
||||
void draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor);
|
||||
void draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, ui::text_layout::text_justify justify, ui::text_layout::word_wrapping wrap, draw_mode draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f);
|
||||
void draw_text_box(render_container *container, const char *text, ui::text_layout::text_justify justify, float xpos, float ypos, rgb_t backcolor);
|
||||
void draw_text_box(render_container *container, ui::text_layout &layout, float xpos, float ypos, rgb_t backcolor);
|
||||
void draw_message_window(render_container *container, const char *text);
|
||||
|
||||
// load/save options to file
|
||||
@ -248,6 +232,10 @@ public:
|
||||
void increase_frameskip();
|
||||
void decrease_frameskip();
|
||||
void request_quit();
|
||||
void draw_fps_counter(render_container *container);
|
||||
void draw_timecode_counter(render_container *container);
|
||||
void draw_timecode_total(render_container *container);
|
||||
void draw_profiler(render_container *container);
|
||||
|
||||
// print the game info string into a buffer
|
||||
std::string &game_info_astring(std::string &str);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
const rgb_t rgb_t::black(0,0,0);
|
||||
const rgb_t rgb_t::white(255,255,255);
|
||||
const rgb_t rgb_t::transparent(0, 0, 0, 0);
|
||||
|
||||
// the colors below are commonly used screen colors
|
||||
const rgb_t rgb_t::green(0, 255, 0);
|
||||
|
@ -80,6 +80,7 @@ public:
|
||||
static const rgb_t white;
|
||||
static const rgb_t green;
|
||||
static const rgb_t amber;
|
||||
static const rgb_t transparent;
|
||||
|
||||
private:
|
||||
UINT32 m_data;
|
||||
|
Loading…
Reference in New Issue
Block a user