Disallow Join button without IP address input
Disallow join button without IP address Input Closes #20234 Trying to join a server with an empty address crashes the game. This fix disallows pressing join button without ip address field input. Updated to reuse search for joinButton vs 2 separate calls to search.
This commit is contained in:
@@ -39,7 +39,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
portField.Text = text.Substring(last + 1);
|
portField.Text = text.Substring(last + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
panel.Get<ButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
var joinButton = panel.Get<ButtonWidget>("JOIN_BUTTON");
|
||||||
|
|
||||||
|
joinButton.IsDisabled = () => string.IsNullOrEmpty(ipField.Text);
|
||||||
|
|
||||||
|
joinButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
var port = Exts.WithDefault(1234, () => Exts.ParseIntegerInvariant(portField.Text));
|
var port = Exts.WithDefault(1234, () => Exts.ParseIntegerInvariant(portField.Text));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user