Skip to content

Commit 2934adb

Browse files
authored
[GEN][ZH] Disable the Firewall Port Override and HTTP Proxy settings from the Options Menu when in-game (#1029)
1 parent 0d713f2 commit 2934adb

File tree

2 files changed

+22
-6
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus
  • Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus

2 files changed

+22
-6
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static void saveOptions( void )
11091109
//-------------------------------------------------------------------------------------------------
11101110
// HTTP Proxy
11111111
GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(NULL, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy"));
1112-
if (textEntryHTTPProxy)
1112+
if (textEntryHTTPProxy && textEntryHTTPProxy->winGetEnabled())
11131113
{
11141114
UnicodeString uStr = GadgetTextEntryGetText(textEntryHTTPProxy);
11151115
AsciiString aStr;
@@ -1121,7 +1121,7 @@ static void saveOptions( void )
11211121
//-------------------------------------------------------------------------------------------------
11221122
// Firewall Port Override
11231123
GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(NULL, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride"));
1124-
if (textEntryFirewallPortOverride)
1124+
if (textEntryFirewallPortOverride && textEntryFirewallPortOverride->winGetEnabled())
11251125
{
11261126
UnicodeString uStr = GadgetTextEntryGetText(textEntryFirewallPortOverride);
11271127
AsciiString aStr;
@@ -1756,18 +1756,26 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
17561756
{
17571757
// disable controls that you can't change the options for in game
17581758
comboBoxLANIP->winEnable(FALSE);
1759+
17591760
if (comboBoxOnlineIP)
17601761
comboBoxOnlineIP->winEnable(FALSE);
1762+
17611763
checkSendDelay->winEnable(FALSE);
1764+
17621765
buttonFirewallRefresh->winEnable(FALSE);
17631766

17641767
if (comboBoxDetail)
17651768
comboBoxDetail->winEnable(FALSE);
17661769

1767-
17681770
if (comboBoxResolution)
17691771
comboBoxResolution->winEnable(FALSE);
17701772

1773+
if (textEntryFirewallPortOverride)
1774+
textEntryFirewallPortOverride->winEnable(FALSE);
1775+
1776+
if (textEntryHTTPProxy)
1777+
textEntryHTTPProxy->winEnable(FALSE);
1778+
17711779
// if (checkAudioSurround)
17721780
// checkAudioSurround->winEnable(FALSE);
17731781
//

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ static void saveOptions( void )
11631163
//-------------------------------------------------------------------------------------------------
11641164
// HTTP Proxy
11651165
GameWindow *textEntryHTTPProxy = TheWindowManager->winGetWindowFromId(NULL, NAMEKEY("OptionsMenu.wnd:TextEntryHTTPProxy"));
1166-
if (textEntryHTTPProxy)
1166+
if (textEntryHTTPProxy && textEntryHTTPProxy->winGetEnabled())
11671167
{
11681168
UnicodeString uStr = GadgetTextEntryGetText(textEntryHTTPProxy);
11691169
AsciiString aStr;
@@ -1175,7 +1175,7 @@ static void saveOptions( void )
11751175
//-------------------------------------------------------------------------------------------------
11761176
// Firewall Port Override
11771177
GameWindow *textEntryFirewallPortOverride = TheWindowManager->winGetWindowFromId(NULL, NAMEKEY("OptionsMenu.wnd:TextEntryFirewallPortOverride"));
1178-
if (textEntryFirewallPortOverride)
1178+
if (textEntryFirewallPortOverride && textEntryFirewallPortOverride->winGetEnabled())
11791179
{
11801180
UnicodeString uStr = GadgetTextEntryGetText(textEntryFirewallPortOverride);
11811181
AsciiString aStr;
@@ -1826,18 +1826,26 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
18261826
{
18271827
// disable controls that you can't change the options for in game
18281828
comboBoxLANIP->winEnable(FALSE);
1829+
18291830
if (comboBoxOnlineIP)
18301831
comboBoxOnlineIP->winEnable(FALSE);
1832+
18311833
checkSendDelay->winEnable(FALSE);
1834+
18321835
buttonFirewallRefresh->winEnable(FALSE);
18331836

18341837
if (comboBoxDetail)
18351838
comboBoxDetail->winEnable(FALSE);
18361839

1837-
18381840
if (comboBoxResolution)
18391841
comboBoxResolution->winEnable(FALSE);
18401842

1843+
if (textEntryFirewallPortOverride)
1844+
textEntryFirewallPortOverride->winEnable(FALSE);
1845+
1846+
if (textEntryHTTPProxy)
1847+
textEntryHTTPProxy->winEnable(FALSE);
1848+
18411849
// if (checkAudioSurround)
18421850
// checkAudioSurround->winEnable(FALSE);
18431851
//

0 commit comments

Comments
 (0)