Hello folks, I was wondering if someone can help me to improve an addon here.
I've been a HandyNotes user for a long time now, have many many notes across my world map about all the cool things I've discovered in years of exploration across Azeroth, at some point I decided to create my own custom icons for HandyNotes since some good gentlemen in this forum helped me to tweak the source code to make the addon read the icons of a list in a custom folder instead of the default ones it comes with http://www.mmo-champion.com/threads/...p-notes-addon)...
but... here's the problem:
I made around 50 icons to document several different things in the maps (cause I'm a freak and like to add little pieces of customized information and curiosities in my maps) but the dropdown list in HandyNotes I think was never meant to include so many icons, leaving me with a huge vertical list that becomes annoying to handle, therefore I thought that the dropmenu list needs a fixed height and a scroll, that way the long list would become easy to handle. Something like:
I know this is not my addon but the current maintainer on Curse.com seems to be on a break or vacation from wow, I'd really like to improve this little addon I like so much but I don't know LUA on a pro level to do so.
I've managed to isolate the code chunk I think (I might be totally wrong tho) needs to be modified to add this feature and although I don't know if this is even possible at least I want to try and ask other fellow players about it.
Code:
-- Create the Icon Dropdown
HNEditFrame.icondropdown = CreateFrame("Frame", "HandyNotes_IconDropDown", HNEditFrame, "UIDropDownMenuTemplate")
HNEditFrame.icondropdown:SetPoint("TOPLEFT", HNEditFrame.descframe, "BOTTOMLEFT", -17, 0)
HNEditFrame.icondropdown:SetHitRectInsets(16, 16, 0, 0)
UIDropDownMenu_SetWidth(HNEditFrame.icondropdown, 120)
UIDropDownMenu_EnableDropDown(HNEditFrame.icondropdown)
HNEditFrame.icondropdown.displayMode = "MENU"
HNEditFrame.icondropdown.texture = HNEditFrame.icondropdown:CreateTexture(nil, "OVERLAY")
HNEditFrame.icondropdown.texture:SetWidth(12)
HNEditFrame.icondropdown.texture:SetHeight(12)
HNEditFrame.icondropdown.texture:SetPoint("RIGHT", HNEditFrame.icondropdown, -41, 2)
HNEditFrame.icondropdown.text = HandyNotes_IconDropDownText
HNEditFrame.icondropdown.text:SetPoint("RIGHT", HNEditFrame.icondropdown.texture, "LEFT", -3, 0)
HNEditFrame.icondropdown.text:SetWidth(HNEditFrame.icondropdown.text:GetWidth() - 9)
HNEditFrame.icondropdown.OnClick = function(button, value)
local t = HN.icons[value]
HNEditFrame.icondropdown.selectedValue = value
HNEditFrame.icondropdown.texture:SetTexture(t.icon)
if t.tCoordLeft then
HNEditFrame.icondropdown.texture:SetTexCoord(t.tCoordLeft, t.tCoordRight, t.tCoordTop, t.tCoordBottom)
else
HNEditFrame.icondropdown.texture:SetTexCoord(0, 1, 0, 1)
end
HNEditFrame.icondropdown.text:SetText(t.text)
local color = t.color
if color then
HNEditFrame.icondropdown.text:SetTextColor(color.r, color.g, color.b, color.a or 1)
else
HNEditFrame.icondropdown.text:SetTextColor(1, 1, 1, 1)
end
end
HNEditFrame.icondropdown.initialize = function(level)
wipe(info)
for i = 1, #HN.icons do
local t = HN.icons[i]
info.text = t.text
info.icon = t.icon
info.tCoordLeft = t.tCoordLeft
info.tCoordRight = t.tCoordRight
info.tCoordTop = t.tCoordTop
info.tCoordBottom = t.tCoordBottom
info.arg1 = i
info.func = HNEditFrame.icondropdown.OnClick
info.checked = HNEditFrame.icondropdown.selectedValue == i
info.keepShownOnClick = nil
UIDropDownMenu_AddButton(info)
end
end
This piece of code belongs to the HandyNotes_EditFrame.lua file in the addon's folder, this is the edit frame that pops up when you right click a note or create a new one with /hnnew or Alt + R.Click.
I would forward the info and this thread to the addon comment section itself so the maintainer can add and improve it for everyone.
Thanks in advance to anyone who can provide feedback to this.