Thread Tools Display Modes
11-20-15, 05:19 PM   #1
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
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()
  Reply With Quote
11-20-15, 11:52 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-22-15, 01:43 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
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
11-23-15, 02:28 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Phanx View Post
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.



Originally Posted by Phanx View Post
...which are not and cannot be secure objects.
My comment on protected frames where more focused on moving and setting the scale of PetActionBarFrame.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-23-15 at 02:41 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Not sure how to add code to this table. Help?

Thread Tools
Display Modes

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