-------------------------------------------------------------------------------
--
--  Title      : 나를 불러주세요~
--  Version    : 1.6
--  Author     : Blink
--  Date       : 2005/03/26
--  LastUpdate : 2006/10/14
--
--  Special Thanks : Deblan,Damjau
--
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- BlinkPrint
-------------------------------------------------------------------------------
if( not BlinkPrint ) then
	BlinkPrint = function(msg)
		if(ChatFrame1) then
			ChatFrame1:AddMessage(msg, 1.0, 1.0, 0.0);
		end
	end
end

function BlinkCallMe_OnLoad()
	
	this:RegisterEvent("CHAT_MSG_CHANNEL");
	this:RegisterEvent("CHAT_MSG_SAY");
	this:RegisterEvent("CHAT_MSG_PARTY");
	this:RegisterEvent("CHAT_MSG_YELL");
	this:RegisterEvent("CHAT_MSG_RAID");
	this:RegisterEvent("CHAT_MSG_RAID_WARNING");
	this:RegisterEvent("CHAT_MSG_RAID_LEADER");
	this:RegisterEvent("CHAT_MSG_GUILD");
	this:RegisterEvent("CHAT_MSG_MONSTER_SAY");
	this:RegisterEvent("CHAT_MSG_MONSTER_YELL");
	this:RegisterEvent("CHAT_MSG_MONSTER_EMOTE");

	BlinkCallMeNames = {};
	BlinkWhoSaidNames = {};

	-- Slash commands
	SlashCmdList["BCALLME"] = function (msg) BlinkCallMe_SlashCmd(msg); end;
	SLASH_BCALLME1 = "/나를불러주세요";
	SLASH_BCALLME2 = "/callme";

	SlashCmdList["BWHOSAID"] = function (msg) BlinkCallMe_WhoSaidSlashCmd(msg); end;
	SLASH_BWHOSAID1 = "/누가말하나";
	SLASH_BWHOSAID2 = "/whosaid";

	BCM_BlinkModRegister();
end

function BlinkCallMe_OnEvent(event)
	local result = false;
	local showCallme = false;
	local showWhosaid = false;
	local color = { r=0.7, g=0.7, b=0.7 };

	if ( string.find(arg1,UnitName("player")) ) then
		showCallme = true;
	else
		for i=1,table.getn(BlinkCallMeNames),1 do
			if( string.find(arg1,BlinkCallMeNames[i]) )then
				showCallme = true;
			end
		end
	end

	for i=1,table.getn(BlinkWhoSaidNames),1 do
		if( event ~= "CHAT_MSG_RAID_WARNING" and arg2 == BlinkWhoSaidNames[i] )then
			showWhosaid = true;
		end
	end

	if ( (showCallme == true or showWhosaid == true) and arg2~=UnitName("player") ) then
		local chattypes = getglobal("ChatTypeInfo");
		if( event == "CHAT_MSG_CHANNEL" )then
			-- Damjau Added
			if ( IsAddOnLoaded("oRA") and oRA_Core:GetOpt("channel") and oRA_Core:GetOpt("channel") == arg9 )
				or ( IsAddOnLoaded("CT_RaidAssist") and getglobal("CT_RA_Channel") and getglobal("CT_RA_Channel") == arg9 )
				or ( IsAddOnLoaded("SW_Stats") and getglobal("SW_SyncChanID") and getglobal("SW_SyncChanID") > 0 and getglobal("SW_SyncChanID") == arg8 ) 
			then
				return;
			end
			color = chattypes["CHANNEL"];
		elseif( event == "CHAT_MSG_SAY" )then
			color = chattypes["SAY"];
		elseif( event == "CHAT_MSG_PARTY" )then
			color = chattypes["PARTY"];
		elseif( event == "CHAT_MSG_YELL" )then
			color = chattypes["YELL"];
		elseif( event == "CHAT_MSG_RAID" )then
			color = chattypes["RAID"];
		elseif( event == "CHAT_MSG_RAID_WARNING" )then
			color = chattypes["RAID_WARNING"];
		elseif( event == "CHAT_MSG_GUILD" )then
			color = chattypes["GUILD"];
		elseif( event == "CHAT_MSG_MONSTER_SAY" )then
			color = chattypes["MONSTER_SAY"];
		elseif( event == "CHAT_MSG_MONSTER_YELL" )then
			color = chattypes["MONSTER_YELL"];
		elseif( event == "CHAT_MSG_MONSTER_EMOTE" )then
			color = chattypes["MONSTER_EMOTE"];
		end
		if ( showCallme == true and showWhosaid == true ) then
			-- BlinkBanner함수는 작은 글자로 표시해줍니다.
--			BlinkBanner(arg2..": "..arg1, color);

			RaidWarningFrame:AddMessage(arg2..": "..arg1, color.r, color.g, color.b, 1.0);

			-- 경매장 종료할때 나오는 '땡땡'소리입니다.
--			PlaySound("AuctionWindowClose"); -- 이것을 원한다면 주석을 해제해주십시오.
			PlaySound("RaidWarning");

			-- 외부사운드파일 불러들여서 소리를 냅니다. (자신이 원하는 wav파일을 불러올수도 있습니다. 하지만 크면 리소스에 영향을 줄수 있습니다)
			-- PlaySoundFile("Interface\\AddOns\\BlinkCallMe\\BlinkCallMe.wav"); -- 클라이언트 v1.11에서 외부사운드 플레이 버그로인해 주석처리
		elseif ( showCallme == true and showWhosaid == false ) then
			-- BlinkBanner함수는 작은 글자로 표시해줍니다.
			BlinkBanner(arg2..": "..arg1, color);

			-- 큰글자로 보여주길 원한다면 이 주석을 해제합니다.
--			RaidWarningFrame:AddMessage(arg2..": "..arg1, color.r, color.g, color.b, 1.0);

			-- 경매장 종료할때 나오는 '땡땡'소리입니다.
--			PlaySound("AuctionWindowClose"); -- 이것을 원한다면 주석을 해제해주십시오.
--			PlaySound("AuctionWindowOpen");

			-- 외부사운드파일 불러들여서 소리를 냅니다. (자신이 원하는 wav파일을 불러올수도 있습니다. 하지만 크면 리소스에 영향을 줄수 있습니다)
			PlaySoundFile("Interface\\AddOns\\BlinkCallMe\\BlinkCallMe.wav");
		elseif ( showCallme == false and showWhosaid == true ) then
			-- BlinkBanner함수는 작은 글자로 표시해줍니다.
--			BlinkBanner(arg2..": "..arg1, color);

			RaidWarningFrame:AddMessage(arg2..": "..arg1, color.r, color.g, color.b, 1.0);

			-- 경매장 종료할때 나오는 '땡땡'소리입니다.
--			PlaySound("AuctionWindowClose"); -- 이것을 원한다면 주석을 해제해주십시오.
			PlaySound("RaidWarning");

			-- 외부사운드파일 불러들여서 소리를 냅니다. (자신이 원하는 wav파일을 불러올수도 있습니다. 하지만 크면 리소스에 영향을 줄수 있습니다)
			-- PlaySoundFile("Interface\\AddOns\\BlinkCallMe\\BlinkCallMe.wav");
		end
	end
end

-- CallMe
function BlinkCallMe_AddText(text)
	local exist = false;
	if not text then return; end
	if text=="" then return; end
	for i=1,#BlinkCallMeNames,1 do
		if( BlinkCallMeNames[i] == text )then
			exist = true;
		end
	end
	if( exist == false )then
		table.insert(BlinkCallMeNames,text);
	end
end

function BlinkCallMe_RemoveText(t)
	local _type = "string";
	local rn = 0;
	if( type(t) == "number" )then
		_type = "number";
		rn = t;
	end
	if( _type == "string" )then
		for i=1,#BlinkCallMeNames,1 do
			if( BlinkCallMeNames[i] == t )then
				rn = i;
			end
		end
	end
	table.remove(BlinkCallMeNames,rn);
end

function BlinkCallMeList()
	BlinkPrint("-----------------");
	if( #BlinkCallMeNames > 0 )then
		for i=1,#BlinkCallMeNames do
			BlinkPrint(i..". "..BlinkCallMeNames[i]);
		end
	else
		BlinkPrint("    없습니다^^");
	end
	BlinkPrint("-----------------");
end

-- WhoSaid
function BlinkWhoSaid_AddText(text)
	local exist = false;
	if not text then return; end
	if text=="" then return; end
	for i=1,#BlinkWhoSaidNames,1 do
		if( BlinkWhoSaidNames[i] == text )then
			exist = true;
		end
	end
	if( exist == false )then
		table.insert(BlinkWhoSaidNames,text);
	end
end

function BlinkWhoSaid_RemoveText(t)
	local _type = "string";
	local rn = 0;
	if( type(t) == "number" )then
		_type = "number";
		rn = t;
	end
	if( _type == "string" )then
		for i=1,#BlinkWhoSaidNames,1 do
			if( BlinkWhoSaidNames[i] == t )then
				rn = i;
			end
		end
	end
	table.remove(BlinkWhoSaidNames,rn);
end

function BlinkWhoSaidList()
	BlinkPrint("-----------------");
	if( #BlinkWhoSaidNames > 0 )then
		for i=1,#BlinkWhoSaidNames do
			BlinkPrint(i..". "..BlinkWhoSaidNames[i]);
		end
	else
		BlinkPrint("    없습니다^^");
	end
	BlinkPrint("-----------------");
end

-- display text
function BlinkBanner(msg,color)
	if( not color )then
		color.r = 1.0;
		color.g = 0.2;
		color.b = 0.2;
	end
	if( UIErrorsFrame )then
		UIErrorsFrame:AddMessage(msg, color.r, color.g, color.b, 1.0, UIERRORS_HOLD_TIME);
	end
end

-- slash commands
function BlinkCallMe_SlashCmd(msg)
	local cmd = gsub(msg, "%s*([^%s]+).*", "%1");
	local name = gsub(msg, "%s*([^%s]+)%s*(.*)", "%2");

	if( strlen(cmd) <= 0 ) then
		BlinkCallMe_Usage();
		return;
	end

	if( cmd == "추가" )then
		if( not name or name == "" )then
			BlinkCallMe_Usage();
			return;
		end
		BlinkCallMe_AddText(name);
		BlinkCallMeList();
		return;
	elseif( cmd == "제거" )then
		if( not name or name == "" )then
			BlinkCallMe_Usage();
			return;
		end
		BlinkCallMe_RemoveText(name);
		BlinkCallMeList();
		return;
	elseif( cmd == "보기" or cmd == "목록" )then
		BlinkCallMeList();
		return;
	end
	BlinkCallMe_Usage();
end

function BlinkCallMe_Usage()
	BlinkPrint("나를 불러주세요~ 사용방법:");
	BlinkPrint(" /나를불러주세요          : 도움말");
	BlinkPrint(" /나를불러주세요 추가 추가할이름   : 이름을 추가합니다.");
	BlinkPrint(" /나를불러주세요 제거 이름(또는 번호) : 등록되어있는 이름을 제거합니다.");
	BlinkPrint(" /나를불러주세요 보기(또는 목록) : 등록되어있는 이름을 확인합니다.");
end

function BlinkCallMe_WhoSaidSlashCmd(msg)
	local cmd = gsub(msg, "%s*([^%s]+).*", "%1");
	local name = gsub(msg, "%s*([^%s]+)%s*(.*)", "%2");

	if( strlen(cmd) <= 0 ) then
		BlinkWhoSaid_Usage();
		return;
	end

	if( cmd == "추가" )then
		if( not name or name == "" )then
			BlinkWhoSaid_Usage();
			return;
		end
		BlinkWhoSaid_AddText(name);
		BlinkWhoSaidList();
		return;
	elseif( cmd == "제거" )then
		if( not name or name == "" )then
			BlinkWhoSaid_Usage();
			return;
		end
		BlinkWhoSaid_RemoveText(name);
		BlinkWhoSaidList();
		return;
	elseif( cmd == "보기" or cmd == "목록" )then
		BlinkWhoSaidList();
		return;
	end
	BlinkWhoSaid_Usage();
end

function BlinkWhoSaid_Usage()
	BlinkPrint("누가말하나~ 사용방법:");
	BlinkPrint(" /누가말하나          : 도움말");
	BlinkPrint(" /누가말하나 추가 추가할이름   : 이름을 추가합니다.");
	BlinkPrint(" /누가말하나 제거 이름(또는 번호) : 등록되어있는 이름을 제거합니다.");
	BlinkPrint(" /누가말하나 보기(또는 목록) : 등록되어있는 이름을 확인합니다.");
end

function BCM_BlinkModRegister()
	if ( not BlinkMod_RegisterMenu ) then
		return;
	end

	local info;

	-- tier 1
	info = {};
	info.parentkey = "SELF";
	info.key = "BCMMAIN";
	info.text = "나를불러주세요";
	info.hasArrow = 1;
	info.tooltipTitle = "나를불러주세요";
	info.tooltipText = "채팅창에서 지정한 문구를 발견하면 사용자에게 표시해줍니다.";
	info.notCheckable = 1;
	BlinkMod_RegisterMenu( info, 1 );

		-- tier 2 : parent = BCMMAIN
		info = {};
		info.parentkey = "BCMMAIN";
		info.key = "BCMTITLE";
		info.text = "나를불러주세요";
		info.isTitle = 1;
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

		info = {};
		info.parentkey = "BCMMAIN";
		info.key = "BCMADDCALLME";
		info.text = "추가하기";
		info.tooltipTitle = "추가하기";
		info.tooltipText = "강조할 문구를 추가합니다.";
		info.ClickFunction = BCM_BM_AddCallMeClick;
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

		info = {};
		info.parentkey = "BCMMAIN";
		info.key = "BCMLIST";
		info.hasArrow = 1;
		info.text = "목록 및 제거하기";
		info.tooltipTitle = "목록 및 제거하기";
		info.tooltipText = "등록된 문구를 확인하고 삭제할수있습니다.";
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

			-- tier 3 : parent = BCMLIST
			for i=1,15,1 do
				info = {};
				info.parentkey = "BCMLIST";
				info.key = "BCMLIST"..i;
				info.text = i..". 문구";
				info.tooltipTitle = "세트1";
				info.tooltipText = "목록에서 제거하시려면 클릭하세요.";
				info.ClickFunction = getglobal("BCM_BM_Remove"..i.."Click");
				info.GetNameFunction = getglobal("BCM_BM_Remove"..i.."Name");
				info.ShowHideFunction = getglobal("BCM_BM_Remove"..i.."Show");
				info.notCheckable = 1;
				BlinkMod_RegisterMenu( info, 3 );
			end


	-- tier 1
	info = {};
	info.parentkey = "SELF";
	info.key = "BWSMAIN";
	info.text = "누가말하나?";
	info.hasArrow = 1;
	info.tooltipTitle = "누가말하나?";
	info.tooltipText = "채팅창에서 지정한 플레이어가 말하면 사용자에게 표시해줍니다.";
	info.notCheckable = 1;
	BlinkMod_RegisterMenu( info, 1 );

		-- tier 2 : parent = BWSMAIN
		info = {};
		info.parentkey = "BWSMAIN";
		info.key = "BWSTITLE";
		info.text = "누가말하나?";
		info.isTitle = 1;
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

		info = {};
		info.parentkey = "BWSMAIN";
		info.key = "BWSADDWHOSAID";
		info.text = "추가하기";
		info.tooltipTitle = "추가하기";
		info.tooltipText = "강조할 플레이어를 추가합니다.";
		info.ClickFunction = BCM_BM_AddWhoSaidClick;
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

		info = {};
		info.parentkey = "BWSMAIN";
		info.key = "BWSLIST";
		info.hasArrow = 1;
		info.text = "목록 및 제거하기";
		info.tooltipTitle = "목록 및 제거하기";
		info.tooltipText = "등록된 플레이어를 확인하고 삭제할수있습니다.";
		info.notCheckable = 1;
		BlinkMod_RegisterMenu( info, 2 );

			-- tier 3 : parent = BCMLIST
			for i=1,15,1 do
				info = {};
				info.parentkey = "BWSLIST";
				info.key = "BWSLIST"..i;
				info.text = i..". 문구";
				info.tooltipTitle = "세트1";
				info.tooltipText = "목록에서 제거하시려면 클릭하세요.";
				info.ClickFunction = getglobal("BCM_BM_TWRemove"..i.."Click");
				info.GetNameFunction = getglobal("BCM_BM_TWRemove"..i.."Name");
				info.ShowHideFunction = getglobal("BCM_BM_TWRemove"..i.."Show");
				info.notCheckable = 1;
				BlinkMod_RegisterMenu( info, 3 );
			end

end

-- CallMe
function BCM_BM_AddCallMeClick()
	StaticPopup_Show("ADD_CALLME");
end

function BCM_BM_RemoveClick(number)
	if ( number ) then
		number = 0 + number;
		BlinkCallMe_RemoveText(number);
	end
end

function BCM_BM_RemoveName(number)
	if( BlinkCallMeNames[number] )then
		return number..". "..BlinkCallMeNames[number];
	end
end

function BCM_BM_RemoveShow(number)
	if ( BlinkCallMeNames[number] )then
		return true;
	else
		return false;
	end
end

function BCM_BM_Remove1Click() BCM_BM_RemoveClick(1); end
function BCM_BM_Remove1Name() return BCM_BM_RemoveName(1); end
function BCM_BM_Remove1Show() return BCM_BM_RemoveShow(1); end

function BCM_BM_Remove2Click() BCM_BM_RemoveClick(2); end
function BCM_BM_Remove2Name() return BCM_BM_RemoveName(2); end
function BCM_BM_Remove2Show() return BCM_BM_RemoveShow(2); end

function BCM_BM_Remove3Click() BCM_BM_RemoveClick(3); end
function BCM_BM_Remove3Name() return BCM_BM_RemoveName(3); end
function BCM_BM_Remove3Show() return BCM_BM_RemoveShow(3); end

function BCM_BM_Remove4Click() BCM_BM_RemoveClick(4); end
function BCM_BM_Remove4Name() return BCM_BM_RemoveName(4); end
function BCM_BM_Remove4Show() return BCM_BM_RemoveShow(4); end

function BCM_BM_Remove5Click() BCM_BM_RemoveClick(5); end
function BCM_BM_Remove5Name() return BCM_BM_RemoveName(5); end
function BCM_BM_Remove5Show() return BCM_BM_RemoveShow(5); end

function BCM_BM_Remove6Click() BCM_BM_RemoveClick(6); end
function BCM_BM_Remove6Name() return BCM_BM_RemoveName(6); end
function BCM_BM_Remove6Show() return BCM_BM_RemoveShow(6); end

function BCM_BM_Remove7Click() BCM_BM_RemoveClick(7); end
function BCM_BM_Remove7Name() return BCM_BM_RemoveName(7); end
function BCM_BM_Remove7Show() return BCM_BM_RemoveShow(7); end

function BCM_BM_Remove8Click() BCM_BM_RemoveClick(8); end
function BCM_BM_Remove8Name() return BCM_BM_RemoveName(8); end
function BCM_BM_Remove8Show() return BCM_BM_RemoveShow(8); end

function BCM_BM_Remove9Click() BCM_BM_RemoveClick(9); end
function BCM_BM_Remove9Name() return BCM_BM_RemoveName(9); end
function BCM_BM_Remove9Show() return BCM_BM_RemoveShow(9); end

function BCM_BM_Remove10Click() BCM_BM_RemoveClick(10); end
function BCM_BM_Remove10Name() return BCM_BM_RemoveName(10); end
function BCM_BM_Remove10Show() return BCM_BM_RemoveShow(10); end

function BCM_BM_Remove11Click() BCM_BM_RemoveClick(11); end
function BCM_BM_Remove11Name() return BCM_BM_RemoveName(11); end
function BCM_BM_Remove11Show() return BCM_BM_RemoveShow(11); end

function BCM_BM_Remove12Click() BCM_BM_RemoveClick(12); end
function BCM_BM_Remove12Name() return BCM_BM_RemoveName(12); end
function BCM_BM_Remove12Show() return BCM_BM_RemoveShow(12); end

function BCM_BM_Remove13Click() BCM_BM_RemoveClick(13); end
function BCM_BM_Remove13Name() return BCM_BM_RemoveName(13); end
function BCM_BM_Remove13Show() return BCM_BM_RemoveShow(13); end

function BCM_BM_Remove14Click() BCM_BM_RemoveClick(14); end
function BCM_BM_Remove14Name() return BCM_BM_RemoveName(14); end
function BCM_BM_Remove14Show() return BCM_BM_RemoveShow(14); end

function BCM_BM_Remove15Click() BCM_BM_RemoveClick(15); end
function BCM_BM_Remove15Name() return BCM_BM_RemoveName(15); end
function BCM_BM_Remove15Show() return BCM_BM_RemoveShow(15); end

StaticPopupDialogs["ADD_CALLME"] = {
	text = "채팅창에서 강조할 문구를 입력해주십시오.\n채팅창에 입력한 문구가 올라오면 '띵~'소리와 함께 화면중앙에 표시합니다.",
	button1 = TEXT(ACCEPT),
	button2 = TEXT(CANCEL),
	hasEditBox = 1,
	maxLetters = 12,
	OnAccept = function()
		local editBox = getglobal(this:GetParent():GetName().."EditBox");
		BlinkCallMe_AddText(editBox:GetText());
	end,
	OnShow = function()
		getglobal(this:GetName().."EditBox"):SetFocus();
	end,
	OnHide = function()
		if ( ChatFrameEditBox:IsVisible() ) then
			ChatFrameEditBox:SetFocus();
		end
		getglobal(this:GetName().."EditBox"):SetText("");
	end,
	EditBoxOnEnterPressed = function()
		local editBox = getglobal(this:GetParent():GetName().."EditBox");
		BlinkCallMe_AddText(editBox:GetText());
		this:GetParent():Hide();
	end,
	EditBoxOnEscapePressed = function()
		this:GetParent():Hide();
	end,
	timeout = 0,
	exclusive = 1,
	whileDead = 1
};

-- WhoSaid
function BCM_BM_AddWhoSaidClick()
	StaticPopup_Show("ADD_WHOSAID");
end

function BCM_BM_TWRemoveClick(number)
	if ( number ) then
		number = 0 + number;
		BlinkWhoSaid_RemoveText(number);
	end
end

function BCM_BM_TWRemoveName(number)
	if( BlinkWhoSaidNames[number] )then
		return number..". "..BlinkWhoSaidNames[number];
	end
end

function BCM_BM_TWRemoveShow(number)
	if ( BlinkWhoSaidNames[number] )then
		return true;
	else
		return false;
	end
end

function BCM_BM_TWRemove1Click() BCM_BM_TWRemoveClick(1); end
function BCM_BM_TWRemove1Name() return BCM_BM_TWRemoveName(1); end
function BCM_BM_TWRemove1Show() return BCM_BM_TWRemoveShow(1); end

function BCM_BM_TWRemove2Click() BCM_BM_TWRemoveClick(2); end
function BCM_BM_TWRemove2Name() return BCM_BM_TWRemoveName(2); end
function BCM_BM_TWRemove2Show() return BCM_BM_TWRemoveShow(2); end

function BCM_BM_TWRemove3Click() BCM_BM_TWRemoveClick(3); end
function BCM_BM_TWRemove3Name() return BCM_BM_TWRemoveName(3); end
function BCM_BM_TWRemove3Show() return BCM_BM_TWRemoveShow(3); end

function BCM_BM_TWRemove4Click() BCM_BM_TWRemoveClick(4); end
function BCM_BM_TWRemove4Name() return BCM_BM_TWRemoveName(4); end
function BCM_BM_TWRemove4Show() return BCM_BM_TWRemoveShow(4); end

function BCM_BM_TWRemove5Click() BCM_BM_TWRemoveClick(5); end
function BCM_BM_TWRemove5Name() return BCM_BM_TWRemoveName(5); end
function BCM_BM_TWRemove5Show() return BCM_BM_TWRemoveShow(5); end

function BCM_BM_TWRemove6Click() BCM_BM_TWRemoveClick(6); end
function BCM_BM_TWRemove6Name() return BCM_BM_TWRemoveName(6); end
function BCM_BM_TWRemove6Show() return BCM_BM_TWRemoveShow(6); end

function BCM_BM_TWRemove7Click() BCM_BM_TWRemoveClick(7); end
function BCM_BM_TWRemove7Name() return BCM_BM_TWRemoveName(7); end
function BCM_BM_TWRemove7Show() return BCM_BM_TWRemoveShow(7); end

function BCM_BM_TWRemove8Click() BCM_BM_TWRemoveClick(8); end
function BCM_BM_TWRemove8Name() return BCM_BM_TWRemoveName(8); end
function BCM_BM_TWRemove8Show() return BCM_BM_TWRemoveShow(8); end

function BCM_BM_TWRemove9Click() BCM_BM_TWRemoveClick(9); end
function BCM_BM_TWRemove9Name() return BCM_BM_TWRemoveName(9); end
function BCM_BM_TWRemove9Show() return BCM_BM_TWRemoveShow(9); end

function BCM_BM_TWRemove10Click() BCM_BM_TWRemoveClick(10); end
function BCM_BM_TWRemove10Name() return BCM_BM_TWRemoveName(10); end
function BCM_BM_TWRemove10Show() return BCM_BM_TWRemoveShow(10); end

function BCM_BM_TWRemove11Click() BCM_BM_TWRemoveClick(11); end
function BCM_BM_TWRemove11Name() return BCM_BM_TWRemoveName(11); end
function BCM_BM_TWRemove11Show() return BCM_BM_TWRemoveShow(11); end

function BCM_BM_TWRemove12Click() BCM_BM_TWRemoveClick(12); end
function BCM_BM_TWRemove12Name() return BCM_BM_TWRemoveName(12); end
function BCM_BM_TWRemove12Show() return BCM_BM_TWRemoveShow(12); end

function BCM_BM_TWRemove13Click() BCM_BM_TWRemoveClick(13); end
function BCM_BM_TWRemove13Name() return BCM_BM_TWRemoveName(13); end
function BCM_BM_TWRemove13Show() return BCM_BM_TWRemoveShow(13); end

function BCM_BM_TWRemove14Click() BCM_BM_TWRemoveClick(14); end
function BCM_BM_TWRemove14Name() return BCM_BM_TWRemoveName(14); end
function BCM_BM_TWRemove14Show() return BCM_BM_TWRemoveShow(14); end

function BCM_BM_TWRemove15Click() BCM_BM_TWRemoveClick(15); end
function BCM_BM_TWRemove15Name() return BCM_BM_TWRemoveName(15); end
function BCM_BM_TWRemove15Show() return BCM_BM_TWRemoveShow(15); end

StaticPopupDialogs["ADD_WHOSAID"] = {
	text = "채팅창에 강조할 유저이름을 입력해주십시오.\n채팅창에 지정한 유저가 말을하면 '띵~'소리와 함께 화면중앙에 표시합니다.",
	button1 = TEXT(ACCEPT),
	button2 = TEXT(CANCEL),
	hasEditBox = 1,
	maxLetters = 12,
	OnAccept = function()
		local editBox = getglobal(this:GetParent():GetName().."EditBox");
		BlinkWhoSaid_AddText(editBox:GetText());
	end,
	OnShow = function()
		getglobal(this:GetName().."EditBox"):SetFocus();
	end,
	OnHide = function()
		if ( ChatFrameEditBox:IsVisible() ) then
			ChatFrameEditBox:SetFocus();
		end
		getglobal(this:GetName().."EditBox"):SetText("");
	end,
	EditBoxOnEnterPressed = function()
		local editBox = getglobal(this:GetParent():GetName().."EditBox");
		BlinkWhoSaid_AddText(editBox:GetText());
		this:GetParent():Hide();
	end,
	EditBoxOnEscapePressed = function()
		this:GetParent():Hide();
	end,
	timeout = 0,
	exclusive = 1,
	whileDead = 1
};
