mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
add options style for UIComboBox, fix push values of otml nodes
This commit is contained in:
@@ -55,8 +55,8 @@ local function onWidgetStyleApply(widget, styleName, styleNode)
|
||||
end
|
||||
end
|
||||
|
||||
connect(UIWidget, { onStyleApply = onWidgetStyleApply,
|
||||
onHoverChange = onWidgetHoverChange})
|
||||
--connect(UIWidget, { onStyleApply = onWidgetStyleApply,
|
||||
-- onHoverChange = onWidgetHoverChange})
|
||||
|
||||
-- UIWidget extensions
|
||||
function UIWidget:setTooltip(text)
|
||||
|
@@ -13,7 +13,7 @@ function UIComboBox:setCurrentOption(text)
|
||||
if v.text == text and self.m_currentIndex ~= i then
|
||||
self.m_currentIndex = i
|
||||
self:setText(text)
|
||||
self:onOptionChange(text, data)
|
||||
self:onOptionChange(text, v.data)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -38,6 +38,14 @@ function UIComboBox:onMousePress(mousePos, mouseButton)
|
||||
return true
|
||||
end
|
||||
|
||||
function UIComboBox:onStyleApply(styleName, styleNode)
|
||||
if styleNode.options then
|
||||
for k,option in pairs(styleNode.options) do
|
||||
self:addOption(option)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIComboBox:onOptionChange(optionText, optionData)
|
||||
-- nothing todo
|
||||
end
|
||||
|
Reference in New Issue
Block a user