ToolsQuickLoot.ClassString = {
	["ROGUE"] = "도적",
	["SHAMAN"] = "주술사",
	["WARRIOR"] = "전사",
	["WARLOCK"] = "흑마법사",
	["HUNTER"] = "사냥꾼",
	["PALADIN"] = "성기사",
	["PRIEST"] = "사제",
	["MAGE"] = "마법사",
	["DRUID"] = "드루이드",
}

function ToolsQuickLoot:ClassLoot_GetID(name)
	for i=1, GetNumRaidMembers() do
		if(UnitName("raid"..i) == name) then
			return "raid"..i
		end
	end
end
function ToolsQuickLoot:ClassLoot_DropDown()
	local self = ToolsQuickLoot

	self.ClassSort = {}

	local candidate;
	local info = UIDropDownMenu_CreateInfo()

	if( GetNumRaidMembers() > 0) then
		for i=1,40 do
			candidate = GetMasterLootCandidate(i);
			if (candidate) then
				if (self:ClassLoot_GetID(candidate)) then
					local class = select(2, UnitClass(self:ClassLoot_GetID(candidate)))
					self.ClassSort[class] = self.ClassSort[class] or {}
					tinsert(self.ClassSort[class], i)
				end
			end	
		end
	end

	if ( UIDROPDOWNMENU_MENU_LEVEL == 2 ) then
		for _, i in pairs(self.ClassSort[UIDROPDOWNMENU_MENU_VALUE]) do
			info = {}
			info.text = GetMasterLootCandidate(i);
			info.value = i;
			info.notCheckable = 1;
			info.func = GroupLootDropDown_GiveLoot;
			UIDropDownMenu_AddButton(info, UIDROPDOWNMENU_MENU_LEVEL);
		end
		return
	end
	if ( GetNumRaidMembers() > 0 ) then
		info = {}
		info.isTitle = 1
		info.text = GIVE_LOOT
		info.notCheckable = 1
		UIDropDownMenu_AddButton(info)

		for k,_ in pairs(self.ClassSort) do
			if getn(self.ClassSort[k]) ~= 0 then
				info = {}
				info.text = self.ClassString[k]
				info.hasArrow = 1
				info.notCheckable = 1
				info.value = k
				info.textR = RAID_CLASS_COLORS[k].r
				info.textG = RAID_CLASS_COLORS[k].g
				info.textB = RAID_CLASS_COLORS[k].b
				UIDropDownMenu_AddButton(info)
			end
		end
	else
		for i=1, MAX_PARTY_MEMBERS+1, 1 do
			candidate = GetMasterLootCandidate(i)
			if ( candidate ) then
				info = {}
				info.text = candidate
				info.value = i
				info.notCheckable = 1
				info.func = GroupLootDropDown_GiveLoot
				UIDropDownMenu_AddButton(info)
			end
		end
	end
end
UIDropDownMenu_Initialize(GroupLootDropDown, ToolsQuickLoot.ClassLoot_DropDown, "MENU")