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
|
||||
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());
|
||||
// else if (!ui_error)
|
||||
// ui_menu::stack_pop(machine()); TODO
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,10 @@ void ui_menu_select_game::handle()
|
||||
{
|
||||
// reset the error on any future m_event
|
||||
if (ui_error)
|
||||
{
|
||||
ui_error = false;
|
||||
machine().ui_input().reset();
|
||||
}
|
||||
|
||||
// handle selections
|
||||
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 (ui_error)
|
||||
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
|
||||
if (check_filter)
|
||||
|
@ -171,7 +171,10 @@ void ui_menu_select_software::handle()
|
||||
{
|
||||
// reset the error on any future m_event
|
||||
if (ui_error)
|
||||
{
|
||||
ui_error = false;
|
||||
machine().ui_input().reset();
|
||||
}
|
||||
|
||||
// handle selections
|
||||
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 (ui_error)
|
||||
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);
|
||||
|
||||
// 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
|
||||
if (m_error)
|
||||
{
|
||||
m_error = false;
|
||||
machine().ui_input().reset();
|
||||
}
|
||||
|
||||
// handle selections
|
||||
else
|
||||
|
@ -53,7 +53,6 @@ void ui_submenu::handle()
|
||||
{
|
||||
bool changed = false;
|
||||
std::string error_string, tmptxt;
|
||||
int i_cur;
|
||||
float f_cur, f_step;
|
||||
|
||||
// process the menu
|
||||
@ -80,7 +79,7 @@ void ui_submenu::handle()
|
||||
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
|
||||
{
|
||||
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++;
|
||||
sm_option->options->set_value(sm_option->name, i_cur, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
sm_option->entry->mark_changed();
|
||||
@ -135,9 +134,6 @@ void ui_submenu::handle()
|
||||
void ui_submenu::populate()
|
||||
{
|
||||
UINT32 arrow_flags;
|
||||
std::string tmptxt;
|
||||
float f_min, f_max, f_cur;
|
||||
int i_min, i_max, i_cur;
|
||||
|
||||
// add options
|
||||
for (auto sm_option = m_options.begin(); sm_option < m_options.end(); sm_option++)
|
||||
@ -169,11 +165,13 @@ void ui_submenu::populate()
|
||||
static_cast<void*>(&(*sm_option)));
|
||||
break;
|
||||
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())
|
||||
{
|
||||
i_min = atof(sm_option->entry->minimum());
|
||||
i_max = atof(sm_option->entry->maximum());
|
||||
i_min = atoi(sm_option->entry->minimum());
|
||||
i_max = atoi(sm_option->entry->maximum());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -186,8 +184,11 @@ void ui_submenu::populate()
|
||||
arrow_flags,
|
||||
static_cast<void*>(&(*sm_option)));
|
||||
break;
|
||||
}
|
||||
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())
|
||||
{
|
||||
f_min = atof(sm_option->entry->minimum());
|
||||
@ -199,12 +200,13 @@ void ui_submenu::populate()
|
||||
f_max = std::numeric_limits<float>::max();
|
||||
}
|
||||
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),
|
||||
tmptxt.c_str(),
|
||||
arrow_flags,
|
||||
static_cast<void*>(&(*sm_option)));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
arrow_flags = MENU_FLAG_RIGHT_ARROW;
|
||||
item_append(_(sm_option->description),
|
||||
@ -229,9 +231,6 @@ void ui_submenu::populate()
|
||||
|
||||
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;
|
||||
ui_manager &mui = machine().ui();
|
||||
|
||||
@ -262,16 +261,9 @@ void ui_submenu::custom_render(void *selectedref, float top, float bottom, float
|
||||
{
|
||||
ui_submenu::option *selected_sm_option = (ui_submenu::option *)selectedref;
|
||||
|
||||
if (last_sm_option == selected_sm_option) {
|
||||
if (interval <= 30) interval++;
|
||||
} else {
|
||||
last_sm_option = selected_sm_option;
|
||||
interval = 0;
|
||||
}
|
||||
|
||||
if (interval > 30 && last_sm_option->entry != nullptr)
|
||||
if (selected_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);
|
||||
|
||||
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;
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
last_sm_option = nullptr;
|
||||
interval = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user