Page 6 of 6 FirstFirst ...
4
5
6
  1. #101
    Deleted
    Change:
    Code:
    elseif event == "ACTIVE_TALENT_GROUP_CHANGED" then
        if ((select(5,GetTalentInfo(3,8)))>=1) then
            self.bar:Show()
            self.background:Show()
        else
            self.bar:Hide()
            self.background:Hide()
        end
    end
    To:
    Code:
    elseif (event == "ACTIVE_TALENT_GROUP_CHANGED") or (event == "SPELLS_CHANGED") then
        if ((select(5,GetTalentInfo(3,8)))>=1) then
            self.bar:Show()
            self.background:Show()
        else
            self.bar:Hide()
            self.background:Hide()
        end
        if event == "SPELLS_CHANGED" then
            self:UnregisterEvent("SPELLS_CHANGED")
        end
    end
    And change the initial loading talent check:
    Code:
    if GetSpellInfo(1752) then
        if ((select(5,GetTalentInfo(3,8)))>=1) then
            a.bar:Show()
            a.background:Show()
        else
            a.bar:Hide()
            a.background:Hide()
        end
    else
        a:RegisterEvent("SPELLS_CHANGED")
    end

  2. #102
    Deleted
    Apparently not solving anyhting :/

  3. #103
    Deleted
    Try changing both occurances of "SPELLS_CHANGED" to "PLAYER_TALENT_UPDATE".

  4. #104
    Deleted
    Quote Originally Posted by Treeston View Post
    Try changing both occurances of "SPELLS_CHANGED" to "PLAYER_TALENT_UPDATE".
    Nope, still have to do a reloadui to have the bar displayed

  5. #105
    Deleted
    Hm, need to find the event when the shit gets available.

  6. #106
    Deleted
    Quote Originally Posted by Treeston View Post
    Hm, need to find the event when the shit gets available.
    Any idea ?

  7. #107
    Deleted
    Yeah. I'm an idiot.
    Change:
    Code:
        if event == "SPELLS_CHANGED" then
            self:UnregisterEvent("SPELLS_CHANGED")
        end
    to:
    Code:
        if event == "SPELLS_CHANGED" then
            self:UnregisterEvent("SPELLS_CHANGED")
            if ((select(5,GetTalentInfo(3,8)))>=1) then
                a.bar:Show()
                a.background:Show()
            else
                a.bar:Hide()
                a.background:Hide()
            end
        end
    And change the others back to "SPELLS_CHANGED" if you haven't yet.

  8. #108
    Immortal Evolixe's Avatar
    10+ Year Old Account
    Join Date
    Nov 2009
    Location
    In the Shadows
    Posts
    7,364
    Hey, sorry for rezzing an old thread. But would you guys be kind enough to upload a working addon of this?

  9. #109
    Deleted
    Code:
    local a = CreateFrame("Frame", nil, UIParent)
    local xOffset, yOffset = 0, 0 -- first zero is X offset, second zero is Y offset
    local width, height = 0, 0 -- first number is width, second number is height
    local r, g, b = 1, 1, 1 -- ranges from 0-1, r g b values for the bar
    a:SetPoint("BOTTOMLEFT", xOffset, yOffset) 
    a:SetSize(width, height)
    a.background = a:CreateTexture(nil, "BACKGROUND")
    a.background:SetAllPoints()
    a.background:SetTexture(r*0.4, g*0.4, b*0.4)
    a.bar = a:CreateTexture(nil, "ARTWORK")
    a.bar:SetPoint("TOPLEFT")
    a.bar:SetPoint("BOTTOMLEFT")
    a.bar:SetTexture(r, g, b)
    function a:SetValue(cur, max)
        if (cur>=max) then
            self.bar:Hide()
        else
            self.bar:Show()
            self.bar:SetWidth((1-(cur/max))*width)
        end
    end
    local spellid=((select(4,GetBuildInfo()))>=40200) and 12 or 10
    a:SetScript("OnEvent", function(self, event, ...)
        if event == "COMBAT_LOG_EVENT_UNFILTERED" then
            self.pGUID = self.pGUID or UnitGUID("player")
            local arg = {...}
            if (arg[2] == "SPELL_PERIODIC_HEAL") and (arg[4] == self.pGUID) and (arg[spellid] == 73651) and ((select(5,GetTalentInfo(3,8)))>=1) then
                a.update.timer = 3
                a.update:Show()
                a:SetValue(3,3)
            end
            if (arg[2] == "SPELL_AURA_REMOVED") and (arg[4] == self.pGUID) and (arg[spellid] == 73651) then
                a.update:Hide()
                a:SetValue(3,3)
            end
        elseif (event == "ACTIVE_TALENT_GROUP_CHANGED") or (event == "SPELLS_CHANGED") then
            if ((select(5,GetTalentInfo(3,8)))>=1) then
                self.bar:Show()
                self.background:Show()
            else
                self.bar:Hide()
                self.background:Hide()
            end
            if event == "SPELLS_CHANGED" then
                self:UnregisterEvent("SPELLS_CHANGED")
            end
        end
    end)
    a:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
    a:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
    a.update = CreateFrame("Frame")
    a.update:Hide()
    a.update:SetScript("OnUpdate", function(self, elapsed)
        self.timer = self.timer-elapsed
        if self.timer>0 then
            a:SetValue(self.timer,3)
        else
            a:SetValue(3,3)
            self:Hide()
        end
    end)
    if GetSpellInfo(1752) then
        if ((select(5,GetTalentInfo(3,8)))>=1) then
            a.bar:Show()
            a.background:Show()
        else
            a.bar:Hide()
            a.background:Hide()
        end
    else
        a:RegisterEvent("SPELLS_CHANGED")
    end
    a:SetValue(3,3)
    Went through and applied all the fixes I posted - I assume those worked as there was no further reply.

    If it doesn't work, post back, I'll be happy to continue working on this.

  10. #110
    Immortal Evolixe's Avatar
    10+ Year Old Account
    Join Date
    Nov 2009
    Location
    In the Shadows
    Posts
    7,364
    Okok, but im a total noob when it comes to making add-ons. So i put this in notepad and save it as a .lua file or something?

    What should i do

  11. #111
    Deleted
    Quote Originally Posted by Holo View Post
    Okok, but im a total noob when it comes to making add-ons. So i put this in notepad and save it as a .lua file or something?

    What should i do
    Create a folder in your "addons" folder with the name you want to give to the addon (ex: ConvTick), create a .lua file with the code given above in it and name it the exact same way as the folder (ConvTick.lua), create another file in Notepad containing:
    Code:
    ## Interface: 40100
    ## Title: ConvTick
    ConvTick.lua
    and save it as ConvTick.TOC

    You'll have in your "ConvTick" folder 2 files: ConvTick.lua (containing the code) and ConvTick.TOC (containing the title of the addon and such info)

    Then you're done

    PS: don't forget to name the files and folder the exact same way (upper case, etc.)

  12. #112
    Immortal Evolixe's Avatar
    10+ Year Old Account
    Join Date
    Nov 2009
    Location
    In the Shadows
    Posts
    7,364
    Thanks. Ill report in tomorrow or thursday right before i go on vacation

  13. #113
    Deleted
    Ah, I totally forgot to add my usual line. Thus, here you go:
    How to use. UnTested. Report back with issues.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •