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

Way to iterate through child Components (primarily, of List)? #34

Open
Shadowstep33 opened this issue Jan 19, 2016 · 0 comments
Open

Way to iterate through child Components (primarily, of List)? #34

Shadowstep33 opened this issue Jan 19, 2016 · 0 comments

Comments

@Shadowstep33
Copy link

Hi, particularly if I define a list - is there a way to iterate through the components that are added to it? I notice if I look in it's children, there are a couple miscellaneous things but it seems the child at index 2 is a container that has the components of the list I'm looking for. But iterating through it seems to produce some unintended results. Currently, what I am doing is this:

    for(var c in EZGUI.components.playerBagList.children[2].children){
        if(!(EZGUI.components.playerBagList.children[2].children[c] instanceof Button))
            continue;

... //All further actions (such as handlers) are done on EZGUI.components[EZGUI.components.playerBagList.children[2].children[c].guiID]

//Perhaps EZGUI.components.playerBagList.components? 
        }

this is suitable but seems like a bit of a long winded way to do it (not to mention if I ever change the order of playerBagList's children things will get weird). Perhaps I am just being lazy... lol

Anyways, love the library so far!

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

No branches or pull requests

1 participant