1. #1

    AddOn Request: Poison Buff Icons

    Hi there,

    I'm looking for an addon which will simply replace the icons of my weapons with icons of the actual poisons you're using! I've tried Poisonous which puts a little letter above each of your weapon enchant buffs, that's almost what I want, however the letter is kind of too small to notice properly.

    Anyone seen anything like this?

    If not, this shouldn't require much lua code to complete?

    Any help appreciated, thanks in advance

  2. #2
    Googled it and the only things that came up were the addon you already use, and Ara Broker WeaponBuffer where you can choose to show the icon of the poison in the frame.

    It's a data broker plugin though, it won't replace your Blizzard Buff icons.

    Example:

    Gershuun @ Borean Tundra US - Interface & Macros Moderator

  3. #3
    Deleted
    Here you go:
    Code:
    local poisonTextures = {}
    local function f(iID)
    	local name,_,_,_,_,_,_,_,_,tex = GetItemInfo(iID)
    	if name == "Mind-Numbing Poison" then name = "Mind Numbing Poison" end
    	poisonTextures["^"..name] = tex
    end
    f(3775)
    f(2892)
    f(6947)
    f(5237)
    f(10918)
    local function hastex(x)
    	local text = x:GetText()
    	for match, tex in pairs(poisonTextures) do
    		if text:match(match) then
    			return tex
    		end
    	end
    end
    local tooltip = CreateFrame("GameTooltip","PoisonScanTooltip",nil,"GameTooltipTemplate")
    local function s(f)
    	return f and f:IsShown()
    end
    local function get(slot)
    	tooltip:SetOwner(UIParent,"ANCHOR_NONE")
    	tooltip:SetInventoryItem("player",slot)
    	local c = 1
    	local l = PoisonScanTooltipTextLeft1
    	while s(l) do
    		local t = hastex(l)
    		if t then return t end
    		c=c+1
    		l = _G[("PoisonScanTooltipTextLeft%d"):format(c)]
    	end
    end
    local giit = GetInventoryItemTexture
    function GetInventoryItemTexture(unit,slot)
    	if UnitIsUnit("player",unit) then
    		if (slot == 16) then
    			if GetWeaponEnchantInfo() then
    				local t = get(16)
    				if t then
    					return t
    				end
    			end
    		elseif (slot == 17) then
    			if select(4,GetWeaponEnchantInfo()) then
    				local t = get(17)
    				if t then
    					return t
    				end
    			end
    		elseif (slot == 18) then
    			local t = get(18)
    			if t then
    				return t
    			end
    		end
    	end
    	return giit(unit,slot)
    end
    How to use. Untested. Report back with issues.
    Last edited by mmocba105e19de; 2011-11-16 at 06:55 AM.

  4. #4
    That's awesome Treeston!

    If I was to add for thrown weapon aswell I would just have to add:

    Code:
    elseif (slot == 17) then
    			if select(4,GetWeaponEnchantInfo()) then
    				local t = get(17)
    				if t then
    					return t
    				end
    			end
    		end
    right?

    Also, just a minor bug, nothing big, but for some reason the distance between my poison buffs and the other buffs seems to be more clumped up for some reason, a quick fix for it? This image will explain the problem better:

    img210.imageshack.us/img210/3127/poisons.png

  5. #5
    Deleted
    Hm, that shouldn't happen obviously but can't see why my code would influence it I'm afraid. Can't think of any quick fix either.

    PS: Expanded my code above to include thrown weapons.

  6. #6
    No worries, it's not a huge problem. However, all poisons are now working correctly, except for Mind-Numbing for some reason I double checked the unit ID in your code with wowhead and it's indeed right. However, I noticed something strange, the item Mind-Numbing Poison is written "Mind-Numbing" while the weapon enchant spell is written "Mind Numbing" - could this have any influence on the above code? Thanks in advance

    ---------- Post added 2011-11-16 at 03:55 AM ----------

    Yeah, that was indeed it - I actually figured it out on my own just by doing some debugging

    Edited the f() function:

    Code:
    local function f(iID)
    	local name,_,_,_,_,_,_,_,_,tex = GetItemInfo(iID)
    	if name == "Mind-Numbing Poison" then name = "Mind Numbing Poison" end
    	poisonTextures["^"..name] = tex
    end
    Probably not the best solution, but does the trick

    Thanks a lot for your help though! +rep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •