Option to toggle quickturn with any hands only (enabled by default)

This commit is contained in:
Jonny_Bro (Nikita) 2023-09-25 17:19:46 +05:00
parent c9a73fda50
commit f3dbf0b2de
2 changed files with 5 additions and 1 deletions

View file

@ -224,6 +224,9 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function()
panel:CheckBox("Quickturn", "Beatrun_QuickturnGround")
panel:ControlHelp("Enables quickturning with secondary attack while on the ground")
panel:CheckBox("Quickturn Hands Only", "Beatrun_QuickturnHandsOnly")
panel:ControlHelp("Enables quickturning with \"Runner Hands\" only")
panel:CheckBox("Purist Mode", "Beatrun_PuristMode")
panel:ControlHelp("Purist mode is a clientside preference that severely weakens the ability to strafe while in the air, which is how Mirror's Edge games handle this.\nDisabled = No restrictions\nEnabled = Reduced move speed in the air")

View file

@ -1,5 +1,6 @@
if CLIENT then
QuickturnGround = CreateClientConVar("Beatrun_QuickturnGround", "0", true, true, "Enables quickturning with secondary attack while on the ground", 0, 1)
QuickturnHandsOnly = CreateClientConVar("Beatrun_QuickturnHandsOnly", "1", true, true, "Enables quickturning with \"Runner Hands\" only", 0, 1)
end
function DoJumpTurn(lookbehind)
@ -55,7 +56,7 @@ end
local standpunch = Angle(-5, 0, 0)
local function Quickturn(ply, mv, cmd)
local keypressed = ply:Alive() and mv:KeyPressed(IN_ATTACK2) and ply:GetActiveWeapon():GetClass() == "runnerhands"
local keypressed = ply:Alive() and mv:KeyPressed(IN_ATTACK2) and (ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 1 and ply:GetActiveWeapon():GetClass() == "runnerhands" or ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 0)
if ply:GetWallrun() ~= 0 then
if mv:KeyDown(IN_BACK) and mv:KeyPressed(IN_JUMP) or ply:GetQuickturn() then