GetBonus() already exists, and has slightly different semantics.
I have added :GetRatingBonus() and :GetFriendlyBonus() as public API and modified :GetBonus() to be compatible with previous version and also give access to the complete internal GetBonus() function parameters.
Those changes (in the latest ItemBonusLib r50636) have killed FuBar_ItemBonusesFu (r47107, last update Aug 21/07).
With the updated ItemBonusLib library, get the following errors mousing over FuBar_ItemBonusesFu. As well, no info tooltip shows up:
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\nItemBonusLib-1.0-50636:451: in function `?'\nAceEvent-2.0-49307 (Ace2):735: in function <Interface\\AddOns\\Ace2\\AceEvent-2.0\\AceEvent-2.0.lua:722>\n<in C code>: ?\nAceEvent-2.0-49307 (Ace2):367: in function <Interface\\AddOns\\Ace2\\AceEvent-2.0\\AceEvent-2.0.lua:345>"
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\n(tail call): ?:\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:179: in function `OnTooltipUpdate'\nFuBarPlugin-2.0-48629:366: in function `runChildren'\nTablet-2.0-49630 (TabletLib):2355: in function `children'\nTablet-2.0-49630 (TabletLib):2399: in function `Open'\nTablet-2.0-49630 (TabletLib):2533: in function <Interface\\AddOns\\TabletLib\\Tablet-2.0\\Tablet-2.0.lua:2527>\nFuBarPlugin-2.0-48629:415: in function <...\\FuBarPlugin-2.0\\FuBarPlugin-2.0\\FuBarPlugin-2.0.lua:414>"
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\n(tail call): ?:\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:249: in function `GetBonusText'\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:229: in function `OnMenuRequest'\nFuBarPlugin-2.0-48629:1116: in function <...\\FuBarPlugin-2.0\\FuBarPlugin-2.0\\FuBarPlugin-2.0.lua:1093>\nDewdrop-2.0-48630 (DewdropLib):1883: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:1832>\nDewdrop-2.0-48630 (DewdropLib):2768: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:2727>\nDewdrop-2.0-48630 (DewdropLib):619: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:603>"
Roll back to the previous ItemBonusLib r50501 and FuBar_ItemBonusesFu works again without errors.
if r <= 0.1 and g >= 0.9 and b <= 0.1 then
self:AddBonusInfo(info.bonuses, bonus)
end
New:
if r <= 0.1 and g >= 0.9 and b <= 0.1 then
self:AddBonusInfo(info.bonuses, bonus)
else
if (info.sockets == nil) then info.sockets = {}; end
self:AddBonusInfo(info.sockets, bonus);
end
This allows my code access to the inactive socket bonuses, without impacting the normal bonus results. Now that you've added support for empty sockets, this is about the only piece of information I need which ItemBonusLib doesn't supply.
In ItemBonusLib:GetUnitEquipment, could you add something to conditionally disable hiding the Inspect frame? It can get in the way if the library is being used with the inspect frame itself. Simply re-showing the frame causes errors as well.
Yes. info.inactive_gem_bonus contains this information.
Quote from Bejitt »
In ItemBonusLib:GetUnitEquipment, could you add something to conditionally disable hiding the Inspect frame?
I'm adding some code so that IBL does not close the inspect frame if you want to inspect the target. I could try and not call NotifyInspect() and ClearInspectPlayer(), which are likely to be simply related with showing the set bonus information in the tooltips of the inspect frame, an information IBL doesn't need.
Jerry, did you see my question above? What do you think of adding this or some similar functionality (or letting me know if something like this already exists :))
Jerry, did you see my question above? What do you think of adding this or some similar functionality (or letting me know if something like this already exists :))
Yes, I saw it. I'll add some way to get this number in the next implementation, but I don't want to put it in the bonus table, as an addon might want to iterate through these table and expect each key to have a defined meaning. i.e. ItemBonusLib:IsValidName(key) should return true for every entry in the bonus table.
Yes, I saw it. I'll add some way to get this number in the next implementation, but I don't want to put it in the bonus table, as an addon might want to iterate through these table and expect each key to have a defined meaning. i.e. ItemBonusLib:IsValidName(key) should return true for every entry in the bonus table.
That makes sense. I guess for now I'll just have to do my own second scan of the tooltip.
There are a few bonuses in IBL that are not properly mapped to a 'friendly name'. You may want to look at this, Jerry.
I have added "Reduced Threat" as the friendly name of THREATREDUCTION.
Please provide a list of missing Friendly names, with a proposal for Friendly name, if possible.
Note that as any pattern may introduce a new bonus type, the list of Friendly names is not guaranteed to be complete. That's why GetBonusFriendlyName() returns the bonus type name by default.
I believe I have a list somewhere in WoWEquip.... digging it out... I basically did my own translations since about half the bonus types don't have a friendly name at all, or the friendly name that was returned was a string that was too long to be displayed.
Below is a cut/paste portion of bonuses from my data file, since I'm kinda lazy to edit it. These ones probably don't have a translation last I checked 1-2 months ago.
CR_WEAPON_FERAL = {id = 3, t = L["Feral Combat s. rating"], r = "FERAL_WEAPON_RATING"},
CR_WEAPON_AXE_2H = {id = 3, t = L["2H-Axe skill rating"], r = "2H_AXE_WEAPON_RATING"},
CR_WEAPON_MACE_2H = {id = 3, t = L["2H-Mace skill rating"], r = "2H_MACE_WEAPON_RATING"},
CR_WEAPON_FIST = {id = 3, t = L["Fist skill rating"], r = "FIST_WEAPON_RATING"},
CR_WEAPON_STAFF = {id = 3, t = L["Staff skill rating"], r = false},
CR_WEAPON_GUN = {id = 3, t = L["Gun skill rating"], r = "GUN_WEAPON_RATING"},
CR_WEAPON_BOW = {id = 3, t = L["Bow skill rating"], r = "BOW_WEAPON_RATING"},
CR_WEAPON_CROSSBOW = {id = 3, t = L["Crossbow skill rating"], r = "CROSSBOW_WEAPON_RATING"},
THREATREDUCTION = {id = 8, t = L["Threat Reduction (%)"]},
MELEEDMG = {id = -1, t = L["Summed Melee Damage"]},
CASTINGREG = {id = 5, t = L["Mana Regen w/casting (%)"]},
NATURECRIT = {id = 4, t = L["Spell Crit (Nature)"]},
CASTINGREGROWTH = {id = -1, t = "-Cast (Regrowth)"},
CASTINGHOLYLIGHT = {id = -1, t = "-Cast (Holy Light)"},
CASTINGHEALINGTOUCH = {id = -1, t = "-Cast (Healing Touch)"},
CASTINGFLASHHEAL = {id = -1, t = "-Cast (Flash Heal)"},
CASTINGCHAINHEAL = {id = -1, t = "-Cast (Chain Heal)"},
DURATIONREJUV = {id = -1, t = "+Dur (Rejuvenation)"},
DURATIONRENEW = {id = -1, t = "+Dur (Renew)"},
MANAREGNORMAL = {id = -1, t = "Normal Life/Mana Regen"},
IMPCHAINHEAL = {id = -1, t = "Healing (Chain Heal)"},
IMPREJUVENATION = {id = -1, t = "Healing (Rejuvenation)"},
IMPLESSERHEALINGWAVE = {id = -1, t = "Healing (L.H. Wave)"},
IMPFLASHOFLIGHT = {id = -1, t = "Healing (Flash of Light)"},
REFUNDHEALINGWAVE = {id = -1, t = "Refund % mana (H. Wave)"},
JUMPHEALINGWAVE = {id = -1, t = "-% Heal/jump (H. Wave)"},
CHEAPERDRUID = {id = -1, t = "-% Mana (HT/Rg/Rej/Tr)"},
REFUNDHTCRIT = {id = -1, t = "Refund % mana (HT)"},
CHEAPERRENEW = {id = -1, t = "-% Mana (Renew)"},
HEALTHREG_P = {id = 5, t = L["Normal Health Regen"]},
RUNSPEED = {id = 8, t = L["Run Speed %"]},
MOUNTSPEED = {id = 8, t = L["Mount Speed %"]},
SWIMSPEED = {id = 8, t = L["Swim Speed %"]},
STEALTH = {id = 8, t = L["Stealth %"]},
RANGED_SPEED_BONUS = {id = 8, t = L["Ranged Speed Bonus %"]},
NEGPARRY = {id = 8, t = L["Less Parry %"]},
STUNRESIST = {id = 6, t = L["Stun Resistance %"]},
FEARRESIST = {id = 6, t = L["Fear Resistance %"]},
DISORIENTRESIST = {id = 6, t = L["Disorient Resistance %"]},
MELEETAKEN = {id = 8, t = L["Less Melee Dmg Taken"]},
DMGTAKEN = {id = 8, t = L["Less Spell Dmg Taken"]},
UNDERWATER = {id = 8, t = L["Underwater Breathing"]},
LOCKPICK = {id = 8, t = L["Lockpicking"]},
STEALTHDETECT = {id = 8, t = L["Stealth Detection"]},
DISARMIMMUNE = {id = 8, t = L["Disarm Immune"]},
SLOWFALL = {id = 8, t = L["Less Falling Damage %"]},
IMPRESS = {id = 8, t = L["Impress Others!"]},
MOJO = {id = 8, t = L["Mojo!"]},
EMPTY_SOCKET_BLUE = {id = 7, t = L["Empty Blue Socket"]},
EMPTY_SOCKET_META = {id = 7, t = L["Empty Meta Socket"]},
EMPTY_SOCKET_RED = {id = 7, t = L["Empty Red Socket"]},
EMPTY_SOCKET_YELLOW = {id = 7, t = L["Empty Yellow Socket"]},
I get a lot of the same error on my shaman so i made a extra check in function MergeDetails and the error goes away. I have attached a diff file for the change i made.
I get a lot of the same error on my shaman so i made a extra check in function MergeDetails and the error goes away. I have attached a diff file for the change i made.
Could please instead try the following ?
for slot, value in pairs(slots) do
if type(value) ~= "number" then
self:Print("Error ! value has the type '%s' for slot '%s' and bonus '%s', type(value), slot, bonus)
else
bonuses[bonus] = (bonuses[bonus] or 0) + value
end
end
and give me the information, as well as the item in the corresponding slot(s) ?
I have added :GetRatingBonus() and :GetFriendlyBonus() as public API and modified :GetBonus() to be compatible with previous version and also give access to the complete internal GetBonus() function parameters.
With the updated ItemBonusLib library, get the following errors mousing over FuBar_ItemBonusesFu. As well, no info tooltip shows up:
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\nItemBonusLib-1.0-50636:451: in function `?'\nAceEvent-2.0-49307 (Ace2):735: in function <Interface\\AddOns\\Ace2\\AceEvent-2.0\\AceEvent-2.0.lua:722>\n<in C code>: ?\nAceEvent-2.0-49307 (Ace2):367: in function <Interface\\AddOns\\Ace2\\AceEvent-2.0\\AceEvent-2.0.lua:345>"
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\n(tail call): ?:\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:179: in function `OnTooltipUpdate'\nFuBarPlugin-2.0-48629:366: in function `runChildren'\nTablet-2.0-49630 (TabletLib):2355: in function `children'\nTablet-2.0-49630 (TabletLib):2399: in function `Open'\nTablet-2.0-49630 (TabletLib):2533: in function <Interface\\AddOns\\TabletLib\\Tablet-2.0\\Tablet-2.0.lua:2527>\nFuBarPlugin-2.0-48629:415: in function <...\\FuBarPlugin-2.0\\FuBarPlugin-2.0\\FuBarPlugin-2.0.lua:414>"
"ItemBonusLib-1.0-50636:114: attempt to index global 'self' (a nil value)\n(tail call): ?:\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:249: in function `GetBonusText'\nFuBar_ItemBonusesFu-2.1.29890\\ItemBonusesFu.lua:229: in function `OnMenuRequest'\nFuBarPlugin-2.0-48629:1116: in function <...\\FuBarPlugin-2.0\\FuBarPlugin-2.0\\FuBarPlugin-2.0.lua:1093>\nDewdrop-2.0-48630 (DewdropLib):1883: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:1832>\nDewdrop-2.0-48630 (DewdropLib):2768: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:2727>\nDewdrop-2.0-48630 (DewdropLib):619: in function <...erface\\AddOns\\DewdropLib\\Dewdrop-2.0\\Dewdrop-2.0.lua:603>"
Roll back to the previous ItemBonusLib r50501 and FuBar_ItemBonusesFu works again without errors.
Fixed in r50745, Thanks.
Old:
New:
This allows my code access to the inactive socket bonuses, without impacting the normal bonus results. Now that you've added support for empty sockets, this is about the only piece of information I need which ItemBonusLib doesn't supply.
Thanks!
It is in there CR_WEAPON_FERAL (which is going away next patch) and ATTACKPOWERFERAL.
Jerry, I was wondering if it would be possible to count up the number of items in a set. In my local version I have added around line 654:
Yes. info.inactive_gem_bonus contains this information.
I'm adding some code so that IBL does not close the inspect frame if you want to inspect the target. I could try and not call NotifyInspect() and ClearInspectPlayer(), which are likely to be simply related with showing the set bonus information in the tooltips of the inspect frame, an information IBL doesn't need.
Yes, I saw it. I'll add some way to get this number in the next implementation, but I don't want to put it in the bonus table, as an addon might want to iterate through these table and expect each key to have a defined meaning. i.e. ItemBonusLib:IsValidName(key) should return true for every entry in the bonus table.
That makes sense. I guess for now I'll just have to do my own second scan of the tooltip.
returns "THREATREDUCTION", expected something like "Reduced Threat"
There are a few bonuses in IBL that are not properly mapped to a 'friendly name'. You may want to look at this, Jerry.
I have added "Reduced Threat" as the friendly name of THREATREDUCTION.
Please provide a list of missing Friendly names, with a proposal for Friendly name, if possible.
Note that as any pattern may introduce a new bonus type, the list of Friendly names is not guaranteed to be complete. That's why GetBonusFriendlyName() returns the bonus type name by default.
Below is a cut/paste portion of bonuses from my data file, since I'm kinda lazy to edit it. These ones probably don't have a translation last I checked 1-2 months ago.
Could please instead try the following ?
and give me the information, as well as the item in the corresponding slot(s) ?
This is the item http://www.wowhead.com/?item=28041
EDIT: Weird it looks like it happens when i equip any of my trinkets.
I also notice it only happens if the trinket i swap in has tooltip information generated by the addon Enhancer.
Xinhuan told me that the problem comes from ItemBonusLib French localization.
http://www.wowace.com/forums/index.php?topic=8317.89
What can I do to help you on ItemBonusLib French localization ?