Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Destroys the given user interface (recursively), or all user interfaces if none is provided.
- function destroyGUI(guiNode)
- if not guiNode then
- guiNode = guiRoot
- end
- local guiElements = getElementData(guiNode, "guiElements", false)
- if type(guiElements) == "table" then
- for _, guiElement in ipairs(guiElements) do
- if isElement(guiElement) then
- destroyElement(guiElement)
- end
- end
- end
- for _, subGuiNode in ipairs(getElementChildren(guiNode)) do
- outputDebugString(getElementID(subGuiNode))
- destroyGUI(subGuiNode)
- end
- destroyElement(guiNode)
- end
Add Comment
Please, Sign In to add comment