From b8740a3a47a8b2d0937396fa6405765c79061193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 11 Jan 2014 10:07:34 +0100 Subject: [PATCH] test for a list of files when loading mods don't cache test file string arrays --- CHANGELOG | 1 + OpenRA.Mods.Cnc/CncLoadScreen.cs | 4 +++- OpenRA.Mods.RA/DefaultLoadScreen.cs | 4 +++- mods/cnc/mod.yaml | 2 +- mods/d2k/mod.yaml | 3 ++- mods/ra/mod.yaml | 2 +- mods/ts/mod.yaml | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b29438e7ef..77019e6cb6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -44,6 +44,7 @@ NEW: Added a new trait Demolishable for buildings to handle the C4 demolition. Mods that use custom TileSize must specify both width and height. If you spot black tiles in your Dune 2000 ARRAKIS maps, replace them with the remaining sand and rock tiles. Go to Map → Fix Open Areas to randomize them. + The TestFile check in mod.yaml has been renamed to TestFiles (plural!) and now supports a comma-separated list of assets that are required to load the game. 20131223: All mods: diff --git a/OpenRA.Mods.Cnc/CncLoadScreen.cs b/OpenRA.Mods.Cnc/CncLoadScreen.cs index d63688c7eb..73441e7274 100644 --- a/OpenRA.Mods.Cnc/CncLoadScreen.cs +++ b/OpenRA.Mods.Cnc/CncLoadScreen.cs @@ -8,8 +8,10 @@ */ #endregion +using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Support; @@ -126,7 +128,7 @@ namespace OpenRA.Mods.Cnc void TestAndContinue() { Ui.ResetAll(); - if (!FileSystem.Exists(loadInfo["TestFile"])) + if (!loadInfo["TestFiles"].Split(',').All(f => FileSystem.Exists(f.Trim()))) { var args = new WidgetArgs() { diff --git a/OpenRA.Mods.RA/DefaultLoadScreen.cs b/OpenRA.Mods.RA/DefaultLoadScreen.cs index 72b70d7b59..1af3e4ad82 100644 --- a/OpenRA.Mods.RA/DefaultLoadScreen.cs +++ b/OpenRA.Mods.RA/DefaultLoadScreen.cs @@ -8,8 +8,10 @@ */ #endregion +using System; using System.Collections.Generic; using System.Drawing; +using System.Linq; using OpenRA.FileFormats; using OpenRA.Graphics; using OpenRA.Support; @@ -77,7 +79,7 @@ namespace OpenRA.Mods.RA void TestAndContinue() { Ui.ResetAll(); - if (!FileSystem.Exists(info["TestFile"])) + if (!info["TestFiles"].Split(',').All(f => FileSystem.Exists(f.Trim()))) { var args = new WidgetArgs() { diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index a228b8b256..041c45d430 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -126,7 +126,7 @@ LoadScreen: CncLoadScreen FilesToCopy: CONQUER.MIX, DESERT.MIX, SCORES.MIX, SOUNDS.MIX, TEMPERAT.MIX, WINTER.MIX FilesToExtract: speech.mix, tempicnh.mix, transit.mix InstallerBackgroundWidget: INSTALL_BACKGROUND - TestFile: conquer.mix + TestFiles: conquer.mix, desert.mix, general.mix, sounds.mix, speech.mix, temperat.mix, tempicnh.mix, winter.mix PackageURL: http://open-ra.org/download/content/cnc-packages ServerTraits: diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index fc0a99bd0d..3615116d7e 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -109,7 +109,8 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/d2k/uibits/loadscreen.png InstallerMenuWidget: INSTALL_PANEL - TestFile: DATA.R8 +# TODO: check if DATA.R8 is at 1.03 patch level with 4840 frames + TestFiles: BLOXBASE.R8, BLOXBAT.R8, BLOXBGBS.R8, BLOXICE.R8, BLOXTREE.R8, BLOXWAST.R8, DATA.R8, SOUND.RS PackageURL: http://open-ra.org/download/content/d2k-103-packages Text: Filling Crates..., Breeding Sandworms... diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index e312bc4584..a9dfd5323e 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -125,7 +125,7 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/ra/uibits/loadscreen.png InstallerMenuWidget: INSTALL_PANEL - TestFile: redalert.mix + TestFiles: allies.mix, conquer.mix, general.mix, interior.mix, redalert.mix, russian.mix, scores.mix, snow.mix, sounds.mix, temperat.mix PackageURL: http://open-ra.org/download/content/ra-packages Text: Filling Crates..., Charging Capacitors..., Reticulating Splines..., Planting Trees..., Building Bridges..., Aging Empires..., Compiling EVA..., Constructing Pylons..., Activating Skynet..., Splitting Atoms... diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 715abc2d69..09bc97b964 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -148,7 +148,7 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/ts/uibits/loadscreen.png InstallerMenuWidget: INSTALL_PANEL - TestFile: isotemp.mix + TestFiles: cache.mix, conquer.mix, isosnow.mix, isotemp.mix, local.mix, sidec01.mix, sidec02.mix, sno.mix, snow.mix, sounds.mix, speech01.mix, tem.mix, temperat.mix PackageURL: http://open-ra.org/download/content/ts-packages Text: Updating EVA installation..., Changing perspective...