Thread Tools Display Modes
07-19-07, 02:00 PM   #1
1337D00D
A Defias Bandit
Join Date: Jun 2007
Posts: 2
Adding an "item" to the loot window.

How exactly would I add a "fake item" to the loot frame correctly? What I've tried is to hook GetNumLootItems to include an extra slot, then when you see that extra slot it displays an icon and text so it looks like it's an item.

The problem is, you can't add it to the new slot, but you can add it to existing slots.

Code:
local CookieLootSlot = 0;

GetNumLootItemsOld = GetNumLootItems;
function GetNumLootItems()
    CookieLootSlot = GetNumLootItemsOld()+1;
    return GetNumLootItemsOld()+1; -- Create extra slot in lootframe.
end

GetLootSlotInfoOld = GetLootSlotInfo;
function GetLootSlotInfo(id)
    if id == CookieLootSlot then
        return "somepath","Cookie",1,1; -- If its the cookie loot slot then make the fake item.
    else
        return GetLootSlotInfoOld(id);
    end
end
Any ideas?
  Reply With Quote
07-19-07, 03:22 PM   #2
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
I would check blizzard's files, find the loop that adds those items, and hook the functions that executes the loop adding one more iteration to it with your fake item.
  Reply With Quote
07-19-07, 03:41 PM   #3
Geboran
A Rage Talon Dragon Guard
Join Date: Dec 2006
Posts: 308
Why would you want to do this anyway?

*curious*
__________________
------------------------------------------
Geboran - Level 70 Paladin
<Evolution>
Stormreaver (US), Alliance
  Reply With Quote
07-19-07, 04:10 PM   #4
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 275
Originally Posted by Geboran
*curious*
Now that you say that, I'm curious too
  Reply With Quote
07-19-07, 04:24 PM   #5
Dez
A Deviate Faerie Dragon
 
Dez's Avatar
Join Date: Jul 2007
Posts: 14
Lol screenshots of hogger dropping epix?
  Reply With Quote
07-19-07, 05:43 PM   #6
Gemini_II
A Molten Giant
 
Gemini_II's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 762
Correct me if I am mistaken, but wouldn't doing something like this not be possible without causing a disconnect? Effectively linking a fake item...
__________________
Retired prior to 3.2, before all challenge was removed.

  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Adding an "item" to the loot window.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off