1
0
mirror of synced 2024-11-27 16:10:52 +01:00

Added hummer strength options

This commit is contained in:
mightymikem 2024-07-24 12:04:45 +01:00 committed by GitHub
parent b6e5cef7bf
commit 3008bfb4d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,8 +22,11 @@ extern int EnableDamper;
extern int DamperStrength;
bool init = false;
extern int EnableDamper;
extern int DamperStrength;
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int ViosityStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ViosityStrength"), 100, settingsFilename);
static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 100, settingsFilename);
static void(__cdecl* clSteerDualDeviceSetTRQCurveHalfPointOrig)(void* thisParam, int param_1, float param_2, float param_3);
static void __cdecl clSteerDualDeviceSetTRQCurveHalfPoint(void* thisParam, int param_1, float param_2, float param_3) {
@ -39,13 +42,15 @@ static void __cdecl clSteerDualDeviceSetVibrate(void* thisParam, int param_1, fl
static void(__cdecl* clSteerDualDeviceSetViscosityOrig)(void* thisParam, int param_1, float param_2, float param_3);
static void __cdecl clSteerDualDeviceSetViscosity(void* thisParam, int param_1, float param_2, float param_3) {
myTriggers->Friction((double)param_2);
double percentForce = (double)param_2 * (ViosityStrength / 100.0);
myTriggers->Friction(percentForce);
return clSteerDualDeviceSetViscosityOrig(thisParam, param_1, param_2, param_3);
}
static void(__cdecl* clSteerDualDeviceInitCenterOrig)(void* thisParam, int param_1, unsigned char param_2);
static void __cdecl clSteerDualDeviceInitCenter(void* thisParam, int param_1, unsigned char param_2) {
myTriggers->Springi(param_2);
double percentForce = (double)param_2 * (SpringStrength / 100.0);
myTriggers->Springi(percentForce);
return clSteerDualDeviceInitCenterOrig(thisParam, param_1, param_2);
}