mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
remember gamepad enabled value
This commit is contained in:
parent
0f5781aec1
commit
628189bad2
1 changed files with 12 additions and 0 deletions
|
@ -37,6 +37,7 @@ public class PickupPushPull_Module : CVRInputModule
|
||||||
private CVRInputManager _inputManager;
|
private CVRInputManager _inputManager;
|
||||||
private ControllerRay desktopControllerRay;
|
private ControllerRay desktopControllerRay;
|
||||||
private float deadzoneRightValue;
|
private float deadzoneRightValue;
|
||||||
|
private bool controlGamepadEnabled;
|
||||||
|
|
||||||
//SteamVR Input
|
//SteamVR Input
|
||||||
private SteamVR_Action_Vector2 vrLookAction;
|
private SteamVR_Action_Vector2 vrLookAction;
|
||||||
|
@ -66,10 +67,19 @@ public class PickupPushPull_Module : CVRInputModule
|
||||||
|
|
||||||
UpdateVRBinding();
|
UpdateVRBinding();
|
||||||
|
|
||||||
|
controlGamepadEnabled = (bool)MetaPort.Instance.settings.GetSettingsBool("ControlDeadZoneRight", false);
|
||||||
|
MetaPort.Instance.settings.settingBoolChanged.AddListener(new UnityAction<string, bool>(SettingsBoolChanged));
|
||||||
|
|
||||||
deadzoneRightValue = (float)MetaPort.Instance.settings.GetSettingInt("ControlDeadZoneRight", 0) / 100f;
|
deadzoneRightValue = (float)MetaPort.Instance.settings.GetSettingInt("ControlDeadZoneRight", 0) / 100f;
|
||||||
MetaPort.Instance.settings.settingIntChanged.AddListener(new UnityAction<string, int>(SettingsIntChanged));
|
MetaPort.Instance.settings.settingIntChanged.AddListener(new UnityAction<string, int>(SettingsIntChanged));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SettingsBoolChanged(string name, bool value)
|
||||||
|
{
|
||||||
|
if (name == "ControlEnableGamepad")
|
||||||
|
controlGamepadEnabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
private void SettingsIntChanged(string name, int value)
|
private void SettingsIntChanged(string name, int value)
|
||||||
{
|
{
|
||||||
if (name == "ControlDeadZoneRight")
|
if (name == "ControlDeadZoneRight")
|
||||||
|
@ -146,6 +156,8 @@ public class PickupPushPull_Module : CVRInputModule
|
||||||
|
|
||||||
private void DoGamepadInput()
|
private void DoGamepadInput()
|
||||||
{
|
{
|
||||||
|
if (!controlGamepadEnabled) return;
|
||||||
|
|
||||||
//not sure how to make settings for this
|
//not sure how to make settings for this
|
||||||
bool button1 = Input.GetButton("Controller Left Button");
|
bool button1 = Input.GetButton("Controller Left Button");
|
||||||
bool button2 = Input.GetButton("Controller Right Button");
|
bool button2 = Input.GetButton("Controller Right Button");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue