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:
BeniS
2013-02-13 05:14:16 +13:00
parent 8f9055f48b
commit cb42481edd
10 changed files with 65 additions and 52 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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