Skip to content

Commit

Permalink
various UI settings menu improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomenor committed Nov 12, 2021
1 parent 99dbc5a commit 50a6491
Show file tree
Hide file tree
Showing 8 changed files with 1,766 additions and 680 deletions.
92 changes: 89 additions & 3 deletions code/ui/ui_atoms.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,17 @@ void UI_LoadMenuText()
menu_normal_text[MNT_BROWSER_MOD] = "MOD";
menu_normal_text[MNT_BROWSER_BOTS] = "BOTS";
menu_normal_text[MNT_BROWSER_SCAN_PROGRESS] = "Scanning %d of %d Servers...";
menu_normal_text[MNT_VIDEO_LOW_QUALITY] = "LOW QUALITY";
menu_normal_text[MNT_VIDEO_MEDIUM_QUALITY] = "MEDIUM QUALITY";
menu_normal_text[MNT_VIDEO_HIGHEST_QUALITY] = "HIGHEST QUALITY";
menu_normal_text[MNT_VIDEO_RENDERER_OPENGL1] = "OPENGL1";
menu_normal_text[MNT_VIDEO_RENDERER_OPENGL2] = "OPENGL2";
menu_normal_text[MNT_VIDEO_2X] = "2X";
menu_normal_text[MNT_VIDEO_4X] = "4X";
menu_normal_text[MNT_VIDEO_8X] = "8X";
menu_normal_text[MNT_VIDEO_16X] = "16X";
menu_normal_text[MNT_ALTSWAP_STANDARD] = "STANDARD";
menu_normal_text[MNT_ALTSWAP_SWAPPED] = "SWAPPED";
menu_normal_text[MNT_ALTSWAP_AUTO] = "AUTO";
menu_normal_text[MNT_ALTSWAP_CUSTOM] = "CUSTOM";

Expand All @@ -2086,6 +2097,10 @@ void UI_LoadMenuText()
menu_normal_text[MNT_BROWSER_BOTS_AND_HUMANS] = "BOTS ODER MENSCHEN";
menu_normal_text[MNT_BROWSER_MOD] = "MODIFIKATION";
menu_normal_text[MNT_BROWSER_SCAN_PROGRESS] = "Scannen von %d von %d Servern...";
menu_normal_text[MNT_VIDEO_LOW_QUALITY] = "GERINGE QUALITÄT";
menu_normal_text[MNT_VIDEO_MEDIUM_QUALITY] = "MITTLERE QUALITÄT";
menu_normal_text[MNT_VIDEO_HIGHEST_QUALITY] = "HÖCHSTE QUALITÄT";
menu_normal_text[MNT_ALTSWAP_SWAPPED] = "INVERTIERT";
menu_normal_text[MNT_ALTSWAP_AUTO] = "AUTOMATISCH";
menu_normal_text[MNT_ALTSWAP_CUSTOM] = "BENUTZER";

Expand Down Expand Up @@ -2117,6 +2132,11 @@ void UI_LoadMenuText()
menu_normal_text[MNT_BROWSER_BOTS_AND_HUMANS] = "BOTS OU HUMAINS";
menu_normal_text[MNT_BROWSER_MOD] = "MODIF.";
menu_normal_text[MNT_BROWSER_SCAN_PROGRESS] = "Analyse de %d des %d serveurs...";
menu_normal_text[MNT_VIDEO_LOW_QUALITY] = "BASSE QUALITÉ";
menu_normal_text[MNT_VIDEO_MEDIUM_QUALITY] = "QUALITÉ MOYENNE";
menu_normal_text[MNT_VIDEO_HIGHEST_QUALITY] = "MEILLEURE QUALITÉ";
menu_normal_text[MNT_ALTSWAP_STANDARD] = "LA NORME";
menu_normal_text[MNT_ALTSWAP_SWAPPED] = "INVERSÉ";
menu_normal_text[MNT_ALTSWAP_AUTO] = "AUTO";
menu_normal_text[MNT_ALTSWAP_CUSTOM] = "SUR MESURE";
}
Expand Down Expand Up @@ -2253,7 +2273,30 @@ void UI_LoadButtonText()
menu_button_text[MBT_CENTERHUD][1] = "MOVE HUD TOWARDS CENTER OF SCREEN";
menu_button_text[MBT_BROWSER_PLAYERTYPE][0] = "PLAYER TYPE";
menu_button_text[MBT_BROWSER_PLAYERTYPE][1] = "FILTER BY AMOUNT OF PLAYERS ON SERVER";

menu_button_text[MBT_SOUND_OPENAL][0] = "OPENAL";
menu_button_text[MBT_SOUND_OPENAL][1] = "OPENAL SOUND ON/OFF.";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][0] = "OVERALL VOLUME";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][1] = "VOLUME FOR ALL IN-GAME AUDIO.";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][0] = "RAW MOUSE";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][1] = "RAW MOUSE INPUT (ON/OFF)";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][0] = "LIGHTING LEVEL";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][1] = "ADJUST OVERALL LIGHTING INTENSITY";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][0] = "LIGHTING CONTRAST";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][1] = "ADJUST MAXIMUM LIGHTING INTENSITY";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][0] = "APPLY";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][1] = "APPLY LIGHTING CHANGES";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][0] = "RESET";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][1] = "RESET LIGHTING CHANGES";
menu_button_text[MBT_VIDEO_RENDERER][0] = "RENDERER";
menu_button_text[MBT_VIDEO_RENDERER][1] = "SELECT RENDERER VERSION";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][0] = "WINDOW SIZE";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][1] = "DISPLAY SIZE IN WINDOWED MODE";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][0] = "ANISOTROPIC FILTERING";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][1] = "ANISOTROPIC FILTERING LEVEL";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][0] = "ANTI ALIASING";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][1] = "MULTISAMPLE ANTI ALIASING LEVEL";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][0] = "VERTICAL SYNC";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][1] = "TURN VERTICAL SYNC ON OR OFF";
menu_button_text[MBT_ALTSWAP_CONTROL][0] = "ALT FIRE SWAPPING";
menu_button_text[MBT_ALTSWAP_CONTROL][1] = "SELECT ALT FIRE BUTTON SWAPPING MODE";
menu_button_text[MBT_ALTSWAP_EDIT][0] = "EDIT";
Expand Down Expand Up @@ -2297,7 +2340,28 @@ void UI_LoadButtonText()
menu_button_text[MBT_CENTERHUD][1] = "HUD ZUR MITTE DES BILDSCHIRMS VERSCHIEBEN";
menu_button_text[MBT_BROWSER_PLAYERTYPE][0] = "SPIELERTYP";
menu_button_text[MBT_BROWSER_PLAYERTYPE][1] = "FILTER NACH ANZAHL DER SPIELER AUF DEM SERVER";

menu_button_text[MBT_SOUND_OPENAL][1] = "OPENAL-SOUND EIN/AUS";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][0] = "GESAMTLAUTSTÄRKE";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][1] = "LAUTSTÄRKE FÜR ALLE IN-GAME-AUDIO.";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][0] = "ROHE MAUS";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][1] = "ROHE MAUSEINGABE (EIN/AUS)";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][0] = "BELEUCHTUNGSNIVEAU";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][1] = "GESAMTLICHTINTENSITÄT EINSTELLEN";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][0] = "BELEUCHTUNGSKONTRAST";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][1] = "MAXIMALE BELEUCHTUNGSINTENSITÄT EINSTELLEN";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][0] = "ANWENDEN";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][1] = "ÄNDERUNGEN DER BELEUCHTUNG ANWENDEN";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][0] = "ZURÜCKSETZEN";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][1] = "BELEUCHTUNGSÄNDERUNGEN ZURÜCKSETZEN";
menu_button_text[MBT_VIDEO_RENDERER][1] = "RENDERER-VERSION AUSWÄHLEN";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][0] = "FENSTERGRÖSSE";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][1] = "ANZEIGEGRÖSSE IM FENSTERMODUS";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][0] = "ANISOTROPIC-FILTER";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][1] = "ANISOTROPISCHE FILTERUNGSSTUFE";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][0] = "ANTI ALIASING";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][1] = "MULTISAMPLE-ANTIALIASING-STUFE";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][0] = "VERTIKALE SYNC";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][1] = "VERTIKALE SYNCHRONISIERUNG EIN- ODER AUSSCHALTEN";
menu_button_text[MBT_ALTSWAP_CONTROL][0] = "ALT FEUER WECHSELN";
menu_button_text[MBT_ALTSWAP_CONTROL][1] = "MODUS FÜR DAS ALTERNATIVE FEUER AUSWÄHLEN";
menu_button_text[MBT_ALTSWAP_EDIT][0] = "BEARBEITEN";
Expand Down Expand Up @@ -2352,7 +2416,29 @@ void UI_LoadButtonText()
menu_button_text[MBT_CENTERHUD][1] = "DÉPLACER LE HUD VERS LE CENTRE DE L'ÉCRAN";
menu_button_text[MBT_BROWSER_PLAYERTYPE][0] = "TYPE DE JOUEUR";
menu_button_text[MBT_BROWSER_PLAYERTYPE][1] = "FILTREZ PAR QUANTITÉ DE JOUEURS SUR SERVEUR";

menu_button_text[MBT_SOUND_OPENAL][1] = "SON OPENAL ON/OFF";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][0] = "VOLUME GLOBAL";
menu_button_text[MBT_SOUND_OVERALL_VOLUME][1] = "VOLUME POUR TOUS LES AUDIO DU JEU.";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][0] = "SOURIS RAW";
menu_button_text[MBT_CONTROLS_RAW_MOUSE][1] = "ENTREE RAW SOURIS (ON/OFF)";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][0] = "NIVEAU D'ÉCLAIRAGE";
menu_button_text[MBT_VIDEO_LIGHTING_LEVEL][1] = "AJUSTER L'INTENSITÉ DE L'ÉCLAIRAGE GÉNÉRAL";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][0] = "CONTRASTE D'ÉCLAIRAGE";
menu_button_text[MBT_VIDEO_LIGHTING_CONTRAST][1] = "AJUSTER L'INTENSITÉ MAXIMALE DE L'ÉCLAIRAGE";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][0] = "APPLIQUER";
menu_button_text[MBT_VIDEO_LIGHTING_APPLY][1] = "APPLIQUER DES CHANGEMENTS D'ÉCLAIRAGE";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][0] = "RÉINITIALISER";
menu_button_text[MBT_VIDEO_LIGHTING_RESET][1] = "RÉINITIALISER LES CHANGEMENTS D'ÉCLAIRAGE";
menu_button_text[MBT_VIDEO_RENDERER][0] = "RENDU";
menu_button_text[MBT_VIDEO_RENDERER][1] = "SÉLECTIONNER LA VERSION DU RENDU";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][0] = "TAILLE DE LA FENÊTRE";
menu_button_text[MBT_VIDEO_WINDOW_SIZE][1] = "TAILLE D'AFFICHAGE EN MODE FENÊTRE";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][0] = "FILTRAGE ANISOTROPE";
menu_button_text[MBT_VIDEO_ANISOTROPIC_LEVEL][1] = "NIVEAU DE FILTRAGE ANISOTROPE";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][0] = "ANTI CRÉNELAGE";
menu_button_text[MBT_VIDEO_ANTI_ALIASING][1] = "NIVEAU D'ANTICRÉNELAGE MULTI-ÉCHANTILLONS";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][0] = "SYNC VERTICAL";
menu_button_text[MBT_VIDEO_VERTICAL_SYNC][1] = "ACTIVER OU DÉSACTIVER LA SYNCHRONISATION VERTICALE";
menu_button_text[MBT_ALTSWAP_CONTROL][0] = "ÉCHANGE DE FEU ALT";
menu_button_text[MBT_ALTSWAP_CONTROL][1] = "SÉLECTIONNER LE MODE D'ÉCHANGE DU BOUTON ALT FIRE";
menu_button_text[MBT_ALTSWAP_EDIT][0] = "ÉDITER";
Expand Down
144 changes: 117 additions & 27 deletions code/ui/ui_controls2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@

#include "ui_local.h"

typedef struct {
qboolean supportFreeLook;
qboolean supportRawMouse;
qboolean supportMouseStrafe;
} controlsEngineConfig_t;

static controlsEngineConfig_t controlsEngineConfig;

/*
=================
UI_InitControlsEngineConfig
Load settings in the soundEngineConfig structure.
=================
*/
static void UI_InitControlsEngineConfig( void ) {
memset( &controlsEngineConfig, 0, sizeof( controlsEngineConfig ) );

if ( !VMExt_GVCommandInt( "ui_suppress_cl_freelook", 0 ) || trap_Cvar_VariableValue( "cl_freelook" ) < 1.0f ) {
controlsEngineConfig.supportFreeLook = qtrue;
}

// Currently only enable this if free look is suppressed, due to button space constraints.
if ( !controlsEngineConfig.supportFreeLook && VMExt_GVCommandInt( "ui_support_cmd_set_raw_mouse", 0 ) &&
VMExt_GVCommandInt( "ui_support_cmd_get_raw_mouse", 0 ) ) {
controlsEngineConfig.supportRawMouse = qtrue;
}

if ( !VMExt_GVCommandInt( "ui_skip_strafe", 0 ) ) {
controlsEngineConfig.supportMouseStrafe = qtrue;
}
}

/* ----------------------------------------------------------------------- */

// Alt Fire Button Swapping
Expand Down Expand Up @@ -208,17 +241,17 @@ static struct {
} altSwapCustomData;

static int altSwapCustom_WeaponValueNames[] = {
MNT_OFF,
MNT_ALTSWAP_STANDARD,
MNT_ALTSWAP_AUTO,
MNT_ON,
MNT_ALTSWAP_SWAPPED,
MNT_NONE
};

typedef enum {
// Order must match altSwapCustom_WeaponValueNames
ALTSWAP_WEAPONBUTTON_OFF,
ALTSWAP_WEAPONBUTTON_STANDARD,
ALTSWAP_WEAPONBUTTON_AUTO,
ALTSWAP_WEAPONBUTTON_ON,
ALTSWAP_WEAPONBUTTON_SWAPPED,
} altSwapCustom_WeaponValueIds_t;

/*
Expand Down Expand Up @@ -269,9 +302,9 @@ static void AltSwapCustom_LoadButtonValues( void ) {
if ( altSwapData.currentButtons[settingIndex] == 'a' ) {
altSwapCustomData.weapons[i].curvalue = ALTSWAP_WEAPONBUTTON_AUTO;
} else if ( altSwapData.currentButtons[settingIndex] == 's' ) {
altSwapCustomData.weapons[i].curvalue = ALTSWAP_WEAPONBUTTON_ON;
altSwapCustomData.weapons[i].curvalue = ALTSWAP_WEAPONBUTTON_SWAPPED;
} else {
altSwapCustomData.weapons[i].curvalue = ALTSWAP_WEAPONBUTTON_OFF;
altSwapCustomData.weapons[i].curvalue = ALTSWAP_WEAPONBUTTON_STANDARD;
}
}
}
Expand Down Expand Up @@ -311,7 +344,7 @@ static void AltSwapCustom_Event( void *ptr, int event ) {

if ( button->curvalue == ALTSWAP_WEAPONBUTTON_AUTO ) {
altSwapData.currentButtons[settingIndex] = 'a';
} else if ( button->curvalue == ALTSWAP_WEAPONBUTTON_ON ) {
} else if ( button->curvalue == ALTSWAP_WEAPONBUTTON_SWAPPED ) {
altSwapData.currentButtons[settingIndex] = 's';
} else {
altSwapData.currentButtons[settingIndex] = 'n';
Expand Down Expand Up @@ -839,6 +872,7 @@ typedef struct
menuaction_s lookdown;
menuaction_s mouselook;
menulist_s freelook;
menulist_s rawmouse;
menuaction_s centerview;
menuaction_s zoomview;
menuaction_s gesture;
Expand Down Expand Up @@ -1528,6 +1562,9 @@ static void Controls_GetConfig( void )
s_controls.joyenable.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "in_joystick" ) );
s_controls.joythreshold.curvalue = UI_ClampCvar( 0.05, 0.75, Controls_GetCvarValue( "joy_threshold" ) );
s_controls.freelook.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "cl_freelook" ) );
if ( controlsEngineConfig.supportRawMouse ) {
s_controls.rawmouse.curvalue = VMExt_GVCommandInt( "cmd_get_raw_mouse", 0 ) > 0 ? 1 : 0;
}
s_keyturnspeed_slider.curvalue = UI_ClampCvar( 1, 5, Controls_GetCvarValue( "cl_anglespeedkey" ) );
s_joyxbutton_box.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "joy_xbutton" ) );
s_joyybutton_box.curvalue = UI_ClampCvar( 0, 1, Controls_GetCvarValue( "joy_ybutton" ) );
Expand Down Expand Up @@ -1590,7 +1627,9 @@ static void Controls_SetConfig( void )
trap_Cvar_SetValue( "cg_autoswitch", s_controls.autoswitch.curvalue );
trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue );
trap_Cvar_SetValue( "joy_threshold", s_controls.joythreshold.curvalue );
trap_Cvar_SetValue( "cl_freelook", s_controls.freelook.curvalue );
if ( controlsEngineConfig.supportFreeLook ) {
trap_Cvar_SetValue( "cl_freelook", s_controls.freelook.curvalue );
}
trap_Cvar_SetValue( "cl_anglespeedkey", s_keyturnspeed_slider.curvalue );
trap_Cvar_SetValue( "joy_xbutton", s_joyxbutton_box.curvalue );
trap_Cvar_SetValue( "joy_ybutton", s_joyybutton_box.curvalue );
Expand Down Expand Up @@ -2408,6 +2447,14 @@ static void SetupActionButtons_Init(int section)
break;
}

if ( !controlsEngineConfig.supportFreeLook && g_section == C_LOOK && controlptr[i] == &s_look_mouselook_action ) {
continue;
}

if ( !controlsEngineConfig.supportMouseStrafe && g_section == C_MOVE && controlptr[i] == &s_move_sidestep_action ) {
continue;
}

((menuaction_s*)controlptr[i])->generic.x = current_menu->listX;
((menuaction_s*)controlptr[i])->generic.y = y;
((menuaction_s*)controlptr[i])->textX = 5;
Expand Down Expand Up @@ -3161,7 +3208,9 @@ static void ControlsMove_MenuInit( void )
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_run_action);
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_stepleft_action);
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_stepright_action);
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_sidestep_action);
if ( controlsEngineConfig.supportMouseStrafe ) {
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_sidestep_action);
}
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_moveup_action);
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_move_movedown_action);
Menu_AddItem( &s_controlsmove_menu, ( void * )&s_attack_waiting_action);
Expand Down Expand Up @@ -3245,6 +3294,8 @@ ControlsAttackLook_MenuInit
*/
static void ControlsAttackLook_MenuInit( void )
{
UI_InitControlsEngineConfig();

s_controlslook_menu.nitems = 0;
s_controlslook_menu.wrapAround = qtrue;
s_controlslook_menu.draw = ControlsAttackLook_MenuDraw;
Expand Down Expand Up @@ -3362,7 +3413,9 @@ static void ControlsAttackLook_MenuInit( void )

Menu_AddItem( &s_controlslook_menu, ( void * )&s_look_lookup_action);
Menu_AddItem( &s_controlslook_menu, ( void * )&s_look_lookdown_action);
Menu_AddItem( &s_controlslook_menu, ( void * )&s_look_mouselook_action);
if ( controlsEngineConfig.supportFreeLook ) {
Menu_AddItem( &s_controlslook_menu, ( void * )&s_look_mouselook_action);
}
Menu_AddItem( &s_controlslook_menu, ( void * )&s_look_centerview_action);
Menu_AddItem( &s_controlslook_menu, ( void * )&s_zoomview_action);
Menu_AddItem( &s_controlslook_menu, ( void * )&s_attack_waiting_action);
Expand Down Expand Up @@ -3476,6 +3529,16 @@ void UI_ControlsMouseJoyStickMenu_Cache(void)
s_joystick_mouse.mouse2 = trap_R_RegisterShaderNoMip(PIC_MOUSE2);
}

/*
=================
Controls_RawMouseEvent
=================
*/
static void Controls_RawMouseEvent (void* ptr, int event)
{
VMExt_GVCommandInt( va( "cmd_set_raw_mouse %i", s_controls.rawmouse.curvalue ), 0 );
}

/*
=================
ControlsMouseJoyStick_MenuInit
Expand All @@ -3485,6 +3548,8 @@ static void ControlsMouseJoyStick_MenuInit( void )
{
int x,y;

UI_InitControlsEngineConfig();

UI_ControlsMouseJoyStickMenu_Cache();

s_controlsmouse_menu.nitems = 0;
Expand All @@ -3508,22 +3573,42 @@ static void ControlsMouseJoyStick_MenuInit( void )
s_controls_mouse.textcolor2 = CT_LTGOLD1;

x = 250;
y = 193;

s_controls.freelook.generic.type = MTYPE_SPINCONTROL;
s_controls.freelook.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_controls.freelook.generic.x = x;
s_controls.freelook.generic.y = y;
s_controls.freelook.generic.id = ID_FREELOOK;
s_controls.freelook.generic.callback = Controls_MenuEvent;
s_controls.freelook.textEnum = MBT_MOUSEFREELOOK;
s_controls.freelook.textcolor = CT_BLACK;
s_controls.freelook.textcolor2 = CT_WHITE;
s_controls.freelook.color = CT_DKPURPLE1;
s_controls.freelook.color2 = CT_LTPURPLE1;
s_controls.freelook.textX = MENU_BUTTON_TEXT_X;
s_controls.freelook.textY = MENU_BUTTON_TEXT_Y;
s_controls.freelook.listnames = s_OffOnNone_Names;
y = 171;

if ( controlsEngineConfig.supportFreeLook ) {
y += 22;
s_controls.freelook.generic.type = MTYPE_SPINCONTROL;
s_controls.freelook.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_controls.freelook.generic.x = x;
s_controls.freelook.generic.y = y;
s_controls.freelook.generic.id = ID_FREELOOK;
s_controls.freelook.generic.callback = Controls_MenuEvent;
s_controls.freelook.textEnum = MBT_MOUSEFREELOOK;
s_controls.freelook.textcolor = CT_BLACK;
s_controls.freelook.textcolor2 = CT_WHITE;
s_controls.freelook.color = CT_DKPURPLE1;
s_controls.freelook.color2 = CT_LTPURPLE1;
s_controls.freelook.textX = MENU_BUTTON_TEXT_X;
s_controls.freelook.textY = MENU_BUTTON_TEXT_Y;
s_controls.freelook.listnames = s_OffOnNone_Names;
}

if ( controlsEngineConfig.supportRawMouse ) {
y += 22;
s_controls.rawmouse.generic.type = MTYPE_SPINCONTROL;
s_controls.rawmouse.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;
s_controls.rawmouse.generic.x = x;
s_controls.rawmouse.generic.y = y;
s_controls.rawmouse.generic.callback = Controls_RawMouseEvent;
s_controls.rawmouse.textEnum = MBT_CONTROLS_RAW_MOUSE;
s_controls.rawmouse.textcolor = CT_BLACK;
s_controls.rawmouse.textcolor2 = CT_WHITE;
s_controls.rawmouse.color = CT_DKPURPLE1;
s_controls.rawmouse.color2 = CT_LTPURPLE1;
s_controls.rawmouse.textX = MENU_BUTTON_TEXT_X;
s_controls.rawmouse.textY = MENU_BUTTON_TEXT_Y;
s_controls.rawmouse.listnames = s_OffOnNone_Names;
}

y += 22;
s_controls.sensitivity.generic.type = MTYPE_SLIDER;
Expand Down Expand Up @@ -3690,7 +3775,12 @@ static void ControlsMouseJoyStick_MenuInit( void )
s_joyybutton_box.listnames = s_OffOnNone_Names;


Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.freelook);
if ( controlsEngineConfig.supportFreeLook ) {
Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.freelook);
}
if ( controlsEngineConfig.supportRawMouse ) {
Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.rawmouse);
}
Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.sensitivity);
Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.invertmouse);
Menu_AddItem( &s_controlsmouse_menu, ( void * )&s_controls.smoothmouse);
Expand Down
Loading

0 comments on commit 50a6491

Please sign in to comment.