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

Added focus_choice_button_node function to Choices subsystem #2499

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DJLink
Copy link

@DJLink DJLink commented Dec 28, 2024

Recently added this function to my own code base for something, thought it could be useful for OG codebase, the possibility of setting a different choice focus later after showing the question.

User could set this for example to be called after choices are shown by getting the signal question_shown.

Dialogic.Choices.focus_choice_button_node(button_index);

@Jowan-Spooner
Copy link
Member

Hi @DJLink, this looks pretty good. I thought I had added a similar helper method for selectting/pressing/activating the focused choice before but now I can't find it.
I would consider shortening those method names (the addition of button_node seems a bit over-kill).

  • focus_choice()
  • get_choice_button()
  • select_choice()
  • select_focused_choice()
    the last two don't exist, but I think would make sense, so feel free to add them if you want.

Also no ; at the end of lines please.

renaming focus_choice_button_node to something better, also cleaned up that ;
Copy link
Author

@DJLink DJLink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @Jowan-Spooner thanks for checking, as suggested I renamed it to select_focused_choice.
removed that ; (habits from other languages, sorry xD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants