From e05c5755d3b3b511cc4b4f0601482bb601823a67 Mon Sep 17 00:00:00 2001 From: tochnonement Date: Sat, 14 May 2022 19:27:39 +0300 Subject: [PATCH] fixed unused stuff and bumped version --- lua/autorun/gfconsole_autorun.lua | 2 +- lua/gfconsole/core/cl_convars.lua | 1 - lua/gfconsole/core/derma/cl_header.lua | 31 +++++++++++++++----------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lua/autorun/gfconsole_autorun.lua b/lua/autorun/gfconsole_autorun.lua index b8e317b..911973c 100644 --- a/lua/autorun/gfconsole_autorun.lua +++ b/lua/autorun/gfconsole_autorun.lua @@ -8,7 +8,7 @@ Email: tochonement@gmail.com --]] gfconsole = { - __VERSION = "1.4.3" + __VERSION = "1.4.4" } AddCSLuaFile("gfconsole/libraries/sh_load.lua") diff --git a/lua/gfconsole/core/cl_convars.lua b/lua/gfconsole/core/cl_convars.lua index 1fb45ab..6e05195 100644 --- a/lua/gfconsole/core/cl_convars.lua +++ b/lua/gfconsole/core/cl_convars.lua @@ -17,7 +17,6 @@ local cvColor = CreateClientConVar("cl_gfconsole_color", "green", true, false) cvars.AddChangeCallback("cl_gfconsole_hidetoolbar", function() local frame = gfconsole.frame if IsValid(frame) then - print(frame) frame.panel:UpdateToolBarVisibility() end end) diff --git a/lua/gfconsole/core/derma/cl_header.lua b/lua/gfconsole/core/derma/cl_header.lua index 430b299..41e26f9 100644 --- a/lua/gfconsole/core/derma/cl_header.lua +++ b/lua/gfconsole/core/derma/cl_header.lua @@ -88,25 +88,30 @@ function PANEL:OnMouseReleased(code) end end -function PANEL:Think() - local curtime = CurTime() +do + local CurTime = CurTime + local Round = math.Round - self:UpdateCollected() + function PANEL:Think() + local curtime = CurTime() - if (self.next_update or 0) <= curtime then - self.fps:SetText(math.Round(get_average(self.collected.fps))) - self.fps:SizeToContentsX() + self:UpdateCollected() - self.ping:SetText(math.Round(get_average(self.collected.ping)) .. "ms") - self.ping:SizeToContentsX() + if (self.next_update or 0) <= curtime then + self.fps:SetText(Round(get_average(self.collected.fps))) + self.fps:SizeToContentsX() - self:ResetCollected() + self.ping:SetText(Round(get_average(self.collected.ping)) .. "ms") + self.ping:SizeToContentsX() - self.next_update = curtime + .8 - end + self:ResetCollected() + + self.next_update = curtime + .8 + end - if gfconsole.holding then - self:MoveController() + if gfconsole.holding then + self:MoveController() + end end end