F4 Tab Creation DPanels

Hi all,

So on DarkRP 2.5 there is a demo module of a custom tab. I tried to make a new tab by making a new DPanel and it doesn’t seem to show up.

I use

local DPanel1 = vgui.Create('DPanel')

to make the panel then once I have parented and positioned all the other DLabels etc. I do this:

DarkRP.addF4MenuTab(tabName, DPanel1)

This should add the f4 tab ( btw tabName is a local variable which I set in the beginning of the code )

Then at the end the hook is:

hook.Add("F4MenuTabs", "InventoryTab", InventoryTab)

I have no idea why it is not adding it.
Also the default tab module when enabled works perfectly fine


local DPanel1 = vgui.Create(‘DPanel’)
local DPanel1 = vgui.Create(‘DermaPanel’)
and if that don’t work
local DPanel1 = vgui.Create(‘DFrame’)
See if that works if not i’ll dig into my code

Thanks, but none of them work

Does the tab not show up at all or does its contents not show?

local tabName = "Inventory"

local function Inventory()
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 80,50 )
DermaPanel:SetSize( 200, 130 )
DermaPanel:SetTitle( "Inventory" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false )
DermaPanel:ShowCloseButton( false )

DarkRP.addF4MenuTab(tabName, DermaPanel)
hook.Add("F4MenuTabs", "F4", Inventory)

I can’t see the tab (meaning I can’t see the content as well), if I enable the example tab it works fine and I can see everything but my custom one doesn’t even appear.

[editline]8th December 2013[/editline]

Cheers this works fine :smiley: