Add a statusbar alpha slider, and change default scr_sbaralpha to 0.95

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@247 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Steven 2010-07-29 06:48:25 +00:00
parent b9d4ec244f
commit 19b960c889
2 changed files with 38 additions and 26 deletions

View file

@ -82,7 +82,7 @@ float oldscreensize, oldfov, oldsbarscale, oldsbaralpha; //johnfitz -- added ol
//johnfitz -- new cvars //johnfitz -- new cvars
cvar_t scr_menuscale = {"scr_menuscale", "1", true}; cvar_t scr_menuscale = {"scr_menuscale", "1", true};
cvar_t scr_sbarscale = {"scr_sbarscale", "1", true}; cvar_t scr_sbarscale = {"scr_sbarscale", "1", true};
cvar_t scr_sbaralpha = {"scr_sbaralpha", "1", true}; cvar_t scr_sbaralpha = {"scr_sbaralpha", "0.95", true};
cvar_t scr_conwidth = {"scr_conwidth", "0", true}; cvar_t scr_conwidth = {"scr_conwidth", "0", true};
cvar_t scr_conscale = {"scr_conscale", "1", true}; cvar_t scr_conscale = {"scr_conscale", "1", true};
cvar_t scr_scale = {"scr_scale", "1", true}; cvar_t scr_scale = {"scr_scale", "1", true};

View file

@ -1030,7 +1030,7 @@ again:
//#ifdef _WIN32 //#ifdef _WIN32
//#define OPTIONS_ITEMS 14 //#define OPTIONS_ITEMS 14
//#else //#else
#define OPTIONS_ITEMS 13 #define OPTIONS_ITEMS 14
//#endif //#endif
#define SLIDER_RANGE 10 #define SLIDER_RANGE 10
@ -1082,7 +1082,15 @@ void M_AdjustSliders (int dir)
sensitivity.value = 11; sensitivity.value = 11;
Cvar_SetValue ("sensitivity", sensitivity.value); Cvar_SetValue ("sensitivity", sensitivity.value);
break; break;
case 6: // music volume case 6: // statusbar alpha
scr_sbaralpha.value -= dir * 0.05;
if (scr_sbaralpha.value < 0)
scr_sbaralpha.value = 0;
else if (scr_sbaralpha.value > 1)
scr_sbaralpha.value = 1;
Cvar_SetValue ("scr_sbaralpha", scr_sbaralpha.value);
break;
case 7: // music volume
#ifdef _WIN32 #ifdef _WIN32
bgmvolume.value += dir * 1.0; bgmvolume.value += dir * 1.0;
#else #else
@ -1094,7 +1102,7 @@ void M_AdjustSliders (int dir)
bgmvolume.value = 1; bgmvolume.value = 1;
Cvar_SetValue ("bgmvolume", bgmvolume.value); Cvar_SetValue ("bgmvolume", bgmvolume.value);
break; break;
case 7: // sfx volume case 8: // sfx volume
sfxvolume.value += dir * 0.1; sfxvolume.value += dir * 0.1;
if (sfxvolume.value < 0) if (sfxvolume.value < 0)
sfxvolume.value = 0; sfxvolume.value = 0;
@ -1103,7 +1111,7 @@ void M_AdjustSliders (int dir)
Cvar_SetValue ("volume", sfxvolume.value); Cvar_SetValue ("volume", sfxvolume.value);
break; break;
case 8: // always run case 9: // always run
if (cl_forwardspeed.value > 200) if (cl_forwardspeed.value > 200)
{ {
Cvar_SetValue ("cl_forwardspeed", 200); Cvar_SetValue ("cl_forwardspeed", 200);
@ -1116,15 +1124,15 @@ void M_AdjustSliders (int dir)
} }
break; break;
case 9: // invert mouse case 10: // invert mouse
Cvar_SetValue ("m_pitch", -m_pitch.value); Cvar_SetValue ("m_pitch", -m_pitch.value);
break; break;
case 10: // lookspring case 11: // lookspring
Cvar_SetValue ("lookspring", !lookspring.value); Cvar_SetValue ("lookspring", !lookspring.value);
break; break;
case 11: // lookstrafe case 12: // lookstrafe
Cvar_SetValue ("lookstrafe", !lookstrafe.value); Cvar_SetValue ("lookstrafe", !lookstrafe.value);
break; break;
} }
@ -1185,28 +1193,32 @@ void M_Options_Draw (void)
r = (sensitivity.value - 1)/10; r = (sensitivity.value - 1)/10;
M_DrawSlider (220, 72, r); M_DrawSlider (220, 72, r);
M_Print (16, 80, " Music Volume"); M_Print (16, 80, " Statusbar alpha");
r = bgmvolume.value; r = (1.0 - scr_sbaralpha.value) ; // scr_sbaralpha range is 1.0 to 0.0
M_DrawSlider (220, 80, r); M_DrawSlider (220, 80, r);
M_Print (16, 88, " Sound Volume"); M_Print (16, 88, " Music Volume");
r = sfxvolume.value; r = bgmvolume.value;
M_DrawSlider (220, 88, r); M_DrawSlider (220, 88, r);
M_Print (16, 96, " Always Run"); M_Print (16, 96, " Sound Volume");
M_DrawCheckbox (220, 96, cl_forwardspeed.value > 200); r = sfxvolume.value;
M_DrawSlider (220, 96, r);
M_Print (16, 104, " Invert Mouse"); M_Print (16, 104, " Always Run");
M_DrawCheckbox (220, 104, m_pitch.value < 0); M_DrawCheckbox (220, 104, cl_forwardspeed.value > 200);
M_Print (16, 112, " Lookspring"); M_Print (16, 112, " Invert Mouse");
M_DrawCheckbox (220, 112, lookspring.value); M_DrawCheckbox (220, 112, m_pitch.value < 0);
M_Print (16, 120, " Lookstrafe"); M_Print (16, 120, " Lookspring");
M_DrawCheckbox (220, 120, lookstrafe.value); M_DrawCheckbox (220, 120, lookspring.value);
M_Print (16, 128, " Lookstrafe");
M_DrawCheckbox (220, 128, lookstrafe.value);
if (vid_menudrawfn) if (vid_menudrawfn)
M_Print (16, 128, " Video Options"); M_Print (16, 136, " Video Options");
// cursor // cursor
M_DrawCharacter (200, 32 + options_cursor*8, 12+((int)(realtime*4)&1)); M_DrawCharacter (200, 32 + options_cursor*8, 12+((int)(realtime*4)&1));
@ -1236,7 +1248,7 @@ void M_Options_Key (int k)
Cbuf_AddText ("resetall\n"); //johnfitz Cbuf_AddText ("resetall\n"); //johnfitz
Cbuf_AddText ("exec default.cfg\n"); Cbuf_AddText ("exec default.cfg\n");
break; break;
case 12: case 13:
M_Menu_Video_f (); M_Menu_Video_f ();
break; break;
default: default:
@ -1268,10 +1280,10 @@ void M_Options_Key (int k)
break; break;
} }
if (options_cursor == 12 && vid_menudrawfn == NULL) if (options_cursor == OPTIONS_ITEMS - 1 && vid_menudrawfn == NULL)
{ {
if (k == K_UPARROW) if (k == K_UPARROW)
options_cursor = 11; options_cursor = OPTIONS_ITEMS - 2;
else else
options_cursor = 0; options_cursor = 0;
} }
@ -2464,8 +2476,8 @@ void M_Menu_GameOptions_f (void)
} }
int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 112, 120}; int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 112, 120, 128};
#define NUM_GAMEOPTIONS 9 #define NUM_GAMEOPTIONS 10
int gameoptions_cursor; int gameoptions_cursor;
void M_GameOptions_Draw (void) void M_GameOptions_Draw (void)