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

Improve portrait positions and position event #2123

Merged

Conversation

Jowan-Spooner
Copy link
Collaborator

@Jowan-Spooner Jowan-Spooner commented Mar 3, 2024

This PR brings big changes to the way portrait positions work. Containers now can have multiple identifiers, and importantly identifiers can be strings, meaning you can now specify positions as "left","center", etc.

The containers in the PortraitLayer are now only used as "presets", but when a character is joined it actually get's its own container. You can now also specify a position, size and rotation directly on the character event instead of a premade position. This makes the portrait event pretty unnecessary. I'll still have to decide whether it should be removed or not.

This is also importantly COMPATIBILITY BREAKING in numberous ways:

  • If the portrait containers are children of a CONTAINER instead of a Control node, they won't behave correctly. I'm considering optionally reintroducing the old "actually inside the premade containers"-behaviour but am not yet sure whether it's necessary.
  • Game saves made on earlier versions won't function correctly

This PR attempts to fix the fact that loading would be called twice, because the style attempted to reload from the current state. This is only sometimes desired, so now Styles.load_style() will NOT reload content by default, while a new helper method change_style() (which just calles load_style() behind the scenes) DOES reload content by default. This means this can still happen but should not happen if used correctly.

Small side-adjustments:

  • separates Container code into PortraitContainer subsystem
  • improve VN portrait layer (better spacing)
  • improve Shortcode Event save/load code.
    • can now Save, whether a shortcode had been set.
  • allow shortcode values to contain = but not unescaped "
  • Implement multitween (allowing multiple tweens to contribute to the same property)
  • Implement container movement, rotation and resizing
  • Add "position-suggestions" field in Portrait settings
  • Improve position event
    • adds translation, rotation, resize
    • adds tweening settings (ease/trans/await)
  • Add a debug draw mode for PortraitContainers
  • move common suggestions functions into the DialogicUtil to avoid repetition
  • separates Fade and animation of character event
  • makes DialogicCharacters _should_do_portrait_update return false by default, otherwise fade doesn't work which feels strange.
  • character events position variable renamed to transform to make it more clear what it now means
  • adds easing options to character event
  • remove prints in subsystem save

Positions can now have a list of identifiers.
- improve VN portrait layer (better spacing)
- improve Shortcode Event save/load code.
    - can now Save, whether a shortcode had been set.
- allow shortcode values to contain = but not unescaped "
- Implement multitween (allowing multiple tweens to contribute to the same property)
- Implement container movement, rotation and resizing
- Add "position-suggestions" field in Portrait settings
- Improve position event
   - adds translation, rotation, resize
   - adds tweening settings (ease/trans/await)
- Add a debug draw mode for PortraitContainers
@Jowan-Spooner Jowan-Spooner added Enhance ⚡ Improve a feature's workflow. Feature✨ Needs testing More feedback/testing would be good labels Mar 3, 2024
@Jowan-Spooner Jowan-Spooner marked this pull request as ready for review March 9, 2024 11:54
@Jowan-Spooner Jowan-Spooner marked this pull request as draft May 31, 2024 12:57
@Jowan-Spooner Jowan-Spooner marked this pull request as draft May 31, 2024 12:57
@Jowan-Spooner Jowan-Spooner marked this pull request as ready for review June 5, 2024 09:03
This PR attempts to fix the fact that loading would be called twice, because the style attempted to reload from the current state. This is only sometimes desired, so now Styles.load_style() will NOT reload content by default, while a new helper method change_style() (which just calles load_style() behind the scenes) DOES reload content by default. This means this can still happen but should not happen if used correctly.
@Jowan-Spooner Jowan-Spooner merged commit 72285a9 into dialogic-godot:main Jun 20, 2024
2 checks passed
@Jowan-Spooner Jowan-Spooner deleted the portrait-position-updates branch July 8, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhance ⚡ Improve a feature's workflow. Feature✨ Needs testing More feedback/testing would be good
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant