3rd Person Saber toggle options (@MuadDib)

This commit is contained in:
Simon 2022-11-25 23:35:49 +00:00
parent 6ee8dcd2bc
commit cd38d00cf8
8 changed files with 135 additions and 13 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.jk2quest"
android:versionCode="29"
android:versionName="0.4.0" android:installLocation="auto" >
android:versionCode="30"
android:versionName="0.4.1" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>

View file

@ -1350,6 +1350,7 @@ void JKVR_Init()
vr_saber_block_debounce_time = Cvar_Get ("vr_saber_block_debounce_time", "200", CVAR_ARCHIVE);
vr_haptic_intensity = Cvar_Get ("vr_haptic_intensity", "1.0", CVAR_ARCHIVE);
vr_comfort_vignette = Cvar_Get ("vr_comfort_vignette", "0.0", CVAR_ARCHIVE);
vr_saber_3rdperson_mode = Cvar_Get ("vr_saber_3rdperson_mode", "1", CVAR_ARCHIVE);
cvar_t *expanded_menu_enabled = Cvar_Get ("expanded_menu_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("expanded_menu.pk3")) {

View file

@ -18,4 +18,5 @@ extern cvar_t *vr_irl_crouch_to_stand_ratio;
extern cvar_t *vr_saber_block_debounce_time;
extern cvar_t *vr_haptic_intensity;
extern cvar_t *vr_comfort_vignette;
extern cvar_t *vr_saber_3rdperson_mode;

View file

@ -38,6 +38,7 @@ cvar_t *vr_irl_crouch_to_stand_ratio;
cvar_t *vr_saber_block_debounce_time;
cvar_t *vr_haptic_intensity;
cvar_t *vr_comfort_vignette;
cvar_t *vr_saber_3rdperson_mode;
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;

View file

@ -267,6 +267,13 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
}
else if (cl.frame.ps.weapon == WP_SABER)
{
if (vr_saber_3rdperson_mode->integer == 2) {
int mode = (int)Cvar_VariableValue("cg_thirdPerson");
if (!mode)
{
sendButtonActionSimple("cg_thirdPerson 1");
}
} else if (vr_saber_3rdperson_mode->integer == 1) {
int mode = (int) Cvar_VariableValue("cg_thirdPerson");
static bool switched = false;
if (between(-0.2f, primaryJoystickX, 0.2f) &&
@ -280,6 +287,13 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
} else {
switched = false;
}
} else {
int mode = (int)Cvar_VariableValue("cg_thirdPerson");
if (mode != 0)
{
sendButtonActionSimple("cg_thirdPerson 0");
}
}
}
else
{

View file

@ -3,7 +3,7 @@ CONFIG W:\bin\striped.cfg
ID 100
REFERENCE MENUS_VR
DESCRIPTION "VR Menu Localizations"
COUNT 123
COUNT 128
INDEX 0
{
REFERENCE COMMON_CONTROLS_ITEM
@ -619,3 +619,28 @@ INDEX 122
REFERENCE COMFORT_VIGNETTE_DESC
TEXT_LANGUAGE1 "Adjust size of comfort vignette."
}
INDEX 123
{
REFERENCE SABER_3RD_PERSON_ITEM
TEXT_LANGUAGE1 "3rd Person Lightsaber:"
}
INDEX 124
{
REFERENCE SABER_3RD_PERSON_DESC
TEXT_LANGUAGE1 "Choose whether to swith to 3rd person when using lightsaber."
}
INDEX 125
{
REFERENCE SABER_3RD_PERSON_DISABLED
TEXT_LANGUAGE1 "Disabled"
}
INDEX 126
{
REFERENCE SABER_3RD_PERSON_MANUAL
TEXT_LANGUAGE1 "Manual"
}
INDEX 127
{
REFERENCE SABER_3RD_PERSON_AUTO
TEXT_LANGUAGE1 "Auto"
}

View file

@ -1580,6 +1580,46 @@
}
itemDef
{
name none
group weaponcontrols
type ITEM_TYPE_MULTI
text @MENUS_VR_SABER_3RD_PERSON_ITEM
cvar "vr_saber_3rdperson_mode"
cvarFloatList
{
@MENUS_VR_SABER_3RD_PERSON_DISABLED 0
@MENUS_VR_SABER_3RD_PERSON_MANUAL 1
@MENUS_VR_SABER_3RD_PERSON_AUTO 2
}
rect 305 291 300 20
textalign ITEM_ALIGN_RIGHT
textalignx 151
textaligny -2
font 2
textscale 0.8
forecolor 1 1 1 1
visible 0
// appearance_slot 1
descText @MENUS_VR_SABER_3RD_PERSON_DESC
action
{
play sound/interface/button1
}
mouseenter
{
show highlight7
}
mouseexit
{
hide highlight7
}
}
//----------------------------------------------------------------------------------------------

View file

@ -1579,6 +1579,46 @@
}
itemDef
{
name none
group weaponcontrols
type ITEM_TYPE_MULTI
text @MENUS_VR_SABER_3RD_PERSON_ITEM
cvar "vr_saber_3rdperson_mode"
cvarFloatList
{
@MENUS_VR_SABER_3RD_PERSON_DISABLED 0
@MENUS_VR_SABER_3RD_PERSON_MANUAL 1
@MENUS_VR_SABER_3RD_PERSON_AUTO 2
}
rect 305 291 300 20
textalign ITEM_ALIGN_RIGHT
textalignx 151
textaligny -2
font 2
textscale 0.8
forecolor 1 1 1 1
visible 0
// appearance_slot 1
descText @MENUS_VR_SABER_3RD_PERSON_DESC
action
{
play sound/interface/button1
}
mouseenter
{
show highlight7
}
mouseexit
{
hide highlight7
}
}
//----------------------------------------------------------------------------------------------