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

Extend Auto-Advance #1755

Merged
merged 57 commits into from
Oct 13, 2023
Merged

Conversation

CakeVR
Copy link
Collaborator

@CakeVR CakeVR commented Sep 23, 2023

Problem

The current Auto-Advance delay does not respect:

  • Text's character count
  • Text's word count
  • Typewriter time taken
  • Voice lines still playing

The developer cannot expose a UI setting the Auto-Advance speed to scale with their reading proficiency.

Solution

On the user-facing end, this Pull Request adds a new UI to the Text Settings, offering to select the specific scaling values for aforementioned ignored text properties.

Additionally, adds support to ignore specific characters, to prevent punctuation and whitespaces to be exempt from Per Character calculation.
The String input gets mapped into a Dictionary with null values, a Hash Set in disguise.

The user-facing settings will be stored in the state info dictionary autoadvance, alongside the already added keys temp_enabled and temp_wait_time.

Voice lines playing longer than the calculated Auto-Advance delay will override the waiting time, to allow them playing until the very end.

The typewriter will now save their time taken to type out the entire text into a state info. This allows the Auto-Advance to respect the base and speed modifiers that may have taken place and changed the read time experience.

The player can change the delay modifier via Dialogic.Settings.autoadvance_delay_modifier.

Problems

The Auto-Advance strips BBCodes via RegEx, however, it does not differentiate between [text] and official/custom BBCodes, for instance [b].
Therefore, if the player wants to use these in their text, the Auto-Advance delay calculation will ignore the square bracketed text.

Related Issues

This Pull Requests closes:

CakeVR and others added 27 commits September 22, 2023 23:08
This value will be used to extend the Auto-Advance delay.
Additionally, add Utility to transform a String to a Hash Set.
Set `ResetDelaysButton`'s icon.
The AutoAdvance delay offers many options now.
Hence, it's recommended to invoke the related delay methods.
This ignores escaped BBCodes, because BBCodes cannot be escaped in Godot.
However, in the future we may want to differentiate between real BBCodes and squared bracket text.
Add support for the new AutoAdvance delays.
Add support for long voice lines overriding user-defined AutoAdvance delay.
Add support for ignoring certain characters, if Per Character Delay gets calculated.
An old range input that has been moved out of my sight.
It's no longer used and can be safely removed.
This feature has been unintentionally removed during the rework.
Last but not least, the `effect_autoadvance` method no longer supports `v` prefixes.
The prefix used to control whether the effect would await playing voices.
However, the playing voice audio will always be respected on Auto-Advance now.
The calculation happens in the `input_handler` now, we can retrieve the time from there.
The method body has been cleared up.
If set, the `temp_wait_time` will be used instead of calculating a delay.
Long voices will override `temp_wait_time`.
Add `get_autoadvance_time`.
Removes `get` and `set` methods for extended Auto-Advance settings.
The `get_autoadvance_info` method can be used to access the settings.
CakeVR and others added 27 commits October 5, 2023 20:19
Updates the button's look if the `autoadvanced_enabled` look has been updated.
This was enabled before but that's rarely wanted.
This was not needed.
The enabled state is now inside `Settings.autoadvance`.
Auto-Advance can be kept until next event or user input.
If both are enabled, the next event must be reached first.
Add a signal for Auto-Advance changes.
Add a variable to track Auto-Advance enable state.
Add method to enable Auto-Advance by the system.
The system can be Dialogic, if the Auto-Advance is always on via Project Settings or code.
Refactor Auto-Advance Setter methods.
Add `waiting_for_system` Auto-Advance state info.
Fix default values for Auto-Advance state info for `await_playing_voice`.
Replace `Dialogic.Settings.autoadvance_enabled`.
Includes
- method renames
- method merges
- removing some unused stuff
- adds Dialogic.current_state_info['text_parsed'] which has bbcode removed already

Makes the UI in the settings a bit simpler at the cost of a little less flexibility.
The settings_text scene broke, I will look into it.
@Jowan-Spooner Jowan-Spooner merged commit c5f2a85 into dialogic-godot:main Oct 13, 2023
@Jowan-Spooner
Copy link
Collaborator

Note: The final PR works a bit differently from what is described in the initial comment. That is no problem as hopefully a good wiki page will be created soon.

@CakeVR CakeVR deleted the extend-auto-advance branch January 1, 2024 21:47
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

2 participants