urho3d/Urho3D — pull request #84 by alexparlett (2013-12-21 19:14:10+00:00)
Title: Modification of Resourece Directory and Package File search priority for GetFile and GetResource

Currently GetFile and subsequently GetResource assume two things, that package files want to be searched first and that Resource Directories are always to be searched in the order that they are added. This is less true for Package files, since you can specify to add them to the front of the vector instead.

What I propose is two fold. First there is a function similar to the following:

GetSubsystem()->SetSearchPackagesFirst(true);

Which when calling GetFile or GetResource will use that flag to define which locations to search first, this will be the default behaviour.

Secondly there is the ability to define the priority of resource directories and package files in this search process. To facilitate this a modification should be made with more granularity than Front or Back that will work along the following lines:

GetSubsystem()->AddResourceDirectory();
GetSubsystem()->AddResourceDirectory(3);

Where the first would default to the end of the list, and the second would be placed in the "4" spot in the list or at the end if the list is not that big.

----

I'm not totally sure whether this is suitable for widespread Urho, since my usage of it has some requirements for modability in my applications where mods can overwrite scripts that define certain aspects of the logic and so instead of keeping my own map of original name to overridden location I'd prefer to have the underlying resource cache able to do so for me.