@@ -217,14 +217,6 @@ extern void DoResolutionDialog();
217217static Bool ignoreSelected = FALSE ;
218218WindowLayout *OptionsLayout = NULL ;
219219
220- enum Detail CPP_11 (: Int)
221- {
222- HIGHDETAIL = 0 ,
223- MEDIUMDETAIL,
224- LOWDETAIL,
225- CUSTOMDETAIL,
226- };
227-
228220
229221OptionPreferences::OptionPreferences ( void )
230222{
@@ -922,25 +914,9 @@ static void setDefaults( void )
922914
923915 // -------------------------------------------------------------------------------------------------
924916 // LOD
925- if ((TheGameLogic->isInGame () == FALSE ) || (TheGameLogic->isInShellGame () == TRUE )) {
926- StaticGameLODLevel level=TheGameLODManager->findStaticLODLevel ();
927- switch (level)
928- {
929- case STATIC_GAME_LOD_LOW:
930- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
931- break ;
932- case STATIC_GAME_LOD_MEDIUM:
933- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
934- break ;
935- case STATIC_GAME_LOD_HIGH:
936- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
937- break ;
938- case STATIC_GAME_LOD_CUSTOM:
939- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
940- break ;
941- default :
942- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
943- };
917+ if ((TheGameLogic->isInGame () == FALSE ) || (TheGameLogic->isInShellGame () == TRUE ))
918+ {
919+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getRecommendedStaticLODLevel ());
944920 }
945921
946922 // -------------------------------------------------------------------------------------------------
@@ -1114,7 +1090,7 @@ static void saveOptions( void )
11141090 // -------------------------------------------------------------------------------------------------
11151091 // Custom game detail settings.
11161092 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1117- if (index == CUSTOMDETAIL )
1093+ if (index == STATIC_GAME_LOD_CUSTOM )
11181094 {
11191095 // -------------------------------------------------------------------------------------------------
11201096 // Texture resolution slider
@@ -1186,27 +1162,8 @@ static void saveOptions( void )
11861162 // LOD
11871163 if (comboBoxDetail && comboBoxDetail->winGetEnabled ())
11881164 {
1189- Bool levelChanged=FALSE ;
11901165 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
1191-
1192- // The levels stored by the LOD Manager are inverted compared to GUI so find correct one:
1193- switch (index) {
1194- case HIGHDETAIL:
1195- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_HIGH);
1196- break ;
1197- case MEDIUMDETAIL:
1198- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_MEDIUM);
1199- break ;
1200- case LOWDETAIL:
1201- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_LOW);
1202- break ;
1203- case CUSTOMDETAIL:
1204- levelChanged=TheGameLODManager->setStaticLODLevel (STATIC_GAME_LOD_CUSTOM);
1205- break ;
1206- default :
1207- DEBUG_ASSERTCRASH (FALSE ,(" LOD passed in was %d, %d is not a supported LOD" ,index,index));
1208- break ;
1209- }
1166+ const Bool levelChanged = TheGameLODManager->setStaticLODLevel ((StaticGameLODLevel)index);
12101167
12111168 if (levelChanged)
12121169 (*pref)[" StaticGameLOD" ] = TheGameLODManager->getStaticGameLODLevelName (TheGameLODManager->getStaticLODLevel ());
@@ -1534,23 +1491,7 @@ static void acceptAdvancedOptions()
15341491static void cancelAdvancedOptions ()
15351492{
15361493 // restore the detail selection back to initial state
1537- switch (TheGameLODManager->getStaticLODLevel ())
1538- {
1539- case STATIC_GAME_LOD_LOW:
1540- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
1541- break ;
1542- case STATIC_GAME_LOD_MEDIUM:
1543- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
1544- break ;
1545- case STATIC_GAME_LOD_HIGH:
1546- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
1547- break ;
1548- case STATIC_GAME_LOD_CUSTOM:
1549- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
1550- break ;
1551- default :
1552- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
1553- };
1494+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel ());
15541495
15551496 WinAdvancedDisplay->winHide (TRUE );
15561497}
@@ -1868,35 +1809,22 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
18681809 GadgetComboBoxSetSelectedPos ( comboBoxResolution, selectedResIndex );
18691810
18701811 // set the display detail
1812+ // TheSuperHackers @tweak xezon 24/09/2025 The Detail Combo Box now has the same value order as StaticGameLODLevel for simplicity.
18711813 GadgetComboBoxReset (comboBoxDetail);
1872- GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:High" ), color);
1873- GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Medium" ), color);
18741814 GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Low" ), color);
1815+ GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Medium" ), color);
1816+ GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:High" ), color);
18751817 GadgetComboBoxAddEntry (comboBoxDetail, TheGameText->fetch (" GUI:Custom" ), color);
1818+ static_assert (STATIC_GAME_LOD_COUNT == 4 , " Wrong combo box count" );
18761819
18771820 // Check if level was never set and default to setting most suitable for system.
18781821 if (TheGameLODManager->getStaticLODLevel () == STATIC_GAME_LOD_UNKNOWN)
1879- TheGameLODManager->setStaticLODLevel (TheGameLODManager->findStaticLODLevel ());
1880-
1881- switch (TheGameLODManager->getStaticLODLevel ())
1882- {
1883- case STATIC_GAME_LOD_LOW:
1884- GadgetComboBoxSetSelectedPos (comboBoxDetail, LOWDETAIL);
1885- break ;
1886- case STATIC_GAME_LOD_MEDIUM:
1887- GadgetComboBoxSetSelectedPos (comboBoxDetail, MEDIUMDETAIL);
1888- break ;
1889- case STATIC_GAME_LOD_HIGH:
1890- GadgetComboBoxSetSelectedPos (comboBoxDetail, HIGHDETAIL);
1891- break ;
1892- case STATIC_GAME_LOD_CUSTOM:
1893- GadgetComboBoxSetSelectedPos (comboBoxDetail, CUSTOMDETAIL);
1894- break ;
1895- default :
1896- DEBUG_ASSERTCRASH (FALSE ,(" Tried to set comboBoxDetail to a value of %d " , TheGameLODManager->getStaticLODLevel ()) );
1897- };
1822+ {
1823+ TheGameLODManager->setStaticLODLevel (TheGameLODManager->getRecommendedStaticLODLevel ());
1824+ }
18981825
18991826 Int txtFact=TheGameLODManager->getCurrentTextureReduction ();
1827+ GadgetComboBoxSetSelectedPos (comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel ());
19001828
19011829 GadgetSliderSetPosition ( sliderTextureResolution, 2 -txtFact);
19021830
@@ -2217,7 +2145,7 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
22172145 {
22182146 Int index;
22192147 GadgetComboBoxGetSelectedPos ( comboBoxDetail, &index );
2220- if (index != CUSTOMDETAIL )
2148+ if (index != STATIC_GAME_LOD_CUSTOM )
22212149 break ;
22222150
22232151 showAdvancedOptions ();
0 commit comments