View Single Post
04-27-23, 01:19 AM   #7
AeroMaxxD
An Aku'mai Servant
Join Date: Dec 2022
Posts: 33
I've made some small changes, the code below is the most current version, I've tried setting a size to the main frame, tried changing the anchor settings for the layer but it's never in the right place it's always offset a little.

I created a paste for you here. https://paste.ee/p/zzGka

The XML code is on one tab and the LUA Code on another tab.

Lua Code:
  1. local TabName="AMD";
  2. local TabID=CharacterFrame.numTabs+1;
  3. local Tab=CreateFrame("Button", "$parentTab"..TabID, CharacterFrame, "CharacterFrameTabTemplate");
  4. PanelTemplates_SetNumTabs(CharacterFrame, TabID);
  5. Tab:SetPoint("LEFT", "$parentTab"..(TabID-1), "RIGHT", -16, 0);
  6. Tab:SetText(TabName);
  7. Tab:SetID(TabID);
  8.  
  9. tinsert(CHARACTERFRAME_SUBFRAMES, "AMD_TabOnCharacterFrame");
  10.  
  11. hooksecurefunc("CharacterFrameTab_OnClick", function(self, button)
  12.     if self:GetID() == TabID then
  13.         ToggleCharacter("AMD_TabOnCharacterFrame")
  14.     end
  15. end)
  Reply With Quote