From 74c7a160da34897ebdf18aaff02b8c9b65809949 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 24 Oct 2016 12:12:19 -0400 Subject: Various other updates and bugfixes --- gamemode/client/qpanels/inventory.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gamemode/client/qpanels/inventory.lua') diff --git a/gamemode/client/qpanels/inventory.lua b/gamemode/client/qpanels/inventory.lua index f4adad6..9fec1cc 100644 --- a/gamemode/client/qpanels/inventory.lua +++ b/gamemode/client/qpanels/inventory.lua @@ -4,6 +4,17 @@ invfuncs = ART.invfuncs --invfuncs = include("../shared/inventory_common.lua") assert(invfuncs ~= nil, "Dependency failed") +local function createMenuFor(menu, tbl) + for k,v in pairs(tbl) do + if isfunction(v) then --This is a dead-end, add the menu + local thisoption = menu:AddOption(k,v) + else --Otherwise it should be a table, recursively call to create + local submenu = menu:AddSubMenu(k) + createMenuFor(submenu,v) + end + end +end + local function DrawBackpackOnDPanel(dp, backpack, backpacknum, tent) local width = ScrW() local height = ScrH() -- cgit v1.2.3-70-g09d2