Improve KeyInputProc behaviour #469
Merged
Conversation
| @@ -1514,6 +1520,8 @@ bool Game_Interpreter_Map::CommandKeyInputProc(RPG::EventCommand const& com) { / | |||
| int result = 0; | |||
| size_t param_size = com.parameters.size(); | |||
|
|
|||
| bool (*check)(Input::InputButton) = wait ? Input::IsTriggered : Input::IsPressed; | |||
Ghabry
May 10, 2015
Member
Is this some kind of inline-function declaration? Works with C++03?
Have never seen this before.
Is this some kind of inline-function declaration? Works with C++03?
Have never seen this before.
Zegeri
May 10, 2015
Author
Member
It's a function pointer. We already use it in Game_Interpreter::SetContinuation.
It's a function pointer. We already use it in Game_Interpreter::SetContinuation.
|
needs rebase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
You can now play everyone's favourite: the Nasu minigame of Yume Nikki!
The hardest issue is, without breaking anything, avoiding restarting an action-triggered event when one of its last commands is a KeyInputProc waiting for the action key. There're three relevant moments that run in the following order: the update of the main interpreter, the update of the event and the update of the game player. Suppose we have an event running a KeyInputProc waiting for the action key. This is what it should happen:
This is what happens without the workaround 08100c3:
This is how it looks with the workaround:
The workaround is ugly, but it works until we come up with a better solution.