mirror of
https://github.com/holub/mame
synced 2025-06-23 21:06:38 +03:00
Do not handle any UI inputs immediately after state load/save
Before this change, if you try to save state to a bound which already does something as a UI button, it will save state there and then immediately execute the bound action (sometimes it would not happen). So, if you have state to P, with default button it would pause the game immediately after saving state (except sometimes it would not).
This commit is contained in:
parent
c9faa144ba
commit
b11f39e7a0
@ -1755,6 +1755,9 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
|
|||||||
machine.schedule_load(filename);
|
machine.schedule_load(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// avoid handling the name of the save state slot as a seperate input
|
||||||
|
machine.ui_input().mark_all_as_pressed();
|
||||||
|
|
||||||
// remove the pause and reset the state
|
// remove the pause and reset the state
|
||||||
machine.resume();
|
machine.resume();
|
||||||
return UI_HANDLER_CANCEL;
|
return UI_HANDLER_CANCEL;
|
||||||
|
@ -324,3 +324,13 @@ void ui_input_manager::push_char_event(render_target* target, unicode_char ch)
|
|||||||
event.ch = ch;
|
event.ch = ch;
|
||||||
push_event(event);
|
push_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
mark_all_as_pressed - marks all buttons
|
||||||
|
as if they were already pressed once
|
||||||
|
-------------------------------------------------*/
|
||||||
|
void ui_input_manager::mark_all_as_pressed()
|
||||||
|
{
|
||||||
|
for (int code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
|
||||||
|
m_next_repeat[code] = osd_ticks();
|
||||||
|
}
|
||||||
|
@ -86,6 +86,8 @@ public:
|
|||||||
void push_mouse_double_click_event(render_target* target, INT32 x, INT32 y);
|
void push_mouse_double_click_event(render_target* target, INT32 x, INT32 y);
|
||||||
void push_char_event(render_target* target, unicode_char ch);
|
void push_char_event(render_target* target, unicode_char ch);
|
||||||
|
|
||||||
|
void mark_all_as_pressed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
|
Loading…
Reference in New Issue
Block a user