Revert replacing generic Ui.OpenWindow with static method in MusicPlayerLogic
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user