Item bug fixes & inventory stuff

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

@ -18,7 +18,7 @@ if SERVER then
name = Quantum.Server.Char.getBasicCharInfo( Quantum.Server.Char.GetCurrentCharacter( pl ) ).name, name = Quantum.Server.Char.getBasicCharInfo( Quantum.Server.Char.GetCurrentCharacter( pl ) ).name,
money = Quantum.Server.Char.getBasicCharInfo( Quantum.Server.Char.GetCurrentCharacter( pl ) ).money money = Quantum.Server.Char.getBasicCharInfo( Quantum.Server.Char.GetCurrentCharacter( pl ) ).money
}, items = { [1] = {"test", 1}, [2] = {"test2", Quantum.Inventory.MaxStackSize} } }) }, items = { [1] = {"test", 1}, [2] = {"test2", Quantum.Inventory.MaxStackSize } } })
end end
} }

@ -57,8 +57,18 @@ function iteminfo.givetooltip( p, page )
desc:SizeToContents() desc:SizeToContents()
desc.w, desc.h = desc:GetSize() desc.w, desc.h = desc:GetSize()
desc:SetPos( title.x, rare.y + rare.h + padding_s ) 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 -- Correct the tooltips size so its content fits inside of it
self:SizeToChildren( true, true ) self:SizeToChildren( true, true )
self.w, self.h = self:GetSize() self.w, self.h = self:GetSize()

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

@ -19,10 +19,10 @@ Quantum.Item.Create( "test", {
Quantum.Item.Create( "test2", { Quantum.Item.Create( "test2", {
name = "Trash Item Test", 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", model = "models/props_phx/gears/bevel12.mdl",
stack = true, stack = true,
soulbound = true, soulbound = false,
equipable = false, equipable = false,
rarity = Quantum.Rarity.Trash, rarity = Quantum.Rarity.Trash,
consumefunction = function( user ) consumefunction = function( user )

Loading…
Cancel
Save