Remove legacy music installer.
This commit is contained in:
@@ -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 }
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user