enhance Rewind/UnwindPause events

This commit is contained in:
thrust26 2019-06-02 14:07:42 +02:00
parent 351aff6be6
commit b1b1d87cfa
4 changed files with 12 additions and 6 deletions

View File

@ -320,7 +320,7 @@ void PhysicalJoystickHandler::setStickDefaultMapping(int stick,
setDefaultBtn(stick, 2, Event::CmdMenuMode);
setDefaultBtn(stick, 3, Event::OptionsMenuMode);
setDefaultBtn(stick, 4, Event::ExitMode);
setDefaultBtn(stick, 5, Event::Rewind);
setDefaultBtn(stick, 5, Event::RewindPause);
setDefaultBtn(stick, 7, Event::ConsoleSelect);
setDefaultBtn(stick, 8, Event::ConsoleReset);
#endif

View File

@ -224,9 +224,11 @@ void PhysicalKeyboardHandler::setDefaultMapping(Event::Type event, EventMode mod
setDefaultKey(Event::ToggleBits , KBDK_COMMA, MOD3);
setDefaultKey(Event::ToggleFixedColors , KBDK_PERIOD, MOD3);
setDefaultKey(Event::RewindPause , KBDK_LEFT, KBDM_SHIFT);
setDefaultKey(Event::Rewind1Menu , KBDK_LEFT, MOD3);
setDefaultKey(Event::Rewind10Menu , KBDK_LEFT, KBDM_SHIFT | MOD3);
setDefaultKey(Event::RewindAllMenu , KBDK_DOWN, MOD3);
setDefaultKey(Event::UnwindPause , KBDK_LEFT, KBDM_SHIFT);
setDefaultKey(Event::Unwind1Menu , KBDK_RIGHT, MOD3);
setDefaultKey(Event::Unwind10Menu , KBDK_RIGHT, KBDM_SHIFT | MOD3);
setDefaultKey(Event::UnwindAllMenu , KBDK_UP, MOD3);

View File

@ -76,7 +76,7 @@ class Event
ChangeState, LoadState, SaveState, TakeSnapshot, Quit,
TogglePauseMode, OptionsMenuMode, CmdMenuMode, TimeMachineMode, DebuggerMode, ExitMode,
Fry, VolumeDecrease, VolumeIncrease, SoundToggle, VidmodeDecrease, VidmodeIncrease,
Rewind, Unwind,
RewindPause, UnwindPause,
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UISelect, UINavPrev, UINavNext, UIOK, UICancel, UIPrevDir,

View File

@ -639,12 +639,16 @@ void EventHandler::handleEvent(Event::Type event, bool pressed, bool repeated)
myOSystem.frameBuffer().showMessage(myOSystem.state().rewindManager().loadAllStates());
return;
case Event::Rewind:
case Event::RewindPause:
if (pressed) myOSystem.state().rewindStates();
if (myState == EventHandlerState::EMULATION)
setState(EventHandlerState::PAUSE);
return;
case Event::Unwind:
case Event::UnwindPause:
if (pressed) myOSystem.state().unwindStates();
if (myState == EventHandlerState::EMULATION)
setState(EventHandlerState::PAUSE);
return;
case Event::Rewind1Menu:
@ -1714,11 +1718,11 @@ EventHandler::ActionList EventHandler::ourEmulActionList[EMUL_ACTIONLIST_SIZE] =
#endif
{ Event::ToggleTimeMachine, "Toggle 'Time Machine' mode", "" },
{ Event::TimeMachineMode, "Toggle 'Time Machine' UI", "" },
{ Event::Rewind, "Rewind game one state", "" },
{ Event::RewindPause, "Rewind one state and enter pause mode", "" },
{ Event::Rewind1Menu, "Rewind one state & enter TM UI", "" },
{ Event::Rewind10Menu, "Rewind 10 states & enter TM UI", "" },
{ Event::RewindAllMenu, "Rewind all states & enter TM UI", "" },
{ Event::Unwind, "Unwind game one state", "" },
{ Event::UnwindPause, "Unwind one state and enter pause mode", "" },
{ Event::Unwind1Menu, "Unwind one state & enter TM UI", "" },
{ Event::Unwind10Menu, "Unwind 10 states & enter TM UI", "" },
{ Event::UnwindAllMenu, "Unwind all states & enter TM UI", "" },