Fixed context menu in the health panel

This commit is contained in:
ZioPao
2023-11-06 15:48:06 +01:00
parent 28ba7d73ab
commit d0dae7dfe2
5 changed files with 85 additions and 7 deletions

View File

@@ -28,13 +28,7 @@ end
function CutLimbHandler:addToMenu(context)
local types = self:getAllItemTypes(self.items.ITEMS)
if #types > 0 then
local option = context:addOption(contextMenuCutLimb, nil)
local subMenu = context:getNew(context)
context:addSubMenu(option, subMenu)
for i=1,#types do
local item = self:getItemOfType(self.items.ITEMS, types[i])
subMenu:addOption(item:getName(), self, self.onMenuOptionSelected, item:getFullType())
end
local option = context:addOption(contextMenuCutLimb, self, self.onMenuOptionSelected)
end
end