Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -469,20 +469,20 @@ int ControllerScriptingInterface::findDevice(QString name) { · 468 unmodified lines | |||
| 469 | return DependencyManager::get<UserInputMapper>()->findDevice(name); | 469 | return DependencyManager::get<UserInputMapper>()->findDevice(name); |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | QVector<QString> ControllerScriptingInterface::getDeviceNames() { | ||
| 473 | return DependencyManager::get<UserInputMapper>()->getDeviceNames(); | ||
| 474 | } | ||
| 475 | |||
| 472 | float ControllerScriptingInterface::getActionValue(int action) { | 476 | float ControllerScriptingInterface::getActionValue(int action) { |
| 473 | return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action)); | 477 | return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action)); |
| 474 | } | 478 | } |
| 475 | 479 | ||
| 476 | int ControllerScriptingInterface::findAction(QString actionName) { | 480 | int ControllerScriptingInterface::findAction(QString actionName) { |
| 477 | auto userInputMapper = DependencyManager::get<UserInputMapper>(); | 481 | return DependencyManager::get<UserInputMapper>()->findAction(actionName); |
| 478 | auto actions = getAllActions(); | 482 | } |
| 479 | for (auto action : actions) { | 483 | |
| 480 | if (userInputMapper->getActionName(action) == actionName) { | 484 | QVector<QString> ControllerScriptingInterface::getActionNames() const { |
| 481 | return action; | 485 | return DependencyManager::get<UserInputMapper>()->getActionNames(); |
| 482 | } | ||
| 483 | } | ||
| 484 | // If the action isn't found, return -1 | ||
| 485 | return -1; | ||
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) : | 488 | InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) : |