Skip to content
Snippets Groups Projects
Commit 98b4869c authored by dg's avatar dg
Browse files

Object requirements are currently colorized again

git-svn-id: http://svn.net-core.org/repos/t-engine4@2442 51575b47-30f0-44d4-a5cc-537603b46e54
parent b9cb7e7e
No related branches found
No related tags found
No related merge requests found
......@@ -188,17 +188,17 @@ function _M:getRequirementDesc(who)
if req.stat then
for s, v in pairs(req.stat) do
local c = (who:getStat(s) >= v) and {"color", 0x00,0xff,0x00} or {"color", 0xff,0x00,0x00}
str:add("- ", ("%s %d\n"):format(who.stats_def[s].name, v), true)
str:add(c, "- ", ("%s %d\n"):format(who.stats_def[s].name, v), {"color", "LAST"}, true)
end
end
if req.level then
local c = (who.level >= req.level) and {"color", 0x00,0xff,0x00} or {"color", 0xff,0x00,0x00}
str:add("- ", ("Level %d\n"):format(req.level), true)
str:add(c, "- ", ("Level %d\n"):format(req.level), {"color", "LAST"}, true)
end
if req.talent then
for _, tid in ipairs(req.talent) do
local c = who:knowTalent(tid) and {"color", 0x00,0xff,0x00} or {"color", 0xff,0x00,0x00}
str:add("- ", ("Talent %s\n"):format(who:getTalentFromId(tid).name), true)
str:add(c, "- ", ("Talent %s\n"):format(who:getTalentFromId(tid).name), {"color", "LAST"}, true)
end
end
return str
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment