I'm looking for a way to hook all incoming numbers in combat floating text and chat and multiply them by 0.1 (According to Lua performance manual and tests: multiply is faster then divide). And then use string.format for strings higher then 100 to remove decimal. So for example 637 will become 63.7, but 7 906 or greater will become 791.
This way i will be able to build an AddOn that get rid of long numbers.
The main problem is that
AddOns\Blizzard_CombatText\Blizzard_CombatText.lua looks like only handles texts below character. For example if i'll add this code:
Lua Code:
hooksecurefunc("CombatText_AddMessage", function()
print(message, scrollFunction, r, g, b, displayType, isStaggered)
-- When i swing or damage deal nothing is output :(
-- Only Output when i receive heal or get damage
end)
local function Test(self, event, ...)
print(self, event)
local arg1, data, arg3, arg4 = ...;
print(arg1, data, arg3, arg4)
-- Same here, when i swing or damage deal nothing is output :(
-- Only Output when i receive heal or get damage
end
CombatText:HookScript("OnEvent", Test)
It will only print heal on me, special effects, damage that i take and so on... but nothing about damage that i deal.
So i take a look on other solutions, I inspected
Scrolling Combat Text - Damage AddOn, and it looks like it only turn off Blizzard's Cvar that show Combat Damage Done Text, and then uses it's own frame and put there text taken from Combat Chat and animate it.
The main problem in method from
Scrolling Combat Text - Damage, is that this text uses fixed position on screen, and if you fight with multiple targets, all damage done text will be placed in center in on place. But i am looking for a way to keep using Blizzard's Damage Done text style, but just hook it to remove 1 number.
I will very appreciate your help and advises.