Merge pull request #16 from petr666/feature/weapon-selector-tweaks

Weapon selector tweaks
This commit is contained in:
Simon 2022-03-14 20:56:07 +00:00 committed by GitHub
commit b8672bb8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 140 additions and 70 deletions

View File

@ -2618,9 +2618,9 @@ static void CG_DrawVignette( void )
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 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);
// sides
@ -2678,6 +2678,11 @@ static void CG_Draw2D(stereoFrame_t stereoFrame)
CG_DrawVignette();
// If weapon selector is active, check whether draw HUD
if (cg.weaponSelectorTime != 0 && trap_Cvar_VariableValue("vr_weaponSelectorWithHud") == 0) {
return;
}
#ifdef MISSIONPACK
if ( cg_drawStatus.integer ) {
Menu_PaintAll();
@ -2841,13 +2846,9 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
VectorCopy( baseOrg, cg.refdef.vieworg );
//Don't draw HUD whilst selecting the weapon with the holster (it gets in the way)
if (cg.weaponSelectorTime == 0)
{
// draw status bar and other floating elements
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
{
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);

View File

@ -55,7 +55,8 @@ GAME OPTIONS MENU
#define ID_HOLSTER2D 140
#define ID_GORE 141
#define ID_SHOWINHAND 142
#define ID_BACK 143
#define ID_SELECTORWITHHUD 143
#define ID_BACK 144
#define NUM_CROSSHAIRS 10
#define NUM_GORE 4
@ -84,6 +85,7 @@ typedef struct {
menuradiobutton_s holster2d;
menulist_s gore;
menuradiobutton_s showinhand;
menuradiobutton_s selectorwithhud;
menubitmap_s back;
qhandle_t crosshairShader[NUM_CROSSHAIRS];
@ -133,6 +135,7 @@ static void Preferences_SetMenuItems( void ) {
s_preferences.gore.curvalue = level % NUM_GORE;
}
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);
break;
case ID_SELECTORWITHHUD:
trap_Cvar_SetValue( "vr_weaponSelectorWithHud", s_preferences.selectorwithhud.curvalue);
break;
case ID_BACK:
UI_PopMenu();
break;
@ -321,7 +328,7 @@ static void Preferences_MenuInit( void ) {
s_preferences.framer.width = 256;
s_preferences.framer.height = 334;
y = 110;
y = 92;
s_preferences.crosshair.generic.type = MTYPE_SPINCONTROL;
s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
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.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;
// s_preferences.allowdownload.generic.type = MTYPE_RADIOBUTTON;
// 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.gore );
Menu_AddItem( &s_preferences.menu, &s_preferences.showinhand );
Menu_AddItem( &s_preferences.menu, &s_preferences.selectorwithhud );
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_comfortVignette = NULL;
cvar_t *vr_weaponSelectorMode = NULL;
cvar_t *vr_weaponSelectorWithHud = NULL;
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_comfortVignette = Cvar_Get ("vr_comfortVignette", "0.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 PROVIDED BY SkillFur - Thank-you!

View File

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

View File

@ -275,13 +275,28 @@ itemDef {
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 {
name options
group grpOptions
type ITEM_TYPE_YESNO
text "Blood:"
cvar "com_blood"
rect 99 345 256 20
rect 99 365 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -296,7 +311,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Gibs:"
cvar "cg_gibs"
rect 99 365 256 20
rect 99 385 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -311,7 +326,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Extra Gibs (Performance Hit):"
cvar "cg_megagibs"
rect 99 385 256 20
rect 99 405 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20

View File

@ -1,16 +1,31 @@
#!/bin/sh
cd ..
#!/bin/bash
TARGET=debug
WORKDIR=$(readlink -f $(dirname $0))
NAME=$(cat $WORKDIR/app/src/main/res/values/strings.xml | grep "app_name" | cut -d">" -f2 | cut -d"<" -f1 )
VERSION=$(cat $WORKDIR/app/src/main/AndroidManifest.xml | grep "versionName" | cut -d\" -f2 | cut -d\" -f1 )
PACKAGE_NAME=$(cat $WORKDIR/app/src/main/AndroidManifest.xml | grep "package" | cut -d\" -f2 | cut -d\" -f1 )
if [ "$1" == "clean" ] || [ "$2" == "clean" ] || [ "$3" == "clean" ]; then
rm -rf $WORKDIR/../build
rm -rf $WORKDIR/build
rm -rf $WORKDIR/app/build
rm -rf $WORKDIR/app/src/main/jniLibs
fi
echo "#define Q3QVERSION \"$VERSION"\" > $WORKDIR/app/src/main/cpp/code/vr/vr_version.h
cd $WORKDIR/..
make -j $(getconf _NPROCESSORS_ONLN) $TARGET
if [ $? -ne 0 ]; then
echo "Failed to build ioq3"
exit 1
fi
cd android
cd $WORKDIR
./make.sh
@ -19,19 +34,21 @@ if [ $? -ne 0 ]; then
exit 1
fi
PACKAGE_NAME=com.drbeef.ioq3quest
ANDROID_STORAGE_LOCATION=/sdcard/Android/data/$PACKAGE_NAME/files/
APK_LOCATION=./app/build/outputs/apk/debug/app-debug.apk
APK_LOCATION=$WORKDIR/app/build/outputs/apk/debug/app-debug.apk
adb install -r $APK_LOCATION
if [ $? -ne 0 ]; then
adb uninstall $PACKAGE_NAME
adb install $APK_LOCATION
if [ $? -ne 0 ]; then
echo "Failed to install apk."
exit 1
fi
if [ "$1" == "install" ] || [ "$2" == "install" ] || [ "$3" == "install" ]; then
adb install -r $APK_LOCATION
if [ $? -ne 0 ]; then
adb uninstall $PACKAGE_NAME
adb install $APK_LOCATION
if [ $? -ne 0 ]; then
echo "Failed to install apk."
exit 1
fi
fi
fi
#adb shell mkdir -p $ANDROID_STORAGE_LOCATION
#adb push --sync ~/.local/share/Steam/steamapps/common/Quake\ 3\ Arena/baseq3 $ANDROID_STORAGE_LOCATION
#if [ $? -ne 0 ]; then
@ -49,10 +66,12 @@ fi
# exit 1
#fi
adb logcat -c
adb shell am start -n $PACKAGE_NAME/.MainActivity
if [ $? -ne 0 ]; then
echo "Failed to start application."
exit 1
if [ "$1" == "start" ] || [ "$2" == "start" ] || [ "$3" == "start" ]; then
adb logcat -c
adb shell am start -n $PACKAGE_NAME/.MainActivity
if [ $? -ne 0 ]; then
echo "Failed to start application."
exit 1
fi
adb logcat *:S Quake3:V SDL:V DEBUG:V
fi
adb logcat *:S Quake3:V SDL:V DEBUG:V