From 0b97a81616a8f9e7c87220ab93e99f92eed46c0c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 29 May 2016 01:34:22 +0100 Subject: [PATCH] Remove legacy music installer. --- .../LoadScreens/ModChooserLoadScreen.cs | 9 +- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 1 - .../Logic/Installation/InstallMusicLogic.cs | 60 ----------- .../Widgets/Logic/MusicPlayerLogic.cs | 12 --- mods/cnc/chrome/lobby-music.yaml | 20 ++-- mods/cnc/chrome/music.yaml | 100 +++++------------- mods/modchooser/install.yaml | 66 ------------ mods/ra/chrome/lobby-music.yaml | 20 ++-- mods/ra/chrome/musicplayer.yaml | 92 +++++----------- 9 files changed, 84 insertions(+), 296 deletions(-) delete mode 100644 OpenRA.Mods.Common/Widgets/Logic/Installation/InstallMusicLogic.cs diff --git a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs index 4ac0df895e..99c24ee948 100644 --- a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs @@ -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() diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 89ad221f3e..cfd2d52455 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -614,7 +614,6 @@ - diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallMusicLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallMusicLogic.cs deleted file mode 100644 index d8efc53be5..0000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallMusicLogic.cs +++ /dev/null @@ -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("BACK_BUTTON"); - if (cancelButton != null) - cancelButton.OnClick = loadDefaultMod; - - var copyFromDiscButton = installMusicContainer.GetOrNull("INSTALL_MUSIC_BUTTON"); - if (copyFromDiscButton != null) - { - copyFromDiscButton.OnClick = () => - { - Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs - { - { "afterInstall", loadDefaultMod }, - { "modId", modId } - }); - }; - } - - var downloadButton = installMusicContainer.GetOrNull("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 } - }); - }; - } - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs index 3274f9a060..80b35f227b 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs @@ -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("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(); - installButton.IsVisible = () => modData.DefaultRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks; - } - var songWatcher = widget.GetOrNull("SONG_WATCHER"); if (songWatcher != null) { diff --git a/mods/cnc/chrome/lobby-music.yaml b/mods/cnc/chrome/lobby-music.yaml index 8ec356ded0..0786683670 100644 --- a/mods/cnc/chrome/lobby-music.yaml +++ b/mods/cnc/chrome/lobby-music.yaml @@ -170,21 +170,27 @@ Container@LOBBY_MUSIC_BIN: Visible: false Children: Label@TITLE: - Y: 75 + Y: 65 Width: PARENT_RIGHT-24 Height: 25 Font: Bold Align: Center - Text: No Music Available + Text: Music Not Installed Label@DESCA: - Y: 95 + Y: 85 Width: PARENT_RIGHT-24 Height: 25 Align: Center - Text: Music can be installed from the - Label@DESCA: - Y: 115 + Text: The game music can be installed + Label@DESCB: + Y: 105 Width: PARENT_RIGHT-24 Height: 25 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. diff --git a/mods/cnc/chrome/music.yaml b/mods/cnc/chrome/music.yaml index a2225bb305..f9c8931b21 100644 --- a/mods/cnc/chrome/music.yaml +++ b/mods/cnc/chrome/music.yaml @@ -154,15 +154,37 @@ Container@MUSIC_PANEL: Height: 20 Font: Regular Text: Loop - Label@NO_MUSIC_LABEL: + Container@NO_MUSIC_LABEL: X: 15 - Y: 147 + Y: 120 Width: 330 - Height: 25 - Font: Bold - Align: Center + Height: 80 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: Key: escape X: 0 @@ -170,73 +192,9 @@ Container@MUSIC_PANEL: Width: 140 Height: 35 Text: Back - Button@INSTALL_BUTTON: - X: 220 - Y: 399 - Width: 140 - Height: 35 - Text: Install Music Label@MUTE_LABEL: X: 165 Y: 399 Width: 300 Height: 20 - 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 + Font: Small \ No newline at end of file diff --git a/mods/modchooser/install.yaml b/mods/modchooser/install.yaml index 7f8d32093d..655c9ea1b1 100644 --- a/mods/modchooser/install.yaml +++ b/mods/modchooser/install.yaml @@ -194,69 +194,3 @@ Container@INSTALL_FROMCD_PANEL: 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 diff --git a/mods/ra/chrome/lobby-music.yaml b/mods/ra/chrome/lobby-music.yaml index eeb7d95377..864c9ce5bf 100644 --- a/mods/ra/chrome/lobby-music.yaml +++ b/mods/ra/chrome/lobby-music.yaml @@ -160,21 +160,27 @@ Container@LOBBY_MUSIC_BIN: Visible: false Children: Label@TITLE: - Y: 75 + Y: 65 Width: PARENT_RIGHT-24 Height: 25 Font: Bold Align: Center - Text: No Music Available + Text: Music Not Installed Label@DESCA: - Y: 95 + Y: 85 Width: PARENT_RIGHT-24 Height: 25 Align: Center - Text: Music can be installed from the - Label@DESCA: - Y: 115 + Text: The game music can be installed + Label@DESCB: + Y: 105 Width: PARENT_RIGHT-24 Height: 25 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. diff --git a/mods/ra/chrome/musicplayer.yaml b/mods/ra/chrome/musicplayer.yaml index 04a29cd8cc..fc6290bf01 100644 --- a/mods/ra/chrome/musicplayer.yaml +++ b/mods/ra/chrome/musicplayer.yaml @@ -141,22 +141,37 @@ Background@MUSIC_PANEL: Width: 70 Height: 20 Text: Loop - Label@NO_MUSIC_LABEL: + Container@NO_MUSIC_LABEL: X: 15 - Y: 147 + Y: 135 Width: 330 - Height: 25 - Font: Bold - Align: Center + Height: 80 Visible: false - Text: No Music Installed - Button@INSTALL_BUTTON: - X: 20 - Y: PARENT_BOTTOM - 45 - Width: 120 - Height: 25 - Text: Install Music - Font: Bold + 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: X: PARENT_RIGHT - 140 Y: PARENT_BOTTOM - 45 @@ -171,54 +186,3 @@ Background@MUSIC_PANEL: Width: 300 Height: 20 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