Skip to content

Commit

Permalink
Merge pull request #2 from JustPlayerDE/master
Browse files Browse the repository at this point in the history
VGUI drawing fixes
  • Loading branch information
TomDotBat authored Nov 3, 2020
2 parents 25a2a02 + b5f8950 commit 765bea4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cl_ui3d2d_extras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ do --3d2d VGUI Drawing
return s.Hovered
end

panel:SetPaintedManually(true)
panel.isUi3d2dSetup = true
end

Expand All @@ -65,7 +66,21 @@ do --3d2d VGUI Drawing
else
if not validChild and pointInsidePanel(panel, x, y) then
panel.Hovered = true
if panel.DoClick and ui3d2d.isPressed() then panel:DoClick() end

if panel.OnMousePressed then
local key = input.IsKeyDown(KEY_LSHIFT) and MOUSE_RIGHT or MOUSE_LEFT

if panel.OnMousePressed and ui3d2d.isPressed() then
panel:OnMousePressed(key)
end

if panel.OnMouseReleased and not ui3d2d.isPressing() then
panel:OnMouseReleased(key)
end
elseif panel.DoClick and ui3d2d.isPressed() then
panel:DoClick()
end

if panel.OnCursorEntered then panel:OnCursorEntered() end

return true
Expand Down

0 comments on commit 765bea4

Please sign in to comment.