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

Allow listing variables and folders inside of variable folders #1840

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

Jowan-Spooner
Copy link
Collaborator

This means there is no need to access the variable dictionary directly.

Dialogic.VAR.my_folder.variables() # returns an array of the variables
Dialogic.VAR.my_folder.variables(true) # returns an array of the variables as absolute (e.g. my_folder.my_variable)
Dialogic.VAR.my_folder.variables().pick_random() # returns a random variable in this folder

Dialogic.VAR.locations.folders().pick_random().variables().pick_random() # picks a random location in a random location folder

These methods do also work on the root Dialogic.VAR level.

Also adds folder.has() method so you can check

Dialogic.VAR.my_folder.has("Variable")

(as you could on the root level already)

I think this is a cool change allowing to get more information from the variables without accessing Dialogic.current_state_info["variables"] directly.

This means there is no need to access the variable dictionary directly.
@Jowan-Spooner Jowan-Spooner merged commit 886ddb4 into main Oct 31, 2023
@Jowan-Spooner Jowan-Spooner deleted the variable-folder-improvements branch December 2, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant