-
-
Notifications
You must be signed in to change notification settings - Fork 265
Choices: Add override for custom choice buttons #2554
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
Conversation
Hey @HuntJSparra, sorry it took me so long.
|
Nothing to apologize for! Dialogic has been a great help to me, so the least I can do is show a little patience. I'll rebase and make the changes sometime this coming week. |
@Jowan-Spooner There is now a layer setting for the number of choice buttons (defaults to 5 for text bubbles and 10 for centered choices) and Everything should be ready for another review when you have the time, but I did have a question: should we pass the choice info or at least additional data to the choice buttons? This would allow custom choice events (or even the regular choice event) to pass data that could then affect a custom button's behavior (e.g., a choice costs 5 gold to select). |
I'm confused, as that's what already happens in the _load_info() method of the DialogicChoiceButton, which custom choices are supposed to overwrite if they want to use the extra data. Maybe we should add this to the docs, not sure if it's mentioned there already. |
I had not thought of overriding |
That looks good to me for now. The class reference is generated from the built-in doc-comments so that should be good for now too (might have to add a bunch of [br] to the doc comments, not sure). More tutorials in the online docs would be cool, but absolutely not necessary for this PR. |
I think this is ready to be merged, right @HuntJSparra? |
Yes. Looks good to me. |
The choice buttons for the
Centered Choices
andTextbubble Layer
layers can be replaced with aPackedScene
descending fromDialogicNode_ChoiceButton
. This is intended for users who want custom behavior for their buttons (the choice must be pressed 3 times, on-hover animations, multi-Control
UI, etc.).New Settings:
Centered Choices:
Choices/Behavior/Custom Button
,Choices/Behavior/Maximum Choices
Textbubble Layer:
Choices/Behavior/Custom Button
,Choices/Behavior/Maximum Choices
Changes to
DialogicNode_ChoiceButton
:The on-pressed behavior of the button can be customized by overriding
_pressed()
. By default, this preserves the existing behavior by emitting the newchoice_selected
signal when the button is pressed. The Choices Subsystem has now listens for the button'schoice_selected
signal instead ofpressed
.Changes to VN/Centered Choice Layer:
The centered choice layer now instantiates its buttons when the style is changed (functionally similar to Textbubble Layer) so that custom buttons are applied, including while the timeline is running.