Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mp/src/game/client/neo/ui/neo_root_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ void NeoSettingsRestore(NeoSettings *ns, const NeoSettings::Keys::Flags flagsKey
pGeneral->bAimHold = cvr->neo_aim_hold.GetBool();
pGeneral->bReloadEmpty = cvr->cl_autoreload_when_empty.GetBool();
pGeneral->bViewmodelRighthand = cvr->cl_righthand.GetBool();
pGeneral->bLeanViewmodelOnly = cvr->cl_neo_lean_viewmodel_only.GetBool();
pGeneral->bShowPlayerSprays = !(cvr->cl_playerspraydisable.GetBool()); // Inverse
pGeneral->bShowPos = cvr->cl_showpos.GetBool();
pGeneral->iShowFps = cvr->cl_showfps.GetInt();
Expand Down Expand Up @@ -432,6 +433,7 @@ void NeoSettingsSave(const NeoSettings *ns)
cvr->neo_aim_hold.SetValue(pGeneral->bAimHold);
cvr->cl_autoreload_when_empty.SetValue(pGeneral->bReloadEmpty);
cvr->cl_righthand.SetValue(pGeneral->bViewmodelRighthand);
cvr->cl_neo_lean_viewmodel_only.SetValue(pGeneral->bLeanViewmodelOnly);
cvr->cl_playerspraydisable.SetValue(!pGeneral->bShowPlayerSprays); // Inverse
cvr->cl_showpos.SetValue(pGeneral->bShowPos);
cvr->cl_showfps.SetValue(pGeneral->iShowFps);
Expand Down Expand Up @@ -627,6 +629,7 @@ void NeoSettings_General(NeoSettings *ns)
NeoUI::RingBoxBool(L"Aim hold", &pGeneral->bAimHold);
NeoUI::RingBoxBool(L"Reload empty", &pGeneral->bReloadEmpty);
NeoUI::RingBoxBool(L"Right hand viewmodel", &pGeneral->bViewmodelRighthand);
NeoUI::RingBoxBool(L"Lean viewmodel only", &pGeneral->bLeanViewmodelOnly);
NeoUI::RingBoxBool(L"Show player spray", &pGeneral->bShowPlayerSprays);
NeoUI::RingBoxBool(L"Show position", &pGeneral->bShowPos);
NeoUI::RingBox(L"Show FPS", SHOWFPS_LABELS, ARRAYSIZE(SHOWFPS_LABELS), &pGeneral->iShowFps);
Expand Down
2 changes: 2 additions & 0 deletions mp/src/game/client/neo/ui/neo_root_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct NeoSettings
bool bAimHold;
bool bReloadEmpty;
bool bViewmodelRighthand;
bool bLeanViewmodelOnly;
bool bShowPlayerSprays;
bool bShowPos;
int iShowFps;
Expand Down Expand Up @@ -154,6 +155,7 @@ struct NeoSettings
CONVARREF_DEF(neo_aim_hold);
CONVARREF_DEF(cl_autoreload_when_empty);
CONVARREF_DEF(cl_righthand);
CONVARREF_DEF(cl_neo_lean_viewmodel_only);
CONVARREF_DEF(cl_showpos);
CONVARREF_DEF(cl_showfps);
CONVARREF_DEF(hud_fastswitch);
Expand Down
14 changes: 13 additions & 1 deletion mp/src/game/shared/neo/neo_predicted_viewmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ CNEOPredictedViewModel::CNEOPredictedViewModel()
#endif

m_flYPrevious = 0;
m_flLeanAngle = 0;
m_flStartAimingChange = 0;
m_bViewAim = false;
}
Expand Down Expand Up @@ -283,6 +284,10 @@ float GetLeanRatio(const float leanAngle)
return fabs(leanAngle) / ((leanAngle < 0) ? neo_lean_yaw_peek_left_amount.GetFloat() : neo_lean_yaw_peek_right_amount.GetFloat());
}

#ifdef CLIENT_DLL
ConVar cl_neo_lean_viewmodel_only("cl_neo_lean_viewmodel_only", "0", FCVAR_ARCHIVE, "Rotate view-model instead of camera when leaning", true, 0, true, 1);
#endif

float CNEOPredictedViewModel::lean(CNEO_Player *player){
Assert(player);
#ifdef CLIENT_DLL
Expand Down Expand Up @@ -342,8 +347,9 @@ float CNEOPredictedViewModel::lean(CNEO_Player *player){
player->m_vecLean = Vector(0, viewOffset.y, -(neo_lean_fp_lower_eyes_scale.GetFloat() * leanRatio));
player->SetViewOffset(viewOffset);

viewAng.z = leanAngle;
m_flLeanAngle = leanAngle;
#ifdef CLIENT_DLL
viewAng.z = cl_neo_lean_viewmodel_only.GetBool() ? 0 : leanAngle;
engine->SetViewAngles(viewAng);
#endif

Expand Down Expand Up @@ -442,6 +448,12 @@ void CNEOPredictedViewModel::CalcViewModelView(CBasePlayer *pOwner,
newPos += vUp * vOffset.z;

newAng += angOffset;
#ifdef CLIENT_DLL
if (cl_neo_lean_viewmodel_only.GetBool())
{
newAng.z += m_flLeanAngle;
}
#endif

BaseClass::CalcViewModelView(pOwner, newPos, newAng);
}
Expand Down
1 change: 1 addition & 0 deletions mp/src/game/shared/neo/neo_predicted_viewmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class CNEOPredictedViewModel : public CPredictedViewModel

private:
float m_flStartAimingChange;
float m_flLeanAngle;
bool m_bViewAim;
Vector m_vOffset;
QAngle m_angOffset;
Expand Down