made the news button optional

This commit is contained in:
Matthias Mailänder
2015-05-25 18:29:36 +02:00
parent 0d8876a1de
commit fa8b4e67a3

View File

@@ -206,6 +206,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
new Download(Game.Settings.Game.NewsUrl, cacheFile, e => { }, (e, c) => NewsDownloadComplete(e, c, cacheFile, currentNews)); new Download(Game.Settings.Game.NewsUrl, cacheFile, e => { }, (e, c) => NewsDownloadComplete(e, c, cacheFile, currentNews));
var newsButton = newsBG.GetOrNull<DropDownButtonWidget>("NEWS_BUTTON"); var newsButton = newsBG.GetOrNull<DropDownButtonWidget>("NEWS_BUTTON");
if (newsButton != null)
{
newsButton.OnClick = () => newsButton.OnClick = () =>
{ {
newsButton.AttachPanel(newsPanel); newsButton.AttachPanel(newsPanel);
@@ -214,6 +216,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
newsButton.IsHighlighted = () => newsHighlighted && Game.LocalTick % 50 < 25; newsButton.IsHighlighted = () => newsHighlighted && Game.LocalTick % 50 < 25;
} }
}
Game.OnRemoteDirectConnect += (host, port) => Game.OnRemoteDirectConnect += (host, port) =>
{ {