From ca26c834149d1e8a37582ed2a7b3093ff8e0529c Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Mon, 6 Jan 2014 22:50:52 -0500 Subject: [PATCH] Add menu:RemoveOption --- objects/menu.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/objects/menu.lua b/objects/menu.lua index 1b76b5f..609b894 100644 --- a/objects/menu.lua +++ b/objects/menu.lua @@ -207,6 +207,21 @@ function newobject:AddOption(text, icon, func) end +--[[--------------------------------------------------------- + - func: RemoveOption(id) + - desc: removes an option +--]]--------------------------------------------------------- +function newobject:RemoveOption(id) + + for k, v in ipairs(self.internals) do + if k == id then + table.remove(self.internals, k) + return + end + end + +end + --[[--------------------------------------------------------- - func: AddSubMenu(text, icon, menu) - desc: adds a submenu to the object