Item bug fixes & inventory stuff

master v0.3-alpha
AlmTech Software 5 years ago
parent 77529575ca
commit 80e2dd8483
  1. 12
      gamemode/engine/derma/lib/cl_menu_iteminfo.lua
  2. 6
      gamemode/engine/lib/sh_items.lua
  3. 4
      gamemode/settings/sh_items.lua

@ -57,7 +57,17 @@ function iteminfo.givetooltip( p, page )
desc:SizeToContents()
desc.w, desc.h = desc:GetSize()
desc:SetPos( title.x, rare.y + rare.h + padding_s )
desc.x, desc.y = desc:GetPos()
if( self.item.soulbound == true ) then
local sb = vgui.Create( "DLabel", self )
sb:SetText( "Soulbound" )
sb:SetFont( "q_tooltip_rarity" )
sb:SetTextColor( Color( 235, 64, 52, 255 ) )
sb:SizeToContents()
sb.w, sb.h = sb:GetSize()
sb:SetPos( title.x, desc.y + desc.h + padding_s )
end
-- Correct the tooltips size so its content fits inside of it
self:SizeToChildren( true, true )

@ -13,9 +13,9 @@ function Quantum.Item.Create( id, args )
name = args.name || "ERROR", -- items name
desc = args.desc || "ERROR: Some idiot forgot to give this item a description.", -- items description
model = args.model || "models/props_phx/gears/bevel12.mdl", -- items model
stack = args.stack || false, -- items max stack size
soulbound = args.soulbound || true, -- if item could be dropped/traded to other players
equipable = args.equipable || false, -- equipable or not
stack = args.stack, -- items max stack size
soulbound = args.soulbound, -- if item could be dropped/traded to other players
equipable = args.equipable, -- equipable or not
rarity = args.rarity || Quantum.Rarity.Trash, -- rarity of the item
usefunction = args.usefunction, -- use function
consumefunction = args.consumefunction --consume function

@ -19,10 +19,10 @@ Quantum.Item.Create( "test", {
Quantum.Item.Create( "test2", {
name = "Trash Item Test",
desc = "This is literall trash\nLine breaker test :D\n\nTest",
desc = "This is literall trash\nLine breaker test :D\n\nTest :D",
model = "models/props_phx/gears/bevel12.mdl",
stack = true,
soulbound = true,
soulbound = false,
equipable = false,
rarity = Quantum.Rarity.Trash,
consumefunction = function( user )

Loading…
Cancel
Save