reginaldofilhog
Member
Hi, I'm implementing a tooltip in my small project, and I strictly followed the implementation done by our friend Matheus. However, the features are related to OtcV8. Is there any advice you can give me where I'm failing to get it to work in OtcClient Redemption? I've already added setFrames and tested with modified code, and the frame appears correctly. However, the code is activated by the tooltip, and when I use it in OtClient, it gives an error!
Commit: Added tooltips for inventory items to display rarity frames · Mateuzkl/TFS-1.5-772@ea04b98 (https://github.com/Mateuzkl/TFS-1.5-772/commit/ea04b98e3430e4ffa54c5bb2e5dd1bd45d722bd6)
Thanks so far, my friends!
Commit: Added tooltips for inventory items to display rarity frames · Mateuzkl/TFS-1.5-772@ea04b98 (https://github.com/Mateuzkl/TFS-1.5-772/commit/ea04b98e3430e4ffa54c5bb2e5dd1bd45d722bd6)
LUA:
local function setFrames()
for _, container in pairs(g_game.getContainers()) do
local window = container.itemsPanel
for i, child in pairs(window:getChildren()) do
local id = child:getItemId()
local price = 0
local name = child:getTooltip() <--------------
child:setImageSource("/images/ui/item")
if (name) then
if (string.find(name, "legendary")) then
child:setImageSource('/images/ui/rarity_gold')
elseif (string.find(name, "epic")) then
child:setImageSource('/images/ui/rarity_purple')
elseif (string.find(name, "rare")) then
child:setImageSource('/images/ui/rarity_blue')
elseif (string.find(name, "a")) then
child:setImageSource('/images/ui/rarity_white')
end
end
end
end
end
Thanks so far, my friends!

