Show advisory notice when UPNP isn't supported by the router

This commit is contained in:
Oliver Brakmann
2016-08-28 13:40:12 +02:00
committed by Matthias Mailänder
parent a79cc6a606
commit c9c542cb37
3 changed files with 22 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (labelUPnP != null) if (labelUPnP != null)
labelUPnP.IsVisible = () => !Game.Settings.Server.DiscoverNatDevices; labelUPnP.IsVisible = () => !Game.Settings.Server.DiscoverNatDevices;
var labelUPnPUnsupported = panel.GetOrNull<LabelWidget>("UPNP_UNSUPPORTED_NOTICE");
if (labelUPnPUnsupported != null)
labelUPnPUnsupported.IsVisible = () => Game.Settings.Server.DiscoverNatDevices && !Game.Settings.Server.AllowPortForward;
var passwordField = panel.GetOrNull<PasswordFieldWidget>("PASSWORD"); var passwordField = panel.GetOrNull<PasswordFieldWidget>("PASSWORD");
if (passwordField != null) if (passwordField != null)
passwordField.Text = Game.Settings.Server.Password; passwordField.Text = Game.Settings.Server.Password;

View File

@@ -101,6 +101,15 @@ Container@MULTIPLAYER_CREATESERVER_PANEL:
Align: Left Align: Left
WordWrap: True WordWrap: True
Text: Requires Network Discovery (UPnP). Enable in Settings - Advanced. Text: Requires Network Discovery (UPnP). Enable in Settings - Advanced.
Label@UPNP_UNSUPPORTED_NOTICE:
X: 130
Y: 180
Width: 220
Height: 25
Font: Tiny
Align: Left
WordWrap: True
Text: Your router does not seem to support UPnP. Please consult your router's manual.
Container@SIDEBAR: Container@SIDEBAR:
X: PARENT_RIGHT-WIDTH X: PARENT_RIGHT-WIDTH
Y: 30 Y: 30

View File

@@ -101,6 +101,15 @@ Container@MULTIPLAYER_CREATESERVER_PANEL:
Align: Left Align: Left
WordWrap: True WordWrap: True
Text: Requires Network Discovery (UPnP). Enable in Settings - Advanced. Text: Requires Network Discovery (UPnP). Enable in Settings - Advanced.
Label@UPNP_UNSUPPORTED_NOTICE:
X: 130
Y: 180
Width: 220
Height: 25
Font: Tiny
Align: Left
WordWrap: True
Text: Your router does not seem to support UPnP. Please consult your router's manual.
Container@SIDEBAR: Container@SIDEBAR:
X: PARENT_RIGHT-WIDTH X: PARENT_RIGHT-WIDTH
Y: 30 Y: 30