Permalink
Browse files

Update properties.lua

Restrict properties to context menu only
  • Loading branch information...
1 parent 72ffb70 commit 4a7dc2b9742054c8c2bed6e0f4d8b027a0ffec94 @robotboy655 robotboy655 committed Jul 15, 2014
Showing with 7 additions and 3 deletions.
  1. +7 −3 garrysmod/lua/includes/modules/properties.lua
@@ -149,9 +149,9 @@ if ( CLIENT ) then
hook.Add( "PreDrawHalos", "PropertiesHover", function()
- if ( vgui.GetHoveredPanel() != vgui.GetWorldPanel() && vgui.GetHoveredPanel() != g_ContextMenu ) then return end
-
- local ent = properties.GetHovered( EyePos(), LocalPlayer():GetAimVector() )
+ if ( !IsValid( vgui.GetHoveredPanel() ) || vgui.GetHoveredPanel() != g_ContextMenu ) then return end
+
+ local ent = GetHovered( EyePos(), LocalPlayer():GetAimVector() )
if ( !IsValid( ent ) ) then return end
local c = Color( 255, 255, 255, 255 )
@@ -168,6 +168,8 @@ if ( CLIENT ) then
-- gui.
--
hook.Add( "GUIMousePressed", "PropertiesClick", function( code, vector )
+
+ if ( !IsValid( vgui.GetHoveredPanel() ) || vgui.GetHoveredPanel() != g_ContextMenu ) then return end
if ( code == MOUSE_RIGHT && !input.IsButtonDown( MOUSE_LEFT ) ) then
OnScreenClick( EyePos(), vector )
@@ -180,6 +182,8 @@ if ( CLIENT ) then
-- gui.
--
hook.Add( "PreventScreenClicks", "PropertiesPreventClicks", function()
+
+ if ( !IsValid( vgui.GetHoveredPanel() ) || vgui.GetHoveredPanel() != g_ContextMenu ) then return end
local ply = LocalPlayer()
if ( !IsValid( ply ) ) then return end

0 comments on commit 4a7dc2b

Please sign in to comment.