Thread Tools Display Modes
10-27-14, 01:17 PM   #1
InfamousX
A Fallenroot Satyr
Join Date: Aug 2014
Posts: 26
Skada Text Shadow + "MONOCHROMEOUTLINE"

Hey again, everyone!

I looked around in Skada's bardisplay.lua file and a few others, but I couldn't find where it controls the shadow and shadow offset. For me, the display shows (-1, 1) - I would like it to be (0, 0) and have an outline flag of "MONOCHROMEOUTLINE"; I just can't find it.

If anyone could point me in the right direction I'd appreciate it! Thanks in advance!
  Reply With Quote
10-27-14, 10:12 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If it doesn't offer in-game options for setting any font properties, then it probably just inherits from the game's predefined font objects, eg.

Code:
<fonstring> = <frame>:CreateFontString(nil, "OVERLAY", "NumberFontSmall")
where "NumberFontSmall" is the predefined font object. Just find that line and add something like this after it:

Code:
local file, size = <fontstring>:GetFont()
<fontstring>:SetFont(file, size, "MONOCHROME,OUTLINE")
<fontstring>:SetShadowOffset(0, 0)
If it does offer in-game options for changing any font properties, then it should already have a SetFont line somewhere; just adjust it as needed and add the SetShadowOffset line.

As a side note, "MONOCHROMEOUTLINE" is not correct; values should be separated by commas, so "MONOCHROME, OUTLINE" would be the proper way to specify what you want. The game might auto-correct bad values for you, but it's better to just use the API properly in the first place.
__________________
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
10-28-14, 12:56 PM   #3
InfamousX
A Fallenroot Satyr
Join Date: Aug 2014
Posts: 26
Originally Posted by Phanx View Post
If it does offer in-game options for changing any font properties, then it should already have a SetFont line somewhere; just adjust it as needed and add the SetShadowOffset line.
It does offer in-game options, I'm just lost as to where to put my code! I put it in pastebin so people don't have to download the addon to help. (; Here it is.

Originally Posted by Phanx View Post
As a side note, "MONOCHROMEOUTLINE" is not correct; values should be separated by commas, so "MONOCHROME, OUTLINE" would be the proper way to specify what you want. The game might auto-correct bad values for you, but it's better to just use the API properly in the first place.
Thanks for that information! I've seen "MONOCHROMEOUTLINE" in a few addons, so I just assumed it was correct without looking up proper documentation. I'll use it this way from now on. (:
  Reply With Quote
10-28-14, 01:35 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by InfamousX View Post
I put it in pastebin so people don't have to download the addon to help. (; Here it is.
Awesome. Everyone should do this always!

There are :SetFont lines here where you should add your "MONOCHROME" flag:

Code:
                        -- Emphathized items - cache a flag saying it is done so it is not done again.
                        -- This is a little lame.
                        if data.emphathize and bar.emphathize_set ~= true then
                                bar:SetFont(nil,nil,"OUTLINE,MONOCHROME")
                                bar.emphathize_set = true
                        elseif not data.emphathize and bar.emphathize_set ~= false then
                                bar:SetFont(nil,nil,"MONOCHROME") -- was "PLAIN") which is invalid
                                bar.emphathize_set = false
                        end
That "PLAIN" in the original code an invalid flag, by the way... it works because the game ignores it, resulting in text without an outline, which is the desired result, but the proper way to specify that would be either nil or an empty string.

Another one here on line 562; add the green bit at the end:

Code:
        g:SetFont(p.barfontpath or media:Fetch('font', p.barfont), p.barfontsize, p.barfontflags .. ",MONOCHROME")
As for the shadow... there's probably some other file called BarGroup.lua or something along those lines; post that one too.
__________________
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
10-30-14, 10:46 PM   #5
InfamousX
A Fallenroot Satyr
Join Date: Aug 2014
Posts: 26
Thanks again Phanx, you're a life saver!

Here are the other lua files since I wasnt sure which to post:
Menus.lua
Options.lua
Skada.lua
  Reply With Quote
10-31-14, 09:30 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It looks like the relevant code is actually in libs/SpecializedLibBars-1.0/SpecializedLibBars-1.0.lua. I'd add the following code in the ApplySettings function in BarDisplay.lua, right after the g:SetFont line in my previous post:

Code:
	local bars = g:GetBars()
	if bars then
		for _, bar in pairs(bars) do
			bar.label:SetShadowOffset(0, 0)
			bar.timerLabel:SetShadowOffset(0, 0)
		end
	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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Skada Text Shadow + "MONOCHROMEOUTLINE"


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