Make it optional
This commit is contained in:
@@ -15,6 +15,7 @@ namespace TLAC::Input
|
||||
TLAC::FileSystem::ConfigFile config(TLAC::framework::GetModuleDirectory(), "keyconfig.ini");
|
||||
config.OpenRead();
|
||||
xinput_num = config.GetIntegerValue("xinput_preferred");
|
||||
rumble = config.GetBooleanValue("rumble");
|
||||
}
|
||||
|
||||
Xinput* Xinput::GetInstance()
|
||||
@@ -227,13 +228,13 @@ namespace TLAC::Input
|
||||
SetTapStates(i, elapsed);
|
||||
}
|
||||
|
||||
if (TLAC::Components::TargetInspector::ShouldVibrate)
|
||||
if (rumble && TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched() && TLAC::Components::TargetInspector::ShouldVibrate)
|
||||
{
|
||||
XINPUT_VIBRATION vibration;
|
||||
ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION));
|
||||
vibration.wLeftMotorSpeed = 8000; // use any value between 0-65535 here
|
||||
vibration.wRightMotorSpeed = 4000; // use any value between 0-65535 here
|
||||
if (TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched()) XInputSetState(xc_pref, &vibration);
|
||||
XInputSetState(xc_pref, &vibration);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,5 +49,6 @@ namespace TLAC::Input
|
||||
void SetTapStates(BYTE keycode, float elapsed);
|
||||
|
||||
int xinput_num;
|
||||
bool rumble;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user