Hey
wanted to add a DropDownMenu to my Addon CCMark, to let the player select specific RaidTargetIcons.
I added a DropDownMenu with the following Code
Code:
if not DropDownMenuTest then
CreateFrame("Button", "DropDownMenuTest", UIParent, "UIDropDownMenuTemplate")
end
DropDownMenuTest:ClearAllPoints()
DropDownMenuTest:SetPoint("CENTER", 0, 0)
DropDownMenuTest:Show()
local items = {
"|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_2:0|t".." Circle",
"|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_8:0|t".." Skull",
}
local function OnClick(self)
UIDropDownMenu_SetSelectedID(DropDownMenuTest, self:GetID())
end
local function initialize(self, level)
local info = UIDropDownMenu_CreateInfo()
for k,v in pairs(items) do
info = UIDropDownMenu_CreateInfo()
info.text = v
info.value = v
info.func = OnClick
UIDropDownMenu_AddButton(info, level)
end
end
UIDropDownMenu_Initialize(DropDownMenuTest, initialize)
UIDropDownMenu_SetWidth(DropDownMenuTest, 100);
UIDropDownMenu_SetButtonWidth(DropDownMenuTest, 124)
UIDropDownMenu_SetSelectedID(DropDownMenuTest, 1)
UIDropDownMenu_JustifyText(DropDownMenuTest, "LEFT")
Everything works, except the RaidTargetIcons. When the DropDown Items show up, the Icons are shown, but when i select an Item, there's no Icon in my DropdownMenu.
Here are two Screenshots to show you what i'm talking about.