mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Some flexibility changes
This commit is contained in:
@@ -48,6 +48,20 @@ function UIComboBox:addOption(text, data)
|
||||
return index
|
||||
end
|
||||
|
||||
function UIComboBox:removeOption(text)
|
||||
for i,v in ipairs(self.options) do
|
||||
if v.text == text then
|
||||
table.remove(self.options, i)
|
||||
if self.currentIndex == i then
|
||||
self:setCurrentIndex(1)
|
||||
elseif self.currentIndex > i then
|
||||
self.currentIndex = self.currentIndex - 1
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIComboBox:onMousePress(mousePos, mouseButton)
|
||||
local menu = g_ui.createWidget(self:getStyleName() .. 'PopupMenu')
|
||||
menu:setId(self:getId() .. 'PopupMenu')
|
||||
|
Reference in New Issue
Block a user