Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 46 additions & 45 deletions Client/core/CClientVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,51 +321,52 @@ void CClientVariables::LoadDefaults()
DEFAULT("server_can_flash_window", true); // allow server to flash the window
DEFAULT("allow_tray_notifications", true); // allow scripts to create tray balloon notifications
DEFAULT("text_scale", 1.0f); // text scale
DEFAULT("invert_mouse", false); // mouse inverting
DEFAULT("fly_with_mouse", false); // flying with mouse controls
DEFAULT("steer_with_mouse", false); // steering with mouse controls
DEFAULT("classic_controls", false); // classic/standard controls
DEFAULT("mastervolume", 1.0f); // master volume
DEFAULT("mtavolume", 1.0f); // custom sound's volume
DEFAULT("voicevolume", 1.0f); // voice chat output volume
DEFAULT("mapalpha", 155); // player map alpha
DEFAULT("mapimage", 0); // player map image
DEFAULT("browser_speed", 1); // Browser speed
DEFAULT("single_download", 0); // Single connection for downloads
DEFAULT("packet_tag", 0); // Tag network packets
DEFAULT("progress_animation", 1); // Progress spinner at the bottom of the screen
DEFAULT("update_build_type", 0); // 0-stable 1-test 2-nightly
DEFAULT("update_auto_install", 1); // 0-off 1-on
DEFAULT("volumetric_shadows", 0); // Enable volumetric shadows
DEFAULT("aspect_ratio", 0); // Display aspect ratio
DEFAULT("hud_match_aspect_ratio", 1); // GTA HUD should match the display aspect ratio
DEFAULT("anisotropic", 0); // Anisotropic filtering
DEFAULT("grass", 1); // Enable grass
DEFAULT("heat_haze", 1); // Enable heat haze
DEFAULT("tyre_smoke_enabled", 1); // Enable tyre smoke
DEFAULT("high_detail_vehicles", 0); // Disable rendering high detail vehicles all the time
DEFAULT("high_detail_peds", 0); // Disable rendering high detail peds all the time
DEFAULT("blur", 1); // Enable blur
DEFAULT("corona_reflections", 0); // Disable corona rain reflections
DEFAULT("dynamic_ped_shadows", 0); // Disable dynamic ped shadows
DEFAULT("fast_clothes_loading", 1); // 0-off 1-auto 2-on
DEFAULT("allow_screen_upload", 1); // 0-off 1-on
DEFAULT("allow_external_sounds", 1); // 0-off 1-on
DEFAULT("max_clientscript_log_kb", 5000); // Max size in KB (0-No limit)
DEFAULT("display_fullscreen_style", 0); // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
DEFAULT("display_windowed", 0); // 0-off 1-on
DEFAULT("multimon_fullscreen_minimize", 1); // 0-off 1-on
DEFAULT("borderless_gamma_power", 0.95f); // Gamma exponent applied to windowed gamma ramp (1.0 = unchanged)
DEFAULT("borderless_brightness_scale", 1.03f); // Brightness multiplier for windowed gamma ramp (1.0 = unchanged)
DEFAULT("borderless_contrast_scale", 1.0f); // Contrast multiplier for borderless presentation (1.0 = unchanged)
DEFAULT("borderless_saturation_scale", 1.0f); // Saturation multiplier for borderless presentation (1.0 = unchanged)
DEFAULT("borderless_enable_srgb", false); // Enable sRGB correction when running borderless
DEFAULT("borderless_gamma_enabled", false); // Apply gamma adjustment while borderless tuning active
DEFAULT("borderless_brightness_enabled", false); // Apply brightness adjustment while borderless tuning active
DEFAULT("borderless_contrast_enabled", false); // Apply contrast adjustment while borderless tuning active
DEFAULT("borderless_saturation_enabled", false); // Apply saturation adjustment while borderless tuning active
DEFAULT("borderless_apply_windowed", false); // Apply display adjustments while windowed/borderless
DEFAULT("borderless_apply_fullscreen", false); // Apply display adjustments while in exclusive fullscreen
DEFAULT("invert_mouse", false); // mouse inverting (vertical, kept the naming as it's due to backwards compatibility)
DEFAULT("invert_mouse_horizontal", true); // mouse inverting (horizontal)
DEFAULT("fly_with_mouse", false); // flying with mouse controls
DEFAULT("steer_with_mouse", false); // steering with mouse controls
DEFAULT("classic_controls", false); // classic/standard controls
DEFAULT("mastervolume", 1.0f); // master volume
DEFAULT("mtavolume", 1.0f); // custom sound's volume
DEFAULT("voicevolume", 1.0f); // voice chat output volume
DEFAULT("mapalpha", 155); // player map alpha
DEFAULT("mapimage", 0); // player map image
DEFAULT("browser_speed", 1); // Browser speed
DEFAULT("single_download", 0); // Single connection for downloads
DEFAULT("packet_tag", 0); // Tag network packets
DEFAULT("progress_animation", 1); // Progress spinner at the bottom of the screen
DEFAULT("update_build_type", 0); // 0-stable 1-test 2-nightly
DEFAULT("update_auto_install", 1); // 0-off 1-on
DEFAULT("volumetric_shadows", 0); // Enable volumetric shadows
DEFAULT("aspect_ratio", 0); // Display aspect ratio
DEFAULT("hud_match_aspect_ratio", 1); // GTA HUD should match the display aspect ratio
DEFAULT("anisotropic", 0); // Anisotropic filtering
DEFAULT("grass", 1); // Enable grass
DEFAULT("heat_haze", 1); // Enable heat haze
DEFAULT("tyre_smoke_enabled", 1); // Enable tyre smoke
DEFAULT("high_detail_vehicles", 0); // Disable rendering high detail vehicles all the time
DEFAULT("high_detail_peds", 0); // Disable rendering high detail peds all the time
DEFAULT("blur", 1); // Enable blur
DEFAULT("corona_reflections", 0); // Disable corona rain reflections
DEFAULT("dynamic_ped_shadows", 0); // Disable dynamic ped shadows
DEFAULT("fast_clothes_loading", 1); // 0-off 1-auto 2-on
DEFAULT("allow_screen_upload", 1); // 0-off 1-on
DEFAULT("allow_external_sounds", 1); // 0-off 1-on
DEFAULT("max_clientscript_log_kb", 5000); // Max size in KB (0-No limit)
DEFAULT("display_fullscreen_style", 0); // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
DEFAULT("display_windowed", 0); // 0-off 1-on
DEFAULT("multimon_fullscreen_minimize", 1); // 0-off 1-on
DEFAULT("borderless_gamma_power", 0.95f); // Gamma exponent applied to windowed gamma ramp (1.0 = unchanged)
DEFAULT("borderless_brightness_scale", 1.03f); // Brightness multiplier for windowed gamma ramp (1.0 = unchanged)
DEFAULT("borderless_contrast_scale", 1.0f); // Contrast multiplier for borderless presentation (1.0 = unchanged)
DEFAULT("borderless_saturation_scale", 1.0f); // Saturation multiplier for borderless presentation (1.0 = unchanged)
DEFAULT("borderless_enable_srgb", false); // Enable sRGB correction when running borderless
DEFAULT("borderless_gamma_enabled", false); // Apply gamma adjustment while borderless tuning active
DEFAULT("borderless_brightness_enabled", false); // Apply brightness adjustment while borderless tuning active
DEFAULT("borderless_contrast_enabled", false); // Apply contrast adjustment while borderless tuning active
DEFAULT("borderless_saturation_enabled", false); // Apply saturation adjustment while borderless tuning active
DEFAULT("borderless_apply_windowed", false); // Apply display adjustments while windowed/borderless
DEFAULT("borderless_apply_fullscreen", false); // Apply display adjustments while in exclusive fullscreen

if (Exists("borderless_enable_srgb"))
{
Expand Down
4 changes: 3 additions & 1 deletion Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,9 @@ void CCore::ApplyGameSettings()
CGameSettings* pGameSettings = m_pGame->GetSettings();

CVARS_GET("invert_mouse", bVal);
pController->SetMouseInverted(bVal);
pController->SetMouseInvertedVertical(bVal);
CVARS_GET("invert_mouse_horizontal", bVal);
pController->SetMouseInvertedHorizontal(bVal);
CVARS_GET("fly_with_mouse", bVal);
pController->SetFlyWithMouse(bVal);
CVARS_GET("steer_with_mouse", bVal);
Expand Down
16 changes: 14 additions & 2 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ void CSettings::ResetGuiPointers()

m_pControlsMouseLabel = NULL;
m_pInvertMouse = NULL;
m_pInvertMouseHorizontal = NULL;
m_pSteerWithMouse = NULL;
m_pFlyWithMouse = NULL;
m_pLabelMouseSensitivity = NULL;
Expand Down Expand Up @@ -606,6 +607,10 @@ void CSettings::CreateGUI()
m_pInvertMouse->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY));
m_pInvertMouse->AutoSize(NULL, 20.0f);

m_pInvertMouseHorizontal = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabControls, _("Invert mouse horizontally"), true));
m_pInvertMouseHorizontal->SetPosition(CVector2D(vecTemp.fX + 170.0f, vecTemp.fY));
m_pInvertMouseHorizontal->AutoSize(NULL, 20.0f);

m_pSteerWithMouse = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabControls, _("Steer with mouse"), true));
m_pSteerWithMouse->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 16.0f));
m_pSteerWithMouse->AutoSize(NULL, 20.0f);
Expand Down Expand Up @@ -2836,6 +2841,7 @@ bool CSettings::OnControlsDefaultClick(CGUIElement* pElement)
// Load the default settings
GetJoystickManager()->SetDefaults();
CVARS_SET("invert_mouse", false);
CVARS_SET("invert_mouse_horizontal", false);
CVARS_SET("fly_with_mouse", false);
CVARS_SET("steer_with_mouse", false);
CVARS_SET("classic_controls", false);
Expand All @@ -2844,7 +2850,8 @@ bool CSettings::OnControlsDefaultClick(CGUIElement* pElement)
gameSettings->SetMouseSensitivity(0.5f);

// Set game vars
pController->SetMouseInverted(CVARS_GET_VALUE<bool>("invert_mouse"));
pController->SetMouseInvertedVertical(CVARS_GET_VALUE<bool>("invert_mouse"));
pController->SetMouseInvertedHorizontal(CVARS_GET_VALUE<bool>("invert_mouse_horizontal"));
pController->SetFlyWithMouse(CVARS_GET_VALUE<bool>("fly_with_mouse"));
pController->SetSteerWithMouse(CVARS_GET_VALUE<bool>("steer_with_mouse"));
pController->SetClassicControls(CVARS_GET_VALUE<bool>("classic_controls"));
Expand All @@ -2853,6 +2860,7 @@ bool CSettings::OnControlsDefaultClick(CGUIElement* pElement)
// Update the GUI
UpdateJoypadTab();
m_pInvertMouse->SetSelected(CVARS_GET_VALUE<bool>("invert_mouse"));
m_pInvertMouseHorizontal->SetSelected(CVARS_GET_VALUE<bool>("invert_mouse_horizontal"));
m_pFlyWithMouse->SetSelected(CVARS_GET_VALUE<bool>("fly_with_mouse"));
m_pSteerWithMouse->SetSelected(CVARS_GET_VALUE<bool>("steer_with_mouse"));
m_pStandardControls->SetSelected(!CVARS_GET_VALUE<bool>("classic_controls"));
Expand Down Expand Up @@ -3950,6 +3958,8 @@ void CSettings::LoadData()
// Controls
CVARS_GET("invert_mouse", bVar);
m_pInvertMouse->SetSelected(bVar);
CVARS_GET("invert_mouse_horizontal", bVar);
m_pInvertMouseHorizontal->SetSelected(bVar);
CVARS_GET("steer_with_mouse", bVar);
m_pSteerWithMouse->SetSelected(bVar);
CVARS_GET("fly_with_mouse", bVar);
Expand Down Expand Up @@ -4285,7 +4295,9 @@ void CSettings::SaveData()
// Very hacky
CControllerConfigManager* pController = g_pCore->GetGame()->GetControllerConfigManager();
CVARS_SET("invert_mouse", m_pInvertMouse->GetSelected());
pController->SetMouseInverted(m_pInvertMouse->GetSelected());
pController->SetMouseInvertedVertical(m_pInvertMouse->GetSelected());
CVARS_SET("invert_mouse_horizontal", m_pInvertMouseHorizontal->GetSelected());
pController->SetMouseInvertedHorizontal(m_pInvertMouseHorizontal->GetSelected());
CVARS_SET("steer_with_mouse", m_pSteerWithMouse->GetSelected());
pController->SetSteerWithMouse(m_pSteerWithMouse->GetSelected());
CVARS_SET("fly_with_mouse", m_pFlyWithMouse->GetSelected());
Expand Down
1 change: 1 addition & 0 deletions Client/core/CSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class CSettings

CGUILabel* m_pControlsMouseLabel;
CGUICheckBox* m_pInvertMouse;
CGUICheckBox* m_pInvertMouseHorizontal;
CGUICheckBox* m_pSteerWithMouse;
CGUICheckBox* m_pFlyWithMouse;
CGUILabel* m_pLabelMouseSensitivity;
Expand Down
10 changes: 8 additions & 2 deletions Client/game_sa/CControllerConfigManagerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#define VAR_InputType ((BYTE*)(0xB6EC2E))
#define VAR_MouseInverted ((BYTE*)(0xBA6745))
#define VAR_MouseInvertedHorizontal ((BYTE*)(0xBA6744))
#define VAR_FlyWithMouse ((BYTE*)(0xC1CC03))
#define VAR_SteerWithMouse ((BYTE*)(0xC1CC02))
#define VAR_VerticalAimSensitivity ((float*)(0xB6EC18))
Expand Down Expand Up @@ -99,9 +100,14 @@ void CControllerConfigManagerSA::SetClassicControls(bool bClassicControls)
MemPutFast<unsigned char>(VAR_InputType, bClassicControls ? 0 : 1);
}

void CControllerConfigManagerSA::SetMouseInverted(bool bInverted)
void CControllerConfigManagerSA::SetMouseInvertedVertical(bool bInvertedVertical)
{
MemPutFast<BYTE>(VAR_MouseInverted, (bInverted) ? 0 : 1);
MemPutFast<BYTE>(VAR_MouseInverted, (bInvertedVertical) ? 0 : 1);
}

void CControllerConfigManagerSA::SetMouseInvertedHorizontal(bool bInvertedHorizontal)
{
MemPutFast<BYTE>(VAR_MouseInvertedHorizontal, (bInvertedHorizontal) ? 0 : 1);
}

void CControllerConfigManagerSA::SetFlyWithMouse(bool bFlyWithMouse)
Expand Down
3 changes: 2 additions & 1 deletion Client/game_sa/CControllerConfigManagerSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class CControllerConfigManagerSA : public CControllerConfigManager
int GetNumOfSettingsForAction(eControllerAction action);
void ClearSettingsAssociatedWithAction(eControllerAction action, eControllerType controllerType);
void SetClassicControls(bool bClassicControls);
void SetMouseInverted(bool bInverted);
void SetMouseInvertedVertical(bool bInvertedVertical);
void SetMouseInvertedHorizontal(bool bInvertedHorizontal);
void SetFlyWithMouse(bool bFlyWithMouse);
void SetSteerWithMouse(bool bSteerWithMouse);
void SuspendSteerAndFlyWithMouse(bool bSuspend);
Expand Down
3 changes: 2 additions & 1 deletion Client/sdk/game/CControllerConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class CControllerConfigManager
virtual void SetControllerKeyAssociatedWithAction(eControllerAction action, int iKey, eControllerType controllerType) = 0;
virtual int GetControllerKeyAssociatedWithAction(eControllerAction action, eControllerType controllerType) = 0;
virtual void SetClassicControls(bool bClassicControls) = 0;
virtual void SetMouseInverted(bool bInverted) = 0;
virtual void SetMouseInvertedVertical(bool bInvertedVertical) = 0;
virtual void SetMouseInvertedHorizontal(bool bInvertedHorizontal) = 0;
virtual void SetFlyWithMouse(bool bFlyWithMouse) = 0;
virtual void SetSteerWithMouse(bool bSteerWithMouse) = 0;
virtual void SuspendSteerAndFlyWithMouse(bool bSuspend) = 0;
Expand Down
Loading