Compared to the original version, ItemBonusLib has the following features :
_ Caches the result of scans so does minimal scanning.
_ Much better set bonuses handling. Although it has still some issues, it is possible to get accurate data for set bonuses.
_ Integrates the regex used by Healpoints.
Note to users, translators and testers :
In order to find a bonus, ItemBonusLib does pattern matching. This means that the exact description string of the bonus is scanned and checked against a database of patterns. When your favorite item does not get all its bonuses detected by the library, it's because the library is missing the corresponding pattern.
You should provide the exact string of the bonuses that are not detected if you want this to change. A screenshot of a tooltip of the item is good. If you don't provide a screenshot, make sure that your transcription is accurate.
I too am glad to see this type of mod based on Ace libraries but yeah I agree no addons should have Ace in their name as it is misleading and for sure not developed by the Ace Development Team.
OK, I'm not good with names. Find one and it's a done deal.
It's possible to make it embeddable, and my first versions were. The problem right now is that the localisation files are way too big for my taste. It makes the whole library in a single file a pain to read. And I only have 3 locales. So you could embed it, but would need to set at least a <module-locale>.lua and <module>.lua files.
Edit: While you're looking for a good name for this lib, please try to find a name for the project for which I created this lib. The idea is to provide à modular addon for TankPoints/HealPoints like functionnality (mostly the calculator of each of these addons).
Does it make use of the new functions provided in the character pane?
GetSpellBonusHealing()
GetSpellPenetration()
and etc. They are in the PaperDollFrame.lua file for BC.
The problem with using these functions, is that I need (Hi, HealPoints' author here) to find how much +healing, mana/5, etc a single item gives in order to compute tooltip values.
Unless we get GetSpellBonusHealing(itemLink) or similar, I'm pretty much forced to continue to use some sort of tooltip scanner.
Great work for HealPoints ! I've been quite amazed by the usefulness of your addon. I'm happy to see it has been converted to Ace2.
I'm right now busy writing an addon for the same purpose, but more generic and with a nice OO approach. I have Variable and Result classes for example. Combined with AceModuleCore, this should greatly help in creating UI similar to HealPointsCalculator and offer more control for module creator or even maybe users to refine the calculations of one or more Efficiency Statistics.
Combined with what I have in mind with ItemBonusLib, this should provide a great tool to get an idea of what can be expected from an equipment set.
Index: ItemBonusesFu.lua
===================================================================
--- ItemBonusesFu.lua (revision 16500)
+++ ItemBonusesFu.lua (working copy)
@@ -6,6 +6,8 @@
local compost = AceLibrary("Compost-2.0")
local dewdrop = AceLibrary("Dewdrop-2.0")
+local ItemBonusLib = AceLibrary("ItemBonusLib-1.0")
+
local const = {
ItemBonuses_colors = {
X = 'FFD200', -- attributes
@@ -88,14 +90,13 @@
end
function ItemBonusesFu:OnEnable()
- self:Hook("BonusScanner_Update", "BSUpdate")
+ self:RegisterEvent("ItemBonusLib_Update", "BSUpdate")
end
function ItemBonusesFu:OnDisable()
end
function ItemBonusesFu:BSUpdate()
- self.hooks["BonusScanner_Update"]()
self:Update()
end
@@ -121,12 +122,12 @@
self:SetText(L["Item Bonuses"])
end
else
- if(not BonusScanner or not BonusScanner.active) then
- self:SetText(crayon:Red(L["BonusScanner N/A"]))
+ if not ItemBonusLib then
+ self:SetText(crayon:Red(L["ItemBonusLib N/A"]))
else
local text = compost:Acquire()
for i,e in ipairs(const.ITEMBONUSES_EFFECTS) do
- if self.db.profile[e.effect] and BONUSSCANNER_NAMES[e.effect] then
+ if self.db.profile[e.effect] and ItemBonusLib:GetBonusFriendlyName(e.effect) then
table.insert(text, self:GetBonusText(e, false))
end
end
@@ -138,14 +139,14 @@
function ItemBonusesFu:OnTooltipUpdate()
self:Debug("Updating Tooltip")
- if (not BonusScanner or not BonusScanner.active) then
+ if not ItemBonusLib then
local TabCat = tablet:AddCategory(
'columns', 1,
'child_textR', 1,
'child_textG', 0,
'child_textB', 0
)
- TabCat:AddLine('text', L["BonusScanner N/A"])
+ TabCat:AddLine('text', L["ItemBonusLib N/A"])
else
local TabCat = compost:Acquire()
for i,itemcat in pairs(const.ITEMBONUSES_CATEGORIES) do
@@ -165,15 +166,15 @@
end
for i,e in pairs(const.ITEMBONUSES_EFFECTS) do
- if BonusScanner.bonuses[e.effect] and BONUSSCANNER_NAMES[e.effect] then
+ if ItemBonusLib:GetBonus(e.effect) > 0 and ItemBonusLib:GetBonusFriendlyName(e.effect) then
local val
if e.format then
- val = format(e.format,BonusScanner.bonuses[e.effect])
+ val = format(e.format,ItemBonusLib:GetBonus(e.effect))
else
- val = BonusScanner.bonuses[e.effect]
+ val = ItemBonusLib:GetBonus(e.effect)
end
TabCat[e.cat]:AddLine(
- 'text', BONUSSCANNER_NAMES[e.effect],
+ 'text', ItemBonusLib:GetBonusFriendlyName(e.effect),
'text2', val
)
end
@@ -210,7 +211,7 @@
)
elseif level == 2 then
for i,e in pairs(const.ITEMBONUSES_EFFECTS) do
- if e.cat == value and BONUSSCANNER_NAMES[e.effect] then
+ if e.cat == value and ItemBonusLib:GetBonusFriendlyName(e.effect) then
local my_e = e
dewdrop:AddLine(
'text', self:GetBonusText(my_e, true),
@@ -232,17 +233,19 @@
function ItemBonusesFu:GetBonusText(EffectTable, forMenu)
local t = compost:Acquire()
- local val
- if BonusScanner.bonuses[EffectTable.effect] then
- val = format(EffectTable.format, BonusScanner.bonuses[EffectTable.effect])
+ local val = ItemBonusLib:GetBonus(EffectTable.effect)
+ if val > 0 then
+ val = format(EffectTable.format, val)
+ else
+ val = nil
end
if forMenu then
- table.insert(t, "[" .. crayon:Colorize(const.ItemBonuses_colors[EffectTable.color], EffectTable.short) .. "] " .. BONUSSCANNER_NAMES[EffectTable.effect])
+ table.insert(t, "[" .. crayon:Colorize(const.ItemBonuses_colors[EffectTable.color], EffectTable.short) .. "] " .. ItemBonusLib:GetBonusFriendlyName(EffectTable.effect))
else
if self.db.profile.short_display then
table.insert(t, crayon:Colorize(const.ItemBonuses_colors[EffectTable.color], EffectTable.short))
else
- table.insert(t, crayon:Colorize(const.ItemBonuses_colors[EffectTable.color], BONUSSCANNER_NAMES[EffectTable.effect]))
+ table.insert(t, crayon:Colorize(const.ItemBonuses_colors[EffectTable.color], ItemBonusLib:GetBonusFriendlyName(EffectTable.effect)))
end
end
if not val then
Quite straightforward.
You can't directly query bonus data, as it is kept in a local table. I added a function to return the human readable name of a bonus, and I use an event instead of a global function for notification
Yeah, I committed a new build of ItemBonusesFu just before you posted this. I did pretty much the exact same changes to use your lib instead of BonusScanner. I haven't had the chance to test it much, but it works well so far.
Edit: Seems the updated ItemBonusFu includes support for this addon, however I get an error when logging in:
...ItemBonusFu\Libs\ItemBonusLib-1.0\Locales\enUS.lua:3:AceLocale(ItemBonusLib): Cannot provide the same locale more than once. "enUS"
I guess it's one of the known issues with set bonuses, but anyway: after login the current FuBar_ItemBonusesFu shows the correct values for Spell Damage: 475 ... if I undress one nemesis set item and equip it directly after Spell Damage shows 498 ... exactly 23 too much, one of the set bonuses of my nemesis set is "Increases damage and healing done by magical spells and effects up to 23." - so I guess it has something to do with it...
Edit: Seems the updated ItemBonusFu includes support for this addon, however I get an error when logging in:
...ItemBonusFu\Libs\ItemBonusLib-1.0\Locales\enUS.lua:3:AceLocale(ItemBonusLib): Cannot provide the same locale more than once. "enUS"
This is becauee you probably have the library twice. Embedding is not yet working. Remove the "ItemBonusLib-1.0" folder from Fubar_ItemBonusFu.
Quote from Srosh »
Shouldn't this be in the Libraries & Mixins forum?
Yes, probably.
Quote from Sariash »
I guess it's one of the known issues with set bonuses...
No. The known issue with set bonuses is that if you have equipped 4 pieces of one set, and you get a bonus from it, the lib can not determine if the bonus is for 2, 3 ou 4 pieces.
Right now, the lib takes a conservative approach, by assuming that the bonus is for 4 pieces and will rescan the set if you equip less items.
What you saw is a bug. I'll look into it. How many set pieces did you have before ? For how many set pieces is the set bonus ?
Could you please try the following :
_ login (or reload), having all nemesis set items equipped.
_ write "/abonus details" and write down information about Spell Damage bonus.
_ remove one set piece. write "/abonus details" and write down information about Spell Damage bonus.
_ put back the set piece. write "/abonus details" and write down information about Spell Damage bonus.
Thanks a lot for your report.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I tried to keep as much compatibility with BonusScanner API as I could.
Documentation is available in the wiki at http://www.wowace.com/wiki/ItemBonusLib-1.0 .
Compared to the original version, ItemBonusLib has the following features :
_ Caches the result of scans so does minimal scanning.
_ Much better set bonuses handling. Although it has still some issues, it is possible to get accurate data for set bonuses.
_ Integrates the regex used by Healpoints.
Note to users, translators and testers :
In order to find a bonus, ItemBonusLib does pattern matching. This means that the exact description string of the bonus is scanned and checked against a database of patterns. When your favorite item does not get all its bonuses detected by the library, it's because the library is missing the corresponding pattern.
You should provide the exact string of the bonuses that are not detected if you want this to change. A screenshot of a tooltip of the item is good. If you don't provide a screenshot, make sure that your transcription is accurate.
GetSpellBonusHealing()
GetSpellPenetration()
and etc. They are in the PaperDollFrame.lua file for BC.
AND it is not yet compatible with wow 2.0 (TBC beta or PTR), although it is planned.
Oh btw, people are going to tell you to change the name. Wait, I'll just do it. Please change the name.
Starting the name with "Ace" is something that belongs in the past.
Other than that, I can't wait to start playing with it, great job! :)
It's possible to make it embeddable, and my first versions were. The problem right now is that the localisation files are way too big for my taste. It makes the whole library in a single file a pain to read. And I only have 3 locales. So you could embed it, but would need to set at least a <module-locale>.lua and <module>.lua files.
Edit: While you're looking for a good name for this lib, please try to find a name for the project for which I created this lib. The idea is to provide à modular addon for TankPoints/HealPoints like functionnality (mostly the calculator of each of these addons).
BonusLib
BonusPointsLib
StatPointsLib
Etc hehe
The problem with using these functions, is that I need (Hi, HealPoints' author here) to find how much +healing, mana/5, etc a single item gives in order to compute tooltip values.
Unless we get GetSpellBonusHealing(itemLink) or similar, I'm pretty much forced to continue to use some sort of tooltip scanner.
What about something simple like Sum Detector? Or SumScannerLib (Kind of like a pun). Dunno just tossing out ideas. :)
Ok, I'll use ItemBonusLib, which is quite descriptive.
I'll rename in trunk
Hi Eridan !
Great work for HealPoints ! I've been quite amazed by the usefulness of your addon. I'm happy to see it has been converted to Ace2.
I'm right now busy writing an addon for the same purpose, but more generic and with a nice OO approach. I have Variable and Result classes for example. Combined with AceModuleCore, this should greatly help in creating UI similar to HealPointsCalculator and offer more control for module creator or even maybe users to refine the calculations of one or more Efficiency Statistics.
Combined with what I have in mind with ItemBonusLib, this should provide a great tool to get an idea of what can be expected from an equipment set.
I'd be interested in seeing the modified version of ItemBonusesFu, if you could PM it to me or something that would be great.
Keep up the good work!
Quite straightforward.
You can't directly query bonus data, as it is kept in a local table. I added a function to return the human readable name of a bonus, and I use an event instead of a global function for notification
...ItemBonusFu\Libs\ItemBonusLib-1.0\Locales\enUS.lua:3:AceLocale(ItemBonusLib): Cannot provide the same locale more than once. "enUS"
This is becauee you probably have the library twice. Embedding is not yet working. Remove the "ItemBonusLib-1.0" folder from Fubar_ItemBonusFu.
Yes, probably.
No. The known issue with set bonuses is that if you have equipped 4 pieces of one set, and you get a bonus from it, the lib can not determine if the bonus is for 2, 3 ou 4 pieces.
Right now, the lib takes a conservative approach, by assuming that the bonus is for 4 pieces and will rescan the set if you equip less items.
What you saw is a bug. I'll look into it. How many set pieces did you have before ? For how many set pieces is the set bonus ?
Could you please try the following :
_ login (or reload), having all nemesis set items equipped.
_ write "/abonus details" and write down information about Spell Damage bonus.
_ remove one set piece. write "/abonus details" and write down information about Spell Damage bonus.
_ put back the set piece. write "/abonus details" and write down information about Spell Damage bonus.
Thanks a lot for your report.