Page MenuHomeWildfire Games

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

Authored by elexis on Sep 26 2019, 4:30 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#3934
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.

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.