Merge pull request #9263 from penev92/assetInstallation

Move asset installation to the ModChooser
This commit is contained in:
Paul Chote
2015-09-26 10:40:04 +01:00
33 changed files with 507 additions and 857 deletions

View File

@@ -0,0 +1,37 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 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,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
namespace OpenRA
{
// Referenced from ModMetadata, so needs to be in OpenRA.Game :(
public class ContentInstaller : IGlobalModData
{
public readonly string[] TestFiles = { };
public readonly string[] DiskTestFiles = { };
public readonly string PackageToExtractFromCD = null;
public readonly bool OverwriteFiles = true;
public readonly Dictionary<string, string[]> CopyFilesFromCD = new Dictionary<string, string[]>();
public readonly Dictionary<string, string[]> ExtractFilesFromCD = new Dictionary<string, string[]>();
public readonly string PackageMirrorList = null;
public readonly string MusicPackageMirrorList = null;
public readonly int ShippedSoundtracks = 0;
/// <summary> InstallShield .CAB file IDs, used to extract Mod-specific files. </summary>
public readonly HashSet<int> InstallShieldCABFileIds = new HashSet<int>();
/// <summary> InstallShield .CAB file IDs, used to extract Mod-specific archives and extract contents of ExtractFilesFromCD. </summary>
public readonly HashSet<string> InstallShieldCABFilePackageIds = new HashSet<string>();
}
}

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -24,6 +25,7 @@ namespace OpenRA
public string Version;
public string Author;
public bool Hidden;
public ContentInstaller Content;
static Dictionary<string, ModMetadata> ValidateMods()
{
@@ -34,19 +36,30 @@ namespace OpenRA
var ret = new Dictionary<string, ModMetadata>();
foreach (var m in mods)
{
var yamlPath = Platform.ResolvePath(".", "mods", m, "mod.yaml");
if (!File.Exists(yamlPath))
continue;
try
{
var yamlPath = Platform.ResolvePath(".", "mods", m, "mod.yaml");
if (!File.Exists(yamlPath))
continue;
var yaml = new MiniYaml(null, MiniYaml.FromFile(yamlPath));
var nd = yaml.ToDictionary();
if (!nd.ContainsKey("Metadata"))
continue;
var yaml = new MiniYaml(null, MiniYaml.FromFile(yamlPath));
var nd = yaml.ToDictionary();
if (!nd.ContainsKey("Metadata"))
continue;
var mod = FieldLoader.Load<ModMetadata>(nd["Metadata"]);
mod.Id = m;
var mod = FieldLoader.Load<ModMetadata>(nd["Metadata"]);
mod.Id = m;
ret.Add(m, mod);
if (nd.ContainsKey("ContentInstaller"))
mod.Content = FieldLoader.Load<ContentInstaller>(nd["ContentInstaller"]);
ret.Add(m, mod);
}
catch (Exception ex)
{
Console.WriteLine("An exception occured when trying to load ModMetadata for `{0}`:".F(m));
Console.WriteLine(ex.Message);
}
}
return ret;

View File

@@ -95,6 +95,7 @@
<Compile Include="FileFormats\IdxReader.cs" />
<Compile Include="FileSystem\BagFile.cs" />
<Compile Include="Map\MapPlayers.cs" />
<Compile Include="ContentInstaller.cs" />
<Compile Include="MPos.cs" />
<Compile Include="Graphics\QuadRenderer.cs" />
<Compile Include="Download.cs" />

View File

@@ -18,31 +18,6 @@ using OpenRA.FileSystem;
namespace OpenRA.Mods.Common
{
public class ContentInstaller : IGlobalModData
{
public readonly string MenuWidget = null;
public readonly string MusicMenuWidget = null;
public readonly string BackgroundWidget = null;
public readonly HashSet<string> TestFiles = new HashSet<string>();
public readonly HashSet<string> DiskTestFiles = new HashSet<string>();
public readonly string PackageToExtractFromCD = null;
public readonly bool OverwriteFiles = true;
public readonly Dictionary<string, string[]> CopyFilesFromCD = new Dictionary<string, string[]>();
public readonly Dictionary<string, string[]> ExtractFilesFromCD = new Dictionary<string, string[]>();
public readonly string PackageMirrorList = null;
public readonly string MusicPackageMirrorList = null;
public readonly int ShippedSoundtracks = 0;
/// <summary> InstallShield .cab File Ids, used to extract Mod specific files. </summary>
public readonly HashSet<int> InstallShieldCABFileIds = new HashSet<int>();
/// <summary> InstallShield .cab File Ids, used to extract Mod specific archives and extract contents of ExtractFilesFromCD. </summary>
public readonly HashSet<string> InstallShieldCABFilePackageIds = new HashSet<string>();
}
public static class InstallUtils
{
static IEnumerable<ZipEntry> GetEntries(this ZipInputStream z)
@@ -81,7 +56,8 @@ namespace OpenRA.Mods.Common
foreach (var file in directory.Value)
{
var dest = Path.Combine(destPath, targetDir, file.ToLowerInvariant());
var containingDir = Path.Combine(destPath, targetDir);
var dest = Path.Combine(containingDir, file.ToLowerInvariant());
if (File.Exists(dest))
{
if (overwrite)
@@ -93,6 +69,8 @@ namespace OpenRA.Mods.Common
}
}
Directory.CreateDirectory(containingDir);
using (var sourceStream = GlobalFileSystem.Open(file))
using (var destStream = File.Create(dest))
{
@@ -123,13 +101,16 @@ namespace OpenRA.Mods.Common
}
var destFile = Path.GetFileName(file);
var dest = Path.Combine(destPath, targetDir, destFile.ToLowerInvariant());
var containingDir = Path.Combine(destPath, targetDir);
var dest = Path.Combine(containingDir, destFile.ToLowerInvariant());
if (File.Exists(dest) && !overwrite)
{
Log.Write("debug", "Skipping {0}".F(dest));
continue;
}
Directory.CreateDirectory(containingDir);
onProgress("Copying " + destFile);
Log.Write("debug", "Copy {0} to {1}".F(sourcePath, dest));
File.Copy(sourcePath, dest, true);

View File

@@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.FileSystem;
@@ -40,27 +41,13 @@ namespace OpenRA.Mods.Common.LoadScreens
Ui.ResetAll();
Game.Settings.Save();
// Check whether the mod content is installed
// TODO: The installation code has finally been beaten into shape, so we can
// finally move it all into the planned "Manage Content" panel in the modchooser mod.
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
var installModContent = !installData.TestFiles.All(f => GlobalFileSystem.Exists(f));
var installModMusic = args != null && args.Contains("Install.Music");
var isModContentInstalled = installData.TestFiles.All(f => GlobalFileSystem.Exists(Path.GetFileName(f)));
if (installModContent || installModMusic)
// Mod assets are missing!
if (!isModContentInstalled)
{
var widgetArgs = new WidgetArgs()
{
{ "continueLoading", () => Game.RunAfterTick(() =>
Game.InitializeMod(Game.Settings.Game.Mod, args)) },
};
if (installData.BackgroundWidget != null)
Ui.LoadWidget(installData.BackgroundWidget, Ui.Root, widgetArgs);
var menu = installModContent ? installData.MenuWidget : installData.MusicMenuWidget;
Ui.OpenWindow(menu, widgetArgs);
Game.InitializeMod("modchooser", new Arguments());
return;
}

View File

@@ -41,7 +41,17 @@ namespace OpenRA.Mods.Common.LoadScreens
public void StartGame(Arguments args)
{
Ui.LoadWidget("MODCHOOSER", Ui.Root, new WidgetArgs());
var widgetArgs = new WidgetArgs();
Ui.LoadWidget("MODCHOOSER_BACKGROUND", Ui.Root, widgetArgs);
if (args != null && args.Contains("installMusic"))
{
widgetArgs.Add("modId", args.GetValue("installMusic", ""));
Ui.OpenWindow("INSTALL_MUSIC_PANEL", widgetArgs);
}
else
Ui.OpenWindow("MODCHOOSER_DIALOG", widgetArgs);
}
public void Dispose()

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets
public string Background = "button";
public bool Depressed = false;
public int VisualHeight = ChromeMetrics.Get<int>("ButtonDepth");
public int BaseLine = 0;
public int BaseLine = ChromeMetrics.Get<int>("ButtonBaseLine");
public string Font = ChromeMetrics.Get<string>("ButtonFont");
public Color TextColor = ChromeMetrics.Get<Color>("ButtonTextColor");
public Color TextColorDisabled = ChromeMetrics.Get<Color>("ButtonTextColorDisabled");

View File

@@ -9,11 +9,10 @@
#endregion
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using OpenRA.Support;
using OpenRA.Widgets;
@@ -21,24 +20,29 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class DownloadPackagesLogic
{
static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
readonly Widget panel;
readonly string modId;
readonly string mirrorListUrl;
readonly ProgressBarWidget progressBar;
readonly LabelWidget statusLabel;
readonly Action afterInstall;
string mirror;
static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
[ObjectCreator.UseCtor]
public DownloadPackagesLogic(Widget widget, Action afterInstall, string mirrorListUrl)
public DownloadPackagesLogic(Widget widget, Action afterInstall, string mirrorListUrl, string modId)
{
this.mirrorListUrl = mirrorListUrl;
this.afterInstall = afterInstall;
this.modId = modId;
panel = widget.Get("INSTALL_DOWNLOAD_PANEL");
progressBar = panel.Get<ProgressBarWidget>("PROGRESS_BAR");
statusLabel = panel.Get<LabelWidget>("STATUS_LABEL");
var text = "Downloading {0} assets...".F(ModMetadata.AllMods[modId].Title);
panel.Get<LabelWidget>("TITLE").Text = text;
ShowDownloadDialog();
}
@@ -52,9 +56,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var cancelButton = panel.Get<ButtonWidget>("CANCEL_BUTTON");
var mirrorsFile = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id, "mirrors.txt");
var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
var dest = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id);
var dest = Platform.ResolvePath("^", "Content", modId);
Action<DownloadProgressChangedEventArgs> onDownloadProgress = i =>
{
@@ -100,7 +103,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
onError(Download.FormatErrorMessage(i.Error));
return;
}
else if (cancelled)
if (cancelled)
{
onError("Download cancelled");
return;
@@ -119,7 +123,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
};
Action<AsyncCompletedEventArgs, bool> onFetchMirrorsComplete = (i, cancelled) =>
Action<DownloadDataCompletedEventArgs, bool> onFetchMirrorsComplete = (i, cancelled) =>
{
progressBar.Indeterminate = true;
@@ -128,21 +132,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
onError(Download.FormatErrorMessage(i.Error));
return;
}
else if (cancelled)
if (cancelled)
{
onError("Download cancelled");
return;
}
var mirrorList = new List<string>();
using (var r = new StreamReader(mirrorsFile))
{
string line;
while ((line = r.ReadLine()) != null)
if (!string.IsNullOrEmpty(line))
mirrorList.Add(line);
}
var data = Encoding.UTF8.GetString(i.Result);
var mirrorList = data.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
mirror = mirrorList.Random(new MersenneTwister());
// Save the package to a temp file
@@ -152,7 +150,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
// Get the list of mirrors
var updateMirrors = new Download(mirrorListUrl, mirrorsFile, onDownloadProgress, onFetchMirrorsComplete);
var updateMirrors = new Download(mirrorListUrl, onDownloadProgress, onFetchMirrorsComplete);
cancelButton.OnClick = () => { updateMirrors.Cancel(); Ui.CloseWindow(); };
retryButton.OnClick = () => { updateMirrors.Cancel(); ShowDownloadDialog(); };
}

View File

@@ -19,19 +19,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
public class InstallFromCDLogic
{
readonly string modId;
readonly Widget panel;
readonly ProgressBarWidget progressBar;
readonly LabelWidget statusLabel;
readonly Action continueLoading;
readonly Action afterInstall;
readonly ButtonWidget retryButton, backButton;
readonly Widget installingContainer, insertDiskContainer;
readonly ContentInstaller installData;
[ObjectCreator.UseCtor]
public InstallFromCDLogic(Widget widget, Action continueLoading)
public InstallFromCDLogic(Widget widget, Action afterInstall, string modId)
{
installData = Game.ModData.Manifest.Get<ContentInstaller>();
this.continueLoading = continueLoading;
this.modId = modId;
installData = ModMetadata.AllMods[modId].Content;
this.afterInstall = afterInstall;
panel = widget.Get("INSTALL_FROMCD_PANEL");
progressBar = panel.Get<ProgressBarWidget>("PROGRESS_BAR");
statusLabel = panel.Get<LabelWidget>("STATUS_LABEL");
@@ -74,6 +76,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
InstallTFD(Platform.ResolvePath(path, "data1.hdr"));
else
{
var text = "Please insert a {0} install CD and click Retry.".F(ModMetadata.AllMods[modId].Title);
insertDiskContainer.Get<LabelWidget>("INFO2").Text = text;
insertDiskContainer.IsVisible = () => true;
installingContainer.IsVisible = () => false;
}
@@ -103,13 +108,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var filename = cabExtractor.FileName(index);
statusLabel.GetText = () => "Extracting {0}".F(filename);
var dest = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id, filename.ToLowerInvariant());
var dest = Platform.ResolvePath("^", "Content", modId, filename.ToLowerInvariant());
cabExtractor.ExtractFile(index, dest);
progressBar.Percentage += installPercent;
}
var ArchivesToExtract = installData.InstallShieldCABFilePackageIds.Select(x => x.Split(':'));
var destDir = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id);
var destDir = Platform.ResolvePath("^", "Content", modId);
var onError = (Action<string>)(s => { });
var overwrite = installData.OverwriteFiles;
@@ -124,7 +129,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var filename = cabExtractor.FileName(uint.Parse(archive[0]));
statusLabel.GetText = () => "Extracting {0}".F(filename);
var destFile = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id, filename.ToLowerInvariant());
var destFile = Platform.ResolvePath("^", "Content", modId, filename.ToLowerInvariant());
cabExtractor.ExtractFile(uint.Parse(archive[0]), destFile);
var annotation = archive.Length > 1 ? archive[1] : null;
InstallUtils.ExtractFromPackage(source, destFile, annotation, extractFiles, destDir, overwrite, onProgress, onError);
@@ -132,7 +137,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
}
continueLoading();
afterInstall();
}) { IsBackground = true }.Start();
}
@@ -143,7 +148,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
insertDiskContainer.IsVisible = () => false;
installingContainer.IsVisible = () => true;
var dest = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id);
var dest = Platform.ResolvePath("^", "Content", modId);
var copyFiles = installData.CopyFilesFromCD;
var packageToExtract = installData.PackageToExtractFromCD.Split(':');
@@ -193,7 +198,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
statusLabel.GetText = () => "Game assets have been extracted.";
Ui.CloseWindow();
continueLoading();
afterInstall();
});
}
catch (Exception e)

View File

@@ -8,8 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -17,31 +15,28 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public class InstallLogic : Widget
{
[ObjectCreator.UseCtor]
public InstallLogic(Widget widget, Action continueLoading)
public InstallLogic(Widget widget, string mirrorListUrl, string modId)
{
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
var panel = widget.Get("INSTALL_PANEL");
var widgetArgs = new WidgetArgs()
var widgetArgs = new WidgetArgs
{
{ "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
{ "continueLoading", continueLoading },
{ "mirrorListUrl", installData.PackageMirrorList },
{ "afterInstall", () => { Game.InitializeMod(modId, new Arguments()); } },
{ "mirrorListUrl", mirrorListUrl },
{ "modId", modId }
};
panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", widgetArgs);
var mod = ModMetadata.AllMods[modId];
var text = "OpenRA requires the original {0} game content.".F(mod.Title);
panel.Get<LabelWidget>("DESC1").Text = text;
var downloadButton = panel.Get<ButtonWidget>("DOWNLOAD_BUTTON");
downloadButton.OnClick = () => Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", widgetArgs);
downloadButton.IsDisabled = () => string.IsNullOrEmpty(mod.Content.PackageMirrorList);
panel.Get<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
Ui.OpenWindow("INSTALL_FROMCD_PANEL", widgetArgs);
panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = () =>
{
Game.RunAfterTick(() =>
{
Game.Settings.Game.PreviousMod = Game.ModData.Manifest.Mod.Id;
Game.InitializeMod("modchooser", null);
});
};
panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = Ui.CloseWindow;
}
}
}

View File

@@ -9,10 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.FileSystem;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -20,38 +16,41 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public class InstallMusicLogic
{
[ObjectCreator.UseCtor]
public InstallMusicLogic(Widget widget)
public InstallMusicLogic(Widget widget, string modId)
{
var installMusicContainer = widget.Get("INSTALL_MUSIC_PANEL");
Action loadDefaultMod = () => Game.RunAfterTick(() =>
Game.InitializeMod(Game.Settings.Game.Mod, null));
Action loadDefaultMod = () => Game.RunAfterTick(() => Game.InitializeMod(modId, null));
var cancelButton = installMusicContainer.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
var cancelButton = installMusicContainer.GetOrNull<ButtonWidget>("BACK_BUTTON");
if (cancelButton != null)
cancelButton.OnClick = loadDefaultMod;
var copyFromDiscButton = installMusicContainer.GetOrNull<ButtonWidget>("COPY_FROM_CD_BUTTON");
var copyFromDiscButton = installMusicContainer.GetOrNull<ButtonWidget>("INSTALL_MUSIC_BUTTON");
if (copyFromDiscButton != null)
{
copyFromDiscButton.OnClick = () =>
{
Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs() {
{ "continueLoading", loadDefaultMod },
Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs
{
{ "afterInstall", loadDefaultMod },
{ "modId", modId }
});
};
}
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_MUSIC_BUTTON");
if (downloadButton != null)
{
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
downloadButton.IsVisible = () => !string.IsNullOrEmpty(installData.MusicPackageMirrorList);
var installData = ModMetadata.AllMods[modId].Content;
downloadButton.IsDisabled = () => string.IsNullOrEmpty(installData.MusicPackageMirrorList);
downloadButton.OnClick = () =>
{
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs
{
{ "afterInstall", loadDefaultMod },
{ "mirrorListUrl", installData.MusicPackageMirrorList },
{ "modId", modId }
});
};
}

View File

@@ -14,6 +14,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -25,6 +26,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly ModMetadata[] allMods;
readonly Dictionary<string, Sprite> previews = new Dictionary<string, Sprite>();
readonly Dictionary<string, Sprite> logos = new Dictionary<string, Sprite>();
readonly Cache<ModMetadata, bool> modInstallStatus;
readonly Widget modChooserPanel;
readonly ButtonWidget loadButton;
readonly SheetBuilder sheetBuilder;
ModMetadata selectedMod;
string selectedAuthor;
@@ -34,30 +38,30 @@ namespace OpenRA.Mods.Common.Widgets.Logic
[ObjectCreator.UseCtor]
public ModBrowserLogic(Widget widget)
{
var panel = widget;
var loadButton = panel.Get<ButtonWidget>("LOAD_BUTTON");
modChooserPanel = widget;
loadButton = modChooserPanel.Get<ButtonWidget>("LOAD_BUTTON");
loadButton.OnClick = () => LoadMod(selectedMod);
loadButton.IsDisabled = () => selectedMod.Id == Game.ModData.Manifest.Mod.Id;
panel.Get<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
modChooserPanel.Get<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
modList = panel.Get("MOD_LIST");
modList = modChooserPanel.Get("MOD_LIST");
modTemplate = modList.Get<ButtonWidget>("MOD_TEMPLATE");
panel.Get<LabelWidget>("MOD_DESC").GetText = () => selectedDescription;
panel.Get<LabelWidget>("MOD_TITLE").GetText = () => selectedMod.Title;
panel.Get<LabelWidget>("MOD_AUTHOR").GetText = () => selectedAuthor;
panel.Get<LabelWidget>("MOD_VERSION").GetText = () => selectedMod.Version;
modChooserPanel.Get<LabelWidget>("MOD_DESC").GetText = () => selectedDescription;
modChooserPanel.Get<LabelWidget>("MOD_TITLE").GetText = () => selectedMod.Title;
modChooserPanel.Get<LabelWidget>("MOD_AUTHOR").GetText = () => selectedAuthor;
modChooserPanel.Get<LabelWidget>("MOD_VERSION").GetText = () => selectedMod.Version;
var prevMod = panel.Get<ButtonWidget>("PREV_MOD");
var prevMod = modChooserPanel.Get<ButtonWidget>("PREV_MOD");
prevMod.OnClick = () => { modOffset -= 1; RebuildModList(); };
prevMod.IsVisible = () => modOffset > 0;
var nextMod = panel.Get<ButtonWidget>("NEXT_MOD");
var nextMod = modChooserPanel.Get<ButtonWidget>("NEXT_MOD");
nextMod.OnClick = () => { modOffset += 1; RebuildModList(); };
nextMod.IsVisible = () => modOffset + 5 < allMods.Length;
panel.Get<RGBASpriteWidget>("MOD_PREVIEW").GetSprite = () =>
modChooserPanel.Get<RGBASpriteWidget>("MOD_PREVIEW").GetSprite = () =>
{
Sprite ret = null;
previews.TryGetValue(selectedMod.Id, out ret);
@@ -89,9 +93,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
catch (Exception) { }
}
ModMetadata initialMod = null;
modInstallStatus = new Cache<ModMetadata, bool>(IsModInstalled);
ModMetadata initialMod;
ModMetadata.AllMods.TryGetValue(Game.Settings.Game.PreviousMod, out initialMod);
SelectMod(initialMod ?? ModMetadata.AllMods["ra"]);
SelectMod(initialMod != null && initialMod.Id != "modchooser" ? initialMod : ModMetadata.AllMods["ra"]);
RebuildModList();
}
@@ -113,6 +119,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
break;
var mod = allMods[j];
var item = modTemplate.Clone() as ButtonWidget;
item.Bounds = new Rectangle(outerMargin + i * stride, 0, width, height);
item.IsHighlighted = () => selectedMod == mod;
@@ -148,10 +155,27 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var selectedIndex = Array.IndexOf(allMods, mod);
if (selectedIndex - modOffset > 4)
modOffset = selectedIndex - 4;
loadButton.Text = modInstallStatus[mod] ? "Load Mod" : "Install Assets";
}
void LoadMod(ModMetadata mod)
{
if (!modInstallStatus[mod])
{
var widgetArgs = new WidgetArgs
{
{ "continueLoading", () =>
Game.RunAfterTick(() => Game.InitializeMod(Game.Settings.Game.Mod, new Arguments())) },
{ "mirrorListUrl", mod.Content.PackageMirrorList },
{ "modId", mod.Id }
};
Ui.OpenWindow("INSTALL_PANEL", widgetArgs);
return;
}
Game.RunAfterTick(() =>
{
Ui.CloseWindow();
@@ -159,5 +183,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.InitializeMod(mod.Id, null);
});
}
static bool IsModInstalled(ModMetadata mod)
{
return mod.Content.TestFiles.All(file => File.Exists(Path.GetFullPath(Platform.ResolvePath(file))));
}
}
}

View File

@@ -90,11 +90,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var installButton = widget.GetOrNull<ButtonWidget>("INSTALL_BUTTON");
if (installButton != null)
{
installButton.IsDisabled = () => world == null || world.Type != WorldType.Shellmap;
var args = new string[] { "Install.Music=true" };
installButton.IsDisabled = () => world.Type != WorldType.Shellmap;
var args = new[] { "installMusic={0}".F(Game.ModData.Manifest.Mod.Id) };
installButton.OnClick = () =>
Game.RunAfterTick(() =>
Game.InitializeMod(Game.Settings.Game.Mod, new Arguments(args)));
Game.RunAfterTick(() => Game.InitializeMod("modchooser", new Arguments(args)));
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
installButton.IsVisible = () => modRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks;

View File

@@ -10,12 +10,17 @@
using System;
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{
public class ProgressBarWidget : Widget
{
public string Background = "progressbar-bg";
public string Bar = "progressbar-thumb";
public Size BarMargin = new Size(2, 2);
public int Percentage = 0;
public bool Indeterminate = false;
@@ -44,14 +49,16 @@ namespace OpenRA.Mods.Common.Widgets
{
var rb = RenderBounds;
var percentage = GetPercentage();
WidgetUtils.DrawPanel("progressbar-bg", rb);
WidgetUtils.DrawPanel(Background, rb);
var barRect = wasIndeterminate ?
new Rectangle(rb.X + 2 + (int)(0.75 * offset * (rb.Width - 4)), rb.Y + 2, (rb.Width - 4) / 4, rb.Height - 4) :
new Rectangle(rb.X + 2, rb.Y + 2, percentage * (rb.Width - 4) / 100, rb.Height - 4);
var minBarWidth = (int)(ChromeProvider.GetImage(Bar, "border-l").Size.X + ChromeProvider.GetImage(Bar, "border-r").Size.X);
var maxBarWidth = rb.Width - BarMargin.Width * 2;
var barWidth = wasIndeterminate ? maxBarWidth / 4 : percentage * maxBarWidth / 100;
barWidth = Math.Max(barWidth, minBarWidth);
if (barRect.Width > 0)
WidgetUtils.DrawPanel("progressbar-thumb", barRect);
var barOffset = wasIndeterminate ? (int)(0.75 * offset * maxBarWidth) : 0;
var barRect = new Rectangle(rb.X + BarMargin.Width + barOffset, rb.Y + BarMargin.Height, barWidth, rb.Height - 2 * BarMargin.Height);
WidgetUtils.DrawPanel(Bar, barRect);
}
bool wasIndeterminate;

View File

@@ -5,7 +5,6 @@ shellmapbits: chrome.png
record: 288,16,16,16
logos: chrome.png
install:128,0,128,128
eva:256,64,128,64
nod-load:0,256,256,256
gdi-load:256,256,256,256

View File

@@ -1,207 +0,0 @@
Container@INSTALL_BACKGROUND:
Width: WINDOW_RIGHT
Height: WINDOW_BOTTOM
Children:
Image@NOD:
X: WINDOW_RIGHT/2-384
Y: (WINDOW_BOTTOM-256)/2
ImageCollection: logos
ImageName: nod-load
Image@GDI:
X: WINDOW_RIGHT/2+128
Y: (WINDOW_BOTTOM-256)/2
ImageCollection: logos
ImageName: gdi-load
Image@EVA:
X: WINDOW_RIGHT-128-43
Y: 43
Width: 128
Height: 64
ImageCollection: logos
ImageName: eva
Background:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Background: shellmapborder
Container@INSTALL_PANEL:
Logic: InstallLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 150)/2
Width: 640
Height: 150
Children:
Label@TITLE:
Width: PARENT_RIGHT
Y: 0-25
Font: BigBold
Contrast: true
Align: Center
Text: Install Required
Background@bg:
Width: 640
Height: 150
Background: panel-black
Children:
Image@INSTALL:
X: 11
Y: 11
ImageCollection: logos
ImageName: install
Label@INFO:
X: 170
Y: 50
Width: PARENT_RIGHT-30
Height: 25
Text: OpenRA requires the original Command & Conquer game content.
Font: Bold
Label@INFO2:
X: 170
Y: 70
Width: PARENT_RIGHT-185
Height: 25
WordWrap: true
Text: Content can be downloaded, or copied from the install CD.
Font: Bold
Button@BACK_BUTTON:
Y: 149
Width: 140
Height: 35
Text: Back
Button@DOWNLOAD_BUTTON:
X: 350
Y: 149
Width: 140
Height: 35
Text: Download
Button@INSTALL_BUTTON:
X: 500
Y: 149
Width: 140
Height: 35
Text: Use CD
Container@INSTALL_FROMCD_PANEL:
Logic: InstallFromCDLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 150)/2
Width: 640
Height: 150
Children:
Label@TITLE:
Width: PARENT_RIGHT
Y: 0-25
Font: BigBold
Contrast: true
Align: Center
Text: Installing from CD
Background@bg:
Width: 640
Height: 150
Background: panel-black
Children:
Image@INSTALL:
X: 11
Y: 11
ImageCollection: logos
ImageName: install
Container@INSTALLING:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
ProgressBar@PROGRESS_BAR:
X: 170
Y: 45
Width: PARENT_RIGHT - 185
Height: 35
Label@STATUS_LABEL:
X: 170
Y: 85
Width: PARENT_RIGHT - 185
Height: 25
Align: Left
Container@INSERT_DISK:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@INFO:
X: 170
Y: 50
Width: PARENT_RIGHT-30
Height: 25
Text: Disk not found.
Font: Bold
Label@INFO2:
X: 170
Y: 70
Width: PARENT_RIGHT-185
Height: 25
WordWrap: true
Text: Please insert one of the Command & Conquer install CDs then click Retry.
Font: Bold
Button@BACK_BUTTON:
Key: escape
Y: 149
Width: 140
Height: 35
Text: Back
Button@RETRY_BUTTON:
Key: return
X: 500
Y: 149
Width: 140
Height: 35
Text: Retry
Container@INSTALL_DOWNLOAD_PANEL:
Logic: DownloadPackagesLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - 150)/2
Width: 640
Height: 150
Children:
Label@TITLE:
Width: PARENT_RIGHT
Y: 0-25
Font: BigBold
Contrast: true
Align: Center
Text: Downloading Command & Conquer Content
Background@bg:
Width: 640
Height: 150
Background: panel-black
Children:
Image@INSTALL:
X: 11
Y: 11
ImageCollection: logos
ImageName: install
ProgressBar@PROGRESS_BAR:
X: 170
Y: 45
Width: PARENT_RIGHT - 185
Height: 35
Label@STATUS_LABEL:
X: 170
Y: 85
Width: PARENT_RIGHT - 185
Height: 25
Align: Left
Text: Initialising...
Button@CANCEL_BUTTON:
Key: escape
Y: 149
Width: 140
Height: 35
Text: Cancel
Button@RETRY_BUTTON:
Key: return
X: 500
Y: 149
Width: 140
Height: 35
Text: Retry

View File

@@ -7,6 +7,7 @@ Metrics:
ButtonTextColorDisabled: 128,128,128
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
ButtonBaseLine: 0
CheckboxPressedState: true
HotkeyFont: Regular
HotkeyColor: 255,255,255

View File

@@ -90,7 +90,6 @@ Assemblies:
./mods/cnc/OpenRA.Mods.Cnc.dll
ChromeLayout:
./mods/cnc/chrome/install.yaml
./mods/cnc/chrome/mainmenu.yaml
./mods/cnc/chrome/serverbrowser.yaml
./mods/cnc/chrome/createserver.yaml
@@ -140,10 +139,7 @@ LoadScreen: CncLoadScreen
Text: Loading
ContentInstaller:
TestFiles: conquer.mix, desert.mix, sounds.mix, speech.mix, temperat.mix, tempicnh.mix, winter.mix
BackgroundWidget: INSTALL_BACKGROUND
MenuWidget: INSTALL_PANEL
MusicMenuWidget: INSTALL_MUSIC_PANEL
TestFiles: ^Content/cnc/conquer.mix, ^Content/cnc/desert.mix, ^Content/cnc/sounds.mix, ^Content/cnc/speech.mix, ^Content/cnc/temperat.mix, ^Content/cnc/tempicnh.mix, ^Content/cnc/winter.mix
FilesToCopy: CONQUER.MIX, DESERT.MIX, SCORES.MIX, SOUNDS.MIX, TEMPERAT.MIX, WINTER.MIX
FilesToExtract: speech.mix, tempicnh.mix, transit.mix
PackageMirrorList: http://www.openra.net/packages/cnc-mirrors.txt

View File

@@ -1,160 +0,0 @@
Background@INSTALL_PANEL:
Logic: InstallLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Install Required
Align: Center
Font: Bold
Label@DESC1:
X: 0
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: OpenRA requires the original Dune 2000 game content.
Align: Center
Label@DESC2:
X: 0
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Content can be downloaded, or copied from the install CD.
Align: Center
Button@DOWNLOAD_BUTTON:
X: 20
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Download
Font: Bold
Button@INSTALL_BUTTON:
X: 140
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Use CD
Font: Bold
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Back
Font: Bold
Background@INSTALL_DOWNLOAD_PANEL:
Logic: DownloadPackagesLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Downloading Dune 2000 Content
Align: Center
Font: Bold
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Visible: false
Text: Retry
Font: Bold
Key: return
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Cancel
Font: Bold
Key: escape
Background@INSTALL_FROMCD_PANEL:
Logic: InstallFromCDLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Installing from CD
Align: Center
Font: Bold
Container@INSTALLING:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Container@INSERT_DISK:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@INFO:
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: Disk not found.
Align: Center
Label@INFO2:
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Please insert the Dune 2000 install CD then click Retry.
Align: Center
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Retry
Font: Bold
Key: return
Button@BACK_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Back
Font: Bold
Key: escape

View File

@@ -7,6 +7,7 @@ Metrics:
ButtonTextColorDisabled: 128,128,128
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
ButtonBaseLine: 0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255

View File

@@ -16,7 +16,6 @@ Folders:
~^Content/d2k/GAMESFX
~^Content/d2k/Movies
~^Content/d2k/Music
~^Content/d2k/Tilesets
MapFolders:
./mods/d2k/maps: System
@@ -65,7 +64,6 @@ Assemblies:
./mods/d2k/OpenRA.Mods.D2k.dll
ChromeLayout:
./mods/d2k/chrome/install.yaml
./mods/d2k/chrome/ingame.yaml
./mods/ra/chrome/ingame-chat.yaml
./mods/ra/chrome/ingame-diplomacy.yaml
@@ -124,17 +122,14 @@ LoadScreen: LogoStripeLoadScreen
Text: Filling Crates..., Breeding Sandworms..., Fuelling carryalls..., Deploying harvesters..., Preparing 'thopters..., Summoning mentats...
ContentInstaller:
MenuWidget: INSTALL_PANEL
MusicMenuWidget: INSTALL_MUSIC_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
TestFiles: ^Content/d2k/BLOXBASE.R8, ^Content/d2k/BLOXBAT.R8, ^Content/d2k/BLOXBGBS.R8, ^Content/d2k/BLOXICE.R8, ^Content/d2k/BLOXTREE.R8, ^Content/d2k/BLOXWAST.R8, ^Content/d2k/DATA.R8, ^Content/d2k/SOUND.RS
PackageMirrorList: http://www.openra.net/packages/d2k-103-mirrors.txt
DiskTestFiles: music/ambush.aud, setup/setup.z
PackageToExtractFromCD: setup/setup.z
OverwriteFiles: False
ExtractFilesFromCD:
.: SOUND.RS, DATA.R8, MOUSE.R8
Tilesets: BLOXBASE.R8, BLOXBAT.R8, BLOXBGBS.R8, BLOXICE.R8, BLOXTREE.R8, BLOXWAST.R8
.: SOUND.RS, DATA.R8, MOUSE.R8, BLOXBASE.R8, BLOXBAT.R8, BLOXBGBS.R8, BLOXICE.R8, BLOXTREE.R8, BLOXWAST.R8
GAMESFX: A_ECONF1.AUD, A_ECONF2.AUD, A_ECONF3.AUD, A_ESEL1.AUD, A_ESEL2.AUD, A_ESEL3.AUD, A_FCONF1.AUD, A_FCONF2.AUD, A_FCONF3.AUD,A_FCONF4.AUD, A_FSEL1.AUD, A_FSEL2.AUD, A_FSEL3.AUD, A_FSEL4.AUD, AI_1MIN.AUD, AI_2MIN.AUD, AI_3MIN.AUD, AI_4MIN.AUD, AI_5MIN.AUD, AI_ABORT.AUD, AI_ATACK.AUD, AI_BDRDY.AUD, AI_BLOST.AUD, AI_BUILD.AUD, AI_CANCL.AUD, AI_CAPT.AUD, A_ICONF1.AUD, A_ICONF2.AUD, A_ICONF3.AUD, AI_DHRDY.AUD, AI_DPLOY.AUD, AI_ENEMY.AUD, AI_GANEW.AUD, AI_GLOAD.AUD, AI_GSAVE.AUD, AI_GUARD.AUD, AI_HATTK.AUD, AI_HOLD.AUD, AI_LAUNC.AUD, AI_MAP1A.AUD, AI_MAP1B.AUD, AI_MAP1C.AUD, AI_MAP2A.AUD, AI_MAP2B.AUD, AI_MAP2C.AUD, AI_MAP3A.AUD, AI_MAP4A.AUD, AI_MAP5A.AUD, AI_MAP6A.AUD, AI_MAP7A.AUD, AI_MAP8A.AUD, AI_MAP9A.AUD, AI_MEND.AUD, AI_MFAIL.AUD, AI_MONEY.AUD, AI_MWIN.AUD, AI_NEWOP.AUD, AI_NROOM.AUD, AI_ORDER.AUD, AI_PLACE.AUD, AI_POWER.AUD, AI_PREP.AUD, AI_PRMRY.AUD, AI_REINF.AUD, AI_RUN.AUD, A_ISEL1.AUD, A_ISEL2.AUD, A_ISEL3.AUD, AI_SELL.AUD, AI_SILOS.AUD, AI_SPORT.AUD, AI_TRAIN.AUD, AI_ULOST.AUD, AI_UNRDY.AUD, AI_UPGOP.AUD, AI_UPGRD.AUD, AI_WATTK.AUD, AI_WSIGN.AUD, A_VCONF1.AUD, A_VCONF2.AUD, A_VCONF3.AUD, A_VSEL1.AUD, A_VSEL2.AUD, A_VSEL3.AUD, G_SCONF1.AUD, G_SCONF2.AUD, G_SCONF3.AUD, G_SSEL1.AUD, G_SSEL2.AUD, G_SSEL3.AUD, H_ECONF1.AUD, H_ECONF2.AUD, H_ECONF3.AUD, H_ESEL1.AUD, H_ESEL2.AUD, H_ESEL3.AUD, HI_1MIN.AUD, HI_2MIN.AUD, HI_3MIN.AUD, HI_4MIN.AUD, HI_5MIN.AUD, HI_ABORT.AUD, HI_ATACK.AUD, HI_BDRDY.AUD, HI_BLOST.AUD, HI_BUILD.AUD, HI_CANCL.AUD, HI_CAPT.AUD, H_ICONF1.AUD, H_ICONF2.AUD, H_ICONF3.AUD, HI_DHRDY.AUD, HI_DPLOY.AUD, HI_ENEMY.AUD, HI_GANEW.AUD,HI_GLOAD.AUD, HI_GSAVE.AUD, HI_GUARD.AUD, HI_HATTK.AUD, HI_HOLD.AUD, HI_LAUNC.AUD, HI_MAP1A.AUD, HI_MAP1B.AUD, HI_MAP1C.AUD, HI_MAP2A.AUD, HI_MAP2B.AUD, HI_MAP2C.AUD, HI_MAP3A.AUD, HI_MAP3B.AUD, HI_MAP4A.AUD, HI_MAP4B.AUD, HI_MAP5A.AUD, HI_MAP6A.AUD, HI_MAP6B.AUD, HI_MAP7A.AUD, HI_MAP9A.AUD, HI_MAP9.AUD, HI_MEND.AUD, HI_MFAIL.AUD, HI_MONEY.AUD, HI_MWIN.AUD, HI_NEWOP.AUD, HI_NROOM.AUD, HI_ORDER.AUD, HI_PLACE.AUD, HI_POWER.AUD, HI_PREP.AUD, HI_PRMRY.AUD, HI_REINF.AUD, HI_RUN.AUD, H_ISEL1.AUD, H_ISEL2.AUD, H_ISEL3.AUD, HI_SELL.AUD, HI_SILOS.AUD,HI_SPORT.AUD, HI_TRAIN.AUD, HI_ULOST.AUD, HI_UNRDY.AUD, HI_UPGOP.AUD, HI_UPGRD.AUD, HI_WATTK.AUD, HI_WSIGN.AUD, H_VCONF1.AUD, H_VCONF2.AUD, H_VCONF3.AUD, H_VSEL1.AUD, H_VSEL2.AUD, H_VSEL3.AUD, O_ECONF1.AUD, O_ECONF2.AUD, O_ECONF3.AUD, O_ESEL1.AUD, O_ESEL2.AUD, O_ESEL3.AUD, OI_1MIN.AUD, OI_2MIN.AUD, OI_3MIN.AUD, OI_4MIN.AUD, OI_5MIN.AUD, OI_ABORT.AUD, OI_ATACK.AUD, OI_BDRDY.AUD, OI_BLOST.AUD, OI_BUILD.AUD, OI_CANCL.AUD, OI_CAPT.AUD, O_ICONF1.AUD, O_ICONF2.AUD, O_ICONF3.AUD, OI_DHRDY.AUD, OI_DPLOY.AUD, OI_ENEMY.AUD, OI_GANEW.AUD, OI_GLOAD.AUD, OI_GSAVE.AUD, OI_GUARD.AUD, OI_HATTK.AUD, OI_HOLD.AUD, OI_LAUNC.AUD, OI_MAP1A.AUD, OI_MAP1B.AUD, OI_MAP1C.AUD, OI_MAP2A.AUD, OI_MAP2B.AUD, OI_MAP2C.AUD, OI_MAP3A.AUD, OI_MAP4A.AUD, OI_MAP5A.AUD, OI_MAP6A.AUD, OI_MAP7A.AUD, OI_MAP8A.AUD, OI_MAP9A.AUD, OI_MEND.AUD, OI_MFAIL.AUD, OI_MONEY.AUD, OI_MWIN.AUD, OI_NEWOP.AUD, OI_NROOM.AUD, OI_ORDER.AUD, OI_PLACE.AUD, OI_POWER.AUD, OI_PREP.AUD, OI_PRMRY.AUD, OI_REINF.AUD, OI_RUN.AUD, O_ISEL1.AUD, O_ISEL2.AUD, O_ISEL3.AUD, OI_SELL.AUD, OI_SILOS.AUD, OI_SPORT.AUD, OI_TRAIN.AUD, OI_ULOST.AUD, OI_UNRDY.AUD, OI_UPGOP.AUD, OI_UPGRD.AUD, OI_WATTK.AUD, OI_WSIGN.AUD, O_SCONF1.AUD, O_SCONF2.AUD, O_SCONF3.AUD, O_SSEL1.AUD, O_SSEL2.AUD, O_SSEL3.AUD, O_VCONF1.AUD, O_VCONF2.AUD, O_VCONF3.AUD, O_VSEL1.AUD, O_VSEL2.AUD, O_VSEL3.AUD
CopyFilesFromCD:
Movies: movies/a_br01_e.vqa, movies/a_br02_e.vqa, movies/a_br03_e.vqa, movies/a_br04_e.vqa, movies/a_br05_e.vqa, movies/a_br06_e.vqa, movies/a_br07_e.vqa, movies/a_br08_e.vqa, movies/a_br09_e.vqa, movies/a_finl_e.vqa, movies/a_lose_e.vqa, movies/a_mntg_e.vqa, movies/h_br01_e.vqa, movies/h_br02_e.vqa, movies/h_br03_e.vqa, movies/h_br04_e.vqa, movies/h_br05_e.vqa, movies/h_br06_e.vqa, movies/h_br07_e.vqa, movies/h_br08_e.vqa, movies/h_br09_e.vqa, movies/h_finl_e.vqa, movies/h_lose_e.vqa, movies/h_mntg_e.vqa, movies/o_br01_e.vqa, movies/o_br02_e.vqa, movies/o_br03_e.vqa, movies/o_br04_e.vqa, movies/o_br05_e.vqa, movies/o_br06_e.vqa, movies/o_br07_e.vqa, movies/o_br08_e.vqa, movies/o_br09_e.vqa, movies/o_finl_e.vqa, movies/o_lose_e.vqa, movies/o_mntg_e.vqa, movies/g_int1_e.vqa, movies/g_int2_e.vqa, movies/g_maps_e.vqa, movies/g_pln2_e.vqa, movies/g_plnt_e.vqa, movies/t_titl_e.vqa

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -124,6 +124,28 @@ button-highlighted-disabled: chrome.png
corner-bl: 256,566,10,10
corner-br: 310,566,10,10
progressbar-bg: chrome.png
background: 453,565,56,6
border-r: 507,565,5,6
border-l: 448,565,5,6
border-b: 453,571,54,5
border-t: 453,560,54,5
corner-tl: 448,560,5,5
corner-tr: 507,560,5,5
corner-bl: 448,571,5,5
corner-br: 507,571,5,5
progressbar-thumb: chrome.png
background: 453,549,56,6
border-r: 507,549,5,6
border-l: 448,549,5,6
border-b: 453,555,54,5
border-t: 453,544,54,5
corner-tl: 448,544,5,5
corner-tr: 507,544,5,5
corner-bl: 448,555,5,5
corner-br: 507,555,5,5
panel-rule: chrome.png
border-t: 64,512,64,2

View File

@@ -0,0 +1,262 @@
Container@INSTALL_PANEL:
Logic: InstallLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 177
Children:
Background:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Background: panel-bg
Background@RULE:
X: 30
Y: 50
Width: 440
Height:150
Background:panel-rule
Label@TITLE:
X: 0
Y: 12
Width: PARENT_RIGHT
Height: 25
Text: Install Assets
Align: Center
Font: MediumBold
Label@DESC1:
X: 0
Y: 65
Width: PARENT_RIGHT
Height: 25
Align: Center
Label@DESC2:
X: 0
Y: 85
Width: PARENT_RIGHT
Height: 25
Text: Content can be downloaded (if available), or copied from the install CD.
Align: Center
Button@DOWNLOAD_BUTTON:
X: 20
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Download
Font: Bold
Button@INSTALL_BUTTON:
X: 140
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Use CD
Font: Bold
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Back
Font: Bold
Key: escape
Container@INSTALL_DOWNLOAD_PANEL:
Logic: DownloadPackagesLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 177
Children:
Background:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Background: panel-bg
Background@RULE:
X: 30
Y: 50
Width: 440
Height:150
Background:panel-rule
Label@TITLE:
X: 0
Y: 12
Width: PARENT_RIGHT
Height: 25
Align: Center
Font: MediumBold
ProgressBar@PROGRESS_BAR:
X: 50
Y: 64
Width: PARENT_RIGHT - 100
Height: 16
BarMargin: 0, 0
Label@STATUS_LABEL:
X: 36
Y: 85
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 120
Height: 32
Visible: false
Text: Retry
Font: Bold
Key: return
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Cancel
Font: Bold
Key: escape
Container@INSTALL_FROMCD_PANEL:
Logic: InstallFromCDLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 177
Children:
Background:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Background: panel-bg
Background@RULE:
X: 30
Y: 50
Width: 440
Height:150
Background:panel-rule
Label@TITLE:
X: 0
Y: 12
Width: PARENT_RIGHT
Height: 25
Text: Fetching assets from CD...
Align: Center
Font: MediumBold
Container@INSTALLING:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
ProgressBar@PROGRESS_BAR:
X: 50
Y: 60
Width: PARENT_RIGHT - 100
Height: 16
BarMargin: 0, 0
Label@STATUS_LABEL:
X: 36
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Container@INSERT_DISK:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@INFO1:
Y: 65
Width: PARENT_RIGHT
Height: 25
Text: Disk not found.
Align: Center
Label@INFO2:
Y: 85
Width: PARENT_RIGHT
Height: 25
Align: Center
Button@RETRY_BUTTON:
X: 20
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Retry
Font: Bold
Key: return
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Back
Font: Bold
Key: escape
Container@INSTALL_MUSIC_PANEL:
Logic: InstallMusicLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 177
Children:
Background:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Background: panel-bg
Background@RULE:
X: 30
Y: 50
Width: 440
Height:150
Background:panel-rule
Label@TITLE:
X: 0
Y: 12
Width: PARENT_RIGHT
Height: 25
Text: Install Music
Align: Center
Font: MediumBold
Label@DESC1:
X: 0
Y: 65
Width: PARENT_RIGHT
Height: 25
Text: OpenRA can download the music files from the internet (if available),
Align: Center
Label@DESC2:
X: 0
Y: 85
Width: PARENT_RIGHT
Height: 25
Text: or you can install them from an original CD.
Align: Center
Button@DOWNLOAD_MUSIC_BUTTON:
X: 20
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Download
Font: Bold
Button@INSTALL_MUSIC_BUTTON:
X: 140
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Use CD
Font: Bold
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 52
Background:button-highlighted
Width: 110
Height: 32
Text: Back
Font: Bold
Key: escape

View File

@@ -3,10 +3,12 @@
Metrics:
ButtonDepth: 0
ButtonFont: Bold
ButtonBaseLine: 1
ButtonTextColor: 255,255,255
ButtonTextColorDisabled: 128,128,128
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
ButtonBaseLine: 2
CheckboxPressedState: true
HotkeyFont: Regular
HotkeyColor: 255,255,255

View File

@@ -8,7 +8,6 @@ Folders:
.
./mods/modchooser
Cursors:
./mods/modchooser/cursors.yaml
@@ -20,6 +19,7 @@ Assemblies:
ChromeLayout:
./mods/modchooser/modchooser.yaml
./mods/modchooser/install.yaml
Notifications:
./mods/modchooser/notifications.yaml

View File

@@ -1,8 +1,10 @@
Background@MODCHOOSER:
Logic:ModBrowserLogic
Background@MODCHOOSER_BACKGROUND:
Background: background
Width:WINDOW_RIGHT
Height:WINDOW_BOTTOM
Background@MODCHOOSER_DIALOG:
Logic:ModBrowserLogic
Children:
Container:
X:(WINDOW_RIGHT - WIDTH)/2
@@ -10,7 +12,7 @@ Background@MODCHOOSER:
Width:750
Height:550-4-32
Children:
Background@bg:
Background@DIALOG_BACKGROUND:
Y:69
Width:PARENT_RIGHT
Height:PARENT_BOTTOM - 69
@@ -123,16 +125,16 @@ Background@MODCHOOSER:
X:PARENT_RIGHT - 53 - WIDTH - 170
Y:PARENT_BOTTOM - 25 - HEIGHT
Width:140
Height:35
Height:32
Text:Load Mod
Button@QUIT_BUTTON:
Background:button-highlighted
X:PARENT_RIGHT - 53 - WIDTH
Y:PARENT_BOTTOM - 25 - HEIGHT
Width:140
Height:35
Height:32
Text:Quit
Background@header:
Background@DIALOG_HEADER:
Width:PARENT_RIGHT
Height:72
Background:panel-header

View File

@@ -1,160 +0,0 @@
Background@INSTALL_PANEL:
Logic: InstallLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Install Required
Align: Center
Font: Bold
Label@DESC1:
X: 0
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: OpenRA requires the original Red Alert game content.
Align: Center
Label@DESC2:
X: 0
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Content can be downloaded, or copied from the install CD.
Align: Center
Button@DOWNLOAD_BUTTON:
X: 20
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Download
Font: Bold
Button@INSTALL_BUTTON:
X: 140
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Use CD
Font: Bold
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Back
Font: Bold
Background@INSTALL_DOWNLOAD_PANEL:
Logic: DownloadPackagesLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Downloading Red Alert Content
Align: Center
Font: Bold
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Visible: false
Text: Retry
Font: Bold
Key: return
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Cancel
Font: Bold
Key: escape
Background@INSTALL_FROMCD_PANEL:
Logic: InstallFromCDLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Installing from CD
Align: Center
Font: Bold
Container@INSTALLING:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Container@INSERT_DISK:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@INFO:
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: Disk not found.
Align: Center
Label@INFO2:
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Please insert one of the Red Alert install CDs then click Retry.
Align: Center
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Retry
Font: Bold
Key: return
Button@BACK_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Back
Font: Bold
Key: escape

View File

@@ -7,6 +7,7 @@ Metrics:
ButtonTextColorDisabled: 128,128,128
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
ButtonBaseLine: 0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255

View File

@@ -77,7 +77,6 @@ Assemblies:
./mods/cnc/OpenRA.Mods.Cnc.dll
ChromeLayout:
./mods/ra/chrome/install.yaml
./mods/ra/chrome/ingame.yaml
./mods/ra/chrome/ingame-chat.yaml
./mods/ra/chrome/ingame-diplomacy.yaml
@@ -141,9 +140,7 @@ LoadScreen: LogoStripeLoadScreen
Text: Filling Crates..., Charging Capacitors..., Reticulating Splines..., Planting Trees..., Building Bridges..., Aging Empires..., Compiling EVA..., Constructing Pylons..., Activating Skynet..., Splitting Atoms...
ContentInstaller:
MenuWidget: INSTALL_PANEL
MusicMenuWidget: INSTALL_MUSIC_PANEL
TestFiles: allies.mix, conquer.mix, interior.mix, redalert.mix, russian.mix, snow.mix, sounds.mix, temperat.mix
TestFiles: ^Content/ra/allies.mix, ^Content/ra/conquer.mix, ^Content/ra/interior.mix, ^Content/ra/redalert.mix, ^Content/ra/russian.mix, ^Content/ra/snow.mix, ^Content/ra/sounds.mix, ^Content/ra/temperat.mix
PackageMirrorList: http://www.openra.net/packages/ra-mirrors.txt
DiskTestFiles: MAIN.MIX, INSTALL/REDALERT.MIX
PackageToExtractFromCD: MAIN.MIX

View File

@@ -1,160 +0,0 @@
Background@INSTALL_PANEL:
Logic: InstallLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Install Required
Align: Center
Font: Bold
Label@DESC1:
X: 0
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: OpenRA requires the original Tiberian Sun game content.
Align: Center
Label@DESC2:
X: 0
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Content can be downloaded, or copied from the install CD.
Align: Center
Button@DOWNLOAD_BUTTON:
X: 20
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Download
Font: Bold
Button@INSTALL_BUTTON:
X: 140
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Use CD
Font: Bold
Button@BACK_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Back
Font: Bold
Background@INSTALL_DOWNLOAD_PANEL:
Logic: DownloadPackagesLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Downloading Tiberian Sun Content
Align: Center
Font: Bold
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Visible: false
Text: Retry
Font: Bold
Key: return
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Cancel
Font: Bold
Key: escape
Background@INSTALL_FROMCD_PANEL:
Logic: InstallFromCDLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 500
Height: 160
Children:
Label@TITLE:
X: 0
Y: 20
Width: PARENT_RIGHT
Height: 25
Text: Installing from CD
Align: Center
Font: Bold
Container@INSTALLING:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
ProgressBar@PROGRESS_BAR:
X: 50
Y: 55
Width: PARENT_RIGHT - 100
Height: 25
Label@STATUS_LABEL:
X: 50
Y: 80
Width: PARENT_RIGHT - 100
Height: 25
Align: Left
Container@INSERT_DISK:
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Visible: false
Children:
Label@INFO:
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: Disk not found.
Align: Center
Label@INFO2:
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Please insert one of the Tiberian Sun install CDs then click Retry.
Align: Center
Button@RETRY_BUTTON:
X: PARENT_RIGHT - 280
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Retry
Font: Bold
Key: return
Button@BACK_BUTTON:
X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: Back
Font: Bold
Key: escape

View File

@@ -7,6 +7,7 @@ Metrics:
ButtonTextColorDisabled: 128,128,128
ButtonTextContrast: false
ButtonTextContrastColor: 0,0,0
ButtonBaseLine: 0
CheckboxPressedState: false
HotkeyFont: Regular
HotkeyColor: 255,255,255

View File

@@ -131,7 +131,6 @@ Assemblies:
./mods/ts/OpenRA.Mods.TS.dll
ChromeLayout:
./mods/ts/chrome/install.yaml
./mods/ra/chrome/ingame.yaml
./mods/ra/chrome/ingame-chat.yaml
./mods/ra/chrome/ingame-diplomacy.yaml
@@ -189,9 +188,7 @@ LoadScreen: LogoStripeLoadScreen
Text: Updating EVA installation..., Changing perspective...
ContentInstaller:
MenuWidget: INSTALL_PANEL
MusicMenuWidget: INSTALL_MUSIC_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
TestFiles: ^Content/ts/cache.mix, ^Content/ts/conquer.mix, ^Content/ts/isosnow.mix, ^Content/ts/isotemp.mix, ^Content/ts/local.mix, ^Content/ts/sidec01.mix, ^Content/ts/sidec02.mix, ^Content/ts/sno.mix, ^Content/ts/snow.mix, ^Content/ts/sounds.mix, ^Content/ts/speech01.mix, ^Content/ts/tem.mix, ^Content/ts/temperat.mix
PackageMirrorList: http://www.openra.net/packages/ts-mirrors.txt
DiskTestFiles: MULTI.MIX, INSTALL/TIBSUN.MIX
CopyFilesFromCD: