Fix mod content installers.

In 4312a4d3f4 MiniYaml merging was adjusted. One effect of this change was that duplicate keys in files that did not previously require merging was previously allowed, but was now an error. (Test case `TestMergeConflictsNoMerge`)

The installer files were relying on the previous behaviour to allow multiple `ContentPackage` keys. The above change caused a regression where attempting to manage mod content would crash due to now erroring on the duplicate keys.

We fix the issue by applying a unique ID suffix, as is a common pattern elsewhere in our yaml files, and teach InstallFromSourceLogic to recognise and strip it.
This commit is contained in:
RoosterDragon
2024-07-30 19:15:37 +01:00
committed by Gustas
parent ebaed9966b
commit 578a9fe457
22 changed files with 198 additions and 193 deletions

View File

@@ -6,15 +6,15 @@ soviet: Red Alert 95 (Soviet Disc, English)
INSTALL/REDALERT.MIX: 0e58f4b54f44f6cd29fecf8cf379d33cf2d4caef
Install:
# Base game files:
ContentPackage:
ContentPackage@base:
Name: base
Actions:
ExtractMix: INSTALL/REDALERT.MIX
ExtractMix@1: INSTALL/REDALERT.MIX
^SupportDir|Content/ra/v2/hires.mix: hires.mix
^SupportDir|Content/ra/v2/local.mix: local.mix
^SupportDir|Content/ra/v2/lores.mix: lores.mix
^SupportDir|Content/ra/v2/speech.mix: speech.mix
ExtractMix: MAIN.MIX
ExtractMix@2: MAIN.MIX
^SupportDir|Content/ra/v2/conquer.mix: conquer.mix
^SupportDir|Content/ra/v2/general.mix: general.mix # Is this one used? The FirstDecade and TUC installers are missing this!
^SupportDir|Content/ra/v2/interior.mix: interior.mix
@@ -24,18 +24,18 @@ soviet: Red Alert 95 (Soviet Disc, English)
^SupportDir|Content/ra/v2/sounds.mix: sounds.mix
^SupportDir|Content/ra/v2/temperat.mix: temperat.mix
# Base game music (optional):
ContentPackage:
ContentPackage@music:
Name: music
Actions:
ExtractMix: MAIN.MIX
^SupportDir|Content/ra/v2/scores.mix: scores.mix
# Soviet campaign briefings (optional):
ContentPackage:
ContentPackage@movies-soviet:
Name: movies-soviet
Actions:
ExtractMix: MAIN.MIX
ExtractMix@1: MAIN.MIX
^SupportDir|Content/ra/v2/movies2.mix: movies2.mix
ExtractMix: ^SupportDir|Content/ra/v2/movies2.mix
ExtractMix@2: ^SupportDir|Content/ra/v2/movies2.mix
^SupportDir|Content/ra/v2/movies/aagun.vqa: aagun.vqa
^SupportDir|Content/ra/v2/movies/cronfail.vqa: cronfail.vqa
^SupportDir|Content/ra/v2/movies/airfield.vqa: airfield.vqa