mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
50 lines
885 B
Lua
50 lines
885 B
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/
|
||
|
|
--]]
|
||
|
|
|
||
|
|
|
||
|
|
menubar = {}
|
||
|
|
|
||
|
|
function menubar.Init()
|
||
|
|
|
||
|
|
menubar.Control = vgui.Create( "DMenuBar" )
|
||
|
|
menubar.Control:Dock( TOP )
|
||
|
|
menubar.Control:SetVisible( false )
|
||
|
|
|
||
|
|
hook.Run( "PopulateMenuBar", menubar.Control )
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
function menubar.ParentTo( pnl )
|
||
|
|
|
||
|
|
// I don't like this
|
||
|
|
if ( !IsValid( menubar.Control ) ) then
|
||
|
|
menubar.Init()
|
||
|
|
end
|
||
|
|
|
||
|
|
menubar.Control:SetParent( pnl )
|
||
|
|
menubar.Control:MoveToBack()
|
||
|
|
menubar.Control:SetHeight( 30 )
|
||
|
|
menubar.Control:SetVisible( true )
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
function menubar.IsParent( pnl )
|
||
|
|
|
||
|
|
return menubar.Control:GetParent() == pnl
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
hook.Add( "OnGamemodeLoaded", "CreateMenuBar", function()
|
||
|
|
|
||
|
|
menubar.Init()
|
||
|
|
|
||
|
|
end )
|