From c9226f6b63ecb622ac67e8af1181c658a19701ce Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 21 Mar 2019 01:26:23 -0400 Subject: [PATCH] [Joystick] Use the button layout for the chosen controller type Using the drop down now FORCES your controller to be detected as your selection for the duration of the session until you choose another --- indra/newview/llviewerjoystick.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 8d0456495..d558988c9 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -111,6 +111,17 @@ enum DS3Keys DS3_LOGO_KEY }; +void set_joystick_type(const S32& type) +{ + switch (type) + { + case 0: sType = SPACE_NAV; break; + case 1: case 2: sType = XBOX; break; + case 3: sType = DS3; break; + default: sType = UNKNOWN; break; + } +} + S32 get_joystick_type() { switch (sType) @@ -1393,6 +1404,7 @@ void LLViewerJoystick::setSNDefaults(S32 type) const bool is_3d_cursor = true; #endif + set_joystick_type(type); // Breaks resetting to default but allows declaring a new identity and button config for the controller //gViewerWindow->alertXml("CacheWillClear"); const bool ouya = type == 1; const bool xbox = ouya || type == 2;