Idea!: Set to defaults flyout button with options for all styles of joystick controller
The button portion does nothing if there is an unknown or no controller connected, otherwise it sets defaults for the controller's identified type. Joystick buttons are still configured based on identification, however. DS3 users will likely find that using Motion in Joy switchboards is much more effective, however.
This commit is contained in:
@@ -126,7 +126,7 @@ BOOL LLFloaterJoystick::postBuild()
|
||||
mCheckFlycamEnabled = getChild<LLCheckBoxCtrl>("JoystickFlycamEnabled");
|
||||
childSetCommitCallback("JoystickFlycamEnabled",onCommitJoystickEnabled,this);
|
||||
|
||||
childSetAction("SpaceNavigatorDefaults", onClickRestoreSNDefaults, this);
|
||||
getChild<LLUICtrl>("Default")->setCommitCallback(boost::bind(&LLFloaterJoystick::onClickDefault, this, _2));
|
||||
childSetAction("cancel_btn", onClickCancel, this);
|
||||
childSetAction("ok_btn", onClickOK, this);
|
||||
|
||||
@@ -301,9 +301,14 @@ void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel)
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterJoystick::onClickRestoreSNDefaults(void *joy_panel)
|
||||
S32 get_joystick_type();
|
||||
void LLFloaterJoystick::onClickDefault(const LLSD& val)
|
||||
{
|
||||
setSNDefaults();
|
||||
S32 type(val.asInteger());
|
||||
if (val.isUndefined()) // If button portion, set to default for device.
|
||||
if ((type = get_joystick_type()) == -1) // Invalid/No device
|
||||
return;
|
||||
LLViewerJoystick::getInstance()->setSNDefaults(type);
|
||||
}
|
||||
|
||||
void LLFloaterJoystick::onClickCancel(void *joy_panel)
|
||||
@@ -332,8 +337,3 @@ void LLFloaterJoystick::onClickOK(void *joy_panel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterJoystick::setSNDefaults()
|
||||
{
|
||||
LLViewerJoystick::getInstance()->setSNDefaults();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user