Download
(2 Kb)
Download
Updated: 03/17/21 09:48 AM
Pictures
File Info
Compatibility:
Flames of Ambition (6.3.5)
Updated:03/17/21 09:48 AM
Created:03/17/21 09:48 AM
Monthly downloads:33
Total downloads:2,376
Favorites:2
MD5:
Torte Tips
Version: 1.0
by: Hyperioxes [More]
An addon that displays alert when your Torte AP buff is about to run out


Dependencies:
-LibAddonMenu
Optional Files (0)


Post A Reply Comment Options
Unread Today, 11:57 AM  
lousytourist

Forum posts: 0
File comments: 2
Uploads: 0
I made some small changes to the same function, it was firing all too often. Now it waits till you are down to one minute before starting the very frequent reminders.
Code:
local function SendAlert(time,staysFor)
    if isZonePvP() then
        cchtime = GetUnitInfo({147687,147733,147734},"player")  --calculate time locally since time is wrong coming into function
        --PlaySound(SOUNDS.DUEL_ACCEPTED)  --since this fires far to often, disable the obnoxious sounds
        local text = TorteTipsUI:GetNamedChild("TorteText")
        local minutes = math.floor(cchtime/60)
        local seconds = math.floor(cchtime%60)
        
		if minutes < 2  then
		--do all this stuff
		TorteTipsUI:SetHidden(false)
        
		if seconds<10 then
            seconds = "0"..seconds
        end
        
		if cchtime ~= 0 then
            text:SetText("Torte expires in "..minutes..":"..seconds)
        else
            text:SetText("Torte has expired 0:00")
        end
		
        EVENT_MANAGER:RegisterForUpdate("RegisterForHide", staysFor,function()
            TorteTipsUI:SetHidden(true)
            EVENT_MANAGER:UnregisterForUpdate("RegisterForHide", staysFor)
        end)
		-- or not
		end
    end
end
Last edited by lousytourist : 09/02/24 at 12:26 PM.
Report comment to moderator  
Reply With Quote
Unread 10/15/21, 01:22 PM  
choekstr
 
choekstr's Avatar

Forum posts: 14
File comments: 391
Uploads: 0
Originally Posted by ClevaTreva
Hello,

Where are the settings for this, please?
The settings haven't been implemented and it's a todo in the files, it seems.


Originally Posted by ClevaTreva
Also: I've had to uninstall it because it says I have "7 mins 30 secs remaining" ~ when I haven't even taken the Torte.
Same here, but I dug into the code to see if I could figure it out. It seems the math is right but the correct value isn't being passed along so I just did a quick hack to recalculate the time locally in that function (yes, very hacky). You can just replace the SendAlert function with this modified version and it should fix it:
Code:
local function SendAlert(time,staysFor)
    if isZonePvP() then
        cchtime = GetUnitInfo({147687,147733,147734},"player")  --calculate time locally since time is wrong coming into function
        TorteTipsUI:SetHidden(false)
        --PlaySound(SOUNDS.DUEL_ACCEPTED)  --since this fires far to often, disable the obnoxious sounds
        local text = TorteTipsUI:GetNamedChild("TorteText")
        local minutes = math.floor(cchtime/60)
        local seconds = math.floor(cchtime%60)
        if seconds<10 then
            seconds = "0"..seconds
        end
        if cchtime ~= 0 then
            text:SetText("Torte expires in "..minutes..":"..seconds)
        else
            text:SetText("Torte has expired 0:00")
        end
        EVENT_MANAGER:RegisterForUpdate("RegisterForHide", staysFor,function()
            TorteTipsUI:SetHidden(true)
            EVENT_MANAGER:UnregisterForUpdate("RegisterForHide", staysFor)
        end)
    end
end
Last edited by choekstr : 10/21/21 at 09:09 AM.
Report comment to moderator  
Reply With Quote
Unread 10/11/21, 10:51 PM  
RoE1106

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by ClevaTreva
Hello,

Where are the settings for this, please?

Also: I've had to uninstall it because it says I have "7 mins 30 secs remaining" ~ when I haven't even taken the Torte.
Addon is broken
Report comment to moderator  
Reply With Quote
Unread 06/16/21, 04:22 AM  
ClevaTreva

Forum posts: 0
File comments: 40
Uploads: 0
Hello,

Where are the settings for this, please?

Also: I've had to uninstall it because it says I have "7 mins 30 secs remaining" ~ when I haven't even taken the Torte.
Last edited by ClevaTreva : 06/16/21 at 06:00 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: