I am generating buttons for players with this code.
for _, data in pairs(players) do
local nodes = gui.clone_tree(player_label)
pos.y = pos.y + off_set_y
gui.set_position(nodes[hash("remove_user_button/buttonBody")], pos)
gui.set_text(nodes[hash("remove_user_button/text")], data)
local button = self.druid:new_button(nodes[hash("remove_user_button/buttonBody")])
button.on_click:subscribe(function() remove_user_buttons(self,button, data ) end)
end
The Idea is that I add all the players with buttons dynamically added then be able to selected the player I want to be removed. Which I can get to work but the problem I have that I can’t seem to figure out is that now. Is after I am done selecting the users and leave the screen the dynamic buttons remain.
would I have to put all the buttons in a table maybe and delete them that way? Or is there an easier way to do this that I am not seeing.
Thanks for any help someone can provide.