ManaPerc showing both Current and Total percentage
ManaPerc showing only Current percentage
ManaPerc showing only Total percentage
ManaPerc
This is a simple addon to display in the tooltip of spells the current
and/or total mana the spell will cost, in percentage.
Example tooltip:
Blizzard North
180 Mana (t:18.1%)(c:25.5%)
This will rain down lots of icy stuff on
thine enemies to smithe them, in thy glory
/manaperc ? : Displays extra information about mypercentage
/manaperc standby : Toggles the addon's standby mode. Standby makes the addon active or inactive, though it is still loaded.
/manaperc total : toggles displaying mana cost in % of total mana
/manaperc current : toggles displaying mana cost in % of current mana
/manaperc colour : toggles displaying colour OR t:/c:
The original author of the Ace1 version of this addon was Instant, it was under the name of MyACEPercentage.
I've taken the addon, converted it to Ace2, optimized the tooltip processing part (the main chunk of the addon) and given it a name change.
Change Log - ManaPerc
18/11/2008: v1.4.1
Upgraded for 3.0.2
Now works properly with Druid Mana while in forms thansk to Blizzard API changes.
07/05/2008: r70749[list][*]Upgraded to Ace3.[*]Added an options interface to the Blizzard Interface options.[*]Now using tooltip:GetSpell() and GetSpellInfo(spellName) to get spell costs. Should be much quicker than scanning the tooltip.[*]Note: Regular slash commands are disabled at the moment and executing /manaperc will bring up the GUI options window. Regular slash commands should be back soon.
r56108:
Updated TOC for WoW 2.3
Changed how we hook the tooltip.
Translation updates.
r36341:
Updated TOC for WoW 2.1
r19595:
Updated to work with 2.0.
r12343:
More optimizations! I lied yesterday, a fresh look this morning revealed more could be done. Check the changelog if you really want to know what's changed.
r12258:
Fixed missing Libs entries in the TOC.
Small optimization. Managed to throw away another unneeded local. I think this is about as optimized as it's ever going to be now.
r12087:
Fixed empty Libs directory. Not sure why it was empty.
I received the following error message when mousing over a gem:
Code:
Message: ..\AddOns\ManaPerc\ManaPerc.lua line 77:
bad argument #2 to 'format' (number expected, got nil)
Following other posts I disabled Stubby, and confirmed that the error still occurs.
I had a look at the code, and I think I've spotted the problem.
At line 57 you use the following code to check for the mana line in a spell:
Code:
if tipline2 and string.find(tipline2, MANA_COST) then
In the English client, MANA_COST is equal to "%d Mana". Therefore the above check will get a "false positive" if the relevant line of text is something like "+1 Mana every 5 seconds."
The error gets thrown when the next section of code can't handle this unexpected result.
Hope this helps.
(Also, your download is missing an Ace library, and another library is incorrectly named in your .toc file)
Originally posted by phyber Find this line in ManaPerc.lua:
line2cost = tonumber(line2cost)
and add under that 'if not line2cost then return end'
That might help.
I have no idea why that error would happen, but from here it looks like Stubby is doing something stupid.
That seems to fix it (Not that easy to edit a lua file in Notepad heh), thanks a ton for the assistance Phyber . And I agree Stubby does tend to piss a few Ace addons off most the time. Thats why hopefully they get a new version out soon. (Not that I'm even all that sure what Stubby does for Auctioneer lol)
First off, great mod very helpful . But I seem to be getting the following error on logon for ManaPerc:
[2006/11/18 20:46:59-93-x2]: ManaPerc\ManaPerc.lua:62: attempt to perform arithmetic on local `line2cost' (a nil value)
ManaPerc\ManaPerc.lua:62: in function <Interface\AddOns\ManaPerc\ManaPerc.lua:54>
<unknown>:
<in C code>: ?
<in C code>: in function `pcall'
Stubby\Stubby.lua:260: in function <Interface\AddOns\Stubby\Stubby.lua:242>
<unknown>:
Venantes\Venantes.lua:1105: in function `Venantes_BuildTooltip'
<string>:"VenantesPetButton:OnEnter":2: in main chunk
---
Any idea as to the possible cause? Thanks in advanced.
It's in the above where it says you're the original author, you're also still listed in the ReadMe file. Infact, your original comment with the MyACEPercentage title is still in the ManaPerc.lua
Check out the processing part of the addon if you have time, it's quite optimized now. There is a version on SVN that I should upload, even more optimized.