disable music installation during a game

closes #6058
This commit is contained in:
Matthias Mailänder
2014-08-03 14:38:47 +02:00
parent 0502d90a05
commit 282b16e3fc
5 changed files with 14 additions and 3 deletions

View File

@@ -68,6 +68,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs()
{
{ "onExit", () => hideButtons = false },
{ "world", world }
});
};

View File

@@ -67,7 +67,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
widget.Get<ButtonWidget>("MUSIC").OnClick = () =>
{
widget.Visible = false;
Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs { { "onExit", () => { widget.Visible = true; } } });
Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs
{
{ "onExit", () => { widget.Visible = true; } },
{ "world", world }
});
};
var resumeButton = widget.Get<ButtonWidget>("RESUME");

View File

@@ -511,7 +511,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var musicButton = lobby.GetOrNull<ButtonWidget>("MUSIC_BUTTON");
if (musicButton != null)
musicButton.OnClick = () => Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs { { "onExit", DoNothing } });
musicButton.OnClick = () => Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs
{
{ "onExit", DoNothing },
{ "world", orderManager.world }
});
var settingsButton = lobby.GetOrNull<ButtonWidget>("SETTINGS_BUTTON");
if (settingsButton != null)

View File

@@ -111,6 +111,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs
{
{ "onExit", () => menuType = MenuType.Extras },
{ "world", world }
});
};

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ScrollItemWidget itemTemplate;
[ObjectCreator.UseCtor]
public MusicPlayerLogic(Widget widget, Ruleset modRules, Action onExit)
public MusicPlayerLogic(Widget widget, Ruleset modRules, World world, Action onExit)
{
this.modRules = modRules;
@@ -84,6 +84,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var installButton = widget.GetOrNull<ButtonWidget>("INSTALL_BUTTON");
if (installButton != null)
{
installButton.IsDisabled = () => !world.IsShellmap;
var args = new string[] { "Launch.Window=INSTALL_MUSIC_PANEL" };
installButton.OnClick = () =>
{