Revert replacing generic Ui.OpenWindow with static method in MusicPlayerLogic

This commit is contained in:
Pavlos Touboulidis
2014-05-10 18:27:30 +03:00
parent 10b8093d5a
commit d9db1c1854
5 changed files with 10 additions and 15 deletions

View File

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

View File

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

View File

@@ -110,7 +110,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
extrasMenu.Get<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
{
menuType = MenuType.None;
MusicPlayerLogic.OpenWindow(world, () => menuType = MenuType.Extras);
Ui.OpenWindow("MUSIC_PANEL", new WidgetArgs
{
{ "onExit", () => menuType = MenuType.Extras },
});
};
var assetBrowserButton = extrasMenu.GetOrNull<ButtonWidget>("ASSETBROWSER_BUTTON");

View File

@@ -28,17 +28,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ScrollItemWidget itemTemplate;
public static Widget OpenWindow(World world, Action onExit = null)
{
return Ui.OpenWindow(
"MUSIC_PANEL",
new WidgetArgs
{
{ "onExit", onExit != null ? onExit : (() => {}) }
}
);
}
[ObjectCreator.UseCtor]
public MusicPlayerLogic(Widget widget, World world, Action onExit)
{