It avoids recreating a new table every time this function is created (and thus fixes a memory leak).
As I'm new to lua and wanting to learn (plus that I was the one posting some of the code you quoted as a qnd fix :) ) could you please explain about the above statement? Will
Klappa.db.profile.buttons[self.index] = {};
cause an actual memory leak as in memory will never get released (if so why, and how should you "free" a collection with data?), or will it just cause the garbage collector to do more (unnecessary) work?
Assigning a variable the way you mentioned seems like a neat trick and good practise indeed.
If I find some spare time I might dabble with Klappa to see if I could make it so that I have different setups depending on whether I am in a (raid) group or soloing and that Klappa would make the switch automatically when I join/leave. As I have a healer I have very different needs when raiding and soloing :)
That's not impossible to do due to blizzards constraints is it? If so please tell me now before I start messing about ;)
As I'm new to lua and wanting to learn (plus that I was the one posting some of the code you quoted as a qnd fix :) ) could you please explain about the above statement? Will
Klappa.db.profile.buttons[self.index] = {};
cause an actual memory leak as in memory will never get released (if so why, and how should you "free" a collection with data?), or will it just cause the garbage collector to do more (unnecessary) work?
Mainly unnecessary work. Freed tables remain into memory until the GC is run. If tables are created at a higher rate than the GC can free them, there is a leak.
About the local, you can use this kind of assignment for tables to avoid evaluating the whole expression for each statement (and it is far, far more readable).
On the issue of the edges showing up in circle skins...if it helps any, BT3 has the same issue and it has to do with which button layout option you choose. There is DreamLayout, Default, and Zoomed -- I forget which is which but between DreamLayout and Default, one of them shows edges and one doesn't. I'm not sure what this changes thouhg..is it using different icon packs when you change that setting?
bug with cyC plugin, when you click a spell and it casts/casting theres a lightblue border for the icon and the bug is when its done casting it should disappear but the border stays, untill you click it again. see ss.
bug with cyC plugin, when you click a spell and it casts/casting theres a lightblue border for the icon and the bug is when its done casting it should disappear but the border stays, untill you click it again. see ss.
I've noticed this, too. The plug-in IS a beta. You can always disable it for Klappa. Until someone that knows something about it fixes it, it'll stay that way. :/
I've been mucking around in the code trying to get cyCircled support working better.
I can make the buttons look fine for the standard circled skins, but some of the square ones then look wrong. They are too small.
I've noticed with the BT3 buttons, when I change cyCircled skins, the button sizes actually adjust based on the skin. I havent' figured out just yet how it knows to do this so i'm still working on it.
However if anyone uses the Serenity skins and would like to know how to adjust the code so the circled buttons look right, just say so and I will post the hardcoded changes you can make. Otherwise i'm going to keep workign on it until I figure out how to make it adapt properyl to all skins.
Well looking at the code in BT3, it has support for cyCircled, in style.lua :
function Bartender3:cyLoaded(obj)
self.hooks[obj].LoadPlugins(obj)
self.cydb = cyCircled:AcquireDBNamespace("Bartender3")
self:RefreshBars()
end
function Bartender3:RefreshStyle(button, bar)
...
if self.cydb then
if self.cydb.profile["Bar" .. bar.id] then
if not button.overlay then button.overlay = _G[button:GetName() .. "Overlay"] end
end
end
Yeah I saw that, along with other code in there that says its for cyCircled support. However I still am not seeing how it knows to adjust the buttons based on the skin being used. I see nothing that changes in that regards, so i'm still missing a piece of the puzzle.
Weird thing is its only the create soulstone portion that doesnt work. i.e. the button 2. But if I have a stone summoned already, I can apply it with no issue.
One, If I make a change to a macro's name or Icon, it does not reflect in Klappa untill I drag a fresh Icon to the Klappa bar.
Yes, because it is not an action bar mod, it will not be recognized about the changes, you have to do it manually.
Klappa has no support for mousebuttons except from the left one.
Klappa has no support for mousebuttons except from the left one.
Thanks for the response.... Is there any intent to add this support... or is that no where on the horizon.
EDIT: I ran into another odd ball issue this morning.
I have dragged the Alchemy icon from my spellbook, but it will not open up the alchemy window via Klappa.
It works from SpellBook as well as from Geist and Bartender.
Little more oddness to this is... I cant open it from tcg_tradeskills either, but all other tradeskills open with no issue. (both from klappa and tcg_tradeskills)
I have a suggestion, as well: Can you add an option in so that users can adjust the spacing between buttons?
As I'm new to lua and wanting to learn (plus that I was the one posting some of the code you quoted as a qnd fix :) ) could you please explain about the above statement? Will
cause an actual memory leak as in memory will never get released (if so why, and how should you "free" a collection with data?), or will it just cause the garbage collector to do more (unnecessary) work?
Assigning a variable the way you mentioned seems like a neat trick and good practise indeed.
If I find some spare time I might dabble with Klappa to see if I could make it so that I have different setups depending on whether I am in a (raid) group or soloing and that Klappa would make the switch automatically when I join/leave. As I have a healer I have very different needs when raiding and soloing :)
That's not impossible to do due to blizzards constraints is it? If so please tell me now before I start messing about ;)
Mainly unnecessary work. Freed tables remain into memory until the GC is run. If tables are created at a higher rate than the GC can free them, there is a leak.
About the local, you can use this kind of assignment for tables to avoid evaluating the whole expression for each statement (and it is far, far more readable).
Of course you can.
I added your optimization suggestions, many thanks.
About the other errors, I could not reproduce them right now.
Any suggestions?
I've noticed this, too. The plug-in IS a beta. You can always disable it for Klappa. Until someone that knows something about it fixes it, it'll stay that way. :/
I can make the buttons look fine for the standard circled skins, but some of the square ones then look wrong. They are too small.
I've noticed with the BT3 buttons, when I change cyCircled skins, the button sizes actually adjust based on the skin. I havent' figured out just yet how it knows to do this so i'm still working on it.
However if anyone uses the Serenity skins and would like to know how to adjust the code so the circled buttons look right, just say so and I will post the hardcoded changes you can make. Otherwise i'm going to keep workign on it until I figure out how to make it adapt properyl to all skins.
Well looking at the code in BT3, it has support for cyCircled, in style.lua :
With a hook to call cyLoaded in core.lua
Anyone?
One, If I make a change to a macro's name or Icon, it does not reflect in Klappa untill I drag a fresh Icon to the Klappa bar.
Two, What I have reported above with a macro not working.
Weird thing is its only the create soulstone portion that doesnt work. i.e. the button 2. But if I have a stone summoned already, I can apply it with no issue.
Yeah I know that (from my alts) and no, I didn't learn any new step for months.
Yes, because it is not an action bar mod, it will not be recognized about the changes, you have to do it manually.
Klappa has no support for mousebuttons except from the left one.
Thanks for the response.... Is there any intent to add this support... or is that no where on the horizon.
EDIT: I ran into another odd ball issue this morning.
I have dragged the Alchemy icon from my spellbook, but it will not open up the alchemy window via Klappa.
It works from SpellBook as well as from Geist and Bartender.
Little more oddness to this is... I cant open it from tcg_tradeskills either, but all other tradeskills open with no issue. (both from klappa and tcg_tradeskills)
Some mentioned issues should be solved.
If you update Klappa, you must delete your saved variables first. ( I am sorry, hope it was the last time).
I have added an updated version for cyCircled to this post.