WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Font size of the nameplates (https://www.wowinterface.com/forums/showthread.php?t=55142)

Dasteman 02-14-17 04:32 PM

Font size of the nameplates
 
I'm using currently a script that I've found on another forum to make text font on the nameplate smaller.
It works but it's applying its effect multiple times after long session in the game.
Text gets so small that you can't read anymore.

Do you know what's wrong with that script?
Lua Code:
  1. local frame = CreateFrame("Frame")
  2.     frame:SetScript("OnEvent", function()
  3.     --big plates with small text
  4.     DefaultCompactNamePlateFrameSetUpOptions.useLargeNameFont=false
  5.     end)
  6.     -- Register for interesting events
  7.     frame:RegisterEvent("PLAYER_ENTERING_WORLD")

Fizzlemizz 02-14-17 05:17 PM

The function is running every time you use a portal, take a boat/zeplin, enter/leave a battlegournd, arena, order hall etc.

Lua Code:
  1. local frame = CreateFrame("Frame")
  2.         frame:SetScript("OnEvent", function()
  3.         --big plates with small text
  4.         DefaultCompactNamePlateFrameSetUpOptions.useLargeNameFont=false
  5.         frame:UnregisterAllEvents()
  6.         end)
  7.         -- Register for interesting events
  8.         frame:RegisterEvent("PLAYER_ENTERING_WORLD")

It could probably be done slightly differently but this will stop the multiple calls.

Dasteman 02-15-17 03:23 AM

Thank you. Works great now:)

--
Seems like this script is causing taint the same way as NameplateColor before the update.
It gives "SetTargetClampingInsets" error.
Link to the thread,
http://www.wowinterface.com/forums/s...ad.php?t=55142

Maybe you could take a look at it? I'd really appreciate it:)

Ketho 02-15-17 11:20 AM

Quote:

Originally Posted by Dasteman (Post 322181)
Seems like this script is causing taint the same way as NameplateColor before the update.
It gives "SetTargetClampingInsets" error.


Probably any kind of nameplate taint will trigger the SetTargetClampingInsets error...

Miiru 02-15-17 12:47 PM

Maybe this can help you:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("PLAYER_LOGIN")
  3. f:SetScript("OnEvent", function()  
  4.  
  5. local function SetFont(obj, optSize)
  6.     local fontName= obj:GetFont()  
  7.     obj:SetFont(fontName,optSize,"OUTLINE")
  8. end
  9.  
  10. SetFont(SystemFont_LargeNamePlate,12)
  11. SetFont(SystemFont_NamePlate,12)
  12. SetFont(SystemFont_LargeNamePlateFixed,12)
  13. SetFont(SystemFont_NamePlateFixed,12)
  14.  
  15. end)

Dasteman 02-16-17 01:51 AM

That's awesome! Not only works without errors but lets me even set a font size.
Thank you!


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

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