For those of you still looking for corner icons, I have made an indicator addon that adds corner and side indicators using the new indicator API: http://www.wowace.com/addons/gridindicatorextra/
First of all thanks Adirelle, I appreciate that you took the effort to review the code.
The reason that ipairs is not used it is because it is noticeably slower than the equivalent for loop, and the len local, while not used inside the loop in every function, it is used in some, and writing all the loops in the same form should make the code more uniform and easier to read, while having no performance cost.
As for not using pairs(), I have tried to make every function that would make sense to be used on a table to work on tables, but otherwise I believe that it is better to use the keys() and values() functions if you only want to work on the keys or values of a table, rather than silently ignoring the keys.
I believe find_first_of and first_last_of are o(n*m) at the moment (m being the number of different values to search for) rather than o(n²), so it shouldn't be _that_ bad, but yeah I agree that making a lookup map should be even faster, I'll run some tests and change it.
I don't like the name invert, does not feel intuitive.
The name is taken from underscore.js. In the context of this library (one that mainly works on lists and tables) I think it is good enough, but I am open to suggestions.
min and max could optionally take a comparator function.
Both of these functions are implemented on terms of reduce, for example min is a call to reduce(list, math.min), so the rationale there is that if you need something more specialized you should use reduce instead.
Some names are strange, for example reverse returnes a copy, while shuffle does so inplace. Maybe reversed would be a better name?
In the spirit of functional programming, all the functions should return copies. The exceptions are sort and shuffle, which work in-place by default for performance (but both have versions that return copies). Probably I should make sort and shuffle returns copies by default, and name the versions that work in-place something else ?
equal takes an argument for shallow or not, why doesn't clone do?
I am thinking that the best option to fix that would be making equal shallow by default. Additionally I am going to change clone to work with tables instead of only lists.
I will add some once the API is locked, it is a lot of work and I don't want to make changing things harder at this point. Meanwhile, if you don't mind terse code, there is a tests.lua file in the repository and in the packaged files that contains a few tests for all of the functions, and it may serve as usage examples as well.
LibFunctional-1.0 is a library that provides a set of functions that allow a more functional style of programming in lua, such as map, filter and bind. Its main purpose is to replace the most commonly used loops with calls to descriptive functions, therefore making the purpose of the operation clearer and increasing the code readability.
I'll be tagging a version soon, therefore locking the API, unless someone wants to request a change.
In the current version of Grid, third-party status modules aren't being added to the "Debugging" page in the options. IIRC Ace2 Grid added them by registering ADDON_LOADED and checking for the X-GridStatusModule tag, however as far as I can tell it is not done anymore.
It doesn't seem to detect Flask of Distilled Wisdom, Buff Enough keeps telling me that I'm missing flask/elixir when using it. Changing the ID in spells.lua to:
This addon adds four text indicators to the corners of Grid. Personally, I use it to display incoming heals and the number of hots, you might find another uses.
How to use it: As any other indicator, you will be able to configure it under the frames section of Grid. You can also change the font and font size from the advanced menu.
Thanks to kunda for GridIndicatorText3, from which this addon has been created.
EDIT: Removed file, download from the svn to get the latest version.
Is there a way to have the configuration show in a standalone frame, not binded to the blizzard's UI?
Thanks though, looks like it's going to be a great addon!
Edit: Also having the same problem than Kyron when using macros, and I also got this error: Chatterbox\Modules\ChatLink.lua:30: bad argument #1 to 'gsub' (string expected, got nil)
0
0
0
0
The reason that ipairs is not used it is because it is noticeably slower than the equivalent for loop, and the len local, while not used inside the loop in every function, it is used in some, and writing all the loops in the same form should make the code more uniform and easier to read, while having no performance cost.
As for not using pairs(), I have tried to make every function that would make sense to be used on a table to work on tables, but otherwise I believe that it is better to use the keys() and values() functions if you only want to work on the keys or values of a table, rather than silently ignoring the keys.
I believe find_first_of and first_last_of are o(n*m) at the moment (m being the number of different values to search for) rather than o(n²), so it shouldn't be _that_ bad, but yeah I agree that making a lookup map should be even faster, I'll run some tests and change it.
0
0
The name is taken from underscore.js. In the context of this library (one that mainly works on lists and tables) I think it is good enough, but I am open to suggestions.
Both of these functions are implemented on terms of reduce, for example min is a call to reduce(list, math.min), so the rationale there is that if you need something more specialized you should use reduce instead.
In the spirit of functional programming, all the functions should return copies. The exceptions are sort and shuffle, which work in-place by default for performance (but both have versions that return copies). Probably I should make sort and shuffle returns copies by default, and name the versions that work in-place something else ?
It won't, I will make the documentation more clear about that.
I am thinking that the best option to fix that would be making equal shallow by default. Additionally I am going to change clone to work with tables instead of only lists.
I will add some once the API is locked, it is a lot of work and I don't want to make changing things harder at this point. Meanwhile, if you don't mind terse code, there is a tests.lua file in the repository and in the packaged files that contains a few tests for all of the functions, and it may serve as usage examples as well.
0
I'll be tagging a version soon, therefore locking the API, unless someone wants to request a change.
Project page
API documentation
0
Also, it links to the old thread instead of this one.
0
Is this the intended behavior ?
Thanks.
0
BuffEnough.flasks["Distilled Wisdom"] = GetSpellInfo(17627)
seems to fix the problem. I guess the ID has changed in some recent patch.
0
0
This addon adds four text indicators to the corners of Grid. Personally, I use it to display incoming heals and the number of hots, you might find another uses.
How to use it: As any other indicator, you will be able to configure it under the frames section of Grid. You can also change the font and font size from the advanced menu.
Thanks to kunda for GridIndicatorText3, from which this addon has been created.
EDIT: Removed file, download from the svn to get the latest version.
0
-Disable fading of old chat text
-Changing text alignment (so that it sticks to the right side)
Also having more control over the fonts, like adding borders or shadows, but that's something minor.
0
http://img187.imageshack.us/my.php?image=cbproblemxf9.jpg
Is there a way to have the configuration show in a standalone frame, not binded to the blizzard's UI?
Thanks though, looks like it's going to be a great addon!
Edit: Also having the same problem than Kyron when using macros, and I also got this error: Chatterbox\Modules\ChatLink.lua:30: bad argument #1 to 'gsub' (string expected, got nil)