From b485abd3ab554f7a41b220c3fe0efa5d4514fa0f Mon Sep 17 00:00:00 2001 From: dvdvideo1234 Date: Sun, 5 Nov 2023 13:07:03 +0200 Subject: [PATCH] Updated: Active radius limits Updated: Draw tool screen sequence --- lua/autorun/trackassembly_init.lua | 6 +++--- lua/weapons/gmod_tool/stools/trackassembly.lua | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 1d164b60..2fd733ea 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -85,7 +85,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present ------------ CONFIGURE ASMLIB ------------ asmlib.InitBase("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","8.731") +asmlib.SetOpVar("TOOL_VERSION","8.732") asmlib.SetIndexes("V" ,1,2,3) asmlib.SetIndexes("A" ,1,2,3) asmlib.SetIndexes("WV",1,2,3) @@ -136,7 +136,7 @@ asmlib.SetBorder(gsToolPrefL.."incsnpang", 0, gnMaxRot) asmlib.SetBorder(gsToolPrefL.."incsnplin", 0, 250) asmlib.SetBorder(gsToolPrefL.."logfile" , 0, 1) asmlib.SetBorder(gsToolPrefL.."logsmax" , 0, 100000) -asmlib.SetBorder(gsToolPrefL.."maxactrad", 1, 200) +asmlib.SetBorder(gsToolPrefL.."maxactrad", 1, 400) asmlib.SetBorder(gsToolPrefL.."maxforce" , 0, 200000) asmlib.SetBorder(gsToolPrefL.."maxfruse" , 1, 150) asmlib.SetBorder(gsToolPrefL.."maxlinear", 0) @@ -390,7 +390,7 @@ if(SERVER) then local nextyaw = mathClamp(pPly:GetInfoNum(gsToolPrefL.."nextyaw" , 0),-gnMaxRot, gnMaxRot) local nextrol = mathClamp(pPly:GetInfoNum(gsToolPrefL.."nextrol" , 0),-gnMaxRot, gnMaxRot) local forcelim = mathClamp(pPly:GetInfoNum(gsToolPrefL.."forcelim", 0),0,asmlib.GetAsmConvar("maxforce" , "FLT")) - local activrad = mathClamp(pPly:GetInfoNum(gsToolPrefL.."activrad", 0),1,asmlib.GetAsmConvar("maxactrad", "FLT")) + local activrad = mathClamp(pPly:GetInfoNum(gsToolPrefL.."activrad", 0),0,asmlib.GetAsmConvar("maxactrad", "FLT")) local trPos, trAng, trRad, trID, trTr = trEnt:GetPos(), trEnt:GetAngles(), activrad, 0 for ID = 1, trRec.Size, 1 do -- Hits distance shorter than the active radius local oTr, oDt = asmlib.GetTraceEntityPoint(trEnt, ID, activrad) diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index 63edf1de..d993dd71 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -2233,9 +2233,9 @@ function TOOL:DrawToolScreen(w, h) scrTool:DrawText("Holds Model: Valid","g") scrTool:DrawTextRe(" ["..gsModeDataB.."]","db") local trEnt = stTrace.Entity - local workmode = self:GetWorkingMode() local actrad = self:GetActiveRadius() local pointid, pnextid = self:GetPointID() + local workmode, workname = self:GetWorkingMode() local trMaxCN, trModel, trOID, trRLen if(trEnt and trEnt:IsValid()) then if(asmlib.IsOther(trEnt)) then return end @@ -2267,19 +2267,18 @@ function TOOL:DrawToolScreen(w, h) .. " (" ..(pnextid or gsNoID) ..") [" ..(hdRec.Size or gsNoID).."]","g") scrTool:DrawText("MaxCL: "..actrad.." < ["..maxrad.."]","c") - scrTool:DrawText("CurAR: "..(trRLen or gsNoAV),"y") local txW, txH = scrTool:GetTextStScreen() local txsX, txsY = scrTool:GetTextStLast() - local nRad = mathClamp(h - txH - (txsY / 2),0,h) / 2 - local cPos = mathClamp(h - nRad - (txsY / 3),0,h) + scrTool:DrawText("Work: ["..workmode.."] "..workname, "wm") + scrTool:DrawText("CurAR: "..(trRLen or gsNoAV),"y") + local nRad = mathClamp(h - txH - txsY / 1.2,0,h) / 2 + local cPos = mathClamp(h - nRad - txsY / 2.5,0,h) local xyPs = asmlib.NewXY(cPos, cPos) - local workmode, workname = self:GetWorkingMode() scrTool:DrawCircle(xyPs, mathClamp(actrad/maxrad,0,1)*nRad, "c","SURF") scrTool:DrawCircle(xyPs, nRad, "m") scrTool:DrawText("Date: "..asmlib.GetDate(),"w") scrTool:DrawText("Time: "..asmlib.GetTime()) if(trRLen) then scrTool:DrawCircle(xyPs, nRad * mathClamp(trRLen/maxrad,0,1),"y") end - scrTool:DrawText("Work: ["..workmode.."] "..workname, "wm") end -- Enter `spawnmenu_reload` in the console to reload the panel