Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor messaging system #1876

Closed
wants to merge 34 commits into from
Closed

Conversation

mateofio
Copy link
Contributor

@mateofio mateofio commented Aug 25, 2019

Refactor message window to get correct frame timings, interpreter behavior, and avoid lockups

Depends on #1742

Fix: #1873
Fix: #1781

TBD:

@mateofio mateofio force-pushed the event_message branch 10 times, most recently from 8e3a04f to 36b5d1b Compare August 26, 2019 20:58
* Update the base class *after* starting open/close animation.
* Terminate the message on next frame after finishing text,
but before starting and animating close.

This fixes an issue where the messages would wait an extra
frame on open and close.

Also fixes an issue where foreground interpreters would resume a frame
early.
Number window is embedded and doesn't animate closed.
This code caused extra frame delays and broke RPG_RT
compatibility
Remove Game_Message::owner_id
Instead of having everyone touch global variables, we pack all
pending message state into an object. To push messages to the message
system, one creates a PendingMessage object, populates it, and
then submits it to the Game_Message system for processing.

* Ensures message state is always cleared when we start a new message
* Early exit due to errors before calling SetPendingMessage() doesn't
affect global message state.
* Removes a lot of manual work for setting things like choice_start,
message_waiting, etc..
* PushPageEnd() instead of exposing `\f`
Set the continuation for choices in the messaging system and
not in the interpreter.
Remove Window_Message::escape_char
* Use the new parsing functions to performan substitutions
* Fixes timing issue where variable substitutions are supposed
to be done when the messages are first pushed, not when the
message window updates. This differece can be seen by spawning
a message with \v[N] in a foreground event while a parallel
event is continuously incrementing the variable each frame.
Perform '\n' insertion in Game_Message instead
of Window_Message
If a foreground event tries to show a message after the previous one
already started animating it's close animation, it will wait
for that close to finish before executing the ShowMessage
command.

Also fix choices, number input, and inn to follow the
same rules.
* Scene change requests are blocked if message is pending or visible
* If a scene is requested before a message but on the same frame, the
scene request is still allowed.
* Still disable calling debug scene from player controls
* Add IsMessageActive() helper method to reduce confusion in code.
* Teleport commands will not execute if message is active
* If message requested after a pending teleport, cancel the message.
To match EasyRPG#1706 Test 19 and 20

* Face and Message Settings block the same way as ShowMessage.
@mateofio
Copy link
Contributor Author

All of this now has been subsumed into other message PRs

@Ghabry Ghabry added the Invalid label Nov 29, 2019
@Ghabry Ghabry removed this from the 0.6.2 milestone Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Handle embedded control characters in text Text overlaps with face on teleport
3 participants