Minor fix to previous commit and added mouse scroll option to UIScrollBar class.
This commit is contained in:
parent
914b4bd5f3
commit
1b6be92cad
|
@ -108,6 +108,7 @@ function UIScrollBar.create()
|
||||||
scrollbar.pixelsScroll = false
|
scrollbar.pixelsScroll = false
|
||||||
scrollbar.showValue = false
|
scrollbar.showValue = false
|
||||||
scrollbar.symbol = nil
|
scrollbar.symbol = nil
|
||||||
|
scrollbar.mouseScroll = true
|
||||||
return scrollbar
|
return scrollbar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -139,6 +140,8 @@ function UIScrollBar:onStyleApply(styleName, styleNode)
|
||||||
self.showValue = true
|
self.showValue = true
|
||||||
elseif name == 'symbol' then
|
elseif name == 'symbol' then
|
||||||
self.symbol = value
|
self.symbol = value
|
||||||
|
elseif name == 'mouse-scroll' then
|
||||||
|
self.mouseScroll = value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -189,6 +192,10 @@ function UIScrollBar:setValue(value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UIScrollBar:setMouseScroll(scroll)
|
||||||
|
self.mouseScroll = scroll
|
||||||
|
end
|
||||||
|
|
||||||
function UIScrollBar:setStep(step)
|
function UIScrollBar:setStep(step)
|
||||||
self.step = step
|
self.step = step
|
||||||
end
|
end
|
||||||
|
@ -202,6 +209,9 @@ function UIScrollBar:onGeometryChange()
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
|
function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
|
||||||
|
if not self.mouseScroll then
|
||||||
|
return false
|
||||||
|
end
|
||||||
if mouseWheel == MouseWheelDown then
|
if mouseWheel == MouseWheelDown then
|
||||||
if self.orientation == 'vertical' then
|
if self.orientation == 'vertical' then
|
||||||
self:decrement()
|
self:decrement()
|
||||||
|
@ -225,3 +235,4 @@ function UIScrollBar:getStep() return self.step end
|
||||||
function UIScrollBar:getOrientation() return self.orientation end
|
function UIScrollBar:getOrientation() return self.orientation end
|
||||||
function UIScrollBar:getShowValue() return self.showValue end
|
function UIScrollBar:getShowValue() return self.showValue end
|
||||||
function UIScrollBar:getSymbol() return self.symbol end
|
function UIScrollBar:getSymbol() return self.symbol end
|
||||||
|
function UIScrollBar:getMouseScroll() return self.mouseScroll end
|
|
@ -359,10 +359,10 @@ function addTabText(text, speaktype, tab, creatureName)
|
||||||
-- Overlay for consoleBuffer which shows highlighted words only
|
-- Overlay for consoleBuffer which shows highlighted words only
|
||||||
local consoleBufferHighlight = panel:getChildById('consoleBufferHighlight')
|
local consoleBufferHighlight = panel:getChildById('consoleBufferHighlight')
|
||||||
local labelHighlight = g_ui.createWidget('ConsoleLabel', consoleBufferHighlight)
|
local labelHighlight = g_ui.createWidget('ConsoleLabel', consoleBufferHighlight)
|
||||||
|
|
||||||
labelHighlight:setId('consoleLabel' .. panel:getChildCount())
|
labelHighlight:setId('consoleLabel' .. panel:getChildCount())
|
||||||
labelHighlight:setColor("#1f9ffe")
|
labelHighlight:setColor("#1f9ffe")
|
||||||
|
|
||||||
|
|
||||||
local player = g_game.getLocalPlayer()
|
local player = g_game.getLocalPlayer()
|
||||||
if speaktype.npcChat and (player:getName() ~= creatureName or player:getName() == 'Account Manager') then -- Check if it is the npc who is talking
|
if speaktype.npcChat and (player:getName() ~= creatureName or player:getName() == 'Account Manager') then -- Check if it is the npc who is talking
|
||||||
local highlightData = getHighlightedText(text)
|
local highlightData = getHighlightedText(text)
|
||||||
|
@ -411,7 +411,9 @@ function addTabText(text, speaktype, tab, creatureName)
|
||||||
labelHighlight:setText("")
|
labelHighlight:setText("")
|
||||||
end
|
end
|
||||||
|
|
||||||
label.onMouseRelease = function (self, mousePos, mouseButton) processMessageMenu(mousePos, mouseButton, creatureName, text) end
|
label.onMouseRelease = function (self, mousePos, mouseButton)
|
||||||
|
processMessageMenu(mousePos, mouseButton, creatureName, text)
|
||||||
|
end
|
||||||
|
|
||||||
if consoleBuffer:getChildCount() > MAX_LINES then
|
if consoleBuffer:getChildCount() > MAX_LINES then
|
||||||
consoleBuffer:getFirstChild():destroy()
|
consoleBuffer:getFirstChild():destroy()
|
||||||
|
@ -476,8 +478,12 @@ function sendCurrentMessage()
|
||||||
if #message == 0 then return end
|
if #message == 0 then return end
|
||||||
consoleTextEdit:clearText()
|
consoleTextEdit:clearText()
|
||||||
|
|
||||||
-- get current channel
|
-- send message
|
||||||
local tab = getCurrentTab()
|
sendMessage(message)
|
||||||
|
end
|
||||||
|
|
||||||
|
function sendMessage(message, tab)
|
||||||
|
local tab = tab or getCurrentTab()
|
||||||
|
|
||||||
-- handling chat commands
|
-- handling chat commands
|
||||||
local originalMessage = message
|
local originalMessage = message
|
||||||
|
|
|
@ -85,7 +85,7 @@ end
|
||||||
|
|
||||||
function load()
|
function load()
|
||||||
local hotkeySettings = g_settings.getNode('HotkeysManager') or {}
|
local hotkeySettings = g_settings.getNode('HotkeysManager') or {}
|
||||||
if hotkeySettings then
|
if hotkeySettings ~= nil then
|
||||||
local playerHotkeySettings = hotkeySettings[g_game.getLocalPlayer():getName()]
|
local playerHotkeySettings = hotkeySettings[g_game.getLocalPlayer():getName()]
|
||||||
|
|
||||||
local hasCombos = false
|
local hasCombos = false
|
||||||
|
|
Loading…
Reference in New Issue