make CncLobbyLogic tolerant of missing music button

This commit is contained in:
Chris Forbes
2011-11-06 11:38:44 +13:00
parent 40b89d177f
commit c20d71c9af

View File

@@ -190,13 +190,10 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
chatTemplate = chatPanel.GetWidget("CHAT_TEMPLATE");
chatPanel.RemoveChildren();
lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () =>
{
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs()
{
{ "onExit", () => {} },
});
};
var musicButton = lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON");
if (musicButton != null)
musicButton.OnClick = () => Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs
{ { "onExit", () => {} } });
// Add a bot on the first lobbyinfo update
if (addBots)