WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Equipment Manager "New Set" Button (https://www.wowinterface.com/forums/showthread.php?t=50246)

evilbib 10-22-14 02:41 PM

Equipment Manager "New Set" Button
 
Hi,

im trying to seperate the "New Set" button in the equipment manager because I dont want an border around this one. The problem is that the name of that button isnt always the same...

My code works if I have only a small number of sets saved and if I dont delete or add a new one.
Maybe the hooked function isnt the right one?

Lua Code:
  1. hooksecurefunc("PaperDollEquipmentManagerPane_Update", function()
  2.             for i = 1, 9 do
  3.                 local button = _G["PaperDollEquipmentManagerPaneButton"..i]
  4.                 local icon = _G["PaperDollEquipmentManagerPaneButton"..i.."Icon"]
  5.                 local text = button.text:GetText()
  6.                 print(text)
  7.                
  8.                 if button and not button.skinned then
  9.                     if (text == "New Set") then
  10.                         button.skinned = true
  11.                     else
  12.                         local border = CreateFrame("Frame", nil, button)
  13.                         border:SetAllPoints(icon)
  14.                         border:CreateBeautyBorder(12)  
  15.                         border:SetBeautyBorderPadding(1)
  16.                         icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
  17.                         button.skinned = true
  18.                     end
  19.                 end
  20.             end
  21.         end)

Duugu 10-22-14 09:17 PM

Hey,

And what exactly does happen (or doesn't happen *g*) if your code fails?

evilbib 10-23-14 05:55 AM

For example if I add a new set the new set button gets an border and the new set doesn't. I think because the new set button becomes PaperDollEquipmentManagerPaneButtoni+1 and the new set becomes the old new set button.

And another example if I have like 15 sets saved then the new set button only appears if I scroll down. So the getText() function doesnt run on this button I guess.


All times are GMT -6. The time now is 07:14 AM.

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