SANDBOX:PopulateContent
Açıklama
İçerik (content) sekmesi oluşturulduğunda spawnmenu tarafından çağrılır.
Bu Hook içerisinde hata oluşturmak, İçerik Sekmesinin tamamen bozulmasına neden olacaktır.
Argümanlar
Örnek
Modeller (Models) paneli ile bir Örnek Kategorisi oluşturur.
hook.Add( "PopulateContent", "Example", function( pnlContent, tree, node )
local ViewPanel = vgui.Create( "ContentContainer", pnlContent )
ViewPanel:SetVisible( false )
ViewPanel.IconList:SetReadOnly( true )
ExampleNode = node:AddNode( "Example", "icon16/folder_database.png" )
ExampleNode.pnlContent = pnlContent
ExampleNode.ViewPanel = ViewPanel
local models = ExampleNode:AddNode( "Models", "icon16/exclamation.png" )
models.DoClick = function()
ViewPanel:Clear( true )
local cp = spawnmenu.GetContentType( "model" )
if cp then
for k, v in ipairs( file.Find( "models/*.mdl", "GAME" ) ) do
cp( ViewPanel, { model = "models/" .. v } )
end
end
ExampleNode.pnlContent:SwitchPanel( ViewPanel )
end
end)
Çıktı: 

Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord