-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feature: Flip dialog portrait avatar based on character direction #298
base: develop
Are you sure you want to change the base?
Feature: Flip dialog portrait avatar based on character direction #298
Conversation
@@ -30,12 +35,16 @@ func _update_avatar(chr: PopochiuCharacter, _msg := '') -> void: | |||
E.scale if E.settings.scale_gui else Vector2.ONE | |||
) | |||
|
|||
var flip_h := _LOOKING_LEFT_DIRS.has(chr._looking_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like _looking_dir
is being misused publically in other singletons should either be a getter/setter or a public variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I guess that's very legacy code that nobody touched in a while. Nice spot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right @edmundito . We can make that property public (by removing the underscore at the beggining) or use getter/setter methods. I prefer the first option.
Changing that will also affect the i_room.gd
and the popochiu_room_data.gd
scripts. And this line of code, of course.
I like this one a lot! Have you got an idea on the API functions to expose for avatar direction management, already? |
@@ -5,6 +5,11 @@ extends PopochiuDialogText | |||
@onready var right_avatar_container: PanelContainer = %RightAvatarContainer | |||
@onready var right_avatar: TextureRect = %RightAvatar | |||
|
|||
const _LOOKING_LEFT_DIRS := [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following Godot's style guide, constants should be defined without underscore on the first character.
const _LOOKING_LEFT_DIRS := [ | |
const LOOKING_LEFT_DIRS := [ |
Interesting feature. I’m afraid relying solely on whether it’s facing left might not be enough. Maybe (and this can be part of that API @stickgrinder is wondering about) characters should have a function to know if their Sprite is flipped or not, and based on that, the avatar will flip too (if it’s set up to flip with the character). |
Hi @edmundito! Did you, by any chance, managed to do more work on this PR? Let us know, thanks. |
I have not and may not have the time. Feel free to take over! |
Thanks @edmundito! We'll add you as reviewer, should you have any comments or suggestion (since you actually needed this feature)! |
This change flips the avatar image of the character based on the character's direction.
Work in Progress
This probably needs a bit more work before it's ready for a final review. I will add a checklist here:
_looking