Baseplate Posted October 13, 2012 Share Posted October 13, 2012 Well, kinda something is wrong here local weapons = { ["Samer"]=true, ["Woods"]=true, ["Thing"]=true, ["Robbster"]=true } GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} heroesWindow = guiCreateWindow(207,81,372,449,"Heroes List:",false) guiSetVisible(heroesWindow, false) GUIEditor_Label[1] = guiCreateLabel(2,21,5,15,"",false,heroesWindow) GUIEditor_Label[2] = guiCreateLabel(13,33,197,26,"This is our current Heroes List",false,heroesWindow) heroesGrid = guiCreateGridList(15,57,343,379,false,heroesWindow) guiGridListSetSelectionMode(heroesGrid,2) local heroesColumn = guiGridListAddColumn(heroesGrid,"Heroes",2) local row = guiGridListAddRow(heroesGrid) guiGridListSetItemText(heroesGrid,row,heroesColumn,tostring(weapons),false,false) addCommandHandler ("heroes",function() if not guiGetVisible(heroesWindow) then guiSetVisible(heroesWindow, true) showCursor(true) end end) Link to comment
Castillo Posted October 13, 2012 Share Posted October 13, 2012 You must loop the table to add each row. local weapons = { ["Samer"]=true, ["Woods"]=true, ["Thing"]=true, ["Robbster"]=true } GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} heroesWindow = guiCreateWindow(207,81,372,449,"Heroes List:",false) guiSetVisible(heroesWindow, false) GUIEditor_Label[1] = guiCreateLabel(2,21,5,15,"",false,heroesWindow) GUIEditor_Label[2] = guiCreateLabel(13,33,197,26,"This is our current Heroes List",false,heroesWindow) heroesGrid = guiCreateGridList(15,57,343,379,false,heroesWindow) guiGridListSetSelectionMode(heroesGrid,2) local heroesColumn = guiGridListAddColumn(heroesGrid,"Heroes",2) for member, _ in pairs ( weapons ) do local row = guiGridListAddRow(heroesGrid) guiGridListSetItemText(heroesGrid,row,heroesColumn,tostring(member),false,false) end addCommandHandler ("heroes",function() if not guiGetVisible(heroesWindow) then guiSetVisible(heroesWindow, true) showCursor(true) end end) Link to comment
Baseplate Posted October 13, 2012 Author Share Posted October 13, 2012 Thanks, I forgot lol! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now