Skip to content

Commit

Permalink
Updated: Active radius limits
Browse files Browse the repository at this point in the history
Updated: Draw tool screen sequence
  • Loading branch information
dvdvideo1234 committed Nov 5, 2023
1 parent 9e9e596 commit b485abd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions lua/weapons/gmod_tool/stools/trackassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b485abd

Please sign in to comment.