papermario icon indicating copy to clipboard operation
papermario copied to clipboard

configure: some way to extend xml across the asset stack

Open bates64 opened this issue 2 years ago • 0 comments

Builds on from #1053. Much lower priority I think.

Imagine we have the asset stack us, mymod and these two files:

<!-- assets/us/sprite/npc/AlbinoDino/SpriteSheet.xml -->
<xml>
    <Rasters>
        <Raster file="Raster1.png" />
    </Rasters>
</xml>
<!-- assets/mymod/sprite/npc/AlbinoDino/SpriteSheet.extend.xml -->
<xml>
    <Rasters>
        <Raster file="Raster2.png" />
    </Rasters>
</xml>

The result is an XML that contains both Rasters, rather than just Raster2 if mymod used SpriteSheet.xml instead of SpriteSheet.extend.xml.

Specifically, I'm thinking Configure.resolve_asset_path/similar can automatically look for ".extend" versions of appropriate file types. This will implement some kind of merging/extending heuristic that enables asset directories (mods) to add new content / replace existing content without redeclaring any data from the originally rom.

We can extend this to other files types perhaps, e.g. #1032 uses YAML right now

bates64 avatar May 15 '23 11:05 bates64