View Single Post
10-24-15, 05:15 AM   #18
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by LanceDH View Post
Won't argue with that. Forgot something in your XML? Well I'm just going to tell you something went wrong in your LUA instead.

Edit:
As for everything LUA, this is unfinished and uncleaned code but I think we can all agree it burns people's eyes out.
Not exactly practicing what I preach, but you could just localize the widget to reduce bloat:
Lua Code:
  1. local Left = PlayFrame:CreateTexture("$parent_L", "ARTWORK", 0)
  2. Left:SetTexture("Interface\\AchievementFrame\\UI-Achievement-MetalBorder-Left")
  3. Left:SetTexCoord(0, 1, 0, .87)
  4. Left:SetWidth(16)
  5. Left:SetVertexColor(bSat, bSat, bSat)
  6. Left:SetPoint("topleft", PlayFrame, 15, -25)
  7. Left:SetPoint("bottomleft", PlayFrame, 15, 25)
  8. PlayFrame.left = Left
  9.  
  10. local Right = PlayFrame:CreateTexture("$parent_R", "ARTWORK", 0)
  11. Right:SetTexture("Interface\\AchievementFrame\\UI-Achievement-MetalBorder-Left")
  12. Right:SetTexCoord(1, 0, 0, .87)
  13. Right:SetWidth(16)
  14. Right:SetVertexColor(bSat, bSat, bSat)
  15. Right:SetPoint("topright", PlayFrame, -15, -25)
  16. Right:SetPoint("bottomright", PlayFrame, -15, 25)
  17. PlayFrame.right = Right

On-topic:
I spent a lot of time trying to get this stuff sorted, because I use a fake cursor in ConsolePort that clicks on buttons and stuff in the interface. Since it had to be robust and refrain from tainting every single thing it touches, it uses the secure action button system along with a clickbutton attribute. The attribute is changed every time the user moves the cursor to another button, thus never calling any specific click scripts and never tainting the buttons it clicks.

The problem you're facing here is whether you can scan the spell book in a secure environment, which can only be done with secure handlers - and they offer a very limited part of the API. Also note that you can't reference non-secure frames in combat in a secure environment, meaning the paging buttons can't be clicked programmatically in combat using that approach. Personally, I think you should think of a different design to solve your problem.
__________________

Last edited by MunkDev : 10-24-15 at 05:29 AM.
  Reply With Quote