I'm trying to make a formatted trinket cooldown I have it showing the correct time as of now using the following in the custom text, with some additional checks in the trigger section
function() local start, duration = GetInventoryItemCooldown("player", 13); local end_time = start + duration; local remaining = end_time - GetTime(); if remaining < 0 then return "" else local hours = floor(remaining / 3600); local minutes = floor((remaining % 3600) / 60); local seconds = floor(remaining % 60); if hours > 0 then return hours.."h "; elseif minutes > 0 then return minutes.."m "; else return seconds.."s"; end end end
I can't seem to find a way to make it desaturate while on cooldown and be saturated off cooldown, as well as the cooldown swipe to show.
I am be no means very well versed in Lua, but things like self:SetDesaturated(true) etc. doesn't seem to want to work.