• 0

    posted a message on Check if an item is armor or weapon
    Hi,

    In my addon (which adds a note to an item's tooltip if it is listed in a pre-built table), I need to add a check if an item is armor or weapon.

    if (armor or weapon) then


    According to Wowwiki there's an ItemType property that returns the type of an item (wowwiki.wikia.com/wiki/ItemType). I have the following code that works well, just need to add the item type check, so the note (Keep/Sell) will be displayed only on gear (armor or weapon) type items.

    local itemSets = {
    	["Battleforge"] = "Keep",
    	["Exalted"] = "Keep",
    	["Imperial Leather"] = "Sell",
    	["Mystical"] = "Keep",
    	["Starfire"] = "Sell",
    	["Warmaul"] = "Keep",
    }
    
    local find = string.find
    
    local function GameTooltip_OnTooltipSetItem(tooltip)
    	local itemName = tooltip:GetItem()
    	if not itemName then return; end
    
            -- check if item is armor or weapon, if yes do the for loop.
    	for setName, action in pairs(itemSets) do
    		if find(itemName, setName) then
    			tooltip:AddLine(action)
    			break
    		end
    	end
    end
    
    GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)


    Any ideas how to get ItemType information from tooltip:GetItem() so I can do the check?

    Thanks.
    Posted in: Need Help?
  • 0

    posted a message on Add note to an item's tooltip
    I checked the addons mentioned in the reply to my other thread but still couldn't figure out how to do what I wanted to do. Therefore I decided to divide the flow into steps and ask them one by one to learn how each step is done.
    Posted in: AddOn HELP!
  • 0

    posted a message on Add note to an item's tooltip
    Hi,

    In my addon, I want to add a note to a specific item's tooltip. Let's say the item ID: 31234

    I will not add the note in the game. I will create the necessary addon file so when I launch the game, and check the item tooltip, I will see the note.

    I created a basic .toc and .lua file following a beginner tutorial but I don't know how to proceed.

    myaddon.toc
    [HTML]## Interface: 60200
    ## Title: Keep or Sell
    ## Version: 1.0
    ## Author: Eom
    ## Notes: Adds notes (keep/sell) to item tooltips if they are specified in a custom list created by the user.

    main.lua[/HTML]

    main.lua file is empty at the moment.

    Any help is appreciated.

    Thanks.
    Posted in: AddOn HELP!
  • 0

    posted a message on Simple addon to put a note in item tooltips
    Hi, thanks for the tips, I will be checking them.
    Posted in: Addon Ideas
  • 0

    posted a message on Simple addon to put a note in item tooltips
    Hi,

    For transmog/collection purposes, I want to write a simple addon that will do the following:

    - It will have a list of item set names and a value corresponding to each set. Example:

    1. Imbued Plate - Keep
    2. Mystical - Keep
    3. Bogslayer - Sell
    4. Blood Knight - Keep
    5. Chromite - Sell
    ...

    - I will populate this list manually as I continue playing the game.

    - What the addon will do is, when I find an item that has a name that starts with one of the set names in the list, it will display a simple "Keep" or "Sell" note in the item tooltip.

    This will be my first addon and it will be nice if those of you who have addon writing experience can give some ideas or lead in the right direction.

    Thank you.
    Posted in: Addon Ideas
  • 0

    posted a message on Shadowed Unit Frames [official]
    Hi,

    When a boss fight starts, in a dungeon or raid, a frame appears at the center of the screen like in the image below (the frame currently display "Stunned"):

    http://i.imgur.com/dx8RTWD.jpg

    It's pretty annoying for me. Can you please tell me how to remove it? I checked all the options with no success.

    Thanks.
    Posted in: Unit Frames
  • To post a comment, please or register a new account.