mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-04 02:24:00 +00:00
Attempt to fix joystick enabled/disabled state
This commit is contained in:
parent
bff072039a
commit
3de004262b
4 changed files with 10 additions and 5 deletions
|
@ -554,11 +554,11 @@ protected:
|
|||
|
||||
void modifyDt(float &dt);
|
||||
|
||||
void fixupJoysticks();
|
||||
virtual void onJoystickAdded(int deviceID);
|
||||
virtual void onJoystickRemoved(int instanceID);
|
||||
|
||||
public:
|
||||
void fixupJoysticks();
|
||||
void initActionButtons();
|
||||
void importActionButtons();
|
||||
};
|
||||
|
|
|
@ -595,10 +595,9 @@ void UserSettings::apply()
|
|||
j->deadZone1 = as.joycfg.s1dead;
|
||||
j->deadZone2 = as.joycfg.s2dead;
|
||||
}
|
||||
as.updateJoystick();
|
||||
}
|
||||
|
||||
dsq->initActionButtons();
|
||||
dsq->fixupJoysticks();
|
||||
|
||||
core->debugLogActive = system.debugLogOn;
|
||||
|
||||
|
|
|
@ -122,9 +122,13 @@ void ActionSet::updateJoystick()
|
|||
if(reassign)
|
||||
assignJoystickByName(true);
|
||||
|
||||
// Enable joystick if used by this ActionSet.
|
||||
// There might be other ActionSets that are also set to this
|
||||
// joystick but disabled, so we can't just do
|
||||
// j->setEnabled(enabled) here.
|
||||
Joystick *j = core->getJoystick(joystickID);
|
||||
if(j)
|
||||
j->setEnabled(enabled);
|
||||
if(j && enabled)
|
||||
j->setEnabled(true);
|
||||
}
|
||||
|
||||
ActionInput *ActionSet::getActionInputByName(const std::string &name)
|
||||
|
|
|
@ -52,6 +52,8 @@ public:
|
|||
void clearActions();
|
||||
int assignJoystickByName(bool force); // -1 if no such joystick found
|
||||
void assignJoystickIdx(int idx, bool updateValues);
|
||||
|
||||
// note: this only ENABLES joysticks if they are needed, but never disables any
|
||||
void updateJoystick();
|
||||
|
||||
ActionInput *addActionInput(const std::string &name);
|
||||
|
|
Loading…
Add table
Reference in a new issue