buildmode fixes

1) align the cursor properly
2) fix highlighting
This commit is contained in:
relaxtakenotes 2025-02-24 22:12:36 +05:00
parent 154a980f60
commit 27ba7c3d49
3 changed files with 14 additions and 13 deletions

View file

@ -95,7 +95,7 @@ entplacefunc = {
entplacefunc_cl = { entplacefunc_cl = {
tt_cp = function() tt_cp = function()
local svec = util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH()) local svec = gui.ScreenToVector(gui.MouseX(), gui.MouseY())
local start = LocalPlayer():EyePos() local start = LocalPlayer():EyePos()
svec:Mul(100000) svec:Mul(100000)
@ -301,9 +301,9 @@ end
local function CustomPropMat(prop) local function CustomPropMat(prop)
if propmatsblacklist[buildmode_props_index[prop:GetModel()]] then return end if propmatsblacklist[buildmode_props_index[prop:GetModel()]] then return end
if prop.hr == true then if prop.hr then
prop:SetMaterial("medge/redplainplastervertex") prop:SetMaterial("medge/redplainplastervertex")
elseif prop.hr == nil or prop.hr == false then else
prop:SetMaterial("medge/plainplastervertex") prop:SetMaterial("medge/plainplastervertex")
end end
end end
@ -481,7 +481,8 @@ if SERVER then
local selected = net.ReadTable() local selected = net.ReadTable()
for _, v in pairs(selected) do for _, v in pairs(selected) do
v.hr = not v.hr if v.hr then v.hr = false end
if not v.hr then v.hr = true end
CustomPropMat(v) CustomPropMat(v)
end end
@ -909,9 +910,9 @@ if CLIENT then
local class = v:GetClass() local class = v:GetClass()
if class == "prop_physics" then if class == "prop_physics" then
local hr = v:GetMaterial() == "medge/redplainplastervertex" and true or nil local hr = false
if v:GetMaterial() == "medge/redplainplastervertex" then hr = true end
if v.buildmode_placed_manually then hr = false end //if v.buildmode_placed_manually then hr = false end
table.insert(save[1], { table.insert(save[1], {
model = v:GetModel():lower(), model = v:GetModel():lower(),
@ -1085,7 +1086,7 @@ if CLIENT then
[KEY_F] = function() [KEY_F] = function()
if CurTime() < BuildModePlaceDelay then return end if CurTime() < BuildModePlaceDelay then return end
local svec = util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH()) local svec = gui.ScreenToVector(gui.MouseX(), gui.MouseY())
svec:Mul(100000) svec:Mul(100000)
local start = LocalPlayer():EyePos() local start = LocalPlayer():EyePos()
@ -1107,7 +1108,7 @@ if CLIENT then
[KEY_S] = function() [KEY_S] = function()
if camcontrol then return end if camcontrol then return end
local svec = util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH()) local svec = gui.ScreenToVector(gui.MouseX(), gui.MouseY())
svec:Mul(100000) svec:Mul(100000)
local start = LocalPlayer():EyePos() local start = LocalPlayer():EyePos()
@ -1319,7 +1320,7 @@ if CLIENT then
end end
if BuildModeIndex == 0 then if BuildModeIndex == 0 then
local svec = util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH()) local svec = gui.ScreenToVector(gui.MouseX(), gui.MouseY()) //util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH())
svec:Mul(100000) svec:Mul(100000)
local start = LocalPlayer():EyePos() local start = LocalPlayer():EyePos()
@ -1488,7 +1489,7 @@ if CLIENT then
function BuildModeSelect() function BuildModeSelect()
if dragging then if dragging then
local svec = util.AimVector(LocalPlayer():EyeAngles(), 133, mousex, mousey, ScrW(), ScrH()) local svec = gui.ScreenToVector(gui.MouseX(), gui.MouseY())
dragoffset:Set(svec) dragoffset:Set(svec)
if not dragorigin then if not dragorigin then

View file

@ -1,6 +1,6 @@
BEATRUN_SHARED = BEATRUN_SHARED or {} BEATRUN_SHARED = BEATRUN_SHARED or {}
versionGlobal = "1.0.40" versionGlobal = "1.0.41"
versionLatest = "" versionLatest = ""
local isVersionCheched local isVersionCheched

View file

@ -1 +1 @@
1.0.40 1.0.41