From 61dfcd87bc0e2aea7b67c8dbabfb52d8d30456b8 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 5 Feb 2010 22:36:44 +1300 Subject: [PATCH] Load chrome.xml from mod --- OpenRa.FileFormats/Session.cs | 2 + OpenRa.Game/Game.cs | 7 +- chrome.xml => mods/cnc/chrome.xml | 0 mods/cnc/mod.yaml | 3 + mods/ra/chrome.xml | 146 ++++++++++++++++++++++++++++++ mods/ra/mod.yaml | 3 + 6 files changed, 157 insertions(+), 4 deletions(-) rename chrome.xml => mods/cnc/chrome.xml (100%) create mode 100644 mods/ra/chrome.xml diff --git a/OpenRa.FileFormats/Session.cs b/OpenRa.FileFormats/Session.cs index 1df5d7dc7c..1cb07a8ddd 100644 --- a/OpenRa.FileFormats/Session.cs +++ b/OpenRa.FileFormats/Session.cs @@ -43,6 +43,7 @@ namespace OpenRa.FileFormats public readonly string[] LegacyRules = { }; public readonly string[] Rules = { }; public readonly string[] Sequences = { }; + public readonly string[] Chrome = { }; public readonly string[] Assemblies = { }; public Manifest(string[] mods) @@ -56,6 +57,7 @@ namespace OpenRa.FileFormats LegacyRules = YamlList(yaml, "LegacyRules"); Rules = YamlList(yaml, "Rules"); Sequences = YamlList(yaml, "Sequences"); + Chrome = YamlList(yaml, "Chrome"); Assemblies = YamlList(yaml, "Assemblies"); } diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index df659350fe..1ea77ed98c 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -79,10 +79,11 @@ namespace OpenRa a.Owner.Shroud.Explore(a); }; Timer.Time( "world: {0}" ); - + + ChromeProvider.Initialize(manifest.Chrome); SequenceProvider.Initialize(manifest.Sequences); viewport = new Viewport(clientSize, Game.world.Map.Offset, Game.world.Map.Offset + Game.world.Map.Size, renderer); - Timer.Time( "SeqProv, viewport: {0}" ); + Timer.Time( "ChromeProv, SeqProv, viewport: {0}" ); skipMakeAnims = true; @@ -113,8 +114,6 @@ namespace OpenRa PerfHistory.items["batches"].hasNormalTick = false; Game.controller = controller; - ChromeProvider.Initialize("chrome.xml"); - ChangeMap(mapName); if (Settings.Replay != "") diff --git a/chrome.xml b/mods/cnc/chrome.xml similarity index 100% rename from chrome.xml rename to mods/cnc/chrome.xml diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 9490795429..0dba198098 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -47,6 +47,9 @@ Sequences: mods/cnc/sequences-infantry.xml: mods/cnc/sequences.xml: Obsolete; will disappear once done converting +Chrome: + mods/cnc/chrome.xml: + Assemblies: mods/cnc/OpenRa.Mods.Cnc.dll: Cnc mod traits mods/ra/OpenRa.Mods.RA.dll: Red alert mod traits diff --git a/mods/ra/chrome.xml b/mods/ra/chrome.xml new file mode 100644 index 0000000000..6fb828115f --- /dev/null +++ b/mods/ra/chrome.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 9dd53097dd..aab2aae47c 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -29,6 +29,9 @@ Rules: Sequences: mods/ra/sequences.xml: Original animation sequences +Chrome: + mods/ra/chrome.xml: + Assemblies: mods/ra/OpenRa.Mods.RA.dll: Traits used