GUIEditor = {
gridlist = {},
window = {},
button = {}
}
GUIEditor.window[1] = guiCreateWindow(284, 255, 571, 369, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.gridlist[1] = guiCreateGridList(29, 34, 517, 265, false, GUIEditor.window[1])
cow = guiGridListAddColumn(GUIEditor.gridlist[1], "Name Maps", 0.9)
GUIEditor.button[1] = guiCreateButton(9, 317, 169, 35, "اغلاق", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
guiSetVisible( GUIEditor.window[1] ,false)
function OpenWin2()
guiSetVisible (GUIEditor.window[1] , true )
showCursor(true)
end
bindKey("F5", "down", OpenWin2)
addEvent ("addMaps_", true)
addEventHandler ("addMaps_", root,
function ( v )
guiGridListClear ( GUIEditor.gridlist[1] )
local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText (GUIEditor.gridlist[1], row, cow, v, false, false)
end
)
function fetchMaps ( )
local Maps_ = { }
for k, v in ipairs( getResources ( ) ) do
if ( getResourceInfo( v, "type" ) == "map" )then
table.insert ( Maps_, getResourceInfo( v, "name" ) )
end
end
return Maps_
end
addEvent ("GetMaps", true)
addEventHandler ("GetMaps", root,
function ()
local Maps = getMaps ()
for _,v in ipairs ( Maps ) do
triggerClientEvent (source, "addMaps_", source, v)
end
end
)