More fixes and edits!

* Fixed a bug with client_exit module button appearing on full reload.
* Fixed the battle window to work properly now (left click: attack, right click: menu).
* Added auto walk checker for more accurate aut walking:
  - It will always find the path now, except in rare occasions gets stuck running back and forward
  - Re-calculates path every 10 steps and also when you hit an object that cancels your step.
  - Right now this is just a temporary method.
  - Cancels the checker when you move or press escape (has to be done client-side).
* Added a new setting to UIComboBox class 'mouse-scroll' to enable/disable mouse wheel scrolling.
* Added support for no ping in cooldowns.
* Added missing PlayerStates (hungry and bleeding).
This commit is contained in:
BeniS
2013-01-08 06:17:01 +13:00
parent fddbafebd3
commit bb139955dc
12 changed files with 139 additions and 24 deletions

View File

@@ -5,6 +5,7 @@ function UIComboBox.create()
local combobox = UIComboBox.internalCreate()
combobox.options = {}
combobox.currentIndex = -1
combobox.mouseScroll = true
return combobox
end
@@ -76,6 +77,9 @@ function UIComboBox:onMousePress(mousePos, mouseButton)
end
function UIComboBox:onMouseWheel(mousePos, direction)
if not self.mouseScroll then
return false
end
if direction == MouseWheelUp and self.currentIndex > 1 then
self:setCurrentIndex(self.currentIndex - 1)
elseif direction == MouseWheelDown and self.currentIndex < #self.options then
@@ -90,6 +94,19 @@ function UIComboBox:onStyleApply(styleName, styleNode)
self:addOption(option)
end
end
for name,value in pairs(styleNode) do
if name == 'mouse-scroll' then
self.mouseScroll = value
end
end
end
function UIComboBox:setMouseScroll(scroll)
self.mouseScroll = scroll
end
function UIComboBox:canMouseScroll()
return self.mouseScroll
end
function UIComboBox:onOptionChange(optionText, optionData)