Jump to content

get GUI children


Recommended Posts

Posted

Any way to list a GUI elements children? I'm trying to make a script that automatically converts GUI into DX gui using presets I have made, but I cannot find how I would go about listing a GUI elements children as to automatically convert them all.

Or even better, any way to list all the GUI from a certain resource?

Posted

Maybe like that?

addCommandHandler( 'gui', function ( _, gui, res ) 
    for k,v in ipairs ( getElementsByType ( 'gui-'..gui,  getResourceRootElement(getResourceFromName ( res ) )) ) do 
        outputChatBox ( guiGetText ( v ) ) 
        end 
    end 
) 

> gui .

Posted

You can't get all GUIs, except if make a table like that :

GUIs = { 'window', 'button', 'edit' } -- etc. 

You can use it like this:

getElementsByType ( 'gui-' ) -- gui-button, gui-window, etc. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...