Many Event Logic and Visual improvements #1060
Merged
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.
Multiline event saving
Allows to load events from multiple lines. To do so, the loader asks the event if it thinks it is full and if not it adds the next line and asks again.
The text event will say it's not full if it ends with
\
The shortcode events will say they are not full if they don't end with
]
The method in is
is_string_full_event(string) -> bool
This means oc that you can also store events in multiple lines.
Making things more modular
I have once again made a lot of the logic behind the events more modular.
This time it was about making the scripts not depend on specific events.
One exception is the DialogicEndBranchEvent!
This event is super special and I cannot see a way to make it deletable.
The Choice and Condition events however are now not needed anymore.
Instead events have a couple of more flags and methods they can fill in:
-> marks events that open a new block and need an end event
-> marks events that want to be the child of a specific event (like choice wants to be child of text)
These are mainly used for indentation logic (both in editor and when saving).
If one or both of these are turned on a couple of overridable methods can be used:
-> to indicate what event a "needs_parent_event"-event needs
-> a control that will be added to the end branch
New event lines
The editor has new lines connecting the events!
They also use the logic from above.
Logic updates
The logic (especially for the End Branch and Condition event) has been updated to be less dependent on specific events as well.
should_execute_this_branch()
-> it should mostly be false except (right now) for a condition event of type IF
-> usually the End Branch event will NOT consider going to another event that opens a branch and is on the same level (like a following choice event or ELIF event) but if this returns true then it will