mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
52 lines
1.1 KiB
Lua
52 lines
1.1 KiB
Lua
--[[
|
|
| This file was obtained through the combined efforts
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
|
|
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
|
|
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
|
--]]
|
|
|
|
|
|
local Panels = {}
|
|
|
|
hook.Add( "DrawOverlay", "VGUIShowLayoutPaint", function()
|
|
|
|
for panel, data in pairs( Panels ) do
|
|
|
|
if ( panel:IsValid() ) then
|
|
|
|
local x, y = panel:LocalToScreen( 0, 0 )
|
|
|
|
local Alpha = math.Clamp( (data.Time - SysTime()) / 0.3, 0, 1 ) * 100
|
|
|
|
surface.SetDrawColor( 255, 0, 0, Alpha )
|
|
surface.DrawRect( x, y, panel:GetWide(), panel:GetTall() )
|
|
|
|
surface.SetDrawColor( 0, 255, 0, Alpha )
|
|
surface.DrawOutlinedRect( x, y, panel:GetWide(), panel:GetTall() )
|
|
|
|
-- vgui_visualizelayout 2?
|
|
-- draw.SimpleText( panel:GetZPos(), "Default", x + 3, y, color_white )
|
|
|
|
end
|
|
|
|
if ( !panel:IsValid() || data.Time < SysTime() ) then
|
|
Panels[ panel ] = nil
|
|
end
|
|
|
|
end
|
|
|
|
end )
|
|
|
|
-- Called from the engine
|
|
function VisualizeLayout( panel )
|
|
|
|
local tab = {}
|
|
tab.Time = SysTime() + 0.3
|
|
|
|
Panels[ panel ] = tab
|
|
|
|
end
|