|
|
@ -188,7 +188,7 @@ function iteminfo.giveoptions( p, page ) |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if( item.usefunction != nil ) then -- USE |
|
|
|
if( item.useeffect != nil ) then -- USE |
|
|
|
|
|
|
|
|
|
|
|
op.use = vgui.Create( "DButton", options ) |
|
|
|
op.use = vgui.Create( "DButton", options ) |
|
|
|
op.use:SetText( "Use Item" ) |
|
|
|
op.use:SetText( "Use Item" ) |
|
|
@ -213,7 +213,7 @@ function iteminfo.giveoptions( p, page ) |
|
|
|
ypos = ypos + op.use.h + yspacing |
|
|
|
ypos = ypos + op.use.h + yspacing |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if( item.consumefunction ) then -- EAT |
|
|
|
if( item.consumeeffect != nil ) then -- EAT |
|
|
|
|
|
|
|
|
|
|
|
op.eat = vgui.Create( "DButton", options ) |
|
|
|
op.eat = vgui.Create( "DButton", options ) |
|
|
|
op.eat:SetText( "Consume" ) |
|
|
|
op.eat:SetText( "Consume" ) |
|
|
@ -335,14 +335,17 @@ function iteminfo.givetooltip( p, page ) |
|
|
|
rare:SetPos( title.x, title.y + title.h + padding_s ) |
|
|
|
rare:SetPos( title.x, title.y + title.h + padding_s ) |
|
|
|
rare.x, rare.y = rare:GetPos() |
|
|
|
rare.x, rare.y = rare:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
local equip = vgui.Create( "DLabel", self ) |
|
|
|
local equip |
|
|
|
equip:SetText( Quantum.EquipSlotsNames[self.item.equipslot] || "ERROR EQUIPTYPE" ) |
|
|
|
if( Quantum.EquipSlotsNames[self.item.equipslot] != nil ) then |
|
|
|
equip:SetFont( "q_tooltip_equiptype" ) |
|
|
|
equip = vgui.Create( "DLabel", self ) |
|
|
|
equip:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
equip:SetText( Quantum.EquipSlotsNames[self.item.equipslot] || "ERROR EQUIPTYPE" ) |
|
|
|
equip:SizeToContents() |
|
|
|
equip:SetFont( "q_tooltip_equiptype" ) |
|
|
|
equip.w, equip.h = equip:GetSize() |
|
|
|
equip:SetTextColor( Color( 255, 255, 255, 255 ) ) |
|
|
|
equip:SetPos( title.x, rare.y + rare.h + padding_s ) |
|
|
|
equip:SizeToContents() |
|
|
|
equip.x, equip.y = equip:GetPos() |
|
|
|
equip.w, equip.h = equip:GetSize() |
|
|
|
|
|
|
|
equip:SetPos( title.x, rare.y + rare.h + padding_s ) |
|
|
|
|
|
|
|
equip.x, equip.y = equip:GetPos() |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local desc = vgui.Create( "DLabel", self ) |
|
|
|
local desc = vgui.Create( "DLabel", self ) |
|
|
|
desc:SetText( self.item.desc || "ERROR DESC" ) |
|
|
|
desc:SetText( self.item.desc || "ERROR DESC" ) |
|
|
@ -350,9 +353,52 @@ function iteminfo.givetooltip( p, page ) |
|
|
|
desc:SetTextColor( Color( 205, 205, 205, 255 ) ) |
|
|
|
desc:SetTextColor( Color( 205, 205, 205, 255 ) ) |
|
|
|
desc:SizeToContents() |
|
|
|
desc:SizeToContents() |
|
|
|
desc.w, desc.h = desc:GetSize() |
|
|
|
desc.w, desc.h = desc:GetSize() |
|
|
|
desc:SetPos( title.x, equip.y + equip.h + padding_s ) |
|
|
|
|
|
|
|
|
|
|
|
if( IsValid(equip) ) then |
|
|
|
|
|
|
|
desc:SetPos( title.x, equip.y + equip.h + padding_s ) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
desc:SetPos( title.x, rare.y + rare.h + padding_s ) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
desc.x, desc.y = desc:GetPos() |
|
|
|
desc.x, desc.y = desc:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local yposBase = desc.y + desc.h + padding_s |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( self.item.useeffect != nil ) then |
|
|
|
|
|
|
|
local effectTbl = Quantum.Effect.Get( self.item.useeffect ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( effectTbl.desc != nil ) then |
|
|
|
|
|
|
|
local use = vgui.Create( "DLabel", self ) |
|
|
|
|
|
|
|
use:SetText( "Use: " .. effectTbl.desc || "ERROR DESC USE" ) |
|
|
|
|
|
|
|
use:SetFont( "q_tooltip_desc" ) |
|
|
|
|
|
|
|
use:SetTextColor( Color( 18, 224, 66, 255 ) ) |
|
|
|
|
|
|
|
use:SizeToContents() |
|
|
|
|
|
|
|
use.w, use.h = use:GetSize() |
|
|
|
|
|
|
|
use:SetPos( title.x, yposBase ) |
|
|
|
|
|
|
|
use.x, use.y = use:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yposBase = yposBase + use.y + padding_s |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( self.item.consumeeffect != nil ) then |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local effectTbl = Quantum.Effect.Get( self.item.consumeeffect ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( effectTbl.desc != nil ) then |
|
|
|
|
|
|
|
local eat = vgui.Create( "DLabel", self ) |
|
|
|
|
|
|
|
eat:SetText( "Consume: " .. effectTbl.desc || "ERROR DESC EAT" ) |
|
|
|
|
|
|
|
eat:SetFont( "q_tooltip_desc" ) |
|
|
|
|
|
|
|
eat:SetTextColor( Color( 18, 224, 66, 255 ) ) |
|
|
|
|
|
|
|
eat:SizeToContents() |
|
|
|
|
|
|
|
eat.w, eat.h = eat:GetSize() |
|
|
|
|
|
|
|
eat:SetPos( title.x, yposBase ) |
|
|
|
|
|
|
|
eat.x, eat.y = eat:GetPos() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yposBase = yposBase + eat.y + padding_s |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if( self.item.soulbound == true ) then |
|
|
|
if( self.item.soulbound == true ) then |
|
|
|
local sb = vgui.Create( "DLabel", self ) |
|
|
|
local sb = vgui.Create( "DLabel", self ) |
|
|
|
sb:SetText( "Soulbound" ) |
|
|
|
sb:SetText( "Soulbound" ) |
|
|
@ -360,7 +406,7 @@ function iteminfo.givetooltip( p, page ) |
|
|
|
sb:SetTextColor( Color( 235, 64, 52, 255 ) ) |
|
|
|
sb:SetTextColor( Color( 235, 64, 52, 255 ) ) |
|
|
|
sb:SizeToContents() |
|
|
|
sb:SizeToContents() |
|
|
|
sb.w, sb.h = sb:GetSize() |
|
|
|
sb.w, sb.h = sb:GetSize() |
|
|
|
sb:SetPos( title.x, desc.y + desc.h + padding_s ) |
|
|
|
sb:SetPos( title.x, yposBase ) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- Correct the tooltips size so its content fits inside of it |
|
|
|
-- Correct the tooltips size so its content fits inside of it |
|
|
|