View Single Post
09-05-12, 10:29 PM   #14
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Decabah View Post
FACTION_STANDING_DECREASED = "- %s %d rep"
FACTION_STANDING_INCREASED = "+ %s %d rep"

The rep nubbins were crashing me, because the tokens were back to front. I'd like to find a way to have them that way ...
There's no way to do that by editing the global strings. You'd need an addon that caught the messages as they were added to the chat frame, and changed them on the fly. Something simple like:

Code:
ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", function(frame, event, message, ...)
    local which, faction, amount = strmatch(message, "^[%+%-] (%+) (%d+) rep$")
    if which and faction and amount then
        return false, (format("%s%d %s rep", which, amount, faction)), ...
    end
end)
CHAT_MSG_SYSTEM may not be the right event.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote