Alright, so I was working on a help menu/item system that doesn't quite do anything yet, and i'm stuck on getting the DPanelLists to only show up in their tabs. What happens is, when I run the derma the Weapons and Items DPanelLists show up on the same tab, I need them to show up on their specified tabs (etc weapons show up on the weapons tab items show up on the items tab)
[code]if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
else
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local ItemList = vgui.Create( "DPanelList" )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetPos(10,30)
ItemList:SetSize(340, 315)
local WeaponList = vgui.Create( "DPanelList" )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetPos(10,30)
ItemList:SetSize(340, 315)
--local DonateArea = vgui.Create( "DCategory" )
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
PropertySheet:AddSheet( "Items", ItemList, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponList, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
local item = {}
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
weapon[6] = "models/weapons/W_crowbar.mdl"
weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
concommand.Add("itemsystem", itemSystem)
end
[/code]
When you are setting the properties of weaponlist, you are still refering to itemlist. Also you aren't asigning either parent frames (SetParent())
[QUOTE=Robert64;16931295]When you are setting the properties of weaponlist, you are still refering to itemlist. Also you aren't asigning either parent frames (SetParent())[/QUOTE]
My New derma:
[code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
else
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( frame )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetPos(10,30)
ItemList:SetSize(340, 315)
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( frame )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetPos(10,30)
WeaponList:SetSize(340, 315)
--local DonateArea = vgui.Create( "DCategory" )
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
PropertySheet:AddSheet( "Items", ItemList, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponList, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
local item = {}
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
weapon[6] = "models/weapons/W_crowbar.mdl"
weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon = vgui.Create( "SpawnIcon", WeaponList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
end
concommand.Add("itemsystem", itemSystem)
[/code]
I set both of their parents to frame, and fixed the referrence issues. except it still will not work.
Well since you set them to both have the same parents and both be in the same position ..
they will both be in the same place. You should change the values in SetPos for one of them to move them apart.
[QUOTE=Robert64;16932301]Well since you set them to both have the same parents and both be in the same position ..
they will both be in the same place. You should change the values in SetPos for one of them to move them apart.[/QUOTE]
What do you mean?
Don't parent the lists to the frame, parent them to the property sheet.
[QUOTE=Entoros;16934543]Don't parent the lists to the frame, parent them to the property sheet.[/QUOTE]
I parented both of them to the property sheet. And they are still in the same place.
[QUOTE=Helix Alioth;16942284]I parented both of them to the property sheet. And they are still in the same place.[/QUOTE]
Are they both parented to the same sheet? If they are then parent one to the other sheet.
[QUOTE=Robert64;16944125]Are they both parented to the same sheet? If they are then parent one to the other sheet.[/QUOTE]
Wait so...
[code] PropertySheet:AddSheet( "Items", ItemList, "gui/silkicons/box", false, false, "Items" )
[/code]
that means its creating a propertysheet with the name of ItemList and not being a child of ItemList?
If so I think I get it.
Erm, not. The PropertySheet functions like this:
You create the property sheet and put it in the frame or something. You then create subpanels or whatever you want and parent those to the property sheet. By using the AddSheet() function, you create a DTab for the item and make the particular derma item visible when you click the DTab. You don't create any sub-propertysheets.
[QUOTE=Entoros;16947936]Erm, not. The PropertySheet functions like this:
You create the property sheet and put it in the frame or something. You then create subpanels or whatever you want and parent those to the property sheet. By using the AddSheet() function, you create a DTab for the item and make the particular derma item visible when you click the DTab. You don't create any sub-propertysheets.[/QUOTE]
Okay, So. How would I go about making a DTab?
I get what you mean with the parenting and all that. I just don't get the DTab.
I currently have:
[code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
else
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( PropertySheet )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetSize(340, 315)
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( PropertySheet )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetSize(340, 315)
--local DonateArea = vgui.Create( "DCategory" )
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
PropertySheet:AddSheet( "Items", ItemList, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponList, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
local item = {}
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
weapon[6] = "models/weapons/W_crowbar.mdl"
weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon2 = vgui.Create( "SpawnIcon", WeaponList )
icon:SetModel( v )
ItemList:AddItem( icon2 )
icon.DoClick = function( icon2 ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
end
concommand.Add("Itemsystem", itemSystem)
[/code]
No, I'm saying the Property Sheet does it for you. All you need to do is AddSheet(). Also, one problem is you're trying to parent stuff to something that doesn't exist; put the PropertySheet above the Item/WeaponLists.
[QUOTE=Entoros;16948176]No, I'm saying the Property Sheet does it for you. All you need to do is AddSheet(). Also, one problem is you're trying to parent stuff to something that doesn't exist; put the PropertySheet above the Item/WeaponLists.[/QUOTE]
My code currently looks like this, when I went ingame to test it only the frame showed up
[code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
else
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
PropertySheet:AddSheet( "Items", ItemList, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponList, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
--local DonateArea = vgui.Create( "DCategory" )
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( PropertySheet )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetSize(340, 315)
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( PropertySheet )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetSize(340, 315)
local item = {}
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
weapon[6] = "models/weapons/W_crowbar.mdl"
weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon = vgui.Create( "SpawnIcon", WeaponList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
end
concommand.Add("Itemsystem", itemSystem)
[/code]
Sorry, I should've been more specific. You CREATE the property sheet first, but you ADD the sheets afterwards. So put the AddSheet stuff after you make the Weapon/ItemLists.
[QUOTE=Entoros;16951415]Sorry, I should've been more specific. You CREATE the property sheet first, but you ADD the sheets afterwards. So put the AddSheet stuff after you make the Weapon/ItemLists.[/QUOTE]
okay, that fixed the problem with nothing being there. But still all the DPanelLists are in one tab and nothing in the other.
Here's a little snippet from my radio system thingy. Don't copy/paste this because I left a bunch of useless stuff out. But this is basically how it would work;
[code]
MainPanel = vgui.Create( "DFrame" )
MainPanel:SetBackgroundBlur( true )
MainPanel:SetPos((ScrW() / 2) - 260,(ScrH() / 2) - 300)
MainPanel:SetSize( 520, 630 )
MainPanel:SetTitle( "" )
MainPanel:SetVisible( true )
MainPanel:MakePopup()
MainPanel:SetDraggable( false )
MainPanel:ShowCloseButton( false )
MainPanel.Paint = function()
draw.RoundedBox(6,0,0,MainPanel:GetWide(), MainPanel:GetTall(),Color(168,168,168,255))
draw.RoundedBox(6,1,1,MainPanel:GetWide()-2, MainPanel:GetTall()-2,Color(25,25,25,230))
end
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( MainPanel )
PropertySheet:SetPos( 3, 3 )
PropertySheet:SetSize( 514, 624 )
local SongPanel = vgui.Create( "DPanel" )
SongPanel:SetPos(0,0)
SongPanel:SetSize(20,20)
SongPanel.Paint = function()
draw.RoundedBox( 6,0, 0, SongPanel:GetWide(), SongPanel:GetTall()-78,Color(50,50,50,255) )
draw.RoundedBox( 6,0, SongPanel:GetTall() - 73, SongPanel:GetWide(), 40,Color(50,50,50,255) )
draw.RoundedBox( 6,SongPanel:GetWide() - 130, SongPanel:GetTall() - 27, 130, 25,Color(50,50,50,255) )
end
MusicWindow = vgui.Create("DListView")
MusicWindow:SetParent(SongPanel)
MusicWindow:SetPos(5,2)
MusicWindow:SetSize(495, 510)
MusicWindow:SetMultiSelect(false)
local Name = MusicWindow:AddColumn("Song Name")
local Artist = MusicWindow:AddColumn("Artist")
local Length = MusicWindow:AddColumn("Time")
local QueuePanel = vgui.Create( "DPanel" )
QueuePanel:SetPos(0,0)
QueuePanel:SetSize(20,20)
QueuePanel.Paint = function()
draw.RoundedBox( 6,0, 0, QueuePanel:GetWide(), 193,Color(50,50,50,255) )
end
QueueWindow = vgui.Create("DListView")
QueueWindow:SetParent(QueuePanel)
QueueWindow:SetPos(5,2)
QueueWindow:SetSize(495, 187)
QueueWindow:SetMultiSelect(false)
local Name = QueueWindow:AddColumn("Song Name")
local Artist = QueueWindow:AddColumn("Artist")
local Length = QueueWindow:AddColumn("Time")
Name:SetWidth(280)
Artist:SetWidth(165)
Length:SetWidth(25)
PropertySheet:AddSheet( "Song List", SongPanel, "gui/silkicons/application_view_detail", false, false, "Song List Yo." )
PropertySheet:AddSheet( "Queue List", QueuePanel, "gui/silkicons/application_view_tile", false, false, "Dat's da QUEUEUE" )
[/code]
I didn't really look through your code that much, so I hope this helps at all xP
Well. I tryed using DPanel's and I get this error
autorun/cl_vgui.lua:80: '<eof>' expected near 'end'
My code is:
[code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
else
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
local ItemArray = vgui.Create( "DPanel" )
SongPanel:SetPos(0,0)
SongPanel:SetSize(20,20)
end
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( ItemArray )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetSize(340, 315)
local WeaponArray = vgui.Create( "DPanel" )
SongPanel:SetPos(0,0)
SongPanel:SetSize(20,20)
end
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( WeaponArray )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetSize(340, 315)
local item = {}
PropertySheet:AddSheet( "Items", ItemArray, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponArray, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
weapon[6] = "models/weapons/W_crowbar.mdl"
weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon = vgui.Create( "SpawnIcon", WeaponList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
end
concommand.Add("Itemsystem", itemSystem)
[/code]
Can someone just make an edit and make it work?
I obviously am not getting something.
[code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
end
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
local ItemArray = vgui.Create( "DPanel" )
ItemArray:SetPos(0,0)
ItemArray:SetSize(20,20)
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( ItemArray )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetSize(340, 315)
local WeaponArray = vgui.Create( "DPanel" )
WeaponArray:SetPos(0,0)
WeaponArray:SetSize(20,20)
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( WeaponArray )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetSize(340, 315)
local item = {}
PropertySheet:AddSheet( "Items", ItemArray, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponArray, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
--weapon[6] = "models/weapons/W_crowbar.mdl"
--weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon2 = vgui.Create( "SpawnIcon", WeaponList )
icon2:SetModel( v )
WeaponList:AddItem( icon2 )
icon2.DoClick = function( icon2 ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
concommand.Add("Itemsystem", itemSystem)
[/code]
I edited out two of the weapon items to check that it's not the same thing on both panels.
[QUOTE=Skapocalypse;16952680][code]
if SERVER then
AddCSLuafile("autorun/cl_vgui.lua")
end
function itemSystem()
local frame = vgui.Create("DFrame")
frame:Center()
frame:SetSize(350,400)
frame:SetTitle("Item System")
frame:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( frame )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )
local ItemArray = vgui.Create( "DPanel" )
ItemArray:SetPos(0,0)
ItemArray:SetSize(20,20)
local ItemList = vgui.Create( "DPanelList" )
ItemList:SetParent( ItemArray )
ItemList:EnableVerticalScrollbar( true )
ItemList:EnableHorizontal( true )
ItemList:SetPadding( 4 )
ItemList:SetSize(340, 315)
local WeaponArray = vgui.Create( "DPanel" )
WeaponArray:SetPos(0,0)
WeaponArray:SetSize(20,20)
local WeaponList = vgui.Create( "DPanelList" )
WeaponList:SetParent( WeaponArray )
WeaponList:EnableVerticalScrollbar( true )
WeaponList:EnableHorizontal( true )
WeaponList:SetPadding( 4 )
WeaponList:SetSize(340, 315)
local item = {}
PropertySheet:AddSheet( "Items", ItemArray, "gui/silkicons/box", false, false, "Items" )
PropertySheet:AddSheet( "Weapons", WeaponArray, "gui/silkicons/bomb", false, false, "Weapons" )
--PropertySheet:AddSheet( "Donate", DonateArea, "gui/silkicons/heart", false, false, "Donate" )
item[1] = "models/weapons/W_grenade.mdl"
item[2] = "models/weapons/W_physics.mdl"
item[3] = "models/weapons/W_rocket_launcher.mdl"
item[4] = "models/weapons/W_stunbaton.mdl"
item[5] = "models/weapons/W_crossbow.mdl"
item[6] = "models/weapons/W_crowbar.mdl"
item[7] = "models/weapons/W_357.mdl"
local weapon = {}
weapon[1] = "models/weapons/W_grenade.mdl"
weapon[2] = "models/weapons/W_physics.mdl"
weapon[3] = "models/weapons/W_rocket_launcher.mdl"
weapon[4] = "models/weapons/W_stunbaton.mdl"
weapon[5] = "models/weapons/W_crossbow.mdl"
--weapon[6] = "models/weapons/W_crowbar.mdl"
--weapon[7] = "models/weapons/W_357.mdl"
for k,v in pairs(item) do
local icon = vgui.Create( "SpawnIcon", ItemList )
icon:SetModel( v )
ItemList:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
for k,v in pairs(weapon) do
local icon2 = vgui.Create( "SpawnIcon", WeaponList )
icon2:SetModel( v )
WeaponList:AddItem( icon2 )
icon2.DoClick = function( icon2 ) surface.PlaySound( "ui/buttonclickrelease.wav" ) end
end
end
concommand.Add("Itemsystem", itemSystem)
[/code]
I edited out two of the weapon items to check that it's not the same thing on both panels.[/QUOTE]
OMG Thank you! Whatever you did fixed the issue, they are now in seperate tabs!!!
Thank you sooo much! :)
You had a couple random ends that were breaking it, and you were copy/pasting some code that made everything overlap. Just had to delete/change some things. Good luck with the system :)
[QUOTE=Skapocalypse;16952909]You had a couple random ends that were breaking it, and you were copy/pasting some code that made everything overlap. Just had to delete/change some things. Good luck with the system :)[/QUOTE]
Thanks.
Sorry, you need to Log In to post a reply to this thread.