mirror of
https://github.com/holub/mame
synced 2025-04-16 21:44:32 +03:00
Fixed the key handler for the error "roms or missing CHD."
Removed the delay in showing the description in the Advanced menu. Synchronized the translation files.
This commit is contained in:
parent
0386367805
commit
b10ffebf58
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1724,10 +1724,8 @@ void ui_menu::handle_main_keys(UINT32 flags)
|
|||||||
// hitting cancel also pops the stack
|
// hitting cancel also pops the stack
|
||||||
if (exclusive_input_pressed(IPT_UI_CANCEL, 0))
|
if (exclusive_input_pressed(IPT_UI_CANCEL, 0))
|
||||||
{
|
{
|
||||||
if (!menu_has_search_active())
|
if (!ui_error && !menu_has_search_active())
|
||||||
ui_menu::stack_pop(machine());
|
ui_menu::stack_pop(machine());
|
||||||
// else if (!ui_error)
|
|
||||||
// ui_menu::stack_pop(machine()); TODO
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +205,10 @@ void ui_menu_select_game::handle()
|
|||||||
{
|
{
|
||||||
// reset the error on any future m_event
|
// reset the error on any future m_event
|
||||||
if (ui_error)
|
if (ui_error)
|
||||||
|
{
|
||||||
ui_error = false;
|
ui_error = false;
|
||||||
|
machine().ui_input().reset();
|
||||||
|
}
|
||||||
|
|
||||||
// handle selections
|
// handle selections
|
||||||
else if (m_event->iptkey == IPT_UI_SELECT)
|
else if (m_event->iptkey == IPT_UI_SELECT)
|
||||||
@ -444,7 +447,7 @@ void ui_menu_select_game::handle()
|
|||||||
// if we're in an error state, overlay an error message
|
// if we're in an error state, overlay an error message
|
||||||
if (ui_error)
|
if (ui_error)
|
||||||
machine().ui().draw_text_box(container, _("The selected machine is missing one or more required ROM or CHD images. "
|
machine().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 (except ESC) to continue."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
"Please select a different machine.\n\nPress any key to continue."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||||
|
|
||||||
// handle filters selection from key shortcuts
|
// handle filters selection from key shortcuts
|
||||||
if (check_filter)
|
if (check_filter)
|
||||||
|
@ -171,7 +171,10 @@ void ui_menu_select_software::handle()
|
|||||||
{
|
{
|
||||||
// reset the error on any future m_event
|
// reset the error on any future m_event
|
||||||
if (ui_error)
|
if (ui_error)
|
||||||
|
{
|
||||||
ui_error = false;
|
ui_error = false;
|
||||||
|
machine().ui_input().reset();
|
||||||
|
}
|
||||||
|
|
||||||
// handle selections
|
// handle selections
|
||||||
else if (m_event->iptkey == IPT_UI_SELECT)
|
else if (m_event->iptkey == IPT_UI_SELECT)
|
||||||
@ -375,7 +378,7 @@ void ui_menu_select_software::handle()
|
|||||||
// if we're in an error state, overlay an error message
|
// if we're in an error state, overlay an error message
|
||||||
if (ui_error)
|
if (ui_error)
|
||||||
machine().ui().draw_text_box(container, _("The selected software is missing one or more required files. "
|
machine().ui().draw_text_box(container, _("The selected software is missing one or more required files. "
|
||||||
"Please select a different software.\n\nPress any key (except ESC) to continue."),
|
"Please select a different software.\n\nPress any key to continue."),
|
||||||
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR);
|
||||||
|
|
||||||
// handle filters selection from key shortcuts
|
// handle filters selection from key shortcuts
|
||||||
|
@ -103,7 +103,10 @@ void ui_simple_menu_select_game::handle()
|
|||||||
{
|
{
|
||||||
// reset the error on any future menu_event
|
// reset the error on any future menu_event
|
||||||
if (m_error)
|
if (m_error)
|
||||||
|
{
|
||||||
m_error = false;
|
m_error = false;
|
||||||
|
machine().ui_input().reset();
|
||||||
|
}
|
||||||
|
|
||||||
// handle selections
|
// handle selections
|
||||||
else
|
else
|
||||||
|
@ -53,7 +53,6 @@ void ui_submenu::handle()
|
|||||||
{
|
{
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
std::string error_string, tmptxt;
|
std::string error_string, tmptxt;
|
||||||
int i_cur;
|
|
||||||
float f_cur, f_step;
|
float f_cur, f_step;
|
||||||
|
|
||||||
// process the menu
|
// process the menu
|
||||||
@ -80,7 +79,7 @@ void ui_submenu::handle()
|
|||||||
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
||||||
{
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
i_cur = atof(sm_option->entry->value());
|
int i_cur = atoi(sm_option->entry->value());
|
||||||
(m_event->iptkey == IPT_UI_LEFT) ? i_cur-- : i_cur++;
|
(m_event->iptkey == IPT_UI_LEFT) ? i_cur-- : i_cur++;
|
||||||
sm_option->options->set_value(sm_option->name, i_cur, OPTION_PRIORITY_CMDLINE, error_string);
|
sm_option->options->set_value(sm_option->name, i_cur, OPTION_PRIORITY_CMDLINE, error_string);
|
||||||
sm_option->entry->mark_changed();
|
sm_option->entry->mark_changed();
|
||||||
@ -135,9 +134,6 @@ void ui_submenu::handle()
|
|||||||
void ui_submenu::populate()
|
void ui_submenu::populate()
|
||||||
{
|
{
|
||||||
UINT32 arrow_flags;
|
UINT32 arrow_flags;
|
||||||
std::string tmptxt;
|
|
||||||
float f_min, f_max, f_cur;
|
|
||||||
int i_min, i_max, i_cur;
|
|
||||||
|
|
||||||
// add options
|
// add options
|
||||||
for (auto sm_option = m_options.begin(); sm_option < m_options.end(); sm_option++)
|
for (auto sm_option = m_options.begin(); sm_option < m_options.end(); sm_option++)
|
||||||
@ -164,16 +160,18 @@ void ui_submenu::populate()
|
|||||||
case OPTION_BOOLEAN:
|
case OPTION_BOOLEAN:
|
||||||
arrow_flags = sm_option->options->bool_value(sm_option->name) ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW;
|
arrow_flags = sm_option->options->bool_value(sm_option->name) ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW;
|
||||||
item_append(_(sm_option->description),
|
item_append(_(sm_option->description),
|
||||||
(arrow_flags == MENU_FLAG_RIGHT_ARROW) ? "On" : "Off",
|
(arrow_flags == MENU_FLAG_RIGHT_ARROW) ? "On" : "Off",
|
||||||
arrow_flags,
|
arrow_flags,
|
||||||
static_cast<void*>(&(*sm_option)));
|
static_cast<void*>(&(*sm_option)));
|
||||||
break;
|
break;
|
||||||
case OPTION_INTEGER:
|
case OPTION_INTEGER:
|
||||||
i_cur = atof(sm_option->entry->value());
|
{
|
||||||
|
int i_min, i_max;
|
||||||
|
int i_cur = atoi(sm_option->entry->value());
|
||||||
if (sm_option->entry->has_range())
|
if (sm_option->entry->has_range())
|
||||||
{
|
{
|
||||||
i_min = atof(sm_option->entry->minimum());
|
i_min = atoi(sm_option->entry->minimum());
|
||||||
i_max = atof(sm_option->entry->maximum());
|
i_max = atoi(sm_option->entry->maximum());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -182,12 +180,15 @@ void ui_submenu::populate()
|
|||||||
}
|
}
|
||||||
arrow_flags = get_arrow_flags(i_min, i_max, i_cur);
|
arrow_flags = get_arrow_flags(i_min, i_max, i_cur);
|
||||||
item_append(_(sm_option->description),
|
item_append(_(sm_option->description),
|
||||||
sm_option->entry->value(),
|
sm_option->entry->value(),
|
||||||
arrow_flags,
|
arrow_flags,
|
||||||
static_cast<void*>(&(*sm_option)));
|
static_cast<void*>(&(*sm_option)));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case OPTION_FLOAT:
|
case OPTION_FLOAT:
|
||||||
f_cur = atof(sm_option->entry->value());
|
{
|
||||||
|
float f_min, f_max;
|
||||||
|
float f_cur = atof(sm_option->entry->value());
|
||||||
if (sm_option->entry->has_range())
|
if (sm_option->entry->has_range())
|
||||||
{
|
{
|
||||||
f_min = atof(sm_option->entry->minimum());
|
f_min = atof(sm_option->entry->minimum());
|
||||||
@ -199,17 +200,18 @@ void ui_submenu::populate()
|
|||||||
f_max = std::numeric_limits<float>::max();
|
f_max = std::numeric_limits<float>::max();
|
||||||
}
|
}
|
||||||
arrow_flags = get_arrow_flags(f_min, f_max, f_cur);
|
arrow_flags = get_arrow_flags(f_min, f_max, f_cur);
|
||||||
tmptxt = string_format("%g", f_cur);
|
std::string tmptxt = string_format("%g", f_cur);
|
||||||
item_append(_(sm_option->description),
|
item_append(_(sm_option->description),
|
||||||
tmptxt.c_str(),
|
tmptxt.c_str(),
|
||||||
arrow_flags,
|
arrow_flags,
|
||||||
static_cast<void*>(&(*sm_option)));
|
static_cast<void*>(&(*sm_option)));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
arrow_flags = MENU_FLAG_RIGHT_ARROW;
|
arrow_flags = MENU_FLAG_RIGHT_ARROW;
|
||||||
item_append(_(sm_option->description),
|
item_append(_(sm_option->description),
|
||||||
sm_option->options->value(sm_option->name),
|
sm_option->options->value(sm_option->name),
|
||||||
arrow_flags, static_cast<void*>(&(*sm_option)));
|
arrow_flags, static_cast<void*>(&(*sm_option)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -229,14 +231,11 @@ void ui_submenu::populate()
|
|||||||
|
|
||||||
void ui_submenu::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
void ui_submenu::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
|
||||||
{
|
{
|
||||||
static int interval = 0;
|
|
||||||
static ui_submenu::option *last_sm_option = nullptr;
|
|
||||||
|
|
||||||
float width;
|
float width;
|
||||||
ui_manager &mui = machine().ui();
|
ui_manager &mui = machine().ui();
|
||||||
|
|
||||||
mui.draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
mui.draw_text_full(container, _(m_options[0].description), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||||
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
|
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
|
||||||
width += 2 * UI_BOX_LR_BORDER;
|
width += 2 * UI_BOX_LR_BORDER;
|
||||||
float maxwidth = MAX(origx2 - origx1, width);
|
float maxwidth = MAX(origx2 - origx1, width);
|
||||||
|
|
||||||
@ -256,22 +255,15 @@ void ui_submenu::custom_render(void *selectedref, float top, float bottom, float
|
|||||||
|
|
||||||
// draw the text within it
|
// draw the text within it
|
||||||
mui.draw_text_full(container, _(m_options[0].description), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
mui.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);
|
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||||
|
|
||||||
if (selectedref != nullptr)
|
if (selectedref != nullptr)
|
||||||
{
|
{
|
||||||
ui_submenu::option *selected_sm_option = (ui_submenu::option *)selectedref;
|
ui_submenu::option *selected_sm_option = (ui_submenu::option *)selectedref;
|
||||||
|
|
||||||
if (last_sm_option == selected_sm_option) {
|
if (selected_sm_option->entry != nullptr)
|
||||||
if (interval <= 30) interval++;
|
|
||||||
} else {
|
|
||||||
last_sm_option = selected_sm_option;
|
|
||||||
interval = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interval > 30 && last_sm_option->entry != nullptr)
|
|
||||||
{
|
{
|
||||||
mui.draw_text_full(container, last_sm_option->entry->description(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
mui.draw_text_full(container, selected_sm_option->entry->description(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
|
||||||
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
|
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
|
||||||
|
|
||||||
width += 2 * UI_BOX_LR_BORDER;
|
width += 2 * UI_BOX_LR_BORDER;
|
||||||
@ -292,13 +284,8 @@ void ui_submenu::custom_render(void *selectedref, float top, float bottom, float
|
|||||||
y1 += UI_BOX_TB_BORDER;
|
y1 += UI_BOX_TB_BORDER;
|
||||||
|
|
||||||
// draw the text within it
|
// draw the text within it
|
||||||
mui.draw_text_full(container, last_sm_option->entry->description(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
|
mui.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);
|
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
last_sm_option = nullptr;
|
|
||||||
interval = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user