Remove legacy music installer.

This commit is contained in:
Paul Chote
2016-05-29 01:34:22 +01:00
parent 27699ce3d7
commit 0b97a81616
9 changed files with 84 additions and 296 deletions

View File

@@ -50,14 +50,7 @@ namespace OpenRA.Mods.Common.LoadScreens
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);
Ui.OpenWindow("MODCHOOSER_DIALOG", widgetArgs);
}
public void Dispose()

View File

@@ -614,7 +614,6 @@
<Compile Include="Widgets\Logic\Installation\DownloadPackagesLogic.cs" />
<Compile Include="Widgets\Logic\Installation\InstallModLogic.cs" />
<Compile Include="Widgets\Logic\Installation\InstallLogic.cs" />
<Compile Include="Widgets\Logic\Installation\InstallMusicLogic.cs" />
<Compile Include="Widgets\Logic\Lobby\ClientTooltipLogic.cs" />
<Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" />
<Compile Include="Widgets\Logic\Lobby\KickSpectatorsLogic.cs" />

View File

@@ -1,60 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2016 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, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
{
public class InstallMusicLogic : ChromeLogic
{
[ObjectCreator.UseCtor]
public InstallMusicLogic(Widget widget, string modId)
{
var installMusicContainer = widget.Get("INSTALL_MUSIC_PANEL");
Action loadDefaultMod = () => Game.RunAfterTick(() => Game.InitializeMod(modId, null));
var cancelButton = installMusicContainer.GetOrNull<ButtonWidget>("BACK_BUTTON");
if (cancelButton != null)
cancelButton.OnClick = loadDefaultMod;
var copyFromDiscButton = installMusicContainer.GetOrNull<ButtonWidget>("INSTALL_MUSIC_BUTTON");
if (copyFromDiscButton != null)
{
copyFromDiscButton.OnClick = () =>
{
Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs
{
{ "afterInstall", loadDefaultMod },
{ "modId", modId }
});
};
}
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_MUSIC_BUTTON");
if (downloadButton != null)
{
var installData = ModMetadata.AllMods[modId].Content;
downloadButton.IsDisabled = () => string.IsNullOrEmpty(installData.MusicPackageMirrorList);
downloadButton.OnClick = () =>
{
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs
{
{ "afterInstall", loadDefaultMod },
{ "mirrorListUrl", installData.MusicPackageMirrorList },
{ "modId", modId }
});
};
}
}
}
}

View File

@@ -103,18 +103,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
musicSlider.OnChange += x => Game.Sound.MusicVolume = x;
musicSlider.Value = Game.Sound.MusicVolume;
var installButton = widget.GetOrNull<ButtonWidget>("INSTALL_BUTTON");
if (installButton != null)
{
installButton.IsDisabled = () => world.Type != WorldType.Shellmap;
var args = new[] { "installMusic={0}".F(modData.Manifest.Mod.Id) };
installButton.OnClick = () =>
Game.RunAfterTick(() => Game.InitializeMod("modchooser", new Arguments(args)));
var installData = modData.Manifest.Get<ContentInstaller>();
installButton.IsVisible = () => modData.DefaultRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks;
}
var songWatcher = widget.GetOrNull<LogicTickerWidget>("SONG_WATCHER");
if (songWatcher != null)
{