Move snapturn setting from comfort to controls menu

This commit is contained in:
Petr Bartos 2022-03-10 17:11:25 +01:00
parent 9097e00f5d
commit d77c7adf77
2 changed files with 38 additions and 38 deletions

View file

@ -41,13 +41,12 @@ COMFORT OPTIONS MENU
#define ID_COMFORTVIGNETTE 127
#define ID_HEIGHTADJUST 128
#define ID_SNAPTURN 129
#define ID_ROLLHIT 130
#define ID_HAPTICINTENSITY 131
#define ID_HUDDEPTH 132
#define ID_HUDYOFFSET 133
#define ID_ROLLHIT 129
#define ID_HAPTICINTENSITY 130
#define ID_HUDDEPTH 131
#define ID_HUDYOFFSET 132
#define ID_BACK 134
#define ID_BACK 133
#define NUM_HUDDEPTH 6
@ -61,7 +60,6 @@ typedef struct {
menuslider_s comfortvignette;
menuslider_s heightadjust;
menulist_s snapturn;
menuradiobutton_s rollhit;
menuslider_s hapticintensity;
menulist_s huddepth;
@ -76,7 +74,6 @@ static comfort_t s_comfort;
static void Comfort_SetMenuItems( void ) {
s_comfort.comfortvignette.curvalue = trap_Cvar_VariableValue( "vr_comfortVignette" );
s_comfort.heightadjust.curvalue = trap_Cvar_VariableValue( "vr_heightAdjust" );
s_comfort.snapturn.curvalue = (int)trap_Cvar_VariableValue( "vr_snapturn" ) / 45;
s_comfort.rollhit.curvalue = trap_Cvar_VariableValue( "vr_rollWhenHit" ) != 0;
s_comfort.hapticintensity.curvalue = trap_Cvar_VariableValue( "vr_hapticIntensity" );
s_comfort.huddepth.curvalue = (int)trap_Cvar_VariableValue( "vr_hudDepth" ) % NUM_HUDDEPTH;
@ -98,10 +95,6 @@ static void Comfort_MenuEvent( void* ptr, int notification ) {
trap_Cvar_SetValue( "vr_heightAdjust", s_comfort.heightadjust.curvalue );
break;
case ID_SNAPTURN:
trap_Cvar_SetValue( "vr_snapturn", s_comfort.snapturn.curvalue * 45 );
break;
case ID_ROLLHIT:
trap_Cvar_SetValue( "vr_rollWhenHit", s_comfort.rollhit.curvalue );
break;
@ -138,14 +131,6 @@ static void Comfort_MenuInit( void ) {
NULL
};
static const char *s_snapturn[] =
{
"Smooth Turning",
"45 Degrees",
"90 Degrees",
NULL
};
memset( &s_comfort, 0 ,sizeof(comfort_t) );
Comfort_Cache();
@ -176,7 +161,7 @@ static void Comfort_MenuInit( void ) {
s_comfort.framer.width = 256;
s_comfort.framer.height = 334;
y = 180;
y = 198;
s_comfort.comfortvignette.generic.type = MTYPE_SLIDER;
s_comfort.comfortvignette.generic.x = VR_X_POS;
s_comfort.comfortvignette.generic.y = y;
@ -198,17 +183,6 @@ static void Comfort_MenuInit( void ) {
s_comfort.heightadjust.minvalue = 0.0f;
s_comfort.heightadjust.maxvalue = 1.0f;
y += BIGCHAR_HEIGHT+2;
s_comfort.snapturn.generic.type = MTYPE_SPINCONTROL;
s_comfort.snapturn.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_comfort.snapturn.generic.x = VR_X_POS;
s_comfort.snapturn.generic.y = y;
s_comfort.snapturn.generic.name = "Turning Mode:";
s_comfort.snapturn.generic.callback = Comfort_MenuEvent;
s_comfort.snapturn.generic.id = ID_SNAPTURN;
s_comfort.snapturn.itemnames = s_snapturn;
s_comfort.snapturn.numitems = 3;
y += BIGCHAR_HEIGHT+2;
s_comfort.rollhit.generic.type = MTYPE_RADIOBUTTON;
s_comfort.rollhit.generic.name = "Roll When Hit:";
@ -268,7 +242,6 @@ static void Comfort_MenuInit( void ) {
Menu_AddItem( &s_comfort.menu, &s_comfort.comfortvignette );
Menu_AddItem( &s_comfort.menu, &s_comfort.heightadjust );
Menu_AddItem( &s_comfort.menu, &s_comfort.snapturn );
Menu_AddItem( &s_comfort.menu, &s_comfort.rollhit );
Menu_AddItem( &s_comfort.menu, &s_comfort.hapticintensity );
Menu_AddItem( &s_comfort.menu, &s_comfort.huddepth );

View file

@ -43,11 +43,12 @@ CONTROLS OPTIONS MENU
#define ID_SCOPE 128
#define ID_TWOHANDED 129
#define ID_DIRECTIONMODE 130
#define ID_RIGHTHANDED 131
#define ID_WEAPONPITCH 132
#define ID_ALTKEY 133
#define ID_SNAPTURN 131
#define ID_RIGHTHANDED 132
#define ID_WEAPONPITCH 133
#define ID_ALTKEY 134
#define ID_BACK 134
#define ID_BACK 135
#define NUM_DIRECTIONMODE 2
@ -63,6 +64,7 @@ typedef struct {
menuradiobutton_s scope;
menuradiobutton_s twohanded;
menulist_s directionmode;
menulist_s snapturn;
menuradiobutton_s righthanded;
menuslider_s weaponpitch;
menuradiobutton_s altkey;
@ -78,6 +80,7 @@ static void Controls3_SetMenuItems( void ) {
s_controls3.scope.curvalue = trap_Cvar_VariableValue( "vr_weaponScope" ) != 0;
s_controls3.twohanded.curvalue = trap_Cvar_VariableValue( "vr_twoHandedWeapons" ) != 0;
s_controls3.directionmode.curvalue = (int)trap_Cvar_VariableValue( "vr_directionMode" ) % NUM_DIRECTIONMODE;
s_controls3.snapturn.curvalue = (int)trap_Cvar_VariableValue( "vr_snapturn" ) / 45;
s_controls3.righthanded.curvalue = trap_Cvar_VariableValue( "vr_righthanded" ) != 0;
s_controls3.weaponpitch.curvalue = trap_Cvar_VariableValue( "vr_weaponPitch" ) + 25;
s_controls3.altkey.curvalue = trap_Cvar_VariableValue( "vr_altKeyEnabled" ) != 0;
@ -106,6 +109,10 @@ static void Controls3_MenuEvent( void* ptr, int notification ) {
trap_Cvar_SetValue( "vr_directionMode", s_controls3.directionmode.curvalue );
break;
case ID_SNAPTURN:
trap_Cvar_SetValue( "vr_snapturn", s_controls3.snapturn.curvalue * 45 );
break;
case ID_RIGHTHANDED:
trap_Cvar_SetValue( "vr_righthanded", s_controls3.righthanded.curvalue );
break;
@ -134,6 +141,14 @@ static void Controls3_MenuInit( void ) {
NULL
};
static const char *s_snapturn[] =
{
"Smooth Turning",
"45 Degrees",
"90 Degrees",
NULL
};
memset( &s_controls3, 0 ,sizeof(controls3_t) );
Controls3_Cache();
@ -164,7 +179,7 @@ static void Controls3_MenuInit( void ) {
s_controls3.framer.width = 256;
s_controls3.framer.height = 334;
y = 180;
y = 162;
s_controls3.autoswitch.generic.type = MTYPE_RADIOBUTTON;
s_controls3.autoswitch.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_controls3.autoswitch.generic.name = "Autoswitch Weapons:";
@ -202,6 +217,17 @@ static void Controls3_MenuInit( void ) {
s_controls3.directionmode.itemnames = s_directionmode;
s_controls3.directionmode.numitems = NUM_DIRECTIONMODE;
y += BIGCHAR_HEIGHT+2;
s_controls3.snapturn.generic.type = MTYPE_SPINCONTROL;
s_controls3.snapturn.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_controls3.snapturn.generic.x = VR_X_POS;
s_controls3.snapturn.generic.y = y;
s_controls3.snapturn.generic.name = "Turning Mode:";
s_controls3.snapturn.generic.callback = Controls3_MenuEvent;
s_controls3.snapturn.generic.id = ID_SNAPTURN;
s_controls3.snapturn.itemnames = s_snapturn;
s_controls3.snapturn.numitems = 3;
y += BIGCHAR_HEIGHT+2;
s_controls3.righthanded.generic.type = MTYPE_RADIOBUTTON;
s_controls3.righthanded.generic.name = "Right-Handed:";
@ -250,6 +276,7 @@ static void Controls3_MenuInit( void ) {
Menu_AddItem( &s_controls3.menu, &s_controls3.scope );
Menu_AddItem( &s_controls3.menu, &s_controls3.twohanded );
Menu_AddItem( &s_controls3.menu, &s_controls3.directionmode );
Menu_AddItem( &s_controls3.menu, &s_controls3.snapturn );
Menu_AddItem( &s_controls3.menu, &s_controls3.righthanded );
Menu_AddItem( &s_controls3.menu, &s_controls3.weaponpitch );
Menu_AddItem( &s_controls3.menu, &s_controls3.altkey );