diff --git a/README.txt b/README.txt index 66698df..dd6a156 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,9 @@ This is the source code! It can NOT be used to play PDAFT! If you just wanted to play the game, you downloaded the wrong thing. +Do not click the download button next to the git URL, that's for the source code. For information on getting and installing the latest release, please read the wiki at https://notabug.org/nastys/PD-Loader/wiki +If you've already read it, pay more attention and you'll find the right link. You should also read the wiki if you have any issues, before asking questions. \ No newline at end of file diff --git a/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.cpp b/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.cpp index b69accc..94034d0 100644 --- a/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.cpp +++ b/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.cpp @@ -19,8 +19,11 @@ namespace TLAC::Components { const std::string KEY_CONFIG_FILE_NAME = "keyconfig.ini"; + TouchSliderEmulator* TouchSliderEmulator::LatestInstance; + TouchSliderEmulator::TouchSliderEmulator() { + LatestInstance = this; } TouchSliderEmulator::~TouchSliderEmulator() diff --git a/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.h b/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.h index 1cc9869..d491e12 100644 --- a/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.h +++ b/source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.h @@ -17,6 +17,8 @@ namespace TLAC::Components class TouchSliderEmulator : public EmulatorComponent { public: + static TouchSliderEmulator* LatestInstance; + Input::Binding* LeftSideSlideLeft; Input::Binding* LeftSideSlideRight; @@ -34,6 +36,14 @@ namespace TLAC::Components virtual void OnFocusLost() override; + bool isSliderTouched() + { + for (int i = 0; i < 32; i++) + if (sliderState->SensorTouched[i].IsTouched) return true; + + return false; + } + private: ComponentsManager* componentsManager; float sliderSpeed = 750.0f; diff --git a/source-code/source/plugins/TLAC/Input/DirectInput/Ds4/DualShock4.h b/source-code/source/plugins/TLAC/Input/DirectInput/Ds4/DualShock4.h index 7b8b568..6d725ee 100644 --- a/source-code/source/plugins/TLAC/Input/DirectInput/Ds4/DualShock4.h +++ b/source-code/source/plugins/TLAC/Input/DirectInput/Ds4/DualShock4.h @@ -5,7 +5,7 @@ namespace TLAC::Input { - // DualShock 4 Controller Product GUIDs: + // Controller GUIDs: const GUID GUID_Ds4[] = { // First Generation: {05C4054C-0000-0000-0000-504944564944} @@ -15,9 +15,9 @@ namespace TLAC::Input // GAMO2 DIVALLER: {11140E8F-0000-0000-0000-504944564944} { 0x11140E8F, 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, // Hori HATSUNE MIKU X: {00A50F0D-0000-0000-0000-504944564944} - { 0x00A50F0D, 0x0000, 0x0000,{ 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, + { 0x00A50F0D, 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, // Hori F2nd Miniboard (Hatsune Miku Sho): {00490F0D-0000-0000-0000-504944564944} - { 0x00490F0D, 0x0000, 0x0000,{ 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, + { 0x00490F0D, 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } } }; class DualShock4 : public Controller, public IInputDevice diff --git a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp index 95ffb05..0e2e353 100644 --- a/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp +++ b/source-code/source/plugins/TLAC/Input/Xinput/Xinput.cpp @@ -4,6 +4,7 @@ #include "../../FileSystem/ConfigFile.h" #include "../../framework.h" #include "../../Components/GameTargets/TargetInspector.h" +#include "../../Components/Input/TouchSliderEmulator.h" namespace TLAC::Input { @@ -232,8 +233,7 @@ namespace TLAC::Input 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 - //XInputSetState(xc_pref, &vibration); - //printf("1"); + if (TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched()) XInputSetState(xc_pref, &vibration); } else { @@ -241,7 +241,7 @@ namespace TLAC::Input ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION)); vibration.wLeftMotorSpeed = 0; // use any value between 0-65535 here vibration.wRightMotorSpeed = 0; // use any value between 0-65535 here - //XInputSetState(xc_pref, &vibration); + XInputSetState(xc_pref, &vibration); //printf("0"); }