Removed useless code & added auto select for recipes

master
AlmTech Software 5 years ago
parent ddc016460a
commit 0a2e07fadc
  1. 11
      gamemode/engine/derma/menus/menu_crafting.lua

@ -231,16 +231,11 @@ function menu.open( dt )
local resBars = {}
local selectedBar
local selTxt = vgui.Create( "DLabel", cont )
selTxt:SetText( "Select a recipe" )
selTxt:SetFont( "q_info" )
selTxt:SetTextColor( Color( 255, 255, 255 ) )
selTxt:SizeToContents()
selTxt.w, selTxt.h = selTxt:GetSize()
selTxt:SetPos( cont.w/2 - selTxt.w/2, cont.h/2 - selTxt.h/2 - padding*10 )
for i, resID in pairs( recipes ) do
resBars[resID] = vgui.Create( "DPanel", scroll )
if( i == 1 ) then selectedBar = resBars[resID] end
resBars[resID].resTbl = Quantum.Recipe.Get( resID )
resBars[resID].resItemTbl = Quantum.Item.Get( resID )

Loading…
Cancel
Save