WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Can we somehow hook Blizzard's Combat Damage Text (that shows above target)? (https://www.wowinterface.com/forums/showthread.php?t=52780)

Nikita S. Doroshenko 09-30-15 02:20 AM

Can we somehow hook Blizzard's Combat Damage Text (that shows above target)?
 
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:
  1. hooksecurefunc("CombatText_AddMessage", function()
  2.     print(message, scrollFunction, r, g, b, displayType, isStaggered)
  3.     -- When i swing or damage deal nothing is output :(
  4.     -- Only Output when i receive heal or get damage
  5. end)
  6.  
  7. local function Test(self, event, ...)
  8.     print(self, event)
  9.     local arg1, data, arg3, arg4 = ...;
  10.     print(arg1, data, arg3, arg4)
  11.     -- Same here, when i swing or damage deal nothing is output :(
  12.     -- Only Output when i receive heal or get damage
  13. end
  14. 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.

p3lim 09-30-15 05:38 AM

If you're thinking about the damage/healing numbers that appear above the targets when you damage or heal them, they cannot be changed as they are part of the game world, not the UI.

The only alternative you've got is to disable it and use an addon to display it in a static location (as most alternatives do).

You could possibly make an addon that anchors them to nameplates, but because of how nameplates work and the fact that they don't have any identifiers usable for matching with the combat log (unless you've put your cursor over them once then cached them), it's not a feasible solution (imo).

Tonyleila 09-30-15 04:47 PM

Quote:

Originally Posted by p3lim (Post 311242)
The only alternative you've got is to disable it and use an addon to display it in a static location (as most alternatives do).

Are you 100% shure its not possible to anchor a new combat text to a nameplate?

sticklord 09-30-15 04:49 PM

Quote:

Originally Posted by Tonyleila (Post 311262)
Are you 100% shure its not possible to anchor a new combat text to a nameplate?

It is possible, it just wouldn't work 100%. Same problem as auras on nameplates have.

p3lim 10-01-15 05:50 AM

Quote:

Originally Posted by Tonyleila (Post 311262)
Are you 100% shure its not possible to anchor a new combat text to a nameplate?

I wouldn't recommend it, as text tends to look weird when moved, but it's possible.

Seerah 10-01-15 07:36 PM

Quote:

Originally Posted by Tonyleila (Post 311262)
Are you 100% shure its not possible to anchor a new combat text to a nameplate?

possible =/= feasible


All times are GMT -6. The time now is 08:34 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI