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

Make text effects and modifiers modular #1403

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Conversation

Jowan-Spooner
Copy link
Collaborator

Removes the text effect and modifier logic from the DialogText node.

The index.gd file can now register text effects and modifiers.
These are effectively just methods. The text subsystem collects them and applies/reads them to/from the text before sending it to the DialogText node. Then the DialogText node calls execute_effects on every letter advance.

Text modifiers are also methods, these are only called once before the text is shown.

The text effect methods have access to the calling dialog_text node, the skipping boolean and the argument string.

All effects/modifiers have been moved to the text subsystem except portrait which is now part of the portrait subsystem.

Additionally the syntax for random selection has been changed from [option1, option2] to [option1/option2].

This PR improves little to nothing for the average user, but makes it easier

  • to maintain existing text effects/modifiers in the future
  • to add text effects/modifiers both in core and in additions
  • to create a custom dialog node implementation (because less functionality is in the default one)

Removes the text effect and modifier logic from the DialogText node.

The index.gd file can now register text effects and modifiers.
These are effectively just methods. The text subsystem collects them and applies/reads them to/from the text before sending it to the DialogText node. Then the DialogText node calls execute_effects on every letter advance. 

Text modifiers are also methods, these are only called once before the text is shown.

The text effect methods have access to the calling dialog_text node, the skipping boolean and the argument string. 

All effects/modifiers have been moved to the text subsystem except portrait which is now part of the portrait subsystem.
@Jowan-Spooner Jowan-Spooner changed the title Make text effects ad modifiers modular Make text effects and modifiers modular Jan 19, 2023
@Jowan-Spooner Jowan-Spooner merged commit 516c190 into main Jan 19, 2023
@Jowan-Spooner Jowan-Spooner deleted the modular-text-effects branch February 17, 2023 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant