| 404 | } |
| 405 | |
| 406 | static float QueryProfileAction(const Input& in, const InputProfile& profile, UserAction action, bool checkFocus) |
| 407 | { |
| 408 | float sum = 0.0f; |
| 409 | for (const InputBinding& binding : profile.GetBindingEntries(action)) |
| 410 | { |
| 411 | if (!ProfileModifierHeld(in, binding.modifier, checkFocus)) |
| 412 | continue; |
| 413 | const float value = QueryProfileCode(in, binding.code, checkFocus) * binding.scale; |
| 414 | switch (action) |
| 415 | { |
| 416 | case UAMoveForward: |
| 417 | case UAMoveBack: |
| 418 | case UATurnLeft: |
| 419 | case UATurnRight: |
| 420 | case UAMoveUp: |
| 421 | case UAMoveDown: |
| 422 | case UAMoveFastForward: |
| 423 | case UAMoveSlowForward: |
| 424 | case UAMoveLeft: |
| 425 | case UAMoveRight: |
| 426 | case UALookLeftDown: |
| 427 | case UALookDown: |
| 428 | case UALookRightDown: |
| 429 | case UALookLeft: |
| 430 | case UALookRight: |
| 431 | case UALookLeftUp: |
| 432 | case UALookUp: |
| 433 | case UALookRightUp: |
| 434 | case UAAimUp: |
| 435 | case UAAimDown: |
| 436 | case UAAimLeft: |
| 437 | case UAAimRight: |
| 438 | sum += std::max(0.0f, value); |
| 439 | break; |
| 440 | default: |
| 441 | sum += value; |
| 442 | break; |
| 443 | } |
| 444 | } |
| 445 | return sum; |
| 446 | } |
| 447 | |
| 448 | static bool QueryProfileActionToDo(Input& in, const InputProfile& profile, UserAction action, bool& actionDone, |
| 449 | bool reset, bool checkFocus) |
no test coverage detected