Minor fix to previous commit and added mouse scroll option to UIScrollBar class.

This commit is contained in:
BeniS
2013-01-11 20:10:37 +13:00
parent 914b4bd5f3
commit 1b6be92cad
3 changed files with 23 additions and 6 deletions

View File

@@ -359,10 +359,10 @@ function addTabText(text, speaktype, tab, creatureName)
-- Overlay for consoleBuffer which shows highlighted words only
local consoleBufferHighlight = panel:getChildById('consoleBufferHighlight')
local labelHighlight = g_ui.createWidget('ConsoleLabel', consoleBufferHighlight)
labelHighlight:setId('consoleLabel' .. panel:getChildCount())
labelHighlight:setColor("#1f9ffe")
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
local highlightData = getHighlightedText(text)
@@ -411,7 +411,9 @@ function addTabText(text, speaktype, tab, creatureName)
labelHighlight:setText("")
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
consoleBuffer:getFirstChild():destroy()
@@ -476,8 +478,12 @@ function sendCurrentMessage()
if #message == 0 then return end
consoleTextEdit:clearText()
-- get current channel
local tab = getCurrentTab()
-- send message
sendMessage(message)
end
function sendMessage(message, tab)
local tab = tab or getCurrentTab()
-- handling chat commands
local originalMessage = message