Zelda Loot Addon Wont show

local zle_version = GetAddOnMetadata(“ZeldaLoot_Extended”, “Version”);
local panel_init = false;


– Menus

local uncommon_menu = {
{ text = “A Link to the Past”, func = function() green_dd_OnClick(0) end },
{ text = “OoT Orchestrated”, func = function() green_dd_OnClick(1) end },
{ text = “Twilight Princess”, func = function() green_dd_OnClick(2) end },
{ text = “Breath of The Wild”, func = function() green_dd_OnClick(3) end },
{ text = “Link Between Worlds”, func = function() green_dd_OnClick(4) end },
};

local rare_menu = {
{ text = “A Link to the Past”, func = function() blue_dd_OnClick(0) end },
{ text = “OoT Orchestrated”, func = function() blue_dd_OnClick(1) end },
{ text = “Twilight Princess”, func = function() blue_dd_OnClick(2) end },
{ text = “Breath of The Wild”, func = function() blue_dd_OnClick(3) end },
{ text = “Link Between Worlds”, func = function() blue_dd_OnClick(4) end },
};

local epic_menu = {
{ text = “A Link to the Past”, func = function() purple_dd_OnClick(0) end },
{ text = “OoT Orchestrated”, func = function() purple_dd_OnClick(1) end },
{ text = “Twilight Princess”, func = function() purple_dd_OnClick(2) end },
{ text = “Breath of The Wild”, func = function() purple_dd_OnClick(3) end },
{ text = “Link Between Worlds”, func = function() purple_dd_OnClick(4) end },
};

local legendary_menu = {
{ text = “A Link to the Past”, func = function() orange_dd_OnClick(0) end },
{ text = “OoT Orchestrated”, func = function() orange_dd_OnClick(1) end },
{ text = “Twilight Princess”, func = function() orange_dd_OnClick(2) end },
{ text = “Breath of The Wild”, func = function() orange_dd_OnClick(3) end },
{ text = “Link Between Worlds”, func = function() orange_dd_OnClick(4) end },
};

local jp_menu = {
{ text = "ALTTP: "…ZLE_GREEN, func = function() jp_dd_OnClick(0) end },
{ text = "ALTTP: "…ZLE_BLUE, func = function() jp_dd_OnClick(1) end },
{ text = "ALTTP: "…ZLE_PURPLE, func = function() jp_dd_OnClick(2) end },
{ text = "ALTTP: "…ZLE_ORANGE, func = function() jp_dd_OnClick(3) end },

{ text = "OOT: "..ZLE_GREEN,                   func = function() jp_dd_OnClick(4)     end },
{ text = "OOT: "..ZLE_BLUE,                    func = function() jp_dd_OnClick(5)     end },
{ text = "OOT: "..ZLE_PURPLE,                  func = function() jp_dd_OnClick(6)     end },
{ text = "OOT: "..ZLE_ORANGE,                  func = function() jp_dd_OnClick(7)     end },

{ text = "TP: "..ZLE_GREEN,                    func = function() jp_dd_OnClick(8)     end },
{ text = "TP: "..ZLE_BLUE,                     func = function() jp_dd_OnClick(9)     end },
{ text = "TP: "..ZLE_PURPLE,                   func = function() jp_dd_OnClick(10)    end },
{ text = "TP: "..ZLE_ORANGE.." [Mastersword]", func = function() jp_dd_OnClick(11)    end },

{ text = "BOTW: "..ZLE_GREEN,                  func = function() jp_dd_OnClick(12)    end },
{ text = "BOTW: "..ZLE_BLUE,                   func = function() jp_dd_OnClick(13)    end },
{ text = "BOTW: "..ZLE_PURPLE,                 func = function() jp_dd_OnClick(14)    end },
{ text = "BOTW: "..ZLE_ORANGE,                 func = function() jp_dd_OnClick(15)    end },

{ text = "ALBW: "..ZLE_GREEN,                  func = function() jp_dd_OnClick(16)    end },
{ text = "ALBW: "..ZLE_BLUE,                   func = function() jp_dd_OnClick(17)    end },
{ text = "ALBW: "..ZLE_PURPLE,                 func = function() jp_dd_OnClick(18)    end },
{ text = "ALBW: "..ZLE_ORANGE,                 func = function() jp_dd_OnClick(19)    end },

};

local hp_menu = {
{ text = "ALTTP: "…ZLE_GREEN, func = function() hp_dd_OnClick(0) end },
{ text = "ALTTP: "…ZLE_BLUE, func = function() hp_dd_OnClick(1) end },
{ text = "ALTTP: "…ZLE_PURPLE, func = function() hp_dd_OnClick(2) end },
{ text = "ALTTP: "…ZLE_ORANGE, func = function() hp_dd_OnClick(3) end },

{ text = "OOT: "..ZLE_GREEN,                   func = function() hp_dd_OnClick(4)     end },
{ text = "OOT: "..ZLE_BLUE,                    func = function() hp_dd_OnClick(5)     end },
{ text = "OOT: "..ZLE_PURPLE,                  func = function() hp_dd_OnClick(6)     end },
{ text = "OOT: "..ZLE_ORANGE,                  func = function() hp_dd_OnClick(7)     end },

{ text = "TP: "..ZLE_GREEN,                    func = function() hp_dd_OnClick(8)     end },
{ text = "TP: "..ZLE_BLUE,                     func = function() hp_dd_OnClick(9)     end },
{ text = "TP: "..ZLE_PURPLE,                   func = function() hp_dd_OnClick(10)    end },
{ text = "TP: "..ZLE_ORANGE.." [Mastersword]", func = function() hp_dd_OnClick(11)    end },

{ text = "BOTW: "..ZLE_GREEN,                  func = function() hp_dd_OnClick(12)    end },
{ text = "BOTW: "..ZLE_BLUE,                   func = function() hp_dd_OnClick(13)    end },
{ text = "BOTW: "..ZLE_PURPLE,                 func = function() hp_dd_OnClick(14)    end },
{ text = "BOTW: "..ZLE_ORANGE,                 func = function() hp_dd_OnClick(15)    end },

{ text = "ALBW: "..ZLE_GREEN,                  func = function() hp_dd_OnClick(16)    end },
{ text = "ALBW: "..ZLE_BLUE,                   func = function() hp_dd_OnClick(17)    end },
{ text = "ALBW: "..ZLE_PURPLE,                 func = function() hp_dd_OnClick(18)    end },
{ text = "ALBW: "..ZLE_ORANGE,                 func = function() hp_dd_OnClick(19)    end },

};

local misc_menu = {
{ text = "ALTTP: "…ZLE_GREEN, func = function() misc_dd_OnClick(0) end },
{ text = "ALTTP: "…ZLE_BLUE, func = function() misc_dd_OnClick(1) end },
{ text = "ALTTP: "…ZLE_PURPLE, func = function() misc_dd_OnClick(2) end },
{ text = "ALTTP: "…ZLE_ORANGE, func = function() misc_dd_OnClick(3) end },

{ text = "OOT: "..ZLE_GREEN,                   func = function() misc_dd_OnClick(4)   end },
{ text = "OOT: "..ZLE_BLUE,                    func = function() misc_dd_OnClick(5)   end },
{ text = "OOT: "..ZLE_PURPLE,                  func = function() misc_dd_OnClick(6)   end },
{ text = "OOT: "..ZLE_ORANGE,                  func = function() misc_dd_OnClick(7)   end },

{ text = "TP: "..ZLE_GREEN,                    func = function() misc_dd_OnClick(8)   end },
{ text = "TP: "..ZLE_BLUE,                     func = function() misc_dd_OnClick(9)   end },
{ text = "TP: "..ZLE_PURPLE,                   func = function() misc_dd_OnClick(10)  end },
{ text = "TP: "..ZLE_ORANGE.." [Mastersword]", func = function() misc_dd_OnClick(11)  end },

{ text = "BOTW: "..ZLE_GREEN,                  func = function() misc_dd_OnClick(12)  end },
{ text = "BOTW: "..ZLE_BLUE,                   func = function() misc_dd_OnClick(13)  end },
{ text = "BOTW: "..ZLE_PURPLE,                 func = function() misc_dd_OnClick(14)  end },
{ text = "BOTW: "..ZLE_ORANGE,                 func = function() misc_dd_OnClick(15)  end },

{ text = "ALBW: "..ZLE_GREEN,                  func = function() misc_dd_OnClick(16)  end },
{ text = "ALBW: "..ZLE_BLUE,                   func = function() misc_dd_OnClick(17)  end },
{ text = "ALBW: "..ZLE_PURPLE,                 func = function() misc_dd_OnClick(18)  end },
{ text = "ALBW: "..ZLE_ORANGE,                 func = function() misc_dd_OnClick(19)  end },

};

local green_dropdown, blue_dropdown, purple_dropdown, orange_dropdown, jp_dropdown, hp_dropdown, misc_dropdown;
local check1, chech2, check3, check4, check5;
local check6, check7, check8, check9, check10, check11, check12, check13;
local check14, check15, check16;
local check17;


– Callbacks

function green_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(green_dropdown, v + 1);
zle_config_temp.sounds.sets.green = v;
end

function blue_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(blue_dropdown, v + 1);
zle_config_temp.sounds.sets.blue = v;
end

function purple_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(purple_dropdown, v + 1);
zle_config_temp.sounds.sets.purple = v;
end

function orange_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(orange_dropdown, v + 1);
zle_config_temp.sounds.sets.orange = v;
end

function jp_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(jp_dropdown, v + 1);
zle_config_temp.sounds.sets.currency.jp = v;
end

function hp_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(hp_dropdown, v + 1);
zle_config_temp.sounds.sets.currency.hp = v;
end

function misc_dd_OnClick(v)
UIDropDownMenu_SetSelectedID(misc_dropdown, v + 1);
zle_config_temp.sounds.sets.currency.misc = v;
end

function green_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(uncommon_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function blue_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(rare_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function purple_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(epic_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function orange_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(legendary_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function jp_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(jp_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function hp_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(hp_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function misc_dropdown_MenuInit()
local info = UIDropDownMenu_CreateInfo();
for _, infoTab in pairs(misc_menu) do
info.text = infoTab.text;
info.func = infoTab.func;
info.checked = false;
UIDropDownMenu_AddButton(info);
end
end

function test_btn_OnClick(i)
local q = {“green”, “blue”, “purple”, “orange”};
local qc = {“jp”, “hp”, “misc”};
local set_id, idx;

if (i < 5) then
	set_id = zle_config_temp["sounds"]["sets"][q[i]];
	idx = i + 1;
else
	local tmp = zle_config_temp["sounds"]["sets"]["currency"][qc[i - 4]];
	set_id = math.floor(tmp / 4);
	idx = (tmp % 4) + 2;
end

play_zeldaSound(set_id, idx);

end

function zle_panel_refresh()
– Checkboxes

check1:SetChecked(zle_config.green.active);
check2:SetChecked(zle_config.blue.active);
check3:SetChecked(zle_config.purple.active);
check4:SetChecked(zle_config.orange.active);
check5:SetChecked(zle_config.inherited.include);

check6:SetChecked(zle_config.green.received);
check7:SetChecked(zle_config.green.crafted);
check8:SetChecked(zle_config.blue.received);
check9:SetChecked(zle_config.blue.crafted);
check10:SetChecked(zle_config.purple.received);
check11:SetChecked(zle_config.purple.crafted);
check12:SetChecked(zle_config.orange.received);
check13:SetChecked(zle_config.orange.crafted);

check14:SetChecked(zle_config.currency.jp.active);
check15:SetChecked(zle_config.currency.hp.active);
check16:SetChecked(zle_config.currency.misc.active);

check17:SetChecked(zle_config.use_antispam);

-- Dropdowns

if (panel_init == true) then

	-- Buggy if UIDropDownMenu_Initialize() removed...
	UIDropDownMenu_Initialize(   green_dropdown,  green_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(green_dropdown,  zle_config.sounds.sets.green  + 1, 0);

	UIDropDownMenu_Initialize(   blue_dropdown,   blue_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(blue_dropdown,   zle_config.sounds.sets.blue   + 1, 0);

	UIDropDownMenu_Initialize(   purple_dropdown, purple_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(purple_dropdown, zle_config.sounds.sets.purple + 1, 0);

	UIDropDownMenu_Initialize(   orange_dropdown, orange_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(orange_dropdown, zle_config.sounds.sets.orange + 1, 0);


	UIDropDownMenu_Initialize(   jp_dropdown,   jp_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(jp_dropdown,   zle_config.sounds.sets.currency.jp   + 1, 0);

	UIDropDownMenu_Initialize(   hp_dropdown,   hp_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(hp_dropdown,   zle_config.sounds.sets.currency.hp   + 1, 0);

	UIDropDownMenu_Initialize(   misc_dropdown, misc_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(misc_dropdown, zle_config.sounds.sets.currency.misc + 1, 0);
end

zle_config_temp = zle_config;

end

function zle_BtoS(b)
if (b == true) then
return “true”;
else
return “false”;
end
end

function zle_panel_default()
– Checkboxes

check1:SetChecked(true);
check2:SetChecked(true);
check3:SetChecked(true);
check4:SetChecked(true);
check5:SetChecked(true);

check6:SetChecked(true);
check7:SetChecked(true);
check8:SetChecked(true);
check9:SetChecked(true);
check10:SetChecked(true);
check11:SetChecked(true);
check12:SetChecked(true);
check13:SetChecked(true);

check14:SetChecked(true);
check15:SetChecked(true);
check16:SetChecked(false);

check17:SetChecked(true);

-- Dropdowns

if (panel_init) then

	-- Buggy if UIDropDownMenu_Initialize() removed...
	UIDropDownMenu_Initialize(   green_dropdown,  green_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(green_dropdown,  1, 0);

	UIDropDownMenu_Initialize(   blue_dropdown,   blue_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(blue_dropdown,   1, 0);

	UIDropDownMenu_Initialize(   purple_dropdown, purple_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(purple_dropdown, 1, 0);

	UIDropDownMenu_Initialize(   orange_dropdown, orange_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(orange_dropdown, 1, 0);

	UIDropDownMenu_Initialize(   jp_dropdown,     jp_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(jp_dropdown,     1, 0);

	UIDropDownMenu_Initialize(   hp_dropdown,     hp_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(hp_dropdown,     1, 0);

	UIDropDownMenu_Initialize(   misc_dropdown,   misc_dropdown_MenuInit);
	UIDropDownMenu_SetSelectedID(misc_dropdown,   1, 0);
end

end


– Main functions

function lua_timestamp()
return os.time(“%Y%m%d%H%I%S”); – pseudo PHP-like unix_timestamp() - ex: 20100914131123
end

function zle_createConfigPanel()

zle_config_temp = zle_config;

-- Frame

local panel   = CreateFrame("FRAME", "zle_cp");
panel.name    = "Zelda Loot";

-- Don't understand why here a function call seem to remove all the function body...
panel.okay    = function(self)
	zle_config = zle_config_temp;
end;

panel.cancel  = function(self)
	zle_config_temp = zle_config;
end;

panel.refresh = function(self) zle_panel_refresh(); end;

panel.default = function(self) zle_panel_default(); end;

-- Texts

local title_str             = panel:CreateFontString("zle_cp_str1",  "OVERLAY", "GameFontNormal");

local uncommon_lbl          = panel:CreateFontString("zle_cp_str2",  "OVERLAY", "GameFontNormal");
local rare_lbl              = panel:CreateFontString("zle_cp_str3",  "OVERLAY", "GameFontNormal");
local epic_lbl              = panel:CreateFontString("zle_cp_str4",  "OVERLAY", "GameFontNormal");
local legendary_lbl         = panel:CreateFontString("zle_cp_str5",  "OVERLAY", "GameFontNormal");
local inherit_lbl           = panel:CreateFontString("zle_cp_str6",  "OVERLAY", "GameFontNormal");

local author_str            = panel:CreateFontString("zle_cp_str7",  "OVERLAY", "GameFontNormalSmall");

local uncommon_received     = panel:CreateFontString("zle_cp_str8",  "OVERLAY", "GameFontNormalSmall");
local uncommon_crafts       = panel:CreateFontString("zle_cp_str9",  "OVERLAY", "GameFontNormalSmall");

local rare_received         = panel:CreateFontString("zle_cp_str10", "OVERLAY", "GameFontNormalSmall");
local rare_crafts           = panel:CreateFontString("zle_cp_str11", "OVERLAY", "GameFontNormalSmall");

local epic_received         = panel:CreateFontString("zle_cp_str12", "OVERLAY", "GameFontNormalSmall");
local epic_crafts           = panel:CreateFontString("zle_cp_str13", "OVERLAY", "GameFontNormalSmall");

local legendary_received    = panel:CreateFontString("zle_cp_str14", "OVERLAY", "GameFontNormalSmall");
local legendary_crafts      = panel:CreateFontString("zle_cp_str15", "OVERLAY", "GameFontNormalSmall");

local jp_str                = panel:CreateFontString("zle_cp_str16", "OVERLAY", "GameFontNormal");
local hp_str                = panel:CreateFontString("zle_cp_str17", "OVERLAY", "GameFontNormal");
local misc_str              = panel:CreateFontString("zle_cp_str18", "OVERLAY", "GameFontNormal");

local use_antispam_str      = panel:CreateFontString("zle_cp_str20", "OVERLAY", "GameFontNormal");
local use_antispam_desc_str = panel:CreateFontString("zle_cp_str21", "OVERLAY", "GameFontNormalSmall");

local l1, l2, l3, l4, l5, l6, l7;

l1 =      -30;
l2 = l1 -  65;
l3 = l2 -  65;
l4 = l3 -  65;
l5 = l4 -  20;
l6 = l5 - 143;
l7 = l6 -  40;

title_str:SetText("|cffffffff"..ZLE_CONFIG_TITLE.."|r");
title_str:SetPoint("TOPLEFT", 10, -10);

uncommon_lbl:SetText("|cff1eff00"..ZLE_GREENLOOT.."|r");
uncommon_lbl:SetPoint("TOPLEFT", 33, l1 - 3);

rare_lbl:SetText("|cff0070dd"..ZLE_BLUELOOT.."|r");
rare_lbl:SetPoint("TOPLEFT", 33, l2 - 3);

epic_lbl:SetText("|cffa335ee"..ZLE_PURPLELOOT.."|r");
epic_lbl:SetPoint("TOPLEFT", 33, l3 - 3);

legendary_lbl:SetText("|cffff8000"..ZLE_ORANGELOOT.."|r");
legendary_lbl:SetPoint("TOPLEFT", 33, l4 - 3);

inherit_lbl:SetText(ZLE_INCLUDEALSO.." |cffe6cc80"..ZLE_INHERITED.."|r");
inherit_lbl:SetPoint("TOPLEFT", 63, l5 - 43);

author_str:SetText("|cffd06600"..ZLE_VERSION_TXT.." "..zle_version.." "..ZLE_BY.." LegendaryHero20 (|cffffd800Drizztknight |cffd06600@ |cffffd800Gilneas |cffd06600)|r");
author_str:SetPoint("BOTTOMLEFT", 20, 7);


uncommon_received:SetText(ZLE_RECEIVED);
uncommon_received:SetPoint("TOPLEFT", 43, l1 - 24);

rare_received:SetText(ZLE_RECEIVED);
rare_received:SetPoint("TOPLEFT", 43, l2 - 24);

epic_received:SetText(ZLE_RECEIVED);
epic_received:SetPoint("TOPLEFT", 43, l3 - 24);

legendary_received:SetText(ZLE_RECEIVED);
legendary_received:SetPoint("TOPLEFT", 43, l4 - 24);


uncommon_crafts:SetText(ZLE_CRAFTS);
uncommon_crafts:SetPoint("TOPLEFT", 43, l1 - 44);

rare_crafts:SetText(ZLE_CRAFTS);
rare_crafts:SetPoint("TOPLEFT", 43, l2 - 44);

epic_crafts:SetText(ZLE_CRAFTS);
epic_crafts:SetPoint("TOPLEFT", 43, l3 - 44);

legendary_crafts:SetText(ZLE_CRAFTS);
legendary_crafts:SetPoint("TOPLEFT", 43, l4 - 44);


jp_str:SetText(ZLE_CFG_PVE);
jp_str:SetPoint("TOPLEFT", 33, -311);

hp_str:SetText(ZLE_CFG_PVP);
hp_str:SetPoint("TOPLEFT", 33, -342);

misc_str:SetText(ZLE_CFG_MISC);
misc_str:SetPoint("TOPLEFT", 33, -371);

use_antispam_str:SetText(ZLE_CFG_USEANTISPAM..":");
use_antispam_str:SetPoint("TOPLEFT", 33, l7 - 4);

use_antispam_desc_str:SetText(ZLE_CFG_USEANTISPAM_DESC..".");
use_antispam_desc_str:SetPoint("TOPLEFT", 40, l7 - 29);

-- Checkboxes

check1  = CreateFrame("CheckButton", "cb1",  panel, "InterfaceOptionsCheckButtonTemplate");
check2  = CreateFrame("CheckButton", "cb2",  panel, "InterfaceOptionsCheckButtonTemplate");
check3  = CreateFrame("CheckButton", "cb3",  panel, "InterfaceOptionsCheckButtonTemplate");
check4  = CreateFrame("CheckButton", "cb4",  panel, "InterfaceOptionsCheckButtonTemplate");
check5  = CreateFrame("CheckButton", "cb5",  panel, "InterfaceOptionsCheckButtonTemplate");

check6  = CreateFrame("CheckButton", "cb6",  panel, "InterfaceOptionsCheckButtonTemplate");
check7  = CreateFrame("CheckButton", "cb7",  panel, "InterfaceOptionsCheckButtonTemplate");
check8  = CreateFrame("CheckButton", "cb8",  panel, "InterfaceOptionsCheckButtonTemplate");
check9  = CreateFrame("CheckButton", "cb9",  panel, "InterfaceOptionsCheckButtonTemplate");
check10 = CreateFrame("CheckButton", "cb10", panel, "InterfaceOptionsCheckButtonTemplate");
check11 = CreateFrame("CheckButton", "cb11", panel, "InterfaceOptionsCheckButtonTemplate");
check12 = CreateFrame("CheckButton", "cb12", panel, "InterfaceOptionsCheckButtonTemplate");
check13 = CreateFrame("CheckButton", "cb13", panel, "InterfaceOptionsCheckButtonTemplate");

check14 = CreateFrame("CheckButton", "cb14", panel, "InterfaceOptionsCheckButtonTemplate");
check15 = CreateFrame("CheckButton", "cb15", panel, "InterfaceOptionsCheckButtonTemplate");
check16 = CreateFrame("CheckButton", "cb16", panel, "InterfaceOptionsCheckButtonTemplate");

check17 = CreateFrame("CheckButton", "cb17", panel, "InterfaceOptionsCheckButtonTemplate");


-- Checkboxes: active sounds for items

check1:SetSize(20, 20);
check1:SetPoint("TOPLEFT", 10, l1);
check1:SetScript("OnClick", function() zle_config_temp.green.active = not(zle_config_temp.green.active); end);

check2:SetSize(20, 20);
check2:SetPoint("TOPLEFT", 10, l2);
check2:SetScript("OnClick", function() zle_config_temp.blue.active = not(zle_config_temp.blue.active); end);

check3:SetSize(20, 20);
check3:SetPoint("TOPLEFT", 10, l3);
check3:SetScript("OnClick", function() zle_config_temp.purple.active = not(zle_config_temp.purple.active); end);

check4:SetSize(20, 20);
check4:SetPoint("TOPLEFT", 10, l4);
check4:SetScript("OnClick", function() zle_config_temp.orange.active = not(zle_config_temp.orange.active); end);


check5:SetSize(20, 20);
check5:SetPoint("TOPLEFT", 40, l5 - 40);
check5:SetScript("OnClick", function() zle_config_temp.inherited.include = not(zle_config_temp.inherited.include); end);


-- Checkboxes: extra active sounds for green items

check6:SetSize(20, 20);
check6:SetPoint("TOPLEFT", 20, l1 - 20);
check6:SetScript("OnClick", function() zle_config_temp.green.received = not(zle_config_temp.green.received); end);


check7:SetSize(20, 20);
check7:SetPoint("TOPLEFT", 20, l1 - 40);
check7:SetScript("OnClick", function() zle_config_temp.green.crafted = not(zle_config_temp.green.crafted); end);


-- Checkboxes: extra active sounds for blue items

check8:SetSize(20, 20);
check8:SetPoint("TOPLEFT", 20, l2 - 20);
check8:SetScript("OnClick", function() zle_config_temp.blue.received = not(zle_config_temp.blue.received); end);

check9:SetSize(20, 20);
check9:SetPoint("TOPLEFT", 20, l2 - 40);
check9:SetScript("OnClick", function() zle_config_temp.blue.crafted = not(zle_config_temp.blue.crafted); end);


-- Checkboxes: extra active sounds for purple items

check10:SetSize(20, 20);
check10:SetPoint("TOPLEFT", 20, l3 - 20);
check10:SetScript("OnClick", function() zle_config_temp.purple.received = not(zle_config_temp.purple.received); end);

check11:SetSize(20, 20);
check11:SetPoint("TOPLEFT", 20, l3 - 40);
check11:SetScript("OnClick", function() zle_config_temp.purple.crafted = not(zle_config_temp.purple.crafted); end);


-- Checkboxes: extra active sounds for orange items

check12:SetSize(20, 20);
check12:SetPoint("TOPLEFT", 20, l4 - 20);
check12:SetScript("OnClick", function() zle_config_temp.orange.received = not(zle_config_temp.orange.received); end);

check13:SetSize(20, 20);
check13:SetPoint("TOPLEFT", 20, l4 - 40);
check13:SetScript("OnClick", function() zle_config_temp.orange.crafted = not(zle_config_temp.orange.crafted); end);


-- v2.03 fix
if (zle_config_temp.currency == nil) then
	zle_config_temp.currency = {
		jp = {
			active = true
		},

		hp = {
			active = true
		},

		misc = {
			active = false
		}
	};
end

if (zle_config_temp.sounds.sets.currency == nil) then
	zle_config_temp.sounds.sets.currency = {
		jp = 0,
		hp = 0,
		misc = 0
	};
end

-- Checkboxes: active sounds for currencies

check14:SetSize(20, 20);
check14:SetPoint("TOPLEFT", 10, -307);
check14:SetScript("OnClick", function() zle_config_temp.currency.jp.active   = not(zle_config_temp.currency.jp.active); end);

check15:SetSize(20, 20);
check15:SetPoint("TOPLEFT", 10, -337);
check15:SetScript("OnClick", function() zle_config_temp.currency.hp.active   = not(zle_config_temp.currency.hp.active); end);

check16:SetSize(20, 20);
check16:SetPoint("TOPLEFT", 10, -365);
check16:SetScript("OnClick", function() zle_config_temp.currency.misc.active = not(zle_config_temp.currency.misc.active); end);

-- Antispam

check17:SetSize(20, 20);
check17:SetPoint("TOPLEFT", 200, l7);
check17:SetScript("OnClick", function() zle_config_temp.use_antispam = not(zle_config_temp.use_antispam); end);


-- Buttons

local btn_test1 = CreateFrame("Button", "btn_test1", panel, "UIPanelButtonTemplate");
local btn_test2 = CreateFrame("Button", "btn_test2", panel, "UIPanelButtonTemplate");
local btn_test3 = CreateFrame("Button", "btn_test3", panel, "UIPanelButtonTemplate");
local btn_test4 = CreateFrame("Button", "btn_test4", panel, "UIPanelButtonTemplate");

local btn_test5 = CreateFrame("Button", "btn_test5", panel, "UIPanelButtonTemplate");
local btn_test6 = CreateFrame("Button", "btn_test6", panel, "UIPanelButtonTemplate");
local btn_test7 = CreateFrame("Button", "btn_test7", panel, "UIPanelButtonTemplate");

btn_test1:SetSize(70, 18);
btn_test1:SetText(ZLE_TEST);
btn_test1:SetPoint("TOPRIGHT", -10, l1);
btn_test1:SetScript("OnClick", function() test_btn_OnClick(1) end );

btn_test2:SetSize(70, 18);
btn_test2:SetText(ZLE_TEST);
btn_test2:SetPoint("TOPRIGHT", -10, l2);
btn_test2:SetScript("OnClick", function() test_btn_OnClick(2) end );

btn_test3:SetSize(70, 18);
btn_test3:SetText(ZLE_TEST);
btn_test3:SetPoint("TOPRIGHT", -10, l3);
btn_test3:SetScript("OnClick", function() test_btn_OnClick(3) end );

btn_test4:SetSize(70, 18);
btn_test4:SetText(ZLE_TEST);
btn_test4:SetPoint("TOPRIGHT", -10, l4);
btn_test4:SetScript("OnClick", function() test_btn_OnClick(4) end );


btn_test5:SetSize(70, 18);
btn_test5:SetText(ZLE_TEST);
btn_test5:SetPoint("TOPRIGHT", -10, -309);
btn_test5:SetScript("OnClick", function() test_btn_OnClick(5) end );

btn_test6:SetSize(70, 18);
btn_test6:SetText(ZLE_TEST);
btn_test6:SetPoint("TOPRIGHT", -10, -339);
btn_test6:SetScript("OnClick", function() test_btn_OnClick(6) end );

btn_test7:SetSize(70, 18);
btn_test7:SetText(ZLE_TEST);
btn_test7:SetPoint("TOPRIGHT", -10, -369);
btn_test7:SetScript("OnClick", function() test_btn_OnClick(7) end );

-- Images

local img_sword   = CreateFrame("FRAME", "zle_img1", panel);
local t1 = img_sword:CreateTexture(nil, "BACKGROUND");
t1:SetTexture("Interface\\AddOns\\ZeldaLoot_Extended\\Images\\master_sword.tga");

img_sword:SetSize(256, 256);
img_sword:SetPoint("BOTTOMRIGHT", 45, 3);
img_sword:SetFrameStrata("BACKGROUND");
img_sword:SetAlpha(0.4);
t1:SetAllPoints(img_sword);
img_sword.texture = t1;

-- Dropdowns

green_dropdown = CreateFrame("Frame", "dd_green", panel, "UIDropDownMenuTemplate");
green_dropdown:SetPoint("TOPRIGHT", -200, l1 + 5);
UIDropDownMenu_Initialize(green_dropdown, green_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(green_dropdown, zle_config.sounds.sets.green + 1, 0);

blue_dropdown = CreateFrame("Frame", "dd_blue", panel, "UIDropDownMenuTemplate");
blue_dropdown:SetPoint("TOPRIGHT", -200, l2 + 5);
UIDropDownMenu_Initialize(blue_dropdown, blue_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(blue_dropdown, zle_config.sounds.sets.blue + 1, 0);

purple_dropdown = CreateFrame("Frame", "dd_purple", panel, "UIDropDownMenuTemplate");
purple_dropdown:SetPoint("TOPRIGHT", -200, l3 + 5);
UIDropDownMenu_Initialize(purple_dropdown, purple_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(purple_dropdown, zle_config.sounds.sets.purple + 1, 0);

orange_dropdown = CreateFrame("Frame", "dd_orange", panel, "UIDropDownMenuTemplate");
orange_dropdown:SetPoint("TOPRIGHT", -200, l4 + 5);
UIDropDownMenu_Initialize(orange_dropdown, orange_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(orange_dropdown, zle_config.sounds.sets.orange + 1, 0);


jp_dropdown   = CreateFrame("Frame", "dd_jp",   panel, "UIDropDownMenuTemplate");
jp_dropdown:SetPoint("TOPRIGHT",   -200, -304);
UIDropDownMenu_Initialize(jp_dropdown, jp_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(jp_dropdown, zle_config.sounds.sets.currency.jp + 1, 0);

hp_dropdown   = CreateFrame("Frame", "dd_hp",   panel, "UIDropDownMenuTemplate");
hp_dropdown:SetPoint("TOPRIGHT",   -200, -334);
UIDropDownMenu_Initialize(hp_dropdown, hp_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(hp_dropdown, zle_config.sounds.sets.currency.hp + 1, 0);

misc_dropdown = CreateFrame("Frame", "dd_misc", panel, "UIDropDownMenuTemplate");
misc_dropdown:SetPoint("TOPRIGHT", -200, -364);
UIDropDownMenu_Initialize(misc_dropdown, misc_dropdown_MenuInit);
UIDropDownMenu_SetSelectedID(misc_dropdown, zle_config.sounds.sets.currency.misc + 1, 0);

InterfaceOptionsFrame_OpenToCategory(panel);

-- GUI config ready.
panel_init = true;

end

function zle_slashCommand()

-- There is a known bug with InterfaceOptionsFrame_OpenToCategory().
-- See BlizzBugsSuck addon page ( http://wow.curse.com/downloads/wow-addons/details/blizzbugssuck.aspx ) for details.
InterfaceOptionsFrame_OpenToCategory(getglobal("zle_cp"));

end

– Slash commands

SLASH_ZLE1 = “/zle”;
SlashCmdList[“ZLE”] = zle_slashCommand;

this is the config file, please show me where to post/update this code

Sorry, I misposted. The function my code is related to is InterfaceOptions_AddCategory

Dumping the whole file onto the forums isn’t helpful, just CTRL-F and find the one line.

For the InterfaceOptionsFrame_OpenToCategory commands, replace them with Settings.OpenToCategory

1 Like

yeah did that and still nothing shows

Well, good news is the dev’s actively working to fix it. So, just give em a couple days.

Go back to the original addon code before you started changing it.

At the top of the Config.lua file add

local category, layout

Then, near the bottom:

Replace:

InterfaceOptions_AddCategory(panel);

with:

category, layout = Settings.RegisterCanvasLayoutCategory(panel, panel.name, panel.name);
category.ID = panel.name
Settings.RegisterAddOnCategory(category);

Replace:

InterfaceOptionsFrame_OpenToCategory(getglobal("zle_cp"));

with:

Settings.OpenToCategory(category.ID)

or, as Elvenbane suggested, wait for the update.

2 Likes

That worked.

The line at the top of the file needs to change, fixed in the code above.

Have Fun!

I have a question about RegisterAddOnCategory.

How do I add a sub-category page?

2 Likes

Thanks for the link, everything works now. :grinning:

Great guide, thanks for this, I’m able to get to my config panels in-game now.

One little annoying issue remains; the name of the addon’s config panel is missing from the AddOns Options panel’s left menu…it’s just a blank space. Doesn’t affect functionality, I just can’t see which options panel I’m clicking for that addon. Simple fix? If not, I can wait for the author’s update.

The config panel (frame) could have a .name key

local configpanel = CreateFrame("FRAME", "AddonConfigFrameName");
configpanel.name = "Addon Name"
...
local category, layout = Settings.RegisterCanvasLayoutCategory(configpanel, configpanel.name, configpanel.name);
category.ID = configpanel.name

configpanel.name should show up as the name in the left hand list.

1 Like

thanks to Elvenbane and you , i was able to cobble together a fix for Phanxfont having the same issue!

2 Likes

jeez now I gotta edit again my addon because its not showing again. Any help will be appreciated.

Open the config.lua file and change line 1 from:

local zle_version = GetAddOnMetadata("ZeldaLoot_Extended", "Version");

to:

local zle_version = C_AddOns.GetAddOnMetadata("ZeldaLoot_Extended", "Version");

I think that’s the only error. If not post the ones you get.

yeah i just noticed that after I made the post thanks.

Realize I’m very late to the party as it were, as I found my way here via an Internet search, but just wanted to leave this here so the next person that comes along has some example code to look at…

Settings.OpenToCategory(Settings.GetCategory("-ADDON_NAME-").ID)

Just replace the “-ADDON_NAME-” text with the name of the addon as it appears in the Options/AddOns tab list.

According to the API code, the second available argument for Settings.OpenToCategory is ‘scrollToElementName’. I’m not using it in my example though, but the variable name seems self-documenting enough.

(In case this might matter, I created the setting UI for my addon via the Ace3 library.)