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(); var widgetArgs = new WidgetArgs();
Ui.LoadWidget("MODCHOOSER_BACKGROUND", Ui.Root, widgetArgs); Ui.LoadWidget("MODCHOOSER_BACKGROUND", Ui.Root, widgetArgs);
Ui.OpenWindow("MODCHOOSER_DIALOG", 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() public void Dispose()

View File

@@ -614,7 +614,6 @@
<Compile Include="Widgets\Logic\Installation\DownloadPackagesLogic.cs" /> <Compile Include="Widgets\Logic\Installation\DownloadPackagesLogic.cs" />
<Compile Include="Widgets\Logic\Installation\InstallModLogic.cs" /> <Compile Include="Widgets\Logic\Installation\InstallModLogic.cs" />
<Compile Include="Widgets\Logic\Installation\InstallLogic.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\ClientTooltipLogic.cs" />
<Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" /> <Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" />
<Compile Include="Widgets\Logic\Lobby\KickSpectatorsLogic.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.OnChange += x => Game.Sound.MusicVolume = x;
musicSlider.Value = Game.Sound.MusicVolume; 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"); var songWatcher = widget.GetOrNull<LogicTickerWidget>("SONG_WATCHER");
if (songWatcher != null) if (songWatcher != null)
{ {

View File

@@ -170,21 +170,27 @@ Container@LOBBY_MUSIC_BIN:
Visible: false Visible: false
Children: Children:
Label@TITLE: Label@TITLE:
Y: 75 Y: 65
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Font: Bold Font: Bold
Align: Center Align: Center
Text: No Music Available Text: Music Not Installed
Label@DESCA: Label@DESCA:
Y: 95 Y: 85
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Align: Center Align: Center
Text: Music can be installed from the Text: The game music can be installed
Label@DESCA: Label@DESCB:
Y: 115 Y: 105
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Align: Center Align: Center
Text: game Extras menu. Text: from the "Manage Content" menu
Label@DESCC:
Y: 125
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: in the mod chooser.

View File

@@ -154,15 +154,37 @@ Container@MUSIC_PANEL:
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Loop Text: Loop
Label@NO_MUSIC_LABEL: Container@NO_MUSIC_LABEL:
X: 15 X: 15
Y: 147 Y: 120
Width: 330 Width: 330
Height: 25 Height: 80
Font: Bold
Align: Center
Visible: false Visible: false
Text: No Music Installed Children:
Label@TITLE:
Width: PARENT_RIGHT-24
Height: 25
Font: Bold
Align: Center
Text: Music Not Installed
Label@DESCA:
Y: 20
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: The game music can be installed
Label@DESCB:
Y: 40
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: from the "Manage Content" menu
Label@DESCC:
Y: 60
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: in the mod chooser.
Button@BACK_BUTTON: Button@BACK_BUTTON:
Key: escape Key: escape
X: 0 X: 0
@@ -170,73 +192,9 @@ Container@MUSIC_PANEL:
Width: 140 Width: 140
Height: 35 Height: 35
Text: Back Text: Back
Button@INSTALL_BUTTON:
X: 220
Y: 399
Width: 140
Height: 35
Text: Install Music
Label@MUTE_LABEL: Label@MUTE_LABEL:
X: 165 X: 165
Y: 399 Y: 399
Width: 300 Width: 300
Height: 20 Height: 20
Font: Small Font: Small
Container@INSTALL_MUSIC_PANEL:
Logic: InstallMusicLogic
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 Music
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: 35
Width: PARENT_RIGHT-30
Height: 25
Text: The soundtrack is currently unavailable.
Font: Bold
Label@INFO2:
X: 170
Y: 70
Width: PARENT_RIGHT-185
Height: 25
WordWrap: true
Text: OpenRA can download the music files from the internet, or you can install from the original C&C CDs.
Font: Bold
Button@CANCEL_BUTTON:
Key: escape
Y: 149
Width: 140
Height: 35
Text: Back
Button@DOWNLOAD_BUTTON:
X: 350
Y: 149
Width: 140
Height: 35
Text: Download
Button@COPY_FROM_CD_BUTTON:
X: 500
Y: 149
Width: 140
Height: 35
Text: Use CD

View File

@@ -194,69 +194,3 @@ Container@INSTALL_FROMCD_PANEL:
Text: Back Text: Back
Font: Bold Font: Bold
Key: escape 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

@@ -160,21 +160,27 @@ Container@LOBBY_MUSIC_BIN:
Visible: false Visible: false
Children: Children:
Label@TITLE: Label@TITLE:
Y: 75 Y: 65
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Font: Bold Font: Bold
Align: Center Align: Center
Text: No Music Available Text: Music Not Installed
Label@DESCA: Label@DESCA:
Y: 95 Y: 85
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Align: Center Align: Center
Text: Music can be installed from the Text: The game music can be installed
Label@DESCA: Label@DESCB:
Y: 115 Y: 105
Width: PARENT_RIGHT-24 Width: PARENT_RIGHT-24
Height: 25 Height: 25
Align: Center Align: Center
Text: game Extras menu. Text: from the "Manage Content" menu
Label@DESCC:
Y: 125
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: in the mod chooser.

View File

@@ -141,22 +141,37 @@ Background@MUSIC_PANEL:
Width: 70 Width: 70
Height: 20 Height: 20
Text: Loop Text: Loop
Label@NO_MUSIC_LABEL: Container@NO_MUSIC_LABEL:
X: 15 X: 15
Y: 147 Y: 135
Width: 330 Width: 330
Height: 25 Height: 80
Font: Bold
Align: Center
Visible: false Visible: false
Text: No Music Installed Children:
Button@INSTALL_BUTTON: Label@TITLE:
X: 20 Width: PARENT_RIGHT-24
Y: PARENT_BOTTOM - 45 Height: 25
Width: 120 Font: Bold
Height: 25 Align: Center
Text: Install Music Text: Music Not Installed
Font: Bold Label@DESCA:
Y: 20
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: The game music can be installed
Label@DESCB:
Y: 40
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: from the "Manage Content" menu
Label@DESCC:
Y: 60
Width: PARENT_RIGHT-24
Height: 25
Align: Center
Text: in the mod chooser.
Button@BACK_BUTTON: Button@BACK_BUTTON:
X: PARENT_RIGHT - 140 X: PARENT_RIGHT - 140
Y: PARENT_BOTTOM - 45 Y: PARENT_BOTTOM - 45
@@ -171,54 +186,3 @@ Background@MUSIC_PANEL:
Width: 300 Width: 300
Height: 20 Height: 20
Font: Small Font: Small
Background@INSTALL_MUSIC_PANEL:
Logic: InstallMusicLogic
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 Music
Align: Center
Font: Bold
Label@DESC1:
X: 0
Y: 50
Width: PARENT_RIGHT
Height: 25
Text: The soundtrack is currently unavailable.
Align: Center
Label@DESC2:
X: 0
Y: 70
Width: PARENT_RIGHT
Height: 25
Text: Please choose an installation method.
Align: Center
Button@COPY_FROM_CD_BUTTON:
X: 20
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Use CD
Font: Bold
Button@DOWNLOAD_BUTTON:
X: 140
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Download
Font: Bold
Button@CANCEL_BUTTON:
X: PARENT_RIGHT - 130
Y: PARENT_BOTTOM - 45
Width: 110
Height: 25
Text: Back
Font: Bold