From 403f7fae422f910c636a4e0232d457e12edd2f55 Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Sat, 1 Feb 2020 00:33:38 +0100 Subject: [PATCH] Added tooltips to item in crafting menu & tooltip fix --- gamemode/engine/derma/lib/cl_menu_iteminfo.lua | 1 + gamemode/engine/derma/menus/menu_crafting.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemode/engine/derma/lib/cl_menu_iteminfo.lua b/gamemode/engine/derma/lib/cl_menu_iteminfo.lua index 5da47b1..6aae74e 100644 --- a/gamemode/engine/derma/lib/cl_menu_iteminfo.lua +++ b/gamemode/engine/derma/lib/cl_menu_iteminfo.lua @@ -379,6 +379,7 @@ function iteminfo.givetooltip( p, page, addW ) tooltip.Paint = function( self ) theme.iteminfopanel( self ) end + tooltip:SetDrawOnTop( true ) tooltip.Think = function( self ) -- prevents tooltip from showing when a item is showing its options if( page.showtooltips != nil ) then diff --git a/gamemode/engine/derma/menus/menu_crafting.lua b/gamemode/engine/derma/menus/menu_crafting.lua index 932f5c2..58a323a 100644 --- a/gamemode/engine/derma/menus/menu_crafting.lua +++ b/gamemode/engine/derma/menus/menu_crafting.lua @@ -307,7 +307,7 @@ function menu.open( dt ) local mw, mh = resBars[resID].cont.w ,resBars[resID].cont.h -- 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 ) if( resBars[resID].resTbl.amount > 1 ) then @@ -386,7 +386,7 @@ function menu.open( dt ) surface.DrawRect( 0, 0, w, h ) 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 ) local itemname = vgui.Create( "DLabel", itemPanels[count] )