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 | 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 | 476 | float ControllerScriptingInterface::getActionValue(int action) { |
| 473 | 477 | return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action)); |
| 474 | 478 | } |
| 475 | 479 | |
| 476 | 480 | int ControllerScriptingInterface::findAction(QString actionName) { |
| 477 | − auto userInputMapper = DependencyManager::get<UserInputMapper>(); | |
| 478 | − auto actions = getAllActions(); | |
| 479 | − for (auto action : actions) { | |
| 480 | − if (userInputMapper->getActionName(action) == actionName) { | |
| 481 | − return action; | |
| 482 | − } | |
| 483 | − } | |
| 484 | − // If the action isn't found, return -1 | |
| 485 | − return -1; | |
| 481 | + return DependencyManager::get<UserInputMapper>()->findAction(actionName); | |
| 482 | +} | |
| 483 | + | |
| 484 | +QVector<QString> ControllerScriptingInterface::getActionNames() const { | |
| 485 | + return DependencyManager::get<UserInputMapper>()->getActionNames(); | |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) : |