All pastes #146895 Raw Edit

Untitled

public text v1 · immutable
#146895 ·published 2006-08-23 23:22 UTC
rendered paste body
<<xml>>

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
  <Script file="localization.lua"/>
	<Button name="LootAnnounceButton" inherits="OptionsButtonTemplate" text="Announce" parent="LootFrame">
		<Anchors>
			<Anchor point="TOP" relativeTo="LootFrame" relativePoint="TOP">
				<Offset>
					<AbsDimension x="0" y="-45"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
			</OnLoad>
			<OnClick>
				LootAnnounce();
			</OnClick>
		</Scripts>
	</Button>
</Ui>


<<lua>>
function LootAnnounce()
    
    local chattype
    
    if (GetNumRaidMembers() >= 4) then
        chattype = "RAID"
    elseif (GetNumPartyMembers() >= 1) then
        chattype = "PARTY"
    end
    for index =1, GetNumLootItems(), 1 do
        if (LootSlotIsItem(index)) then
            local iteminfo = GetLootSlotLink(index);
            SendChatMessage(iteminfo, chattype);
        elseif (LootSlotIsCoin(index)) then
            local _,lootName, _,_ = GetLootSlotInfo(index);
            SendChatMessage(string.gsub(lootName, "\n", " "), chattype);
        end
    end
end


<<toc>>
## Interface: 11000
## Author: |cff00a800Zeryl|r
## Title: LootAnnounce
## Dependencies:
LootAnnounce.xml