diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index 3f3944baf6..caad343c15 100644 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -53,7 +53,7 @@ namespace OpenRA if (useLoadScreen) { LoadScreen = ObjectCreator.CreateObject(Manifest.LoadScreen.Value); - LoadScreen.Init(Manifest, Manifest.LoadScreen.ToDictionary(my => my.Value)); + LoadScreen.Init(this, Manifest.LoadScreen.ToDictionary(my => my.Value)); LoadScreen.Display(); } @@ -205,7 +205,7 @@ namespace OpenRA public interface ILoadScreen : IDisposable { - void Init(Manifest m, Dictionary info); + void Init(ModData m, Dictionary info); void Display(); void StartGame(Arguments args); } diff --git a/OpenRA.Mods.Cnc/CncLoadScreen.cs b/OpenRA.Mods.Cnc/CncLoadScreen.cs index 45dcb89473..3c18eae282 100644 --- a/OpenRA.Mods.Cnc/CncLoadScreen.cs +++ b/OpenRA.Mods.Cnc/CncLoadScreen.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc Rectangle bounds; Renderer r; - public override void Init(Manifest m, Dictionary info) + public override void Init(ModData modData, Dictionary info) { loadInfo = info; @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Cnc r = Game.Renderer; if (r == null) return; - using (var stream = File.OpenRead(Platform.ResolvePath(loadInfo["Image"]))) + using (var stream = modData.ModFiles.Open(info["Image"])) sheet = new Sheet(SheetType.BGRA, stream); var res = r.Resolution; @@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc brightBlock = new Sprite(sheet, new Rectangle(320, 0, 16, 35), TextureChannel.Alpha); dimBlock = new Sprite(sheet, new Rectangle(336, 0, 16, 35), TextureChannel.Alpha); - versionText = m.Mod.Version; + versionText = modData.Manifest.Mod.Version; } bool setup; diff --git a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs index 231d3552b8..3ef8c6d62e 100644 --- a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.LoadScreens { public LaunchArguments Launch; - public virtual void Init(Manifest m, Dictionary info) { } + public virtual void Init(ModData m, Dictionary info) { } public virtual void Display() { diff --git a/OpenRA.Mods.Common/LoadScreens/LogoStripeLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/LogoStripeLoadScreen.cs index 429080f115..d32ba40731 100644 --- a/OpenRA.Mods.Common/LoadScreens/LogoStripeLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/LogoStripeLoadScreen.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.LoadScreens Sprite stripe, logo; string[] messages = { "Loading..." }; - public override void Init(Manifest m, Dictionary info) + public override void Init(ModData modData, Dictionary info) { // Avoid standard loading mechanisms so we // can display the loadscreen as early as possible @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.LoadScreens if (info.ContainsKey("Image")) { - using (var stream = File.OpenRead(Platform.ResolvePath(info["Image"]))) + using (var stream = modData.ModFiles.Open(info["Image"])) sheet = new Sheet(SheetType.BGRA, stream); logo = new Sprite(sheet, new Rectangle(0, 0, 256, 256), TextureChannel.Alpha); diff --git a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs index ae2287651a..c1a0ca4ba3 100644 --- a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs @@ -21,12 +21,12 @@ namespace OpenRA.Mods.Common.LoadScreens Sprite sprite; Rectangle bounds; - public void Init(Manifest m, Dictionary info) + public void Init(ModData modData, Dictionary info) { var res = Game.Renderer.Resolution; bounds = new Rectangle(0, 0, res.Width, res.Height); - using (var stream = File.OpenRead(info["Image"])) + using (var stream = modData.ModFiles.Open(info["Image"])) { var sheet = new Sheet(SheetType.BGRA, stream); sprite = new Sprite(sheet, new Rectangle(0, 0, 1024, 480), TextureChannel.Alpha); diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 5c6c7978d2..2eed4948b1 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -126,7 +126,7 @@ Translations: d2k:languages/english.yaml LoadScreen: LogoStripeLoadScreen - Image: d2k:uibits/loadscreen.png + Image: ./mods/d2k/uibits/loadscreen.png Text: Filling Crates..., Breeding Sandworms..., Fuelling carryalls..., Deploying harvesters..., Preparing 'thopters..., Summoning mentats... ContentInstaller: