MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / PlayAnimIdle

Method PlayAnimIdle

ogsr_engine/xrGame/PDA.cpp:404–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404void 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
450constexpr float _inertion(const float _val_cur, const float _val_trgt, const float _friction)

Callers 2

OnMovementChangedMethod · 0.45
MouseMovementMethod · 0.45

Calls 5

H_ParentFunction · 0.85
xr_strconcatFunction · 0.85
H_RootFunction · 0.85
get_stateMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected