Scrolling Combat Text Abbreviator
Are there any addons out there that can abbreviate large numbers in the default scrolling combat text? i.e. 200 instead of 200,000 or 1000 instead of 1,000,000. I can live with it if there is a "k" or "m" but ideally I'd like to be able to hide even that.
I can live with a full SCT replacement addon but only if it retains the ability to pop the text up around the target. When I tested addons like Miks, xCT, and SCT a year ago in WoD, they only appeared to have the ability to scroll down the screen in static "columns." That used to be our only option, but I've gotten used to numbers being centered around the target they actually apply to and don't want to give up that functionality. However, I really hate the idea of 6 and 7 digits for every hit and would like to shorten the numbers so that I can more quickly mentally parse and compare. Does this exist? Is it possible? |
You could try overwriting the CombatText frame's OnEvent handler with a copy of CombatText_OnEvent modified to use AbbreviateNumbers instead of BreakUpLargeNumbers. I'm not sure whether it would work, though.
|
Quote:
|
1. Copy and paste the entire function from Blizzard's code into your addon file.
2. Add a "local" keyword in front of the function definition so it only exists in your file, not everywhere. "function DoStuff(x)" --> "local function DoStuff(x)" 3. Change each instance of the function names I mentioned where they're called from inside the function. 4. Set a new OnEvent handler on the CombatText frame, passing it your modified function. You can use this tool to generate an addon package for your code if you're not sure how to write a TOC file and set up your folder structure. |
Quote:
I used this: CombatText:SetScript("OnEvent", CombatText_OnEvent); And get this error: code.lua:268: attempt to index global 'CombatText' (a nil value) I think I'm missing something, is CombatText not a global frame? edit: see reply below, I think I got past this hurdle. |
Ok I worked on it and got rid of the nil global error. Blizzard_CombatText wasn't loading before my addon so I had to change the code to this:
Code:
local name = "Blizzard_CombatText" I'm going to investigate AbbreviateNumbers and hopefully find out what I can do to make my output what I want it to be. |
Does it work if, instead of AbbreviateNumber, you simply change the output to an arbitrary string like "TEST"?
That's where the "you could try" part of my original response comes in -- it may be that the combat text system, once loaded into memory, can't be affected by any further changes by addons. This would be in keeping with things like the NAME_TEXT_FONT global, which can be overridden to change the font used for unit names in the game world, but only if it's called early in the loading process, and changes persist through UI reloads, and additional changes after logging in are ignored. Another (simpler) way you can solve the load-on-demand problem is to just write this in your TOC file: ## LoadOnDemand: 1Then your addon will automatically be loaded right after Blizzard_CombatText. |
Quote:
Here's where I'm at. If I attack with an ability on a target dummy on a Rogue, I get executions of the following events: PLAYER_REGEN_DISABLED (entering combat), COMBAT_TEXT_UPDATE (arg1: ENERGIZE, happens twice), COMBAT_TEXT_UPDATE (arg1: SPELL_AURA_START), UNIT_POWER (happens 3x), COMBAT_TEXT_UPDATE (arg1: SPELL_AURA_END), UNIT_POWER (3x), PLAYER_REGEN_ENABLED (when I leave combat), UNIT_POWER But I can't seem to find the actual damage value in any of these events. And if I attack with no weapon/procs equipped and just autoattack with a fist, the only events I get are PLAYER_REGEN_DISABLED and PLAYER_REGEN_ENABLED. There are no events fired on each autoattack, at least not ones that are caught by my handler. And within the code of the function itself, it doesn't actually get to the end when it does execute. This part of the function: Code:
-- See if we should display the message or not At the end is the only call to addMessage that I can find in all of Blizzard_CombatText.lua: Code:
-- Add the message ----- Edit: Played around with print some more and confirmed that I was only getting secondary events, the actual "damage" event of COMBAT_TEXT_UPDATE doesn't seem to be getting caught. Code:
[05:09:37] Event: UNIT_POWER arg1: player data: COMBO_POINTS arg3: nil arg4: nil |
Oh, shit. I figured it out. So I forced the watched entity for COMBAT_TEXT_UPDATE to my target by adding CombatTextSetActiveUnit("target"); as a line right near the top of CombatText_OnEvent. Immediately I started getting events fired for all my damage done, but backwards:
Code:
[05:17:58] Event: COMBAT_TEXT_UPDATE arg1: DAMAGE data: 324561 arg3: nil arg4: nil So the method seems right, but the function being modified is not what I'm looking for. Are there other resources out there or am I out of luck? |
You can look around in the Blizzard UI source code but it seems likely you simply cannot modify this part of the UI, since it's rendered in the game world rather than in the UI. Probably once the UI code for it is loaded into memory, it's copied over to the game world rendering system, and after-the-fact modifications to it in the UI space just aren't copied over, so they have no effect. This is how the UNIT_NAME_FONT global works, too.
|
Quote:
Cause if it is I might just write my own addon and do all this from scratch. |
Now that the nameplates have valid unitIDs this may be possible.
|
It should be doable; just get the GUID for each nameplate's unit when it changes (NAMEPLATE_UNIT_ADDED event) and keep a table mapping GUID->nameplate, then in your COMBAT_LOG_EVENT_UNFILTERED handler, consult your map to figure out which nameplate (if any) to show the combat text for that event on.
|
All times are GMT -6. The time now is 03:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI