• 0

    posted a message on PitBull4 - some "challenges"
    Mouseover is already an option for indicators/text.

    Make a new event in the LuaText module section for PLAYER_REGEN_ENABLED and PLAYER_REGEN_DISABLED. These are your combat flag events. Ripping apart my threat tag would reveal this.

    if UnitAffectingCombat("player")==1 then
    return "%s %s",UnitHealth("player"),UnitHealth("target") --see note
    end


    May also be Health(), I'm a bit foggy on the LuaText shortcuts the team did. For boss health, you would check UnitClassification for boss, then make separate tags for them. For the level 80 one, there is probably already a coloration option for that somewhere, but worse case just compare their level against yours, use |cff%02x%02x%02x%s|r in the return, and make a formula based on what colors you want. Lets say you want it to go from yellow to green, you would use %02xFF00 and the variable for the level discrepancy would be used to scale the first color (red). It's a bit tricky and I have some code I used with hit points to help you out with this. For the last request, see the first.
    Posted in: Unit Frames
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    I've been getting random crashes that I've singled down to ButtonFacade with ThinBlack lately. I can disable JUST ButtonFacade and the crashing stops. It crashes when it is loading the UI, as in when I log in or if I do a reload. It basically blocked me out of my druid today, I couldn't log in at all without crashing. No error logs are generated.

    I am not sure if I am the only one having this problem, so let me know if there is any testing you wish for me to do.
    Posted in: General AddOns
  • 0

    posted a message on LuaTexts Official Thread
    HP :: Power% - Shades to red as HP and Power Percentage deplete. Can also make it green to yellow to red with a bit of work. I used some code to turn the :: separator into a combat indicator, but it could really be used for anything.

    h,p=HP(unit)/MaxHP(unit),Power(unit)/MaxPower(unit)
    return '|cFFFf%02x%02x%s|r :: |cFFFF%02x%02x%.0f|r',h*255,h*255,VeryShort(HP(unit),true),p*255,p*255,p*100
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Quote from cremor
    That really works, thanks.
    I wonder then why Sabaren and Shefki wrote that it doesn't work this way some weeks ago (the post I quoted).


    It's working for me now. I don't know what is different, but it seems to work properly.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    I need to get targettarget, pet, and focus information on my player/target frames. Lets use targettarget's name for an example. The code would be ::return UnitName("targettarget"):: obviously, but we need an event.

    And this is where I'm stuck. I have UNIT_NAME_UPDATE set to all, but that still does not trigger the update on the text.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    I would try a different font. That doesn't seem like a Pitbul problem as much as a general font problem. The I has a ^ over it. The other font may not support that character properly.

    <3<3<3 Shefki for adding in Custom Backgrounds. I just noticed that functionality and it saved me from resorting to kgPanels for now.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Quote from Shefki

    I know that the:
    if p..l..r..a~='' then
    bit is tempting but you really should do:


    That's right, I remember reading something on that in a good coding practices guide.

    I figured out what was wrong with PLAYER_REGEN, I was using it on the player frame, but in LuaText I had the default update option. When I changed it to Update for Player it started working. I figured player would have gotten passed from the player frame. I really don't need combat indicators for my party. As a healer, it's obvious when someone gets agro :).

    Here is another example of a tag. One if then statement to assign a variable. Another statement with a bit more complex evaluation, needing a variable and static text. This is how I coded this the first time:

    if Function()==1 then
    a="true"
    else
    a="false"
    end
    if e>0 then
        if u="friend" then
            b=e..'%'
        else
            b="not friend"
        end
    end
    return '%s%s',a,b


    I'm thinking this is a better alternative? Allowing me to not use concatenation. Also allows me to not use b.

    if Function()==1 then
    a="true"
    else
    a="false"
    end
    if e>0 then
        if u="friend" then
            return '%s%s%%',a,e
        else
            return '%s not friend',a
        end
    end


    Edit: v thanks, I always forget to tag code.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    What would be the most efficient way to format a variable with static text on a condition? For example, if HP > 0 then return HP: %s. Rough example code:

    local c=HP(unit)
    if c>0 then
    s='HP: '..c -- ?
    end
    return '%s',s


    Obviously this could be done in a more simple fashion, but this assumes that there is more formatting in the code fed to the return line. The point is to not show static text under a prior condition, as return 'HP: %s',c would always show HP:, and it's not always possible to use returns in the if statements.

    Any other efficiency tips would be most welcome. From what I've read, if using a function more than once it is more beneficial to put it to a local variable. Example displaying this as well. I'd like to minimize garbage as my raid frames will have a bit of information on them concerning healing, and one tag will be amplified X25.

    By the way Shefki, just ignore all the idiots. DogTags is becoming obsolete, LuaText has plenty of defaults to chose from, and Shadowed should have just PMed you in the first place instead of spamming up a thread dedicated to answering user's concerns.

    Also, would it be more beneficial to say, lump multiple tags together, or use separate tags for unrelated events. Example would be having [80] [x] [L+], tags being Level (UNIT_LEVEL), combat (PLAYER_REGEN_(disabled/enabled), and player flags for leader and ML and such (PLAYER_FLAGS_CHANGED). This also goes along with the original question if combat and flags were combined to [xL+]. This is what I was using before I started reconstructing my UI.

    --Indicators
    local p,l,r,a='','','','','',''
    if UnitIsPVP(unit) then
    p='P'
    end
    if UnitIsPartyLeader(unit) or IsRaidLeader(unit) then
    l='L'
    end
    if IsResting(unit)  then
    r='R'
    end
    if UnitIsAFK(unit) then
    a='A'
    end
    if p..l..r..a~='' then
    return '[%s%s%s%s]',p,l,r,a
    end


    This looks absolutely terrible, but it did work fine. I never got combat working flawlessly though, how are you handling it in the combat indicator? Mine seems to randomly stick. I tried UnitAffectingCombat() as well as the secure action lock function to check for combat, but it seems like the event isn't firing it off correctly or at all with PLAYER_REGEN.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    http://www.wowwiki.com/API_UnitRace

    LuaText isn't just some fancy Lua functions, you can use any of the WoW API to form text tags. These are premade functions that allow you to save a lot of coding, they're similar to the aliases in DogTags. They made these for convenience (and performance) for the WoW community.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    You are my hero Shefki. A quick question, what should I use to indicate whether or not I am in combat? Right now I'm using UnitAffectingCombat(unit), but it seems to display randomly instead of when I enter/leave combat.

    I'll try the Lifebloom code with the newest push. Also, I haven't noticed as bad of lag in raids as when I first posted. With this, it should run flawlessly.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Quote from Shefki
    You'd need to use UpdateIn() or I'd need to specifically add some sort of support for modifier keys. (...)

    I'll think on this.


    So will I. I was wanting to use them to hide raid frame names in a sensible fashion, but I'm not seeing it implementing like I want it. I did get UpdateIn working though.
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Modifier keys:

    if IsShiftKeyDown() then
    s="SHIFT"
    end
    return s

    MODIFIER_STATE_CHANGED

    This general type of code does not work. I tested on the target frame. If I hold the key down then target something, it shows the test text, but if I target something then press the key it does nothing. Do I need a different event or an UpdateIn()?
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    Cool, thanks for the explanation bro. I'll sift through the code a bit more tomorrow. How is the second one, is that an example of proper usage? I think UnitAura is going to be one of the more complex types of texts people are going to make, since they were pretty popular with dogtags for missing buffs and such.

    Here's what they look like in a raid setting by the way, with a rough raid layout.

    http://www.sabaren.com/wow/ui/ui3.1.3.raid.png
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    So I should trigger the color update when the aura changes and not within the update time I'm guessing? My Lua is rough, and there are a lot of conditions to account for with my low skill. I just started learning about events with Lua Texts.

    My other counters are similar, but do the returns at the end and set the variables to the formatting, basically cutting everything in the if n=="Lifebloom" and using var='color formatting' instead. I have 2 more of these and recently added a third for debuffs.

    local i=1
    while true do
        local n,_,_,c,_,_,e,u=UnitAura(unit,i,"HELPFUL")
            if not n then
                break
            elseif u=="player" then
                if n=="Lifebloom" then
                    UpdateIn(0.2)
                    local d=floor(e-GetTime(),1)+1
                    if c==3 then
                        return '|cFF00FF00%s|r',d
                    elseif c==2 then
                        return '|cFFFFFF00%s|r',d
                    elseif c==1 then
                        return '|cFFFF0000%s|r',d
                    end
                end
            end
        i=i+1
    end



    Here is what I used as a sort of template for the other ones. How bad is the garbage and stuff on these as well?

    local i=1
    rj,rg,wg='','','',''
    while true do
        local n,_,_,c,_,_,e,u=UnitAura(unit,i,"HELPFUL")
            if not n then
                break
            elseif u=="player" then
                if n=="Rejuvenation" then
                    rj='|cFFFF00FF.|r'
                elseif n=="Regrowth" then
                    rg='|cFF00FF00.|r'
                elseif n=="Wild Growth" then
                    wg='|cFF55FF55.|r'
                end
            end
        i=i+1
    end
    Outline()
    return '%s%s%s',wg,rg,rj
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 4.0
    I am replicating GridStatus on PB4 raid frames. I have this as a general layout.

    local i=1
    a,b,c='','',''
    while true do
    local n=UnitAura(unit,i,"HELPFUL")
    if not n then
        break
    elseif n=="spell" then
            w='|cFFFFFFFF.|r'
    elseif n=="spell" then
        t='|cFFFFFFFF.|r'
    elseif n=="spell" then
        sm='|cFFFFFFFF.|r'
    end
    i=i+1
    end
    Outline()
    return '%s%s%s',a,b,c


    This returns the buffs on my raid frames as large squares. I have one set for buffs, another for my HoTs (using unitCaster as another nested if statement), and another for lifebloom (using count and expires along with unitCaster), so each raid frame has 3 of these running. This is identical to what I tried with Dogtags (except it had no ismine), and using only Lua Text, this is suppose to run a lot cleaner. What I noticed, however, is that I am getting frame skips in raids during combat.

    Is my code flawed? I based it upon the other buff codes on here. I would find it hard to imagine that running buff checks would cause too much strain, because I ran the raid frames with the Aura mod (UpdateIn() for every aura instead of only lifebloom), as well as the Dogtag equivalent.
    Posted in: Unit Frames
  • To post a comment, please or register a new account.