Added tooltips to item in crafting menu & tooltip fix

master
AlmTech Software 5 years ago
parent c51e521327
commit 403f7fae42
  1. 1
      gamemode/engine/derma/lib/cl_menu_iteminfo.lua
  2. 4
      gamemode/engine/derma/menus/menu_crafting.lua

@ -379,6 +379,7 @@ function iteminfo.givetooltip( p, page, addW )
tooltip.Paint = function( self ) tooltip.Paint = function( self )
theme.iteminfopanel( self ) theme.iteminfopanel( self )
end end
tooltip:SetDrawOnTop( true )
tooltip.Think = function( self ) -- prevents tooltip from showing when a item is showing its options tooltip.Think = function( self ) -- prevents tooltip from showing when a item is showing its options
if( page.showtooltips != nil ) then if( page.showtooltips != nil ) then

@ -307,7 +307,7 @@ function menu.open( dt )
local mw, mh = resBars[resID].cont.w ,resBars[resID].cont.h local mw, mh = resBars[resID].cont.w ,resBars[resID].cont.h
-- icon -- icon
resBars[resID].cont.icon = createItemPanel( mw/8, mh/8, 2, resBars[resID].cont, f ) resBars[resID].cont.icon = createItemPanel( mw/8, mh/8, 2, resBars[resID].cont, back, false, true )
resBars[resID].cont.icon.SetItem( resID ) resBars[resID].cont.icon.SetItem( resID )
if( resBars[resID].resTbl.amount > 1 ) then if( resBars[resID].resTbl.amount > 1 ) then
@ -386,7 +386,7 @@ function menu.open( dt )
surface.DrawRect( 0, 0, w, h ) surface.DrawRect( 0, 0, w, h )
end end
itemPanels[count].icon = createItemPanel( (itemWidth*regScale)/2 + padding*2, itemPanels[count].h/2, regScale, itemPanels[count], f ) itemPanels[count].icon = createItemPanel( (itemWidth*regScale)/2 + padding*2, itemPanels[count].h/2, regScale, itemPanels[count], back, false, true )
itemPanels[count].icon.SetItem( itemid ) itemPanels[count].icon.SetItem( itemid )
local itemname = vgui.Create( "DLabel", itemPanels[count] ) local itemname = vgui.Create( "DLabel", itemPanels[count] )

Loading…
Cancel
Save