MTROPOLIS: Implement the Return Modifier and tentative opint handling #4651
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When SPQR opens a dialog box it wants to return from, it sets
worldmanager.opintto 7 before switchingworldmanager.currentsceneto the dialog box scene. (Other values encountered in SPQR are 2 and 4, which seem to be used for scene transitions that do not go to dialogs.) It therefore seems logical that 7 is used to indicate that the add-to-return-list flag should be set. This PR tentatively assumes that the least significant bit ofopintis the add-to-return-list flag and sets this flag accordingly when handling writes tocurrentscene.Together with a (very simple) implementation of the Return Modifier, this PR makes SPQR's dialog handling work (i.e., dialogs can be closed with the exit button now).
Please note that I have not reverse-engineered anything here (as I have no real idea how to achieve that). This PR is based simply on observing SPQR's behavior, so what's implemented here may not match what mTropolis does. For games that do not use
opint, this change should not break anything, as the add-to-return-list flag was already set tofalseanyway.