Weapon selector tweaks

This commit is contained in:
Petr Bartos 2022-03-14 17:37:00 +01:00
parent 53b60ca372
commit 7cc87f9fe3
7 changed files with 101 additions and 50 deletions

View File

@ -2618,9 +2618,9 @@ static void CG_DrawVignette( void )
if (currentComfortVignetteValue > 0.0f && currentComfortVignetteValue <= 1.0f && !(vr->weapon_zoomed)) if (currentComfortVignetteValue > 0.0f && currentComfortVignetteValue <= 1.0f && !(vr->weapon_zoomed))
{ {
int x = (int)(0 + currentComfortVignetteValue * cg.refdef.width / 3); int x = (int)(0 + currentComfortVignetteValue * cg.refdef.width / 3.5f);
int w = (int)(cg.refdef.width - 2 * x); int w = (int)(cg.refdef.width - 2 * x);
int y = (int)(0 + currentComfortVignetteValue * cg.refdef.height / 3); int y = (int)(0 + currentComfortVignetteValue * cg.refdef.height / 3.5f);
int h = (int)(cg.refdef.height - 2 * y); int h = (int)(cg.refdef.height - 2 * y);
// sides // sides
@ -2678,6 +2678,11 @@ static void CG_Draw2D(stereoFrame_t stereoFrame)
CG_DrawVignette(); CG_DrawVignette();
// If weapon selector is active, check whether draw HUD
if (cg.weaponSelectorTime != 0 && trap_Cvar_VariableValue("vr_weaponSelectorWithHud") == 0) {
return;
}
#ifdef MISSIONPACK #ifdef MISSIONPACK
if ( cg_drawStatus.integer ) { if ( cg_drawStatus.integer ) {
Menu_PaintAll(); Menu_PaintAll();
@ -2841,13 +2846,9 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
VectorCopy( baseOrg, cg.refdef.vieworg ); VectorCopy( baseOrg, cg.refdef.vieworg );
//Don't draw HUD whilst selecting the weapon with the holster (it gets in the way) // draw status bar and other floating elements
if (cg.weaponSelectorTime == 0) hudStereoView = stereoView;
{ CG_Draw2D(hudStereoView);
// draw status bar and other floating elements
hudStereoView = stereoView;
CG_Draw2D(hudStereoView);
}
} }

View File

@ -2087,7 +2087,8 @@ void CG_DrawWeaponSelector( void )
} }
else else
{ {
VectorMA(holsterOrigin, -3.0f, holsterUp, holsterOrigin); // Do not shift weapon wheel down in order to fit inside comfort vignette
//VectorMA(holsterOrigin, -3.0f, holsterUp, holsterOrigin);
} }
VectorCopy(holsterOrigin, beamOrigin); VectorCopy(holsterOrigin, beamOrigin);

View File

@ -55,7 +55,8 @@ GAME OPTIONS MENU
#define ID_HOLSTER2D 140 #define ID_HOLSTER2D 140
#define ID_GORE 141 #define ID_GORE 141
#define ID_SHOWINHAND 142 #define ID_SHOWINHAND 142
#define ID_BACK 143 #define ID_SELECTORWITHHUD 143
#define ID_BACK 144
#define NUM_CROSSHAIRS 10 #define NUM_CROSSHAIRS 10
#define NUM_GORE 4 #define NUM_GORE 4
@ -84,6 +85,7 @@ typedef struct {
menuradiobutton_s holster2d; menuradiobutton_s holster2d;
menulist_s gore; menulist_s gore;
menuradiobutton_s showinhand; menuradiobutton_s showinhand;
menuradiobutton_s selectorwithhud;
menubitmap_s back; menubitmap_s back;
qhandle_t crosshairShader[NUM_CROSSHAIRS]; qhandle_t crosshairShader[NUM_CROSSHAIRS];
@ -133,6 +135,7 @@ static void Preferences_SetMenuItems( void ) {
s_preferences.gore.curvalue = level % NUM_GORE; s_preferences.gore.curvalue = level % NUM_GORE;
} }
s_preferences.showinhand.curvalue = trap_Cvar_VariableValue( "vr_showItemInHand" ) != 0; s_preferences.showinhand.curvalue = trap_Cvar_VariableValue( "vr_showItemInHand" ) != 0;
s_preferences.selectorwithhud.curvalue = trap_Cvar_VariableValue( "vr_weaponSelectorWithHud" ) != 0;
} }
@ -232,6 +235,10 @@ static void Preferences_Event( void* ptr, int notification ) {
trap_Cvar_SetValue( "vr_showItemInHand", s_preferences.showinhand.curvalue); trap_Cvar_SetValue( "vr_showItemInHand", s_preferences.showinhand.curvalue);
break; break;
case ID_SELECTORWITHHUD:
trap_Cvar_SetValue( "vr_weaponSelectorWithHud", s_preferences.selectorwithhud.curvalue);
break;
case ID_BACK: case ID_BACK:
UI_PopMenu(); UI_PopMenu();
break; break;
@ -321,7 +328,7 @@ static void Preferences_MenuInit( void ) {
s_preferences.framer.width = 256; s_preferences.framer.width = 256;
s_preferences.framer.height = 334; s_preferences.framer.height = 334;
y = 110; y = 92;
s_preferences.crosshair.generic.type = MTYPE_SPINCONTROL; s_preferences.crosshair.generic.type = MTYPE_SPINCONTROL;
s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW; s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
s_preferences.crosshair.generic.x = PREFERENCES_X_POS; s_preferences.crosshair.generic.x = PREFERENCES_X_POS;
@ -454,6 +461,15 @@ static void Preferences_MenuInit( void ) {
s_preferences.drawhud.generic.x = PREFERENCES_X_POS; s_preferences.drawhud.generic.x = PREFERENCES_X_POS;
s_preferences.drawhud.generic.y = y; s_preferences.drawhud.generic.y = y;
y += BIGCHAR_HEIGHT+2;
s_preferences.selectorwithhud.generic.type = MTYPE_RADIOBUTTON;
s_preferences.selectorwithhud.generic.name = "Draw HUD On Weapon Selector:";
s_preferences.selectorwithhud.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_preferences.selectorwithhud.generic.callback = Preferences_Event;
s_preferences.selectorwithhud.generic.id = ID_SELECTORWITHHUD;
s_preferences.selectorwithhud.generic.x = PREFERENCES_X_POS;
s_preferences.selectorwithhud.generic.y = y;
// y += BIGCHAR_HEIGHT+2; // y += BIGCHAR_HEIGHT+2;
// s_preferences.allowdownload.generic.type = MTYPE_RADIOBUTTON; // s_preferences.allowdownload.generic.type = MTYPE_RADIOBUTTON;
// s_preferences.allowdownload.generic.name = "Automatic Downloading:"; // s_preferences.allowdownload.generic.name = "Automatic Downloading:";
@ -505,6 +521,7 @@ static void Preferences_MenuInit( void ) {
// Menu_AddItem( &s_preferences.menu, &s_preferences.allowdownload ); // Menu_AddItem( &s_preferences.menu, &s_preferences.allowdownload );
Menu_AddItem( &s_preferences.menu, &s_preferences.gore ); Menu_AddItem( &s_preferences.menu, &s_preferences.gore );
Menu_AddItem( &s_preferences.menu, &s_preferences.showinhand ); Menu_AddItem( &s_preferences.menu, &s_preferences.showinhand );
Menu_AddItem( &s_preferences.menu, &s_preferences.selectorwithhud );
Menu_AddItem( &s_preferences.menu, &s_preferences.back ); Menu_AddItem( &s_preferences.menu, &s_preferences.back );

View File

@ -37,6 +37,7 @@ cvar_t *vr_lasersight = NULL;
cvar_t *vr_hapticIntensity = NULL; cvar_t *vr_hapticIntensity = NULL;
cvar_t *vr_comfortVignette = NULL; cvar_t *vr_comfortVignette = NULL;
cvar_t *vr_weaponSelectorMode = NULL; cvar_t *vr_weaponSelectorMode = NULL;
cvar_t *vr_weaponSelectorWithHud = NULL;
engine_t* VR_Init( ovrJava java ) engine_t* VR_Init( ovrJava java )
{ {
@ -75,6 +76,7 @@ void VR_InitCvars( void )
vr_hapticIntensity = Cvar_Get ("vr_hapticIntensity", "1.0", CVAR_ARCHIVE); vr_hapticIntensity = Cvar_Get ("vr_hapticIntensity", "1.0", CVAR_ARCHIVE);
vr_comfortVignette = Cvar_Get ("vr_comfortVignette", "0.0", CVAR_ARCHIVE); vr_comfortVignette = Cvar_Get ("vr_comfortVignette", "0.0", CVAR_ARCHIVE);
vr_weaponSelectorMode = Cvar_Get ("vr_weaponSelectorMode", "0", CVAR_ARCHIVE); vr_weaponSelectorMode = Cvar_Get ("vr_weaponSelectorMode", "0", CVAR_ARCHIVE);
vr_weaponSelectorWithHud = Cvar_Get ("vr_weaponSelectorWithHud", "0", CVAR_ARCHIVE);
// Values are: scale,right,up,forward,pitch,yaw,roll // Values are: scale,right,up,forward,pitch,yaw,roll
// VALUES PROVIDED BY SkillFur - Thank-you! // VALUES PROVIDED BY SkillFur - Thank-you!

View File

@ -8,7 +8,7 @@ menuDef {
visible 0 visible 0
fullscreen 0 fullscreen 0
outOfBoundsClick // this closes the window if it gets a click out of the rectangle outOfBoundsClick // this closes the window if it gets a click out of the rectangle
rect 225 30 290 375 rect 195 30 350 375
focusColor 1 .75 0 1 focusColor 1 .75 0 1
style 1 style 1
border 1 border 1
@ -16,7 +16,7 @@ menuDef {
itemDef { itemDef {
name window name window
rect 10 15 280 360 rect 10 15 340 360
style 1 style 1
backcolor 0 .1 0 1 backcolor 0 .1 0 1
visible 1 visible 1
@ -36,7 +36,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 64 10 52 8 rect 34 10 102 8
style 3 style 3
background "ui/assets/ingametop.tga" background "ui/assets/ingametop.tga"
visible 1 visible 1
@ -44,7 +44,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 184 10 52 8 rect 218 10 82 8
style 3 style 3
background "ui/assets/ingametop.tga" background "ui/assets/ingametop.tga"
visible 1 visible 1
@ -53,7 +53,7 @@ itemDef {
itemDef { itemDef {
name window name window
rect 237 10 64 64 rect 297 10 64 64
style 3 style 3
background "ui/assets/ingamerightcorner.tga" background "ui/assets/ingamerightcorner.tga"
visible 1 visible 1
@ -61,7 +61,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 114 0 73 16 rect 144 0 73 16
style 3 style 3
background "ui/assets/ingameconnection.tga" background "ui/assets/ingameconnection.tga"
visible 1 visible 1
@ -77,7 +77,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 237 314 64 64 rect 297 314 64 64
style 3 style 3
background "ui/assets/ingamerightcornerb.tga" background "ui/assets/ingamerightcornerb.tga"
visible 1 visible 1
@ -114,7 +114,7 @@ itemDef {
itemDef { itemDef {
name window name window
rect 285 64 16 84 rect 345 64 16 84
style 3 style 3
background "ui/assets/ingameright.tga" background "ui/assets/ingameright.tga"
visible 1 visible 1
@ -124,7 +124,7 @@ itemDef {
itemDef { itemDef {
name window name window
rect 285 148 16 84 rect 345 148 16 84
style 3 style 3
background "ui/assets/ingameright.tga" background "ui/assets/ingameright.tga"
visible 1 visible 1
@ -132,7 +132,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 285 232 16 84 rect 345 232 16 84
style 3 style 3
background "ui/assets/ingameright.tga" background "ui/assets/ingameright.tga"
visible 1 visible 1
@ -142,7 +142,7 @@ itemDef {
itemDef { itemDef {
name window name window
rect 64 370 104 8 rect 34 370 134 8
style 3 style 3
background "ui/assets/ingamebottom.tga" background "ui/assets/ingamebottom.tga"
visible 1 visible 1
@ -150,7 +150,7 @@ itemDef {
} }
itemDef { itemDef {
name window name window
rect 168 370 104 8 rect 198 370 134 8
style 3 style 3
background "ui/assets/ingamebottom.tga" background "ui/assets/ingamebottom.tga"
visible 1 visible 1
@ -164,7 +164,7 @@ itemDef {
group grpOptions group grpOptions
text "Crosshair:" text "Crosshair:"
ownerdraw UI_CROSSHAIR ownerdraw UI_CROSSHAIR
rect 173 20 20 17 rect 193 20 20 17
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 0 textalignx 0
textaligny 17 textaligny 17
@ -179,7 +179,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Laser Sight:" text "Laser Sight:"
cvar "vr_lasersight" cvar "vr_lasersight"
rect 30 37 200 20 rect 50 37 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -193,7 +193,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Simple Items (World):" text "Simple Items (World):"
cvar "cg_simpleItems" cvar "cg_simpleItems"
rect 30 54 200 20 rect 50 54 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -208,7 +208,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Simple Items (Holster):" text "Simple Items (Holster):"
cvar "cg_weaponSelectorSimple2DIcons" cvar "cg_weaponSelectorSimple2DIcons"
rect 30 71 200 20 rect 50 71 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -223,7 +223,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Show Item In Hand:" text "Show Item In Hand:"
cvar "vr_showItemInHand" cvar "vr_showItemInHand"
rect 30 88 200 20 rect 50 88 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -238,7 +238,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Marks On Walls:" text "Marks On Walls:"
cvar "cg_marks" cvar "cg_marks"
rect 30 105 200 20 rect 50 105 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -253,7 +253,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Show Floating Scores:" text "Show Floating Scores:"
cvar "cg_scorePlums" cvar "cg_scorePlums"
rect 30 122 200 20 rect 50 122 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -269,7 +269,7 @@ itemDef {
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
cvar "cg_brassTime" cvar "cg_brassTime"
cvarFloatList { "High" 2500 "Med" 1250 "Off" 0 } cvarFloatList { "High" 2500 "Med" 1250 "Off" 0 }
rect 30 139 200 20 rect 50 139 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -284,7 +284,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Identify Target:" text "Identify Target:"
cvar "cg_drawCrosshairNames" cvar "cg_drawCrosshairNames"
rect 30 156 200 20 rect 50 156 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -299,7 +299,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Low Quality Sky:" text "Low Quality Sky:"
cvar "r_fastsky" cvar "r_fastsky"
rect 30 173 200 20 rect 50 173 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -314,7 +314,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Force Player Models:" text "Force Player Models:"
cvar "cg_forceModel" cvar "cg_forceModel"
rect 30 190 200 20 rect 50 190 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -328,7 +328,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Draw Team Overlay:" text "Draw Team Overlay:"
cvar "cg_drawTeamOverlay" cvar "cg_drawTeamOverlay"
rect 30 207 200 20 rect 50 207 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -342,7 +342,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Show Time:" text "Show Time:"
cvar "cg_drawTimer" cvar "cg_drawTimer"
rect 30 224 200 20 rect 50 224 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -356,7 +356,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Taunts Off:" text "Taunts Off:"
cvar "cg_noTaunt" cvar "cg_noTaunt"
rect 30 241 200 20 rect 50 241 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -370,7 +370,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "In Game Video:" text "In Game Video:"
cvar "r_inGameVideo" cvar "r_inGameVideo"
rect 30 258 200 20 rect 50 258 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -385,7 +385,7 @@ itemDef {
text "Statusbar:" text "Statusbar:"
cvar "cg_hudfiles" cvar "cg_hudfiles"
cvarStrList { Normal "ui/hud.txt" Small "ui/hud2.txt" } cvarStrList { Normal "ui/hud.txt" Small "ui/hud2.txt" }
rect 30 275 200 20 rect 50 275 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -394,13 +394,28 @@ itemDef {
visible 1 visible 1
} }
itemDef {
name options
group grpOptions
type ITEM_TYPE_YESNO
text "Statusbar On Weapon Selector:"
cvar "vr_weaponSelectorWithHud"
rect 50 292 200 20
textalign ITEM_ALIGN_RIGHT
textalignx 143
textaligny 17
textscale .25
forecolor 1 1 1 1
visible 1
}
itemDef { itemDef {
name options name options
group grpOptions group grpOptions
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Blood:" text "Blood:"
cvar "com_blood" cvar "com_blood"
rect 30 292 200 20 rect 50 309 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -415,7 +430,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Gibs:" text "Gibs:"
cvar "cg_gibs" cvar "cg_gibs"
rect 30 309 200 20 rect 50 326 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17
@ -429,9 +444,9 @@ itemDef {
name options name options
group grpOptions group grpOptions
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Extra Gibs (Perf. Hit):" text "Extra Gibs (Performance Hit):"
cvar "cg_megagibs" cvar "cg_megagibs"
rect 30 326 200 20 rect 50 343 200 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 143 textalignx 143
textaligny 17 textaligny 17

View File

@ -275,13 +275,28 @@ itemDef {
visible 1 visible 1
} }
itemDef {
name options
group grpOptions
type ITEM_TYPE_YESNO
text "Statusbar On Weapon Selector:"
cvar "vr_weaponSelectorWithHud"
rect 99 335 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
textscale .3
forecolor 1 1 1 1
visible 1
}
itemDef { itemDef {
name options name options
group grpOptions group grpOptions
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Blood:" text "Blood:"
cvar "com_blood" cvar "com_blood"
rect 99 345 256 20 rect 99 365 256 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 128 textalignx 128
textaligny 20 textaligny 20
@ -296,7 +311,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Gibs:" text "Gibs:"
cvar "cg_gibs" cvar "cg_gibs"
rect 99 365 256 20 rect 99 385 256 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 128 textalignx 128
textaligny 20 textaligny 20
@ -311,7 +326,7 @@ itemDef {
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Extra Gibs (Performance Hit):" text "Extra Gibs (Performance Hit):"
cvar "cg_megagibs" cvar "cg_megagibs"
rect 99 385 256 20 rect 99 405 256 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
textalignx 128 textalignx 128
textaligny 20 textaligny 20