diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 7098e7e6332..5b4b15cfae2 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -3581,8 +3581,14 @@ void CMenus::RenderSettingsTClient(CUIRect MainView) // checkbox for hiding nameplates DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClRenderNameplateSpec, ("Hide nameplates in spec"), &g_Config.m_ClRenderNameplateSpec, &MainView, LineMargin); - // create dropdown for rainbow modes + // hammer rotates with cursor + CUIRect HammerRotatesWithCursorButton; + MainView.HSplitTop(20.0f, &HammerRotatesWithCursorButton, &MainView); + if(DoButton_CheckBox(&g_Config.m_ClHammerRotatesWithCursor, Localize("Hammer rotates with cursor"), g_Config.m_ClHammerRotatesWithCursor, &HammerRotatesWithCursorButton)) + g_Config.m_ClHammerRotatesWithCursor ^= 1; + GameClient()->m_Tooltips.DoToolTip(&g_Config.m_ClHammerRotatesWithCursor, &HammerRotatesWithCursorButton, Localize("Allow your hammer to rotate like other weapons")); + // create dropdown for rainbow modes static std::vector s_DropDownNames = {Localize("Rainbow"), Localize("Pulse"), Localize("Black")}; static CUi::SDropDownState s_RainbowDropDownState; diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index b2145e240e4..2d465981944 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -608,16 +608,20 @@ void CPlayers::RenderPlayer( if(IsSit) WeaponPosition.y += 3.0f; - // if active and attack is under way, bash stuffs - if(!Inactive || LastAttackTime < m_pClient->m_aTuning[g_Config.m_ClDummy].GetWeaponFireDelay(Player.m_Weapon)) + // set rotation + float QuadsRotation = -pi / 2; + QuadsRotation += State.GetAttach()->m_Angle * (Direction.x < 0 ? -1 : 1) * pi * 2; + if(g_Config.m_ClHammerRotatesWithCursor) { - if(Direction.x < 0) - Graphics()->QuadsSetRotation(-pi / 2 - State.GetAttach()->m_Angle * pi * 2); - else - Graphics()->QuadsSetRotation(-pi / 2 + State.GetAttach()->m_Angle * pi * 2); + QuadsRotation += Angle; + if (Direction.x < 0) + QuadsRotation += pi; } - else - Graphics()->QuadsSetRotation(Direction.x < 0 ? 100.0f : 500.0f); + else if(Inactive && LastAttackTime > m_pClient->m_aTuning[g_Config.m_ClDummy].GetWeaponFireDelay(Player.m_Weapon)) + { + QuadsRotation = Direction.x < 0 ? 100.0f : 500.0f; + } + Graphics()->QuadsSetRotation(QuadsRotation); Graphics()->RenderQuadContainerAsSprite(m_WeaponEmoteQuadContainerIndex, QuadOffset, WeaponPosition.x, WeaponPosition.y); } diff --git a/src/game/tater_variables.h b/src/game/tater_variables.h index 2b7021872c1..e299559aab5 100644 --- a/src/game/tater_variables.h +++ b/src/game/tater_variables.h @@ -24,6 +24,8 @@ MACRO_CONFIG_INT(ClSpecmenuID, tc_spec_menu_ID, 0, 0, 1, CFGFLAG_CLIENT | CFGFLA MACRO_CONFIG_INT(ClLimitMouseToScreen, tc_limit_mouse_to_screen, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Limit mouse to screen boundries") +MACRO_CONFIG_INT(ClHammerRotatesWithCursor, tc_hammer_rotates_with_cursor, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Allow your hammer to rotate like other weapons") + // Anti Latency Tools MACRO_CONFIG_INT(ClFreezeUpdateFix, tc_freeze_update_fix, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Will change your skin faster when you enter freeze. ") MACRO_CONFIG_INT(ClRemoveAnti, tc_remove_anti, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Removes some amount of antiping & player prediction in freeze")