WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Outline for Name in default Unit Frames (https://www.wowinterface.com/forums/showthread.php?t=55794)

Ezi 10-09-17 03:09 PM

Outline for Name in default Unit Frames
 
I' m looking to add outline to name in target and focus names on default unit frames, i've found this code:

Code:

local FrameTypes = {'target', 'focus'}

        local DefaultFont, DefaultSize, _  = PlayerName:GetFont()
   
    for i, FrameType in ipairs(FrameTypes) do
        FrameTextureFrameName = loadstring("return " .. FrameType:sub(1,1):upper()..FrameType:sub(2) .. "FrameTextureFrameName")()
        local FontStyle = self.sets['textOutline'] and "OUTLINE" or nil;
        FrameTextureFrameName:SetFont(DefaultFont, DefaultSize, FontStyle)
    end

It's from rozbur's UI tweaks. However this addon is broken and this is only feature i'm looking for. This alone does not work, could anyone help me tweak this piece of code?

Dasteman 10-12-17 04:15 PM

Try this:
Lua Code:
  1. TargetFrameTextureFrameName:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  2. TargetFrameTextureFrameName:SetTextColor(1,.9,0)
  3. FocusFrameTextureFrameName:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  4. FocusFrameTextureFrameName:SetTextColor(1,.9,0)

MunkDev 10-12-17 06:19 PM

Lua Code:
  1. FrameTextureFrameName = loadstring("return " .. FrameType:sub(1,1):upper()..FrameType:sub(2) .. "FrameTextureFrameName")()

... but why.

Ammako 10-12-17 09:06 PM

Quote:

Originally Posted by Dasteman (Post 325459)
Try this:
Lua Code:
  1. TargetFrameTextureFrameName:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  2. TargetFrameTextureFrameName:SetTextColor(1,.9,0)
  3. FocusFrameTextureFrameName:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  4. FocusFrameTextureFrameName:SetTextColor(1,.9,0)

Just keep in mind if you hardcode the font to FRIZQT__.TTF it will break when fed Russian character names (not strictly, but the name will be replaced with ???????'s)

This may not be a problem for OP if they play on NA servers, but if anyone found this code and wanted to use it while playing on EU servers this can be a problem.


All times are GMT -6. The time now is 08:05 AM.

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