Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Captures the loot that is above the desired threshold and opens the loot frame
- if event == "LOOT_OPENED" then
- if IsRaidLeader() and RaidLootDB.autoAnnouceLoot == true then
- lootOnMob = {}
- raidLoot_AnnounceLoot()
- end
- end
- -- Automattically announces the loot on a mob to the raid
- function raidLoot_AnnounceLoot()
- local lootLinks
- for index = 1, GetNumLootItems() do
- if (LootSlotIsItem(index)) then
- local itemLink = GetLootSlotLink(index);
- local _, _, _, rarity, _ = GetLootSlotInfo(index)
- if rarity >= RaidLootDB.autoSetLootThresholdName then
- if lootLinks == nil then
- lootLinks = itemLink
- else
- lootLinks = lootLinks .. itemLink
- end
- lootOnMob[index] = itemLink
- end
- end
- end
- if lootLinks ~= nil then
- if tonumber(RaidLootDB.autoAnnounceLootName) == 1 then
- SendChatMessage(lootLinks, "GUILD")
- elseif tonumber(RaidLootDB.autoAnnounceLootName) == 2 then
- SendChatMessage(lootLinks, "PARTY")
- elseif tonumber(RaidLootDB.autoAnnounceLootName) == 3 then
- SendChatMessage(lootLinks, "RAID")
- elseif tonumber(RaidLootDB.autoAnnounceLootName) == 4 then
- SendChatMessage(lootLinks, "SAY")
- end
- raidLoot_ShowLF()
- end
- end
- -- Shows the Raid Loot frame
- function raidLoot_ShowLF()
- RaidLootDB.isHiddenLF = false
- raidLoot_ShowRolls()
- raidLoot_LootDrop()
- raidLoot_LootFrame:Show()
- raidLoot_LootFrame_headerText:SetText(rLV)
- end
- -- Creates the dropdown menu that contains the loot found on the mob
- function raidLoot_LootDrop()
- if not LootDrop then
- CreateFrame("Button", "LootDrop", raidLoot_LootFrame, "UIDropDownMenuTemplate")
- end
- LootDrop:ClearAllPoints()
- LootDrop:SetPoint("BOTTOMLEFT", raidLoot, "TOPLEFT", -20, 20)
- LootDrop:Show()
- local function OnClick(self)
- UIDropDownMenu_SetSelectedID(LootDrop, self:GetID())
- RaidLootDB.LootDropSelected = UIDropDownMenu_GetSelectedID(LootDrop)
- end
- local function initialize(self, level)
- local info = UIDropDownMenu_CreateInfo()
- if lootOnMob[1] == nil then
- info = UIDropDownMenu_CreateInfo()
- info.text = "Loot"
- info.value = "OptionVariable"
- info.func = OnClick
- UIDropDownMenu_AddButton(info, level)
- else
- for k,v in pairs(lootOnMob) do
- print("Creating loot drop down")
- local _, itemLink, _, _, _, _, _, _, _, _, _ = GetItemInfo(v)
- info = UIDropDownMenu_CreateInfo()
- info.text = v
- print(v)
- info.value = "OptionVariable"
- info.func = OnClick
- UIDropDownMenu_AddButton(info, level)
- end
- end
- end
- UIDropDownMenu_Initialize(LootDrop, initialize)
- UIDropDownMenu_SetWidth(LootDrop, 100);
- UIDropDownMenu_SetButtonWidth(LootDrop, 124)
- if lootOnMob[1] == nil then
- UIDropDownMenu_SetSelectedID(LootDrop, 1)
- else
- UIDropDownMenu_SetSelectedID(LootDrop, RaidLootDB.LootDropSelected)
- end
- UIDropDownMenu_JustifyText(LootDrop, "LEFT")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement