diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index aa304234..eb5ff781 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -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()) - 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 + if speaktype.npcChat and (g_game.getCharacterName() ~= creatureName or g_game.getCharacterName() == 'Account Manager') then local highlightData = getHighlightedText(text) - if #highlightData == 0 then - labelHighlight:setText("") - else + if #highlightData > 0 then + local labelHighlight = g_ui.createWidget('ConsolePhantomLabel', label) + labelHighlight:fill('parent') + + labelHighlight:setId('consoleLabelHighlight' .. consoleBuffer:getChildCount()) + labelHighlight:setColor("#1f9ffe") + -- 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) diff --git a/modules/game_console/console.otui b/modules/game_console/console.otui index e00e98a3..dc50ed0c 100644 --- a/modules/game_console/console.otui +++ b/modules/game_console/console.otui @@ -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