From 461a29d8fdb2fd6c86a77912e9c2232e1f101ca8 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 19 Jun 2017 00:07:01 -0400 Subject: Massive updates Lots of stuff was updated, mostly to support addons. Inventory tracking is also updated a little and a bug fixed in inventory. Nrequire now probably won't crash the client, no matter how many times it's used. --- gamemode/client/cl_inventory.lua | 9 +++++---- gamemode/client/qtabs/cl_qinventory.lua | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'gamemode/client') diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 758f9b1..c5725dc 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -36,6 +36,7 @@ local height = ScrH() local credits = 0 local creditslabel local droppanel --Dpanel to drop things on when they are dropped, should be the backmost panel, and cover the entire screen. +inv.tabsheet = nil local player_data --The data the player needs to show the q panel net.Receive("art_load_player_data",function() @@ -79,16 +80,16 @@ local function BuildInventory() creditstext:SetText("Credits:") creditstext:SetPos(100,5) - local tabsheet = vgui.Create("DPropertySheet",qframe) - tabsheet:Dock(FILL) + inv.tabsheet = vgui.Create("DPropertySheet",qframe) + inv.tabsheet:Dock(FILL) - local invsheet = qinv.CreateInventorySheet(tabsheet) + local invsheet = qinv.CreateInventorySheet(inv.tabsheet) --qpray.CreatePrayerSheet(tabsheet) invsheet.id = #qtabs + 1 qtabs[#qtabs + 1] = invsheet --prasheet.id = #qtabs + 1 --qtabs[#qtabs + 1] = prasheet - tabsheet:AddSheet("Inventory",invsheet,"icon16/user.png") + inv.tabsheet:AddSheet("Inventory",invsheet,"icon16/user.png") --tabsheet:AddSheet("Prayers",prasheet,"icon16/user.png") end diff --git a/gamemode/client/qtabs/cl_qinventory.lua b/gamemode/client/qtabs/cl_qinventory.lua index 6fc3d37..2879ac5 100644 --- a/gamemode/client/qtabs/cl_qinventory.lua +++ b/gamemode/client/qtabs/cl_qinventory.lua @@ -14,9 +14,9 @@ local invsheet local drawfloatinginventory = function(id, inventory) --print("Drawing a floating inventory!") local frame = vgui.Create("DFrame") - frame:SetPos( 100, 100 ) - frame:SetSize( 300, 200 ) - frame:SetTitle( "My new Derma frame" ) + frame:SetPos( ScrW() - (ScrW()/4), 0 ) + frame:SetSize( ScrW()/4, ScrH()/4 ) + frame:SetTitle( inventory.Name ) frame:SetDraggable( true ) local panel = vgui.Create("DPanel",frame) panel:Dock(FILL) -- cgit v1.2.3-70-g09d2