@@ -923,11 +923,14 @@ static void saveOptions( void )
923
923
924
924
// -------------------------------------------------------------------------------------------------
925
925
// send Delay
926
- TheWritableGlobalData->m_firewallSendDelay = GadgetCheckBoxIsChecked (checkSendDelay);
927
- if (TheGlobalData->m_firewallSendDelay ) {
928
- (*pref)[" SendDelay" ] = AsciiString (" yes" );
929
- } else {
930
- (*pref)[" SendDelay" ] = AsciiString (" no" );
926
+ if (checkSendDelay && checkSendDelay->winGetEnabled ())
927
+ {
928
+ TheWritableGlobalData->m_firewallSendDelay = GadgetCheckBoxIsChecked (checkSendDelay);
929
+ if (TheGlobalData->m_firewallSendDelay ) {
930
+ (*pref)[" SendDelay" ] = AsciiString (" yes" );
931
+ } else {
932
+ (*pref)[" SendDelay" ] = AsciiString (" no" );
933
+ }
931
934
}
932
935
933
936
// -------------------------------------------------------------------------------------------------
@@ -1000,29 +1003,33 @@ static void saveOptions( void )
1000
1003
1001
1004
// -------------------------------------------------------------------------------------------------
1002
1005
// LOD
1003
- Bool levelChanged=FALSE ;
1004
- GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1005
- // The levels stored by the LOD Manager are inverted compared to GUI so find correct one:
1006
- switch (index) {
1007
- case HIGHDETAIL:
1008
- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_HIGH);
1009
- break ;
1010
- case MEDIUMDETAIL:
1011
- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_MEDIUM);
1012
- break ;
1013
- case LOWDETAIL:
1014
- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_LOW);
1015
- break ;
1016
- case CUSTOMDETAIL:
1017
- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_CUSTOM);
1018
- break ;
1019
- default :
1020
- DEBUG_ASSERTCRASH (FALSE ,(" LOD passed in was %d, %d is not a supported LOD" ,index,index));
1021
- break ;
1022
- }
1006
+ if (comboBoxDetail && comboBoxDetail->winGetEnabled ())
1007
+ {
1008
+ Bool levelChanged=FALSE ;
1009
+ GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1023
1010
1024
- if (levelChanged)
1025
- (*pref)[" StaticGameLOD" ] = TheGameLODManager->getStaticGameLODLevelName (TheGameLODManager->getStaticLODLevel ());
1011
+ // The levels stored by the LOD Manager are inverted compared to GUI so find correct one:
1012
+ switch (index) {
1013
+ case HIGHDETAIL:
1014
+ levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_HIGH);
1015
+ break ;
1016
+ case MEDIUMDETAIL:
1017
+ levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_MEDIUM);
1018
+ break ;
1019
+ case LOWDETAIL:
1020
+ levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_LOW);
1021
+ break ;
1022
+ case CUSTOMDETAIL:
1023
+ levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_CUSTOM);
1024
+ break ;
1025
+ default :
1026
+ DEBUG_ASSERTCRASH (FALSE ,(" LOD passed in was %d, %d is not a supported LOD" ,index,index));
1027
+ break ;
1028
+ }
1029
+
1030
+ if (levelChanged)
1031
+ (*pref)[" StaticGameLOD" ] = TheGameLODManager->getStaticGameLODLevelName (TheGameLODManager->getStaticLODLevel ());
1032
+ }
1026
1033
1027
1034
// -------------------------------------------------------------------------------------------------
1028
1035
// Resolution
@@ -1034,12 +1041,11 @@ static void saveOptions( void )
1034
1041
oldDispSettings.bitDepth = TheDisplay->getBitDepth ();
1035
1042
oldDispSettings.windowed = TheDisplay->getWindowed ();
1036
1043
1037
- if (index < TheDisplay->getDisplayModeCount () && index >= 0 )
1044
+ if (comboBoxResolution && comboBoxResolution-> winGetEnabled () && index < TheDisplay->getDisplayModeCount () && index >= 0 )
1038
1045
{
1039
1046
TheDisplay->getDisplayModeDescription (index,&xres,&yres,&bitDepth);
1040
1047
if (TheGlobalData->m_xResolution != xres || TheGlobalData->m_yResolution != yres)
1041
1048
{
1042
-
1043
1049
if (TheDisplay->setDisplayMode (xres,yres,bitDepth,TheDisplay->getWindowed ()))
1044
1050
{
1045
1051
dispChanged = TRUE ;
@@ -1077,19 +1083,27 @@ static void saveOptions( void )
1077
1083
1078
1084
// -------------------------------------------------------------------------------------------------
1079
1085
// IP address
1080
- UnsignedInt ip;
1081
- GadgetComboBoxGetSelectedPos (comboBoxLANIP, &index);
1082
- if (index>=0 && TheGlobalData)
1086
+ if (comboBoxLANIP && comboBoxLANIP->winGetEnabled ())
1083
1087
{
1084
- ip = (UnsignedInt)GadgetComboBoxGetItemData (comboBoxLANIP, index);
1085
- TheWritableGlobalData->m_defaultIP = ip;
1086
- pref->setLANIPAddress (ip);
1088
+ UnsignedInt ip;
1089
+ GadgetComboBoxGetSelectedPos (comboBoxLANIP, &index);
1090
+ if (index>=0 && TheGlobalData)
1091
+ {
1092
+ ip = (UnsignedInt)GadgetComboBoxGetItemData (comboBoxLANIP, index);
1093
+ TheWritableGlobalData->m_defaultIP = ip;
1094
+ pref->setLANIPAddress (ip);
1095
+ }
1087
1096
}
1088
- GadgetComboBoxGetSelectedPos (comboBoxOnlineIP, &index);
1089
- if (index>= 0 )
1097
+
1098
+ if (comboBoxOnlineIP && comboBoxOnlineIP-> winGetEnabled () )
1090
1099
{
1091
- ip = (UnsignedInt)GadgetComboBoxGetItemData (comboBoxOnlineIP, index);
1092
- pref->setOnlineIPAddress (ip);
1100
+ UnsignedInt ip;
1101
+ GadgetComboBoxGetSelectedPos (comboBoxOnlineIP, &index);
1102
+ if (index>=0 )
1103
+ {
1104
+ ip = (UnsignedInt)GadgetComboBoxGetItemData (comboBoxOnlineIP, index);
1105
+ pref->setOnlineIPAddress (ip);
1106
+ }
1093
1107
}
1094
1108
1095
1109
// -------------------------------------------------------------------------------------------------
0 commit comments