2D Toolkit Forum
2D Toolkit => Support => Topic started by: pixeltrap on January 13, 2014, 04:14:26 pm
-
Hello, there.
I'm working on project which has different sprite collections for each game chapter. Having all of them in one dropdown list is a bit annoying and we resorted to adding prefixes for sorting.
Is there any way to group them in folders within the dropdown list?
Thanks!
-
In tk2dSpriteGuiUtility.cs,
BuildLookupIndex
change these lines (312 or so)
for (int i = 0; i < allSpriteCollections.Count; ++i)
{
allSpriteCollectionLookup[allSpriteCollections[i].spriteCollectionDataGUID] = i;
spriteCollectionNames[i] = allSpriteCollections[i].name;
spriteCollectionNamesInclTransient[i] = allSpriteCollections[i].name;
}
to
for (int i = 0; i < allSpriteCollections.Count; ++i)
{
allSpriteCollectionLookup[allSpriteCollections[i].spriteCollectionDataGUID] = i;
string name = allSpriteCollections[i].name.Replace("__", "/");
spriteCollectionNames[i] = name;
spriteCollectionNamesInclTransient[i] = name;
}
Feel free to replace __ with a separator of your choice. If you're already using a single underscore for the prefix, then use that and it should put those into folders.