• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Change text colour in Skill TAB

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
549
Solutions
32
Reaction score
305
Location
Poland
GitHub
AscuasFunkeln
Hello Otlanders,

Ok, im stuck now in changing colours in skill tab and need some tips and little help.

This work in this way:

Server send to client "extended opcode" and its not a number.
Code:
player:sendExtendedOpcode(250, "Otland")

Ofcourse its work perfect and there is 0 problems...

In this lines, i can set colours of values i tested it and its works, but "only for skills thats are bind in sources" cuz of this "getChildById" right?
Code:
function setSkillBase(id, value, baseValue)
  if baseValue <= 0 or value < 0 then
    return
  end
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')

  if value > baseValue then
    widget:setColor('#00ff00') -- green
    skill:setTooltip(baseValue .. ' +' .. (value - baseValue))
  elseif value < baseValue then
    widget:setColor('#ff0000') -- red
    skill:setTooltip(baseValue .. ' ' .. (value - baseValue))
  else
    widget:setColor('#ffffff') -- default
    skill:removeTooltip()
  end
end

Ok, my skill named "Crystal" have two values (value depends with in games script) send by extendedopcode is "Active" and "Destroyed",
Now i wanna to color this values, like green if active and red when destroyed.

1. I think first problem is "setSkillBase(id, value, baseValue)" value is definied as number, and buffer with "text" from opcode as string, right? How to bypass this?
2. How to change text color for specific skill name in skills.otui? Any "single" changing fk up module, cuz this lines defined it for all?

Any suggestions and tips will be nice to read :)
Code:
SkillNameLabel < GameLabel
  font: verdana-11px-monochrome
  anchors.left: parent.left
  anchors.top: parent.top
  anchors.bottom: parent.bottom

SkillValueLabel < GameLabel
  id: value
  font: verdana-11px-monochrome
  text-align: topright
  anchors.right: parent.right
  anchors.top: parent.top
  anchors.bottom: parent.bottom
  anchors.left: prev.left
 
Back
Top