Jump to content

[Help] gridlist


Newbie

Recommended Posts

Here's how gridlist looks: http://i.imgur.com/cdJ7Zhj.png

Is there any way to hide or edit shroll bar of gridlist ?

and i need to show maps as a name's from meta and not as a resources name.

mapGridList = guiCreateGridList(x/3.6, y/3.0, 417, 275, false)  
mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) 
guiGridListSetSelectionMode(mapGridList,1) 
  
addEvent("sendMaps", true ) 
function sendmaps(name) 
    row = guiGridListAddRow ( mapGridList ) 
    guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) 
end 
addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) 
  
addEvent( "clearGridList", true ) 
function clearGridList() 
    guiGridListClear( mapGridList ) 
end 
addEventHandler( "clearGridList", getLocalPlayer(), clearGridList ) 

Link to comment
Can you post the server sided function; 'sendMaps' ?

Sure

function mapsList() 
    local resourceTable = getResources() 
    triggerClientEvent ( "clearGridList", getRootElement() ) 
    for resourceKey, resourceValue in ipairs(resourceTable) do 
          local name = getResourceName(resourceValue) 
          local type1 = getResourceInfo ( resourceValue, "type" ) 
          local gamemode1 = getResourceInfo ( resourceValue, "gamemodes" ) 
          if type1 == "map" and gamemode1 == "race" then 
            triggerClientEvent ( "sendMaps", getRootElement(), name) 
          else 
            cancelEvent() 
        end 
    end 
end 
addCommandHandler( "sendMaps", mapsList, false, false ) 
addEventHandler("onPostFinish",getRootElement(),mapsList) 

Link to comment

I don't think you can hide it, even by using a GUI property, but if you really need to hide it, you can make your own custom gridlist using dx-functions, but it wouldn't be that easy since it needs a lot of math and scripting professionalization to produce the best customized gridlist.

Link to comment

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...