• 0

    posted a message on PitBull 2.0
    Bug found:
    If you are a druid, and you shift to catform while the spark bar is moving, then you get an error: "Attempt to index upvalue 'powerBar' (a nil value).

    To fix, change Spark.lua on line 80 to:


    if powerBar then
    		 if powerBar.orientation == "VERTICAL" then
    			 frame:SetPoint('BOTTOM', powerBar, 'BOTTOM', 0, (timediff / fiveseclength) * (powerBar:GetHeight() - 1))
    		 else
    			 frame:SetPoint('LEFT', powerBar, 'LEFT', (timediff / fiveseclength) * (powerBar:GetWidth() - 1), 0)
    		 end
    		end
    Posted in: Unit Frames
  • 0

    posted a message on Post useful/interesting DogTag-1.0 sequences here
    Wow, I just discovered the "/dog" command. That is, by far, the coolest feature of this release! I just love it, well done on the work you put in for that.

    Below is some modifications I made. I want a dogag that determines if a unit has aggro, so
    I created a "HasAggro" tag. Now you can do stuff like:

    [HasAggro ? Name:Red ! Name]


    This will give you the capability to simply change the color of the Name text to red instead of changing the entire bar color when someone gains aggro.


    However, it's very slow in updating the screen. You have to add the following code to AddOns\Pitbull\libs\LibDogTag-Unit-3.0\Categories\Threat.lua at the top of the file right below the line that has "local ThreatLib":

    local BanzaiLib
    
    DogTag:AddAddonFinder("Unit", "AceLibrary", "LibBanzai-2.0", function(v)
     BanzaiLib = v
     function HasAggro_func(unit)
      local aggro = BanzaiLib:GetUnitAggroByUnitId(unit)
      if (aggro) then 
       return true
      else
       return false
      end
     end
    end)



    Then you need to add this code at the very end of the file before the word "end":

    DogTag:AddTag("Unit", "HasAggro", {
    	code = function(args)
    		return HasAggro_func
    	end,
    	dynamicCode = true,
    	arg = {
    		'unit', 'string;undef', 'player'
    	},
    	ret = "boolean",
    	events = "Threat#$unit",
    	doc = L["Return True if you or a friendly unit have aggro from an enemy"],
    	example = ('[HasAggro] => %q; [HasAggro] => ""'):format(L["True"]),
    	category = L["Threat"]
    })



    I think it's slow because I used the "Threat#$unit" event but I'm not sure.

    I'm trying to modify the Banzai module to give the option to show a frame highlight when a unit gets aggro, similar to what it looks like when a unit gets poisoned or cursed, but the color would be red.
    Posted in: Unit Frames
  • 0

    posted a message on Post useful/interesting DogTag-1.0 sequences here
    I upgraded my Pitbull, but i was hesitant because I'd created four new dog tags in the 2.0 library and didn't want to upgrade because I'd have to add them.

    But I was delighted to see ckknight added them to the 3.0 libary. :))

    TimeLeftOnAura -> AuraDuration
    CountAura -> NumAura
    Repeat -> Repeat


    However, there's one of my tags that didn't make it! :(

    The tag was called "HasAggro" and worked like this:

    [HasAggro?[Name:Red]!Name]

    Here was the code that I posted earlier in this thread:


    Tags.HasAggro = {[[do
    local banzai = AceLibrary("Banzai-1.1")
    local aggro = banzai:GetUnitAggroByUnitId(${unit})
    if (aggro) then value = true end
    end]], ret = "string;nil", events = "Update"}
    ]



    I was wondering, ckknight, if you could add this tag to the next build of the DogTags-3.0 library. Thank you for making Pitbull such an amazingly flexible unit frames. There is no equal. :)

    Posted in: Unit Frames
  • 0

    posted a message on Post useful/interesting DogTag-1.0 sequences here
    The server is still undergoing maintenance, but you can use this logic to check if your current character is a druid and if so, use that dogtag:

    [Class#player:IsEqual(Druid)?[Put your dog tag here]![Put another dog tag here]

    Again, can't test it cuz the server isn't up.
    Posted in: Unit Frames
  • 0

    posted a message on Post useful/interesting DogTag-1.0 sequences here
    I'm a resto druid, and loved Grid's features for showing remaining time on hot buffs i've cast on other units, as well as which HoTs I currently have cast. However, grid doesn't have the visual flexibility and functionality that pitbull has, so...

    I created the following new dogtags to give me this functionality:

    CountAura(Lifebloom)
    TimeLeftOnAura(Lifebloom)

    And also a new modifier:

    Text(Hi):Repeat(3)

    This will output "HiHiHi"

    How is this useful?

     [Text(*):Repeat([CountAura(Lifebloom)]):Cyan]

    The above tag will show a cyan asterik for each lifebloom cast on the target unit.

    This is the full dogtags that I use, which shows lifeblooms, rejuv, and regrowth buffs, as well as the time left on each:

     [Text(*):Repeat([CountAura(Lifebloom)]):Cyan] [HasAura(Rejuvenation)?Text(*):Yellow]
     [HasAura(Regrowth)?Text(*):Green]

    And this:

    [TimeLeftOnAura(Lifebloom):~IsEqual():Append(, ):Cyan] [TimeLeftOnAura(Rejuvenation):~IsEqual():Append(, ):Yellow]
     [TimeLeftOnAura(Regrowth):Green]

    This is what the result will look like in Pitbull:


    I am going to hide the icons, and just use the asteriks, as in a raid, I'll have my units arranged in a grid format, and the auras just don't fit in this layout since they must be outside of the unit frame. What you see above is asteriks for lifeblooms, rejuv, and regrowth cast, as well as the time left for each on the right.

    To get these new tags to work, you must add the following code to LibDogTag-2.0.lua:

    Modifiers.Repeat = {function(data)
    return
    [[
     if type(${arg}) == "nil" then
      value = ""
     else 
    	 if type(value) ~= "string" then
    	  value = tostring(value)
    	 end
    	 if ${arg}==0 then 
    	  value = "" 
    	 else
    		 local val = value
    		 for i = 2, ${arg} do
    		  value = value .. val
    		 end
    	 end 
     end
    ]]
    end, arg="number", value="number;string", ret="string"}
    
    
    
    Tags.CountAura = {function(data)
      return [[
     		for i = 1, 40 do -- 40 is max buffs  
    		 	local buffName, rank, texture, applications, duration, timeleft = UnitBuff(${unit},i)
    		 	if buffName then
    		 	 if buffName == ${arg} then
    		 	  if applications == 0 then
    		 	   value = 1
    		 	  else
    		     value = tonumber(applications)
    		    end
    		    break
    		   else
    		    value = 0
    		   end
    		  end
    		end
      ]]
    end, arg = "string", ret = "number", events = "Update"}
    
    Tags.TimeLeftOnAura = {function(data)
      return [[
        value = ""
     		for i = 1, 40 do -- 40 is max buffs  
    		 	local buffName, rank, texture, applications, duration, timeleft = UnitBuff(${unit},i)
    		 	if type(timeleft) ~= "nil" then
    			 	local time = tostring(math.floor(timeleft))
    			 	if buffName then
    			 	 if buffName == ${arg} then
    			    value = time
    			    break
    			   else
    			    value = ""
    			   end
    			  end
    		  end
    		end
      ]]
    end, arg = "string", ret = "string", events = "Update"}



    Hopefully, none of you use these new tags against me in the arena!

    - Teakan on Area 52 - resto druid
    Posted in: Unit Frames
  • 0

    posted a message on Post useful/interesting DogTag-1.0 sequences here
    If you don't want the entire bar to change color, but just, say, the unit name color, you can use this:

    [HasAggro?[Name:Red]!Name]


    You need to add the following code to LibDogTag-2.0.lua:

    Tags.HasAggro = {[[do
      local banzai = AceLibrary("Banzai-1.1")
      local aggro = banzai:GetUnitAggroByUnitId(${unit})
      if (aggro) then value = true end
    end]], ret = "string;nil", events = "Update"}

    This is my first custom dog tag so it may not be the most efficient but it works! :)
    Posted in: Unit Frames
  • To post a comment, please or register a new account.