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:
local function ToggleTalentUI()
if not PlayerTalentFrame then
LoadAddOn("Blizzard_TalentUI");
end
ShowUIPanel(PlayerTalentFrame);
end
local customButtons = {
{name = "Character", title = "Character Info", ClickFunc = ToggleCharacter, arg = "PaperDollFrame"},
{name = "Spellbook", title = "Spellbook", ClickFunc = ToggleFrame, arg = SpellBookFrame},
{name = "Talent", title = "Specialization", ClickFunc = ToggleTalentUI, arg = nil},
{name = "Bag", title = "Bags", ClickFunc = ToggleAllBags, arg = nil},
{name = "Achievement", title = "Achievements", ClickFunc = ToggleAchievementFrame, arg = nil},
{name = "QuestLog", title = "Quest Log", ClickFunc = ToggleQuestLog, arg = nil},
{name = "LFD", title = "Group Finder", ClickFunc = PVEFrame_ToggleFrame, arg = nil},
{name = "PvP", title = "PvP", ClickFunc = TogglePVPUI, arg = nil},
{name = "Collections", title = "Collections", ClickFunc = ToggleCollectionsJournal, arg = nil},
{name = "EJ", title = "Dungeon Journal", ClickFunc = ToggleEncounterJournal, arg = nil},
{name = "Garrison", title = "Garrison Report", ClickFunc = ToggleGarrisonReport, arg = nil},
{name = "Score", title = "Score Screen", ClickFunc = ToggleWorldStateScoreFrame, arg = nil},
{name = "Social", title = "Social", ClickFunc = ToggleFriendsFrame, arg = nil},
{name = "Guild", title = "Guild", ClickFunc = ToggleGuildFrame, arg = nil},
}
for i, btn in pairs(customButtons) do
local button = CreateFrame("BUTTON", "GameMenuButton"..btn.name, GameMenuFrame, "GameMenuButtonTemplate");
local anchor = customButtons[i-1] and customButtons[i-1].name or nil;
button:SetText(btn.title);
if anchor then
button:SetPoint("TOP", _G["GameMenuButton"..anchor], "BOTTOM", 0, -1);
else
button:SetPoint("TOPRIGHT", GameMenuFrame, "TOPRIGHT", -20, -20);
end
button:SetScript("OnClick", function(...)
ToggleFrame(GameMenuFrame);
btn.ClickFunc(btn.arg);
end);
table.insert(buttons, button);
end
Here's what it ends up looking like atm.