From: Holger Z. <hz...@us...> - 2005-01-11 14:25:20
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4510/src/jake2/client Modified Files: Menu.java Log Message: dynamic sound menu Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Menu.java 22 Dec 2004 15:50:40 -0000 1.13 --- Menu.java 11 Jan 2005 14:24:59 -0000 1.14 *************** *** 1313,1321 **** //s_options_quality_list.curvalue = 1 - ((int) // Cvar.VariableValue("s_loadas8bit")); ! if ("joal".equals(Cvar.VariableString("s_impl"))) { ! s_options_quality_list.curvalue = 0; ! } else { ! s_options_quality_list.curvalue = 1; } s_options_sensitivity_slider.curvalue = (sensitivity.value) * 2; --- 1313,1327 ---- //s_options_quality_list.curvalue = 1 - ((int) // Cvar.VariableValue("s_loadas8bit")); ! String s = Cvar.VariableString("s_impl"); ! for (int i = 0; i < s_options_quality_list.itemnames.length; i++) { ! if (s.equals(s_options_quality_list.itemnames[i])) { ! s_options_quality_list.curvalue = i; ! } } + // if ("joal".equals(Cvar.VariableString("s_impl"))) { + // s_options_quality_list.curvalue = 0; + // } else { + // s_options_quality_list.curvalue = 1; + // } s_options_sensitivity_slider.curvalue = (sensitivity.value) * 2; *************** *** 1391,1405 **** static void UpdateSoundQualityFunc(Object unused) { boolean driverNotChanged = false; ! if (s_options_quality_list.curvalue != 0) { ! // Cvar.SetValue("s_khz", 22); ! // Cvar.SetValue("s_loadas8bit", 0); ! driverNotChanged = S.getDriverName().equals("dummy"); ! Cvar.Set("s_impl", "dummy"); ! } else { ! // Cvar.SetValue("s_khz", 11); ! // Cvar.SetValue("s_loadas8bit", 1); ! driverNotChanged = S.getDriverName().equals("joal"); ! Cvar.Set("s_impl", "joal"); ! } //Cvar.SetValue("s_primary", s_options_compatibility_list.curvalue); --- 1397,1413 ---- static void UpdateSoundQualityFunc(Object unused) { boolean driverNotChanged = false; ! String current = s_options_quality_list.itemnames[s_options_quality_list.curvalue]; ! driverNotChanged = S.getDriverName().equals(current); ! // if (s_options_quality_list.curvalue != 0) { ! // // Cvar.SetValue("s_khz", 22); ! // // Cvar.SetValue("s_loadas8bit", 0); ! // driverNotChanged = S.getDriverName().equals("dummy"); ! // Cvar.Set("s_impl", "dummy"); ! // } else { ! // // Cvar.SetValue("s_khz", 11); ! // // Cvar.SetValue("s_loadas8bit", 1); ! // driverNotChanged = S.getDriverName().equals("joal"); ! // Cvar.Set("s_impl", "joal"); ! // } //Cvar.SetValue("s_primary", s_options_compatibility_list.curvalue); *************** *** 1409,1413 **** return; } else { ! DrawTextBox(8, 120 - 48, 36, 3); Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This"); --- 1417,1422 ---- return; } else { ! Cvar.Set("s_impl", current); ! DrawTextBox(8, 120 - 48, 36, 3); Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This"); *************** *** 1480,1484 **** } }; ! s_options_quality_list.itemnames = soundstate_items; //s_options_quality_list.curvalue = 1 - (int) // Cvar.VariableValue("s_loadas8bit"); --- 1489,1493 ---- } }; ! s_options_quality_list.itemnames = S.getDriverNames();//soundstate_items; //s_options_quality_list.curvalue = 1 - (int) // Cvar.VariableValue("s_loadas8bit"); *************** *** 4891,4896 **** if (s.curvalue < 0) s.curvalue = 0; ! else if (s.itemnames[s.curvalue] == null) ! s.curvalue--; if (s.callback != null) --- 4900,4905 ---- if (s.curvalue < 0) s.curvalue = 0; ! else if (s.curvalue >= s.itemnames.length) ! s.curvalue = s.itemnames.length - 1; if (s.callback != null) |