WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Not sure how to add code to this table. Help? (https://www.wowinterface.com/forums/showthread.php?t=52895)

Lesteryoung 11-20-15 05:19 PM

Not sure how to add code to this table. Help?
 
Trying to add this
Lua Code:
  1. PlayerName:SetTextColor(1,.92,0)
  2. TargetFrameTextureFrameName:SetTextColor(1,.92,0)
  3. FocusFrameTextureFrameName:SetTextColor(1,.92,0)
  4. TargetFrameToTTextureFrameName:SetTextColor(1,.92,0)
  5. FocusFrameToTTextureFrameName:SetTextColor(1,.92,0)
  6. TargetFrameTextureFrameName:SetWidth(117)
  7. FocusFrameTextureFrameName:SetWidth(117)
  8. TargetFrameToTTextureFrameName:SetWidth(66)
  9. FocusFrameToTTextureFrameName:SetWidth(66)

to this:
Lua Code:
  1. local fontStrings = {
  2. PlayerName,
  3. TargetFrameTextureFrameName,
  4. TargetFrameTextureFrameDeadText,
  5. FocusFrameTextureFrameName,
  6. FocusFrameTextureFrameDeadText
  7. }
  8.  
  9. for _, v in pairs(fontStrings) do
  10.     v:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  11.     v:SetShadowOffset(0, 0)
  12. end

And can't figure it out. Could anybody help?

Also, could someone tell me if these few lines are tainting my UI?

Lua Code:
  1. PetActionBarFrame:ClearAllPoints()
  2. PetActionBarFrame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 322, 112)
  3. PetActionBarFrame:SetScale(.87)
  4.  
  5. LossOfControlFrame:SetScale(.93)
  6. SpellActivationOverlayFrame:SetScale(.94)
  7.  
  8. PlayerHitIndicator:SetText(nil)
  9. PlayerHitIndicator.SetText = function() end
  10.  
  11. PetHitIndicator:SetText(nil)
  12. PetHitIndicator.SetText = function() end
  13.  
  14. hooksecurefunc(PlayerFrameGroupIndicator,"Show",function(self) self:Hide() end)
  15.  
  16. PetName:Hide()

SDPhantom 11-20-15 11:52 PM

1) I'm guessing you're looking for something like this:
Lua Code:
  1. local fontStrings = {
  2.     PlayerName,
  3.  
  4.     TargetFrameTextureFrameName,
  5.     TargetFrameTextureFrameDeadText,
  6.     TargetFrameToTTextureFrameName,
  7.  
  8.     FocusFrameTextureFrameName,
  9.     FocusFrameTextureFrameDeadText,
  10.     FocusFrameToTTextureFrameName
  11. }
  12.  
  13. for _, v in pairs(fontStrings) do
  14.     v:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  15.     v:SetShadowOffset(0, 0)
  16.     v:SetTextColor(1,.92,0)
  17. end
  18.  
  19. TargetFrameTextureFrameName:SetWidth(117)
  20. TargetFrameToTTextureFrameName:SetWidth(66)
  21.  
  22. FocusFrameTextureFrameName:SetWidth(117)
  23. FocusFrameToTTextureFrameName:SetWidth(66)



2) Lines 9 and 12 are the only points where you are tainting functions. However, many calls exist in the code that are protected from being used in combat if the affected frames are protected frames.

Phanx 11-22-15 01:43 PM

Lines 9 and 12 shouldn't actually cause a problem since they're overriding methods on font strings, which are not and cannot be secure objects.

You probably don't need to use a secure hook on PlayerFrameGroupIndicator either -- just do this:

Code:

PlayerFrameGroupIndicator.Show = PlayerFrameGroupIndicator.Hide
However, the best way to determine if you're breaking something through taint is just to try it and see what happens. If you don't get any errors about actions being blocked, you're probably fine.

SDPhantom 11-23-15 02:28 PM

Quote:

Originally Posted by Phanx (Post 311918)
Lines 9 and 12 shouldn't actually cause a problem since they're overriding methods on font strings...

If secure code were to call the method, it would still taint the execution path. To directly answer the OP's question, yes, it does cause taint. If the question was if this specific taint would interfere with specific secure code calling a protected function under certain conditions, I don't know.



Quote:

Originally Posted by Phanx (Post 311918)
...which are not and cannot be secure objects.

My comment on protected frames where more focused on moving and setting the scale of PetActionBarFrame.


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

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