Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPC keywords color
#11
(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?
Reply
#12
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]
[-] The following 1 user Likes Brush's post:
  • Kondra
Reply
#13
Mine default trade text is not changing, someone could post entire file? Mine only floating text is in blue, default not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)