OTClientV8 & Tibia Forum
NPC keywords color - Printable Version

+- OTClientV8 & Tibia Forum (http://otclient.net)
+-- Forum: OTClientV8 (http://otclient.net/forumdisplay.php?fid=1)
+--- Forum: Support (http://otclient.net/forumdisplay.php?fid=4)
+--- Thread: NPC keywords color (/showthread.php?tid=33)

Pages: 1 2


RE: NPC keywords color - Claudia - 06-10-2020

(06-10-2020, 04:33 PM)Kondra Wrote: get version 2.4, it's included. Code doing that is in game_console/console.lua
Code responsible for text being displayed on main game window? Like floating one?


RE: NPC keywords color - Brush - 06-10-2020

function sendMessage() is responsible for that.
If you want to let curly braces color the text in default, go to line 1139

Code:
if isNpcMode then
  local highlightData = getNewHighlightedText(staticMessage, speaktype.color, "#1f9ffe")
    if #highlightData > 2 then
      staticText:addColoredMessage(name, mode, highlightData)
    else
      staticText:addMessage(name, mode, staticMessage)
    end
    staticText:setColor(speaktype.color)
  else
    staticText:addMessage(name, mode, staticMessage)
end

change to

Code:
local staticMessage = message
local highlightData = getNewHighlightedText(staticMessage, speaktype.color, "#1f9ffe")
if #highlightData > 2 then
  staticText:addColoredMessage(name, mode, highlightData)
else
  staticText:addMessage(name, mode, staticMessage)
end
staticText:setColor(speaktype.color)


Realized that there is a small issue, it seems like if the word is starting from a new line, the very first character is being skipped. Will try to investigate further.
[Image: f4liJcD.png]

@edit
It also happens when there is some other text overlapping nearby, look here.
[Image: xSyZx3D.png]


RE: NPC keywords color - p0t1nh0 - 11-03-2021

Mine default trade text is not changing, someone could post entire file? Mine only floating text is in blue, default not.