Wednesday, April 18, 2012

Pitbull 4 Lua Text

I've been messing around with Pitbull 4 since it seems to offer a lot of nice flexibility to get my unit frames just the way I want them. My problem is that some of the Lua needed to do this is apparently well beyond what I can do. Basically, I can copy and modify other stuff if I can find a reasonably close example to what I want, but I'm pretty clueless as far as creating something on my own.

So, here is what I want to do.

The PvP indicator in Pitbull is functional, but the icon really just don't work with the look I'm going for. I'd like it to be text based, which should be possible using Lua Texts, but I'm at a loss as to how to do it.

There is a premade lua text to show the countdown until you become unflagged once you disable PvP. When the timer isn't active, there is just nothing there.


Code:
if unit == "player" then
local pvp = PVPDuration()
if pvp then
return "|cffff0000%s|r",FormatDuration(pvp)
end
end

What I would like is for this indicator to show "PvP" when I'm actively flagged from something like entering a PvP area or actually turning on my PvP flag. When I turn off the flag, it would turn into the timer. Obviously, when I'm not flagged there would be nothing there.

No comments:

Post a Comment