Announcement

Collapse
No announcement yet.

How to change maps list order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to change maps list order

    Hello my friends.

    Just a small help needed here.

    How can I change the order of the maps selection list in UDK (I am using UTGame). I want that the maps be listed ordered by name in ascendance, like:

    Mission 1
    Mission 2
    Mission 3
    Mission 4

    But it is listing inverted, as you can see here on this screenshot:



    I have been reading through GFxUDKFrontEnd_MapSelect but I could not find anything related to order listing.

    The closest I found was this function:

    Code:
    function UpdateListDataProvider()
    {
    local int i, ListCounter;
    local GFxObject DataProvider;
    local GFxObject TempObj;
    local array<UDKUIResourceDataProvider> ProviderList;
    local array<UTUIDataProvider_MapInfo> LocalMapList;
    
    // fill the local map list
    MapList.Length = 0;
    LocalMapList.Length = 0;
    class'UTUIDataStore_MenuItems'.static.GetAllResourceDataProviders(class'UTUIDataProvider_MapInfo', ProviderList);
    for (i = 0; i < ProviderList.length; i++)
    {
    LocalMapList.AddItem(UTUIDataProvider_MapInfo(ProviderList[i]));
    }
    
    // No need to create an object if no maps are available.
    if (LocalMapList.Length == 0)
    {
    return;
    }
    
    // Use a counter for the current list index so that items that are filtered are not added in
    // the incorrect position.
    ListCounter = 0;
    DataProvider = Outer.CreateArray();
    for (i = 0; i < LocalMapList.Length; i++)
    {
    if (!LocalMapList[i].ShouldBeFiltered())
    {
    TempObj = CreateObject("Object");
    TempObj.SetString("label", Caps(GetMapFriendlyName(LocalMapList[i].MapName)));
    TempObj.SetString("players", LocalMapList[i].NumPlayers);
    
    // If a preview image exists, use that.
    if (LocalMapList[i].PreviewImageMarkup != "")
    {
    TempObj.SetString("image", "img://" $ LocalMapList[i].PreviewImageMarkup);
    }
    else
    {
    // Otherwise, use a placeholder "UDK" map image.
    TempObj.SetString("image", "img://" $ class'GFxUDKFrontEnd_LaunchGame'.const.MarkupForNoMapImage);
    }
    
    DataProvider.SetElementObject(ListCounter++, TempObj);
    MapList.AddItem(LocalMapList[i]);
    }
    }
    ListMC.SetObject("dataProvider", DataProvider);
    ListDataProvider = ListMC.GetObject("dataProvider");
    
    ImgScrollerMC.SetObject("dataProvider", DataProvider);
    ImgScrollerMC.SetFloat("selectedIndex", ListMC.GetFloat("selectedIndex"));
    }
    But anyway there is no reference to listing order.

    Any help is welcome.

    Thanks!
    https://sites.google.com/view/udkultimate/


    #2
    Its the way you are adding them in this line
    LocalMapList.AddItem(UTUIDataProvider_MapInfo(ProviderList[i]));

    got to UTUIDataProvider_MapInfo File and fix way you are filtering what will be in the list and in what order. they should add in the same order they are in your maps folder.

    Comment


      #3
      Originally posted by gamepainters View Post
      Its the way you are adding them in this line
      LocalMapList.AddItem(UTUIDataProvider_MapInfo(ProviderList[i]));

      got to UTUIDataProvider_MapInfo File and fix way you are filtering what will be in the list and in what order. they should add in the same order they are in your maps folder.
      Thanks mate! I will try it.
      https://sites.google.com/view/udkultimate/

      Comment

      Working...
      X