Thread Tools Display Modes
06-09-14, 10:08 AM   #1
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Outline on Combat Text

Hey I was wondering if there is any way to put a shadow outline on the floating combat text. Also I was wondering if there was a way to change the color / font of just the error text in the top center of the screen.

Thanks!
  Reply With Quote
06-09-14, 11:31 AM   #2
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Have you tried any of the combat text addons? XCt, XCt+, Miks Scrolling Combat Text, Scrolling Combat Text (SCT).
  Reply With Quote
06-09-14, 12:42 PM   #3
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
The default ui uses font widgets for those. CombatTextFont and ErrorFont are the ones you are looking for. From that on it's simply using SetShadowColor, SetShadowOffset and SetTextColor for achieving what you want. You should use Font:GetFont() in order to get the values already used if you want to preserve them.
  Reply With Quote
06-09-14, 11:09 PM   #4
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Originally Posted by Rainrider View Post
The default ui uses font widgets for those. CombatTextFont and ErrorFont are the ones you are looking for. From that on it's simply using SetShadowColor, SetShadowOffset and SetTextColor for achieving what you want. You should use Font:GetFont() in order to get the values already used if you want to preserve them.
I tried doing it myself and I couldn't get it to work. Could you do it for me? All I would like is just the shadow outline on the combat text. The error text I was wondering if it was possible to make it a creme color instead of the red similar to the Wildstar error text. Thank you so much for your post too I really appreciate it.
  Reply With Quote
06-10-14, 06:02 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Simply changing the default color of the error font object won't do much, since most (if not all) types of error messages are sent to the error frame along with a color specific to the message. To override the colors for all messages, you need to replace the function that tells the frame what color to use for each message:

Code:
local orig = UIErrorFrame.AddMessage
function UIErrorFrame:AddMessage(message, r, g, b, ...)
	orig(message, 1, 1, 0, ...)
end
As for the "floating combat text" font, if you're talking about the damage/healing numbers that appear over units in the game world -- those are rendered as part of the 3D game world, not as part of the interface, and you can't change any of their properties except for the font itself. You can't change the size or color, you can't remove the shadow, you can't add an outline, etc. This is all you can do:

Code:
DAMAGE_TEXT_FONT = "Interface\\AddOns\\MyAddon\\MyFont.ttf"
You can (probably) change more properties for the actual "floating combat text" -- friendly healer names, aura changes, reactive abilities, enter/leave combat, etc. -- this way:

Code:
local font, size = CombatTextTemplate:GetFont()
CombatTextTemplate:SetFont(font, size, "OUTLINE") -- add an outline
CombatTextTemplate:SetShadowOffset(0, 0) -- remove the shadow
Again, changing the default color likely won't achieve much, as each message is displayed in a specific color that overrides the default color of the font object. If you want to override those colors, look through the default UI code in Blizzard_CombatText.lua, find the function that actually tells the font strings what text to display, and pre-hook (replace) it.
__________________
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
06-10-14, 12:21 PM   #6
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Originally Posted by Phanx View Post
Simply changing the default color of the error font object won't do much, since most (if not all) types of error messages are sent to the error frame along with a color specific to the message. To override the colors for all messages, you need to replace the function that tells the frame what color to use for each message:

Code:
local orig = UIErrorFrame.AddMessage
function UIErrorFrame:AddMessage(message, r, g, b, ...)
	orig(message, 1, 1, 0, ...)
end
As for the "floating combat text" font, if you're talking about the damage/healing numbers that appear over units in the game world -- those are rendered as part of the 3D game world, not as part of the interface, and you can't change any of their properties except for the font itself. You can't change the size or color, you can't remove the shadow, you can't add an outline, etc. This is all you can do:

Code:
DAMAGE_TEXT_FONT = "Interface\\AddOns\\MyAddon\\MyFont.ttf"
You can (probably) change more properties for the actual "floating combat text" -- friendly healer names, aura changes, reactive abilities, enter/leave combat, etc. -- this way:

Code:
local font, size = CombatTextTemplate:GetFont()
CombatTextTemplate:SetFont(font, size, "OUTLINE") -- add an outline
CombatTextTemplate:SetShadowOffset(0, 0) -- remove the shadow
Again, changing the default color likely won't achieve much, as each message is displayed in a specific color that overrides the default color of the font object. If you want to override those colors, look through the default UI code in Blizzard_CombatText.lua, find the function that actually tells the font strings what text to display, and pre-hook (replace) it.
Those are breaking my scripts unless I'm not doing something right, I get:

Code:
 Message: Interface\AddOns\YourAddon\YourAddon.lua:11: attempt to index global 'CombatTextTemplate' (a nil value)
Time: 06/10/14 14:18:14
Count: 1
Stack: Interface\AddOns\YourAddon\YourAddon.lua:11: in main chunk

Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'CombatTextTemplate' (a nil value)"
  Reply With Quote
06-10-14, 01:59 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
CombatTextTemplate is defined in Blizzard_CombatText.xml, which is loaded as part of the Blizzard_CombatText addon, so you need to wait until that loads before running your code.

Code:
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, ...)
     if not CombatTextTemplate then return end
     self:UnregisterAllEvents()
     self:SetScript("OnEvent", nil)

     -- your code here
end)
__________________
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
06-11-14, 12:37 PM   #8
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Things still aren't working out unfortunately.

I guess the best way to put it is there anyway to make the error text look just like the error text in Wildstar. The one just above their head in the game, color, the single line and everything. I know it's very unusual but I would be very grateful if there was someway to make it into an addon. If not then thank you for everything you have done for me.
  Reply With Quote
06-11-14, 01:02 PM   #9
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Personally I've been using BigRed for, like, 5 years or so now.
  Reply With Quote
06-11-14, 02:02 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Ash93 View Post
I guess the best way to put it is there anyway to make the error text look just like the error text in Wildstar. The one just above their head in the game, color, the single line and everything.
I think your use of terminology is making things more confusing than they need to be.

The term "error text" officially means the messages like "Out of range" or "You can't do that yet" that appear in red in the upper middle area of the screen. If you want to change that, you can, very easily; either use the addon Ravagernl linked, or any of the numerous other addons with the word "error" in their name that modify this text, or work with the code snippet in my last post to get the result you want.

However, based on your description of text appearing above heads, I suspect you are talking about what is the thing officially called "damage/healing text" or "floating combat text" -- the damage and healing amount text that pops up over the unit that was damaged or healed in the game world -- and like I said in my last post, you can only change the font (eg. use Comic Sans instead of the default font); you cannot change the size, color, or any other properties of this text.

Also, any time you want something in WoW to look like something in another game, you should really post a screenshot of what it looks like in the other game. Personally I don't play any other games, and I suspect I'm not alone in this. Nobody's going to go buy another game (or pirate it, or figure out how to get a free trial, or find a friend whose account they can borrow, or whatever) just to see what something looks like in it so they can help you write a WoW addon to copy the effect, but if you just show us a picture of what you want, you're likely to get a lot more help, and faster.
__________________
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
06-11-14, 11:15 PM   #11
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Yeah sorry about that. Here is a screenshot of it: http://chromaengine.com/wp-content/u...4-07-45-96.jpg

It's the text in the middle that says "You can't do that yet"
  Reply With Quote
06-11-14, 11:16 PM   #12
Ash93
A Deviate Faerie Dragon
Join Date: May 2014
Posts: 12
Originally Posted by ravagernl View Post
Personally I've been using BigRed for, like, 5 years or so now.
Just saw this. Thank you!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Outline on Combat Text


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off