1
0
mirror of synced 2025-02-17 10:58:36 +01:00

Adding persistence flag to disable saving strength adjustments.

This commit is contained in:
Adam Pooley 2020-07-01 00:56:37 +01:00
parent 98f2e258c9
commit 991f7074cc
2 changed files with 13 additions and 7 deletions

View File

@ -52,6 +52,8 @@ ResetFFBStrength=
; Step is the amount to adjust when increasing or decreasing per button where FFB strength is represented on
; a scale of 0-100.
StepFFBStrength=5
; Set to 1 if you want FFB strength adjustments to persist between loads, else 0.
EnableFFBStrengthPersistence=0
; Set to 1 if you want FFB strength adjustments text to speech over speaker
EnableFFBStrengthTextToSpeech=0

View File

@ -929,6 +929,7 @@ int IncreaseFFBStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseF
int DecreaseFFBStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("DecreaseFFBStrength"), NULL, settingsFilename);
int ResetFFBStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ResetFFBStrength"), NULL, settingsFilename);
int StepFFBStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("StepFFBStrength"), 5, settingsFilename);
int EnableFFBStrengthPersistence = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableFFBStrengthPersistence"), 0, settingsFilename);
int EnableFFBStrengthTextToSpeech = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableFFBStrengthTextToSpeech"), 0, settingsFilename);
extern void DefaultConfigValues();
@ -1948,14 +1949,17 @@ int WorkaroundToFixRumble(void* ptr)
void WritePersistentMaxForce()
{
if (AlternativeFFB == 1)
if (EnableFFBStrengthPersistence == 1)
{
WritePrivateProfileStringA("Settings", CustomAlternativeMaxForceLeft, (char*)(std::to_string(configAlternativeMaxForceLeft)).c_str(), ".\\FFBPlugin.ini");
WritePrivateProfileStringA("Settings", CustomAlternativeMaxForceRight, (char*)(std::to_string(configAlternativeMaxForceRight)).c_str(), ".\\FFBPlugin.ini");
}
else
{
WritePrivateProfileStringA("Settings", CustomMaxForce, (char*)(std::to_string(configMaxForce)).c_str(), ".\\FFBPlugin.ini");
if (AlternativeFFB == 1)
{
WritePrivateProfileStringA("Settings", CustomAlternativeMaxForceLeft, (char*)(std::to_string(configAlternativeMaxForceLeft)).c_str(), ".\\FFBPlugin.ini");
WritePrivateProfileStringA("Settings", CustomAlternativeMaxForceRight, (char*)(std::to_string(configAlternativeMaxForceRight)).c_str(), ".\\FFBPlugin.ini");
}
else
{
WritePrivateProfileStringA("Settings", CustomMaxForce, (char*)(std::to_string(configMaxForce)).c_str(), ".\\FFBPlugin.ini");
}
}
}