| 402 | } |
| 403 | |
| 404 | void CPda::PlayAnimIdle() |
| 405 | { |
| 406 | if (auto pActor = smart_cast<CActor*>(H_Parent()); pActor && ThumbAnimsAllowed() && IsZoomed()) |
| 407 | { |
| 408 | const char* moving_postfix{""}; |
| 409 | const u32 State = pActor->get_state(); |
| 410 | if ((State & mcAnyMove) && AnmIdleMovingAllowed()) |
| 411 | { |
| 412 | if (!(State & mcCrouch)) |
| 413 | { |
| 414 | if (State & mcAccel) // Ходьба медленная (SHIFT) |
| 415 | moving_postfix = "_moving_slow"; |
| 416 | else |
| 417 | moving_postfix = "_moving"; |
| 418 | } |
| 419 | else if (State & mcAccel) // Ходьба в присяде (CTRL+SHIFT) |
| 420 | moving_postfix = "_moving_crouch_slow"; |
| 421 | else |
| 422 | moving_postfix = "_moving_crouch"; |
| 423 | } |
| 424 | string64 anm_name; |
| 425 | xr_strconcat(anm_name, "anm_idle", thumb_anim_name.c_str(), moving_postfix); |
| 426 | |
| 427 | if (AnimationExist(anm_name)) |
| 428 | { |
| 429 | PlayHUDMotion(anm_name, true, GetState()); |
| 430 | if (thumb_anim_name == "_click") |
| 431 | { |
| 432 | Fvector C; |
| 433 | Center(C); |
| 434 | HUD_SOUND::PlaySound(sndBtnPress, C, H_Root(), !!GetHUDmode(), false, false); |
| 435 | HUD_SOUND::PlaySound(sndBtnRelease, C, H_Root(), !!GetHUDmode(), false, false); |
| 436 | } |
| 437 | } |
| 438 | else |
| 439 | { |
| 440 | inherited::PlayAnimIdle(); |
| 441 | } |
| 442 | } |
| 443 | else |
| 444 | { |
| 445 | inherited::PlayAnimIdle(); |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | // inertion |
| 450 | constexpr float _inertion(const float _val_cur, const float _val_trgt, const float _friction) |
no test coverage detected