From fb55ec07be035157428114770e027511b1ac6857 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Mon, 5 Jun 2023 13:09:26 +0500 Subject: [PATCH] =?UTF-8?q?Fix=20Purist=20mode=20=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beatrun/gamemode/cl/BodyAnim.lua | 4 +-- .../beatrun/gamemode/cl/JumpAnim.lua | 2 +- .../beatrun/gamemode/cl/ToolMenuSettings.lua | 29 +++++++++++++++++++ .../beatrun/gamemode/sh/PuristMode.lua | 4 +-- .../beatrun/gamemode/sh/sh_buildmode.lua | 2 +- .../beatrun/gamemode/sv/Menu_Gamemodes.lua | 2 +- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua b/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua index a6e057e..2881344 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/BodyAnim.lua @@ -33,7 +33,7 @@ local customcycle = false deathanim = false local allowmove = false local allowedangchange = false -local attach, attachId, weapontoidle = nil +local attach, attachId, weapontoidle = nil, nil, nil local smoothend = false local endlerp = 0 camoffset = Vector() @@ -452,7 +452,7 @@ function BodyAnimSetEase(pos) end local lastattachpos = Vector(0, 0, 0) -local lastatt, savedatt = nil +local lastatt, savedatt = nil, nil local lerpchangeatt = 1 local lastattdata = nil local lerpedpos = Vector() diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua b/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua index b75d580..8bbb42e 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua @@ -1412,7 +1412,7 @@ hook.Add("Think", "FBAnimHandler", function() lastwr = ply:GetWallrun() end) -local animtr, animtr_result = nil +local animtr, animtr_result = nil, nil local oldnewang = Angle() local function JumpThink() diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua index 0cb7fcd..942ea5c 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua @@ -141,6 +141,7 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() panel:CheckBox("Quickturn", "Beatrun_QuickturnGround") panel:ControlHelp("Enables quickturning with secondary attack while on the ground") + 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") end) @@ -240,5 +241,33 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() StartDataTheft() end panel:AddItem(DatatheftButton) + + -- local divider = vgui.Create("DHorizontalDivider") + -- panel:AddItem(divider) + + -- local LoadoutMenuButton = vgui.Create("DButton", panel) + -- LoadoutMenuButton:SetText("Open Loadouts Menu") + -- LoadoutMenuButton:SetSize(0, 20) + -- LoadoutMenuButton.DoClick = function() + -- local frame = vgui.Create("DFrame") + -- frame:SetTitle("Loadouts menu") + -- frame:SetSize(400, 300) + -- frame:SetDeleteOnClose(true) + -- frame:Center() + -- frame:MakePopup() + + -- local TextEntry = vgui.Create("DTextEntry", frame) + -- TextEntry:Dock(TOP) + + -- local okButton = vgui.Create("DButton", frame) + -- okButton:SetText("Change API Key") + -- okButton:SetPos(25, 60) + -- okButton:SetSize(250, 30) + -- okButton.DoClick = function() + -- RunConsoleCommand("Beatrun_LoadoutMenu", TextEntry:GetValue()) + -- frame:Close() + -- end + -- end + -- panel:AddItem(LoadoutMenuButton) end) end) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/PuristMode.lua b/beatrun/gamemodes/beatrun/gamemode/sh/PuristMode.lua index 4a5a348..6cf9ac0 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/PuristMode.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/PuristMode.lua @@ -6,9 +6,9 @@ local PuristModeForce = CreateConVar("Beatrun_PuristModeForce", 0, {FCVAR_REPLIC local function PuristMove(ply, mv, cmd) if not ply:OnGround() and not ply:GetGrappling() then - local purist = ply:GetInfoNum("Beatrun_PuristMode", 0) + local purist = PuristMode:GetBool() - if (purist > 0 or PuristModeForce:GetBool()) and ply:WaterLevel() == 0 then + if (purist or PuristModeForce:GetBool()) and ply:WaterLevel() == 0 then mv:SetForwardSpeed(mv:GetForwardSpeed() * 0.001) mv:SetSideSpeed(mv:GetSideSpeed() * 0.001) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua index 0c021fe..67f7f3e 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua @@ -739,7 +739,7 @@ if CLIENT then playerstart:SetNoDraw(true) local playerstartang = Angle() - local ZiplineStart, _ = nil + local ZiplineStart = nil local ziplinemins = Vector(-8, -8, -8) local ziplinemaxs = Vector(8, 8, 8) diff --git a/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua b/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua index b592b2f..a0a8bd2 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua @@ -1,7 +1,7 @@ util.AddNetworkString("Beatrun_ToggleGamemode") util.AddNetworkString("Beatrun_UpdateDataTheftLoadout") -local datatheft, infection = false +local datatheft, infection = false, false net.Receive("Beatrun_ToggleGamemode", function(_, ply) local gm = net.ReadString()