Page MenuHomeWildfire Games

Allow mods to insert or delete individual resource icons without hardcoding all resources at a time
ClosedPublic

Authored by elexis on Sep 26 2019, 4:30 PM.

Details

Summary

In rP18964 / #3934 we have made the code agnostic of resource types with few exceptions.
One of them is setup_resources.xml.
If a mod wants to insert a new resource type, it has to overwrite setup_resources.xml.
But that makes it impossible to launch two mods which each insert one resource.
It also means that a mod which changes the icon of one resource type to something more attractive won't work with another mod which inserts a new resource.
By splitting this file per resource type, these issues are undermined.

Test Plan

Notice that this approach also addresses Vladislavs recommendation to load all textures at XML parsing time rather than at JS runtime (D1745).
Make sure that the python checkrefs script is happy.
In case of commit, update the wiki page ModdingResources and Mod_Layout and inform modders.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Sep 26 2019, 4:30 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/320/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/835/display/redirect

Make sure that the python checkrefs script is happy.

Checkrefs complains about the png files being unused before and after the patch, amongst 1500 other matches.

Anything holding this back? It looks good and still applies cleanly :)

wraitii accepted this revision.Sun, Jan 10, 10:28 AM
wraitii added a subscriber: wraitii.

I think this is a fairly good idea, yes.

This revision is now accepted and ready to land.Sun, Jan 10, 10:28 AM
Owners added a subscriber: Restricted Owners Package.Sun, Jan 10, 10:41 AM