Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-21-15, 09:23 AM   #1
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
ToggleTalentFrame() / ToggleGlyphFrame() taint issue

Hello, I'm trying to create a custom game menu and I'm having trouble with two buttons pertaining to the talent and glyph frames.

The taint issue comes from calling ToggleTalentFrame() and ToggleGlyphFrame() insecurely. Since these frames are not loaded by default, I can't use ToggleFrame() as I do with the Spellbook. My question is whether it's possible to actually open these frames with code without it blowing up in my face.

Edit: Here's the updated code:
Lua Code:
  1. local function ToggleTalentUI()
  2.     if not PlayerTalentFrame then
  3.         LoadAddOn("Blizzard_TalentUI");
  4.     end
  5.     ShowUIPanel(PlayerTalentFrame);
  6. end
  7.  
  8. local customButtons = {
  9.     {name = "Character",    title = "Character Info",   ClickFunc = ToggleCharacter,    arg = "PaperDollFrame"},
  10.     {name = "Spellbook",    title = "Spellbook",        ClickFunc = ToggleFrame,        arg = SpellBookFrame},
  11.     {name = "Talent",       title = "Specialization",   ClickFunc = ToggleTalentUI,     arg = nil},
  12.     {name = "Bag",          title = "Bags",             ClickFunc = ToggleAllBags,      arg = nil},
  13.     {name = "Achievement",  title = "Achievements",     ClickFunc = ToggleAchievementFrame, arg = nil},
  14.     {name = "QuestLog",     title = "Quest Log",        ClickFunc = ToggleQuestLog,     arg = nil},
  15.     {name = "LFD",          title = "Group Finder",     ClickFunc = PVEFrame_ToggleFrame, arg = nil},
  16.     {name = "PvP",          title = "PvP",              ClickFunc = TogglePVPUI,        arg = nil},
  17.     {name = "Collections",  title = "Collections",      ClickFunc = ToggleCollectionsJournal, arg = nil},
  18.     {name = "EJ",           title = "Dungeon Journal",  ClickFunc = ToggleEncounterJournal, arg = nil},
  19.     {name = "Garrison",     title = "Garrison Report",  ClickFunc = ToggleGarrisonReport, arg = nil},
  20.     {name = "Score",        title = "Score Screen",     ClickFunc = ToggleWorldStateScoreFrame, arg = nil},
  21.     {name = "Social",       title = "Social",           ClickFunc = ToggleFriendsFrame, arg = nil},
  22.     {name = "Guild",        title = "Guild",            ClickFunc = ToggleGuildFrame,   arg = nil},
  23. }
  24.  
  25. for i, btn in pairs(customButtons) do
  26.     local button = CreateFrame("BUTTON", "GameMenuButton"..btn.name, GameMenuFrame, "GameMenuButtonTemplate");
  27.     local anchor = customButtons[i-1] and customButtons[i-1].name or nil;
  28.     button:SetText(btn.title);
  29.     if anchor then
  30.         button:SetPoint("TOP", _G["GameMenuButton"..anchor], "BOTTOM", 0, -1);
  31.     else
  32.         button:SetPoint("TOPRIGHT", GameMenuFrame, "TOPRIGHT", -20, -20);
  33.     end
  34.     button:SetScript("OnClick", function(...)
  35.         ToggleFrame(GameMenuFrame);
  36.         btn.ClickFunc(btn.arg);
  37.     end);
  38.     table.insert(buttons, button);
  39. end
Here's what it ends up looking like atm.
__________________

Last edited by MunkDev : 03-21-15 at 02:04 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » ToggleTalentFrame() / ToggleGlyphFrame() taint issue

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