• 0

    posted a message on PitBull 4.0
    I hope this hasn't been mentioned because I'd hate to waste time with a useless request, but I couldn't find the answer I'm looking for:

    Is it possible to have Pitbull show a unit's guild / vendor classification (<Armor Vendor> vs <Fruit Vendor>) / class type (for Faction Champions: <Mage> vs <Paladin>)? The unit's guild I assume is easily doable (though I don't know what the code is to display guild) but the latter two might require special coding. I know it's possible to see vendor type and class type because TipTac is able to do it.

    Basically, is it possible for Pitbull to display the information that would appear inside < ... > when mousing over a unit?

    Realize that when I say 'class type' I don't mean the player's class. For Faction Champions, the unit's class doesn't actually match their class type; the <Warlock> is classed as a Mage, for example.

    [Edit] I just found the answer: GameTooltipTextLeft2:GetText(unit). That was a lot easier than I thought. Now, to filter it so that it only displays that information if my target is NOT a player (I really only want to see it for NPCs and Faction Champs), I assume I'd have to set up an If UnitIsPlayer(unit) then ... else ... conditional. I'll try testing that but if I'm off, advice would be welcome. :)

    [Edit 2] lol ok, after quite a bit of testing, I managed to find my answer. I'm using the following code:

    local guild = ''
    if UnitIsPlayer(unit) or string.find(GameTooltipTextLeft2:GetText(unit),"<")==nil then
    guild = ''
    else
    guild = GameTooltipTextLeft2:GetText(unit)
    end
    return "%s", guild

    This makes it so that any time my target is a non-player (the target can be a pet or an npc) that has a special tag (something with "< ... >", recognized by containing a "<") in the second line of their name string, Pitbull will display that special tag. This tells me pet owners, vendors, and (I have yet to test it) I hope Faction Champion classes.
    Posted in: Unit Frames
  • To post a comment, please or register a new account.