mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
Market fix, and a few other things:
* Added 'button' param to g_mouse.bindPress * Added 'lower' param to table.contains * UIComboBox:onOptionChange should signalcall? * Changed the experience bar color * Market buy/sell 'amount' window will now show the cost of the amount you are selecting
This commit is contained in:
@@ -25,9 +25,12 @@ function g_mouse.bindPressMove(widget, callback)
|
||||
end })
|
||||
end
|
||||
|
||||
function g_mouse.bindPress(widget, callback)
|
||||
function g_mouse.bindPress(widget, callback, button)
|
||||
connect(widget, { onMousePress = function(widget, mousePos, mouseButton)
|
||||
callback(mousePos, mouseButton)
|
||||
return true
|
||||
if not button or button == mouseButton then
|
||||
callback(mousePos, mouseButton)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end })
|
||||
end
|
||||
|
@@ -65,8 +65,8 @@ function table.findbykey(t, key, lowercase)
|
||||
end
|
||||
end
|
||||
|
||||
function table.contains(t, value)
|
||||
return table.find(t, value) ~= nil
|
||||
function table.contains(t, value, lowercase)
|
||||
return table.find(t, value, lowercase) ~= nil
|
||||
end
|
||||
|
||||
function table.findkey(t, key)
|
||||
|
@@ -31,7 +31,7 @@ function UIComboBox:setCurrentOption(text)
|
||||
if v.text == text and self.currentIndex ~= i then
|
||||
self.currentIndex = i
|
||||
self:setText(text)
|
||||
self:onOptionChange(text, v.data)
|
||||
signalcall(self.onOptionChange, self, text, v.data)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -43,7 +43,7 @@ function UIComboBox:setCurrentOptionByData(data)
|
||||
if v.data == data and self.currentIndex ~= i then
|
||||
self.currentIndex = i
|
||||
self:setText(v.text)
|
||||
self:onOptionChange(v.text, v.data)
|
||||
signalcall(self.onOptionChange, self, v.text, v.data)
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -54,7 +54,7 @@ function UIComboBox:setCurrentIndex(index)
|
||||
local v = self.options[index]
|
||||
self.currentIndex = index
|
||||
self:setText(v.text)
|
||||
self:onOptionChange(v.text, v.data)
|
||||
signalcall(self.onOptionChange, self, v.text, v.data)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -140,7 +140,3 @@ end
|
||||
function UIComboBox:canMouseScroll()
|
||||
return self.mouseScroll
|
||||
end
|
||||
|
||||
function UIComboBox:onOptionChange(optionText, optionData)
|
||||
-- nothing todo
|
||||
end
|
||||
|
Reference in New Issue
Block a user