I've had this too and I think it can be solved by changing:
Klappa.db.profile.buttons[self.index] = {};
to:
local pbuttons = Klappa.db.profile.buttons[self.index].popupButtons;
local npopups = Klappa.db.profile.buttons[self.index].popups;
Klappa.db.profile.buttons[self.index] = {};
Klappa.db.profile.buttons[self.index].popupButtons = pbuttons;
Klappa.db.profile.buttons[self.index].popups = npopups;
close to the top in the function Klappa.Button.prototype:ButtonDrop() in KlappaButton.lua.
Info about the popup buttons is lost when replacing the spell on a main button.
I'm new to lua so this is the qnd way to fix it but at least it seems to work for me locally :)
I have updated Klappa with your fix, thx for the help.
local addonName = "Klappa"
cyCircled_Klappa = cyCircled:NewModule(addonName)
function cyCircled_Klappa:AddonLoaded(addon)
self.db = cyCircled:AcquireDBNamespace(addonName);
cyCircled:RegisterDefaults(addonName, "profile", {
["Main"] = true,
["Popup"] = true,
})
self:SetupElements();
end
function cyCircled_Klappa:GetElements()
return {
["Main"] = true,
["Popup"] = true,
}
end
function cyCircled_Klappa:SetupElements()
local size = Klappabar1Button:GetWidth()
self.elements = {
["Main"] = {
args = {
button = { width = size, height = size, },
},
elements = {},
},
["Popup"] = {
args = {
button = { width = size, height = size, },
},
elements = {},
},
}
for k,v in pairs(Klappa.root.buttons) do
table.insert(self.elements["Main"].elements, "Klappabar"..k.."Button")
for k2,v2 in pairs(Klappa.root.buttons[k].popupButtons) do
table.insert(self.elements["Popup"].elements, "Klappabar"..k.."PopUpButton"..k2)
end
end
end
However, for non-square buttons, it doenst work quite right :
I dont know if its the overlay skin from cyCircled, or the backdrop of the original buttons thats showing thru - but at least with square buttons it matches the look of everything else.
Also, with circular buttons, the label text is below the circular border - which doesnt happen with other baraddons, and as far as I can tell the text is all created the same way - I must be missing where the frame strata are setup.
This is just a start. There's some issues still with it that I was unable to resolve. If you can figure it out and get it working right, post it and I'll add it to cyCircled on the SVN.
This is the one thing I'm waiting for to enable Klappa! :D
However, for non-square buttons, it doenst work quite right :
I dont know if its the overlay skin from cyCircled, or the backdrop of the original buttons thats showing thru - but at least with square buttons it matches the look of everything else.
Also, with circular buttons, the label text is below the circular border - which doesnt happen with other baraddons, and as far as I can tell the text is all created the same way - I must be missing where the frame strata are setup.
Its the backdrop of the original, i will change it, that it will only appear when cyC is not present.
For the circular, the edges will look through, I dont know atm how to solve the problem
With the text I will change the layer level, so that they will be in foreground.
updated:
-the label text is now on top
-if cyC is loaded, then the background will not be shown (the edges of the icon will be visible if you use a round skin, could not solve that issue at the moment)
-option to lock/unlock the buttons.
[2007/09/27 23:49:44-160-x3]
Klappa\KlappaPopUp.lua:160: attempt to index field '?' (a nil value) Klappa\KlappaPopUp.lua:42: in function <Interface\AddOns\Klappa\KlappaPopUp.lua:42>
Dragging any icon:
[2007/09/27 23:51:16-160-x1]
Klappa\KlappaPopUp.lua:153: PickupSpell(): Invalid spell slot
Klappa\KlappaPopUp.lua:153: in function `ButtonDrag' Klappa\KlappaPopUp.lua:42: in function <Interface\AddOns\Klappa\KlappaPopUp.lua:42>
Got the icon dragging error too but only once. Happened right after I added a new bar and tried to add a button to the first sub-button (not the main). The bar had multiple sub-buttons already created. Then I just placed the button into the next sub-button above and that worked fine without error.
Oddly after that I could place anything into said button without problems. Probably an initialization problem when sub-buttons are first created.
CyCircled plugin added. Seems to work fine. Oh, as far as the icon edges showing through, perhaps you could adjust the scale a little bit? It doesn't do it on all icons, only certain ones.
I have updated Klappa with your fix, thx for the help.
i have never used this mod before, but i have one issue which is weird
macros like the one below do not respond to the right click casting the other buff.
/cast [button:1] Blessing of Kings; Greater Blessing of Kings
also anything that isnt in the popup part of the bars are being erased on relogging but the popup buttons keep their stuff.
request: make it so you can lock the buttons from being dragged even tho the bar is "locked" u can still pull them off
something i would like to see implemented if possible.
have an option if you click something in the popupbar itll move to the mainbar and the old item in its place move to the popupbar
similar to the old architotem.
keybindings for the mainbar buttons would be nice too
Yeah we need cyCircled!
I've created a template for klappa :
However, for non-square buttons, it doenst work quite right :
I dont know if its the overlay skin from cyCircled, or the backdrop of the original buttons thats showing thru - but at least with square buttons it matches the look of everything else.
Also, with circular buttons, the label text is below the circular border - which doesnt happen with other baraddons, and as far as I can tell the text is all created the same way - I must be missing where the frame strata are setup.
It's missing the option to hide the minimap button.
Gief, now.
It's a start! I noticed the same issues you're having but can't seem to figure it out. :/
Very nice, thank you.
This is just a start. There's some issues still with it that I was unable to resolve. If you can figure it out and get it working right, post it and I'll add it to cyCircled on the SVN.
This is the one thing I'm waiting for to enable Klappa! :D
Its the backdrop of the original, i will change it, that it will only appear when cyC is not present.
For the circular, the edges will look through, I dont know atm how to solve the problem
With the text I will change the layer level, so that they will be in foreground.
But not today anymore, perhaps tomorrow :-)
-the label text is now on top
-if cyC is loaded, then the background will not be shown
(the edges of the icon will be visible if you use a round skin, could not solve that issue at the moment)
-option to lock/unlock the buttons.
Dragging on an empty button slot:
Dragging any icon:
BTW, I'll be adding the cC plugin shortly.
Oddly after that I could place anything into said button without problems. Probably an initialization problem when sub-buttons are first created.
Instead of :
Please do :
It avoids recreating a new table every time this function is created (and thus fixes a memory leak).
Btw things like :
Could be optimized into :
Besides saving some CPU cycles, it enhances readability and maintainability.