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

Gui element allows return of array. #196

Closed
Cooldude2606 opened this issue Jan 24, 2021 · 1 comment
Closed

Gui element allows return of array. #196

Cooldude2606 opened this issue Jan 24, 2021 · 1 comment
Labels
Feature Request Request for a new feature to be added

Comments

@Cooldude2606
Copy link
Member

Feature overview
Name: Gui element returning an array
TL;DR: The gui module should allow for the return of an array of elements which will be looped over for styling,

Details
Allow for the return of an array, each value in the array should be a valid element, and checked to be valid, before being passed to the style callback. This array can then be returned to the caller, the caller should expect a table based on the element factory called.

Possible methods
Test for a table return type, then iterate over it with ipairs.

Additional context
Idea from #190 when returning an array was expected to be supported.

@Cooldude2606 Cooldude2606 added the Feature Request Request for a new feature to be added label Jan 24, 2021
@Cooldude2606
Copy link
Member Author

Current opinion is that this should not be implimented because it encourages the creation of sibling frames/flows which should be separated into new functions. It also encourages creating elements in a loop without calling an element definition and complicates the logic and readability. There is one case where this could be useful which is when elements are added to a table and need to be accessed by the caller; however in this case it is better practice to name the elements, return the first common ancestor, then access them by name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request for a new feature to be added
Projects
None yet
Development

No branches or pull requests

1 participant