This commit is contained in:
dankan1890 2016-04-12 13:04:02 +02:00
parent fa28dd9c77
commit f7166e84ae
8 changed files with 149 additions and 38 deletions

View File

@ -1919,3 +1919,66 @@ msgstr " 色彩"
#: src/emu/ui/viewgfx.cpp:392
msgid " PENS"
msgstr " PENS"
#~ msgid "Lightgun Device Assignment"
#~ msgstr "配置光枪设备"
#~ msgid "Trackball Device Assignment"
#~ msgstr "配置轨迹球设备"
#~ msgid "Pedal Device Assignment"
#~ msgstr "配置踏板设备"
#~ msgid "Adstick Device Assignment"
#~ msgstr "配置 AD 游戏杆设备"
#~ msgid "Paddle Device Assignment"
#~ msgstr "配置操纵杆设备"
#~ msgid "Dial Device Assignment"
#~ msgstr "配置方向盘设备"
#~ msgid "Positional Device Assignment"
#~ msgstr "配置定位设备"
#~ msgid "Mouse Device Assignment"
#~ msgstr "配置鼠标设备"
#~ msgid "Device Mapping"
#~ msgstr "装置映对"
#~ msgid "Video Mode"
#~ msgstr "视讯模式"
#~ msgid "Triple Buffering"
#~ msgstr "三重缓冲"
#~ msgid "HLSL"
#~ msgstr "HLSL"
#~ msgid "GLSL"
#~ msgstr "GLSL"
#~ msgid "Bilinear Filtering"
#~ msgstr "双线过滤"
#~ msgid "Bitmap Prescaling"
#~ msgstr "点阵预缩放"
#~ msgid "Window Mode"
#~ msgstr "视窗模式"
#~ msgid "Enforce Aspect Ratio"
#~ msgstr "强制长宽比例"
#~ msgid "Start Out Maximized"
#~ msgstr "启动时最大化"
#~ msgid "Synchronized Refresh"
#~ msgstr "同步更新"
#~ msgid "Wait Vertical Sync"
#~ msgstr "等待垂直同步"
#~ msgid "Display Options"
#~ msgstr "视讯选项"

View File

@ -1919,3 +1919,66 @@ msgstr " 色彩"
#: src/emu/ui/viewgfx.cpp:392
msgid " PENS"
msgstr " PENS"
#~ msgid "Lightgun Device Assignment"
#~ msgstr "指派光線槍裝置"
#~ msgid "Trackball Device Assignment"
#~ msgstr "指派軌跡球裝置"
#~ msgid "Pedal Device Assignment"
#~ msgstr "指派踏板裝置"
#~ msgid "Adstick Device Assignment"
#~ msgstr "指派 AD 搖桿裝置"
#~ msgid "Paddle Device Assignment"
#~ msgstr "指派操縱桿裝置"
#~ msgid "Dial Device Assignment"
#~ msgstr "指派轉盤裝置"
#~ msgid "Positional Device Assignment"
#~ msgstr "指派定位裝置"
#~ msgid "Mouse Device Assignment"
#~ msgstr "指派滑鼠裝置"
#~ msgid "Device Mapping"
#~ msgstr "裝置映對"
#~ msgid "Video Mode"
#~ msgstr "視訊模式"
#~ msgid "Triple Buffering"
#~ msgstr "三重緩衝"
#~ msgid "HLSL"
#~ msgstr "HLSL"
#~ msgid "GLSL"
#~ msgstr "GLSL"
#~ msgid "Bilinear Filtering"
#~ msgstr "雙線過濾"
#~ msgid "Bitmap Prescaling"
#~ msgstr "點陣預縮放"
#~ msgid "Window Mode"
#~ msgstr "視窗模式"
#~ msgid "Enforce Aspect Ratio"
#~ msgstr "強制長寬比例"
#~ msgid "Start Out Maximized"
#~ msgstr "啟動時最大化"
#~ msgid "Synchronized Refresh"
#~ msgstr "同步更新"
#~ msgid "Wait Vertical Sync"
#~ msgstr "等待垂直同步"
#~ msgid "Display Options"
#~ msgstr "視訊選項"

View File

@ -1420,7 +1420,7 @@ void ui_menu::draw_select_game(bool noinput)
{
float line_height = machine().ui().get_line_height();
float ud_arrow_width = line_height * machine().render().ui_aspect();
float gutter_width = 0.52f * line_height * machine().render().ui_aspect();
float gutter_width = 0.52f * ud_arrow_width;
mouse_x = -1, mouse_y = -1;
float right_panel_size = (ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_RIGHT_PANEL) ? 2.0f * UI_BOX_LR_BORDER : 0.3f;
float visible_width = 1.0f - 4.0f * UI_BOX_LR_BORDER;
@ -1579,7 +1579,7 @@ void ui_menu::draw_select_game(bool noinput)
else
draw_icon(linenum, item[itemnum].ref, effective_left, line_y);
space = mui.get_line_height() * container->manager().ui_aspect() * 1.5f;
space = ud_arrow_width * 1.5f;
}
mui.draw_text_full(container, itemtext, effective_left + space, line_y, effective_width - space, JUSTIFY_LEFT, WRAP_TRUNCATE,
DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);

View File

@ -496,7 +496,6 @@ void ui_menu_select_game::populate()
// reset search string
m_search[0] = '\0';
m_displaylist.clear();
m_tmp.clear();
// if filter is set on category, build category list
switch (main_filters::actual)
@ -505,16 +504,16 @@ void ui_menu_select_game::populate()
build_category();
break;
case FILTER_MANUFACTURER:
build_list(m_tmp, c_mnfct::ui[c_mnfct::actual].c_str());
build_list(c_mnfct::ui[c_mnfct::actual].c_str());
break;
case FILTER_YEAR:
build_list(m_tmp, c_year::ui[c_year::actual].c_str());
build_list(c_year::ui[c_year::actual].c_str());
break;
case FILTER_CUSTOM:
build_custom();
break;
default:
build_list(m_tmp);
build_list();
break;
}
@ -1280,7 +1279,7 @@ void ui_menu_select_game::inkey_configure(const ui_menu_event *m_event)
// build list
//-------------------------------------------------
void ui_menu_select_game::build_list(std::vector<const game_driver *> &s_drivers, const char *filter_text, int filter, bool bioscheck)
void ui_menu_select_game::build_list(const char *filter_text, int filter, bool bioscheck, std::vector<const game_driver *> s_drivers)
{
int cx = 0;
bool cloneof = false;
@ -1444,13 +1443,13 @@ void ui_menu_select_game::build_custom()
switch (filter)
{
case FILTER_YEAR:
build_list(s_drivers, c_year::ui[custfltr::year[count]].c_str(), filter, bioscheck);
build_list(c_year::ui[custfltr::year[count]].c_str(), filter, bioscheck, s_drivers);
break;
case FILTER_MANUFACTURER:
build_list(s_drivers, c_mnfct::ui[custfltr::mnfct[count]].c_str(), filter, bioscheck);
build_list(c_mnfct::ui[custfltr::mnfct[count]].c_str(), filter, bioscheck, s_drivers);
break;
default:
build_list(s_drivers, nullptr, filter, bioscheck);
build_list(nullptr, filter, bioscheck, s_drivers);
break;
}
}
@ -1462,14 +1461,14 @@ void ui_menu_select_game::build_custom()
void ui_menu_select_game::build_category()
{
m_displaylist.clear();
std::vector<int> temp_filter;
machine().inifile().load_ini_category(temp_filter);
for (auto actual : temp_filter)
m_tmp.push_back(&driver_list::driver(actual));
m_displaylist.push_back(&driver_list::driver(actual));
std::stable_sort(m_tmp.begin(), m_tmp.end(), sorted_game_list);
m_displaylist = m_tmp;
std::stable_sort(m_displaylist.begin(), m_displaylist.end(), sorted_game_list);
}
//-------------------------------------------------
@ -1780,7 +1779,7 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
{
float origy1 = y1;
float origy2 = y2;
float text_size = 0.75f;
float text_size = machine().ui().options().infos_size();
float line_height_max = line_height * text_size;
float left_width = 0.0f;
int text_lenght = main_filters::length;
@ -1796,13 +1795,13 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
line_height_max = line_height * text_size;
}
float text_sign = mui.get_string_width_ex("_# ", text_size);
float text_sign = mui.get_string_width("_# ", text_size);
for (int x = 0; x < text_lenght; ++x)
{
float total_width;
// compute width of left hand side
total_width = mui.get_string_width_ex(text[x], text_size);
total_width = mui.get_string_width(text[x], text_size);
total_width += text_sign;
// track the maximum
@ -2076,7 +2075,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
else if (ui_globals::curdats_view == UI_STORY_LOAD)
{
// check size
float textlen = mui.get_string_width_ex(tempbuf.c_str(), text_size);
float textlen = mui.get_string_width(tempbuf.c_str(), text_size);
float tmp_size = (textlen > sc) ? text_size * (sc / textlen) : text_size;
size_t last_underscore = tempbuf.find_last_of("_");
@ -2106,7 +2105,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
else if (ui_globals::curdats_view == UI_COMMAND_LOAD || ui_globals::curdats_view == UI_GENERAL_LOAD)
{
// check size
float textlen = mui.get_string_width_ex(tempbuf.c_str(), text_size);
float textlen = mui.get_string_width(tempbuf.c_str(), text_size);
float tmp_size = (textlen > sc) ? text_size * (sc / textlen) : text_size;
int first_dspace = (ui_globals::curdats_view == UI_COMMAND_LOAD) ? tempbuf.find(" ") : tempbuf.find(":");

View File

@ -53,7 +53,6 @@ private:
std::vector<const game_driver *> m_availsortedlist;
std::vector<const game_driver *> m_unavailsortedlist;
std::vector<const game_driver *> m_displaylist;
std::vector<const game_driver *> m_tmp;
const game_driver *m_searchlist[VISIBLE_GAMES_IN_SEARCH + 1];
@ -61,7 +60,7 @@ private:
void build_custom();
void build_category();
void build_available_list();
void build_list(std::vector<const game_driver *> &vec, const char *filter_text = nullptr, int filter = 0, bool bioscheck = false);
void build_list(const char *filter_text = nullptr, int filter = 0, bool bioscheck = false, std::vector<const game_driver *> vec = {});
bool isfavorite();
void populate_search();

View File

@ -1415,13 +1415,13 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo
line_height = l_height * text_size;
}
float text_sign = mui.get_string_width_ex("_# ", text_size);
float text_sign = mui.get_string_width("_# ", text_size);
for (int x = 0; x < text_lenght; ++x)
{
float total_width;
// compute width of left hand side
total_width = mui.get_string_width_ex(text[x], text_size);
total_width = mui.get_string_width(text[x], text_size);
total_width += text_sign;
// track the maximum

View File

@ -602,9 +602,9 @@ float ui_manager::get_char_width(unicode_char ch)
// character string
//-------------------------------------------------
float ui_manager::get_string_width(const char *s)
float ui_manager::get_string_width(const char *s, float text_size)
{
return get_font()->utf8string_width(get_line_height(), machine().render().ui_aspect(), s);
return get_font()->utf8string_width(get_line_height() * text_size, machine().render().ui_aspect(), s);
}
@ -2684,16 +2684,6 @@ void ui_manager::draw_textured_box(render_container *container, float x0, float
container->add_line(x0, y1, x0, y0, UI_LINE_WIDTH, linecolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
//-------------------------------------------------
// get_string_width_ex - return the width of a
// character string with given text size
//-------------------------------------------------
float ui_manager::get_string_width_ex(const char *s, float text_size)
{
return get_font()->utf8string_width(get_line_height() * text_size, machine().render().ui_aspect(), s);
}
//-------------------------------------------------
// decode UI color options
//-------------------------------------------------

View File

@ -140,7 +140,7 @@ public:
render_font *get_font();
float get_line_height();
float get_char_width(unicode_char ch);
float get_string_width(const char *s);
float get_string_width(const char *s, float text_size = 1.0f);
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);
@ -186,9 +186,6 @@ public:
// draw an outlined box with given line color and filled with a texture
void draw_textured_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, UINT32 flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
// return text string width with given text size
float get_string_width_ex(const char *s, float text_size);
private:
// instance variables
running_machine & m_machine;