This commit is contained in:
Eduardo Bart 2013-02-26 18:13:50 -03:00
parent 41b81da76f
commit 406c7bdae6
2 changed files with 8 additions and 40 deletions

View File

@ -257,7 +257,6 @@ end
function clearChannel(consoleTabBar)
consoleTabBar:getCurrentTab().tabPanel:getChildById('consoleBuffer'):destroyChildren()
consoleTabBar:getCurrentTab().tabPanel:getChildById('consoleBufferHighlight'):destroyChildren()
end
function setTextEditText(text)
@ -447,17 +446,16 @@ function addTabText(text, speaktype, tab, creatureName)
consoleTabBar:blinkTab(tab)
-- Overlay for consoleBuffer which shows highlighted words only
local consoleBufferHighlight = panel:getChildById('consoleBufferHighlight')
local labelHighlight = g_ui.createWidget('ConsolePhantomLabel', consoleBufferHighlight)
labelHighlight:setId('consoleLabel' .. consoleBufferHighlight:getChildCount())
if speaktype.npcChat and (g_game.getCharacterName() ~= creatureName or g_game.getCharacterName() == 'Account Manager') then
local highlightData = getHighlightedText(text)
if #highlightData > 0 then
local labelHighlight = g_ui.createWidget('ConsolePhantomLabel', label)
labelHighlight:fill('parent')
labelHighlight:setId('consoleLabelHighlight' .. consoleBuffer:getChildCount())
labelHighlight:setColor("#1f9ffe")
if speaktype.npcChat and (g_game.getCharacterName() ~= creatureName or g_game.getCharacterName() == 'Account Manager') then -- Check if it is the npc who is talking
local highlightData = getHighlightedText(text)
if #highlightData == 0 then
labelHighlight:setText("")
else
-- Remove the curly braces
for i = 1, #highlightData / 3 do
local dataBlock = { _start = highlightData[(i-1)*3+1], _end = highlightData[(i-1)*3+2], words = highlightData[(i-1)*3+3] }
@ -496,8 +494,6 @@ function addTabText(text, speaktype, tab, creatureName)
labelHighlight:setText(tmpText)
end
else
labelHighlight:setText("")
end
label.name = creatureName
@ -508,10 +504,6 @@ function addTabText(text, speaktype, tab, creatureName)
if consoleBuffer:getChildCount() > MAX_LINES then
consoleBuffer:getFirstChild():destroy()
end
if consoleBufferHighlight:getChildCount() > MAX_LINES then
consoleBufferHighlight:getFirstChild():destroy()
end
end
function removeTabLabelByName(tab, name)

View File

@ -15,7 +15,6 @@ ConsolePhantomLabel < UILabel
font: verdana-11px-antialised
height: 14
color: yellow
margin-left: 2
text-wrap: true
text-auto-resize: true
selection-color: #111416
@ -39,29 +38,6 @@ ConsoleTabBarPanel < MoveableTabBarPanel
inverted-scroll: true
padding: 1
ScrollablePanel
id: consoleBufferHighlight
anchors.fill: parent
margin-right: 12
vertical-scrollbar: consoleScrollBarHighlight
layout:
type: verticalBox
align-bottom: true
inverted-scroll: true
padding: 1
@onScrollbarChange: |
local consoleScrollBar = self:getParent():getChildById('consoleScrollBar')
local consoleScrollBarHighlight = self:getParent():getChildById('consoleScrollBarHighlight')
consoleScrollBar:setValue(consoleScrollBarHighlight:getValue())
VerticalScrollBar
id: consoleScrollBarHighlight
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
step: 14
pixels-scroll: true
VerticalScrollBar
id: consoleScrollBar
anchors.top: parent.top