diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index ece91098dc..9a578c2df7 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -32,6 +32,7 @@ namespace OpenRA public readonly IReadOnlyDictionary MapFolders; public readonly MiniYaml LoadScreen; public readonly MiniYaml LobbyDefaults; + public readonly IReadOnlyDictionary ContentInstaller; public readonly Dictionary> Fonts; public readonly Size TileSize = new Size(24, 24); public readonly string NewsUrl; @@ -71,6 +72,7 @@ namespace OpenRA LoadScreen = yaml["LoadScreen"]; LobbyDefaults = yaml["LobbyDefaults"]; + ContentInstaller = YamlDictionary(yaml, "ContentInstaller"); Fonts = yaml["Fonts"].ToDictionary(my => { var nd = my.ToDictionary(); diff --git a/OpenRA.Mods.Cnc/CncLoadScreen.cs b/OpenRA.Mods.Cnc/CncLoadScreen.cs index c5fbb6517e..d2762f320f 100644 --- a/OpenRA.Mods.Cnc/CncLoadScreen.cs +++ b/OpenRA.Mods.Cnc/CncLoadScreen.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Cnc r = Game.Renderer; if (r == null) return; - var s = new Sheet("mods/cnc/uibits/chrome.png"); + var s = new Sheet(loadInfo["Image"]); var res = r.Resolution; bounds = new Rectangle(0, 0, res.Width, res.Height); @@ -92,7 +92,7 @@ namespace OpenRA.Mods.Cnc if (!setup && r.Fonts != null) { loadingFont = r.Fonts["BigBold"]; - loadingText = "Loading"; + loadingText = loadInfo["Text"]; loadingPos = new float2((bounds.Width - loadingFont.Measure(loadingText).X) / 2, barY); versionFont = r.Fonts["Regular"]; @@ -127,15 +127,16 @@ namespace OpenRA.Mods.Cnc void TestAndContinue() { Ui.ResetAll(); - if (!loadInfo["TestFiles"].Split(',').All(f => GlobalFileSystem.Exists(f.Trim()))) + var installData = Game.modData.Manifest.ContentInstaller; + if (!installData["TestFiles"].Split(',').All(f => GlobalFileSystem.Exists(f.Trim()))) { var args = new WidgetArgs() { { "continueLoading", () => TestAndContinue() }, - { "installData", loadInfo } + { "installData", installData } }; - Ui.LoadWidget(loadInfo["InstallerBackgroundWidget"], Ui.Root, args); - Ui.OpenWindow(loadInfo["InstallerMenuWidget"], args); + Ui.LoadWidget(installData["InstallerBackgroundWidget"], Ui.Root, args); + Ui.OpenWindow(installData["InstallerMenuWidget"], args); } else Game.LoadShellMap(); diff --git a/OpenRA.Mods.RA/DefaultLoadScreen.cs b/OpenRA.Mods.RA/DefaultLoadScreen.cs index ef6b5342d7..a9f01e9b5a 100644 --- a/OpenRA.Mods.RA/DefaultLoadScreen.cs +++ b/OpenRA.Mods.RA/DefaultLoadScreen.cs @@ -20,7 +20,6 @@ namespace OpenRA.Mods.RA { public class DefaultLoadScreen : ILoadScreen { - Dictionary info; Stopwatch lastUpdate = Stopwatch.StartNew(); Renderer r; @@ -31,8 +30,6 @@ namespace OpenRA.Mods.RA public void Init(Manifest m, Dictionary info) { - this.info = info; - // Avoid standard loading mechanisms so we // can display the loadscreen as early as possible r = Game.Renderer; @@ -78,14 +75,15 @@ namespace OpenRA.Mods.RA void TestAndContinue() { Ui.ResetAll(); - if (!info["TestFiles"].Split(',').All(f => GlobalFileSystem.Exists(f.Trim()))) + var installData = Game.modData.Manifest.ContentInstaller; + if (!installData["TestFiles"].Split(',').All(f => GlobalFileSystem.Exists(f.Trim()))) { var args = new WidgetArgs() { { "continueLoading", () => TestAndContinue() }, - { "installData", info } + { "installData", installData } }; - Ui.OpenWindow(info["InstallerMenuWidget"], args); + Ui.OpenWindow(installData["InstallerMenuWidget"], args); } else Game.LoadShellMap(); diff --git a/OpenRA.Mods.RA/ModChooserLoadScreen.cs b/OpenRA.Mods.RA/ModChooserLoadScreen.cs index bdfc3d2968..e6c8b86068 100644 --- a/OpenRA.Mods.RA/ModChooserLoadScreen.cs +++ b/OpenRA.Mods.RA/ModChooserLoadScreen.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Cnc public void Init(Manifest m, Dictionary info) { - var sheet = new Sheet("mods/modchooser/chrome.png"); + var sheet = new Sheet(info["Image"]); var res = Game.Renderer.Resolution; bounds = new Rectangle(0, 0, res.Width, res.Height); sprite = new Sprite(sheet, new Rectangle(0,0,1024,480), TextureChannel.Alpha); diff --git a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs index 5cd29af5ea..8a06760ffc 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs @@ -22,14 +22,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic public class DownloadPackagesLogic { Widget panel; - Dictionary installData; + IReadOnlyDictionary installData; ProgressBarWidget progressBar; LabelWidget statusLabel; Action afterInstall; string mirror; [ObjectCreator.UseCtor] - public DownloadPackagesLogic(Widget widget, Dictionary installData, Action afterInstall) + public DownloadPackagesLogic(Widget widget, IReadOnlyDictionary installData, Action afterInstall) { this.installData = installData; this.afterInstall = afterInstall; diff --git a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs index 97a53a74ff..0da7eebe25 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic public class InstallLogic : Widget { [ObjectCreator.UseCtor] - public InstallLogic(Widget widget, Dictionary installData, Action continueLoading) + public InstallLogic(Widget widget, IReadOnlyDictionary installData, Action continueLoading) { var panel = widget.Get("INSTALL_PANEL"); var args = new WidgetArgs() @@ -30,15 +30,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic panel.Get("DOWNLOAD_BUTTON").OnClick = () => Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", args); - if (installData.ContainsKey("FilesToCopy") && !string.IsNullOrEmpty(installData["FilesToCopy"]) && - installData.ContainsKey("FilesToExtract") && !string.IsNullOrEmpty(installData["FilesToExtract"])) - { - args = new WidgetArgs(args) - { - { "filesToCopy", installData["FilesToCopy"].Split(',') }, - { "filesToExtract", installData["FilesToExtract"].Split(',') }, - }; - } panel.Get("INSTALL_BUTTON").OnClick = () => Ui.OpenWindow("INSTALL_FROMCD_PANEL", args); diff --git a/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs index b0aa1846b8..bceb20eab3 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/RAInstallFromCDLogic.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 42928e31d6..07cc15ea44 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -127,11 +127,15 @@ TileSets: mods/cnc/tilesets/jungle.yaml LoadScreen: CncLoadScreen + Image: mods/cnc/uibits/chrome.png + Text: Loading + +ContentInstaller: + TestFiles: conquer.mix, desert.mix, general.mix, sounds.mix, speech.mix, temperat.mix, tempicnh.mix, winter.mix + InstallerBackgroundWidget: INSTALL_BACKGROUND InstallerMenuWidget: INSTALL_PANEL FilesToCopy: CONQUER.MIX, DESERT.MIX, SCORES.MIX, SOUNDS.MIX, TEMPERAT.MIX, WINTER.MIX FilesToExtract: speech.mix, tempicnh.mix, transit.mix - InstallerBackgroundWidget: INSTALL_BACKGROUND - TestFiles: conquer.mix, desert.mix, general.mix, sounds.mix, speech.mix, temperat.mix, tempicnh.mix, winter.mix PackageMirrorList: http://openra.net/packages/cnc-mirrors.txt ServerTraits: diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index a96e0ef6f4..c242a2291d 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -112,11 +112,13 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/d2k/uibits/loadscreen.png + Text: Filling Crates..., Breeding Sandworms... + +ContentInstaller: InstallerMenuWidget: INSTALL_PANEL # 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 PackageMirrorList: http://openra.net/packages/d2k-103-mirrors.txt - Text: Filling Crates..., Breeding Sandworms... ServerTraits: LobbyCommands diff --git a/mods/modchooser/mod.yaml b/mods/modchooser/mod.yaml index 4a290c6bac..533e8519fa 100644 --- a/mods/modchooser/mod.yaml +++ b/mods/modchooser/mod.yaml @@ -24,6 +24,7 @@ Notifications: mods/modchooser/notifications.yaml LoadScreen: ModChooserLoadScreen + Image: mods/modchooser/chrome.png ChromeMetrics: mods/modchooser/metrics.yaml @@ -47,4 +48,6 @@ Fonts: TinyBold: Font:FreeSansBold.ttf Size:10 -LobbyDefaults: \ No newline at end of file + +LobbyDefaults: +ContentInstaller: diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index a3e17e6a66..94eafcaf11 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -129,10 +129,12 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/ra/uibits/loadscreen.png + Text: Filling Crates..., Charging Capacitors..., Reticulating Splines..., Planting Trees..., Building Bridges..., Aging Empires..., Compiling EVA..., Constructing Pylons..., Activating Skynet..., Splitting Atoms... + +ContentInstaller: InstallerMenuWidget: INSTALL_PANEL TestFiles: allies.mix, conquer.mix, general.mix, interior.mix, redalert.mix, russian.mix, scores.mix, snow.mix, sounds.mix, temperat.mix PackageMirrorList: http://openra.net/packages/ra-mirrors.txt - Text: Filling Crates..., Charging Capacitors..., Reticulating Splines..., Planting Trees..., Building Bridges..., Aging Empires..., Compiling EVA..., Constructing Pylons..., Activating Skynet..., Splitting Atoms... ServerTraits: LobbyCommands diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 6321b0a615..2d2427477d 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -154,6 +154,9 @@ Translations: LoadScreen: DefaultLoadScreen Image: mods/ts/uibits/loadscreen.png + Text: Updating EVA installation..., Changing perspective... + +ContentInstaller: InstallerMenuWidget: INSTALL_PANEL 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 PackageMirrorList: http://openra.net/packages/ts-mirrors.txt