Quantcast

Merge branch 'master' into mop

F16Gaming [08-09-12 - 02:55]
Merge branch 'master' into mop
Filename
Events_Chat.lua
SummonManager.lua
locales/enUS.lua
locales/svSE.lua
diff --git a/Events_Chat.lua b/Events_Chat.lua
index f4f4a1a..e5cb1f6 100644
--- a/Events_Chat.lua
+++ b/Events_Chat.lua
@@ -22,6 +22,7 @@ local select = select

 -- API Upvalues
 local BNET_CLIENT_WOW = BNET_CLIENT_WOW
+local UnitFactionGroup = UnitFactionGroup

 local C = Command
 local CM = C.ChatManager
diff --git a/SummonManager.lua b/SummonManager.lua
index ea7c972..3c33062 100644
--- a/SummonManager.lua
+++ b/SummonManager.lua
@@ -26,11 +26,14 @@ local tostring = tostring
 local CreateFrame = CreateFrame
 local CancelSummon = CancelSummon
 local ConfirmSummon = ConfirmSummon
+local StaticPopup_Hide = StaticPopup_Hide
 local PlayerCanTeleport = PlayerCanTeleport
+local StaticPopup_Visible = StaticPopup_Visible
 local GetSummonConfirmSummoner = GetSummonConfirmSummoner
 local GetSummonConfirmAreaName = GetSummonConfirmAreaName
 local GetSummonConfirmTimeLeft = GetSummonConfirmTimeLeft

+
 local C = Command

 C.SummonManager = {}
@@ -38,8 +41,9 @@ C.SummonManager = {}
 local L = C.LocaleManager
 local SM = C.SummonManager
 local CM
+local GT = C.GroupTools

-local MAX_TIME = 110 -- 1 minute 50 seconds, summons expire after 2 minutes (usually)
+local MAX_DELAY = 110 -- 1 minute 50 seconds, summons expire after 2 minutes (usually)

 local LastSummoner

@@ -107,7 +111,9 @@ function SM:Announce()

 	LastSummoner = name

-	CM:SendMessage(L("SM_ONSUMMON"):format(area, name, left), "SMART")
+	local channel = "SMART"
+	if not GT:IsGroup() then channel = "WHISPER" end
+	CM:SendMessage(L("SM_ONSUMMON"):format(area, name, left), channel, name)
 end

 function SM:AcceptSummon()
@@ -117,6 +123,10 @@ function SM:AcceptSummon()

 	ConfirmSummon()

+	if StaticPopup_Visible("CONFIRM_SUMMON") then
+		StaticPopup_Hide("CONFIRM_SUMMON")
+	end
+
 	return "SM_ACCEPTED", {LastSummoner}
 end

@@ -127,6 +137,10 @@ function SM:DeclineSummon()

 	CancelSummon()

+	if StaticPopup_Visible("CONFIRM_SUMMON") then
+		StaticPopup_Hide("CONFIRM_SUMMON")
+	end
+
 	return "SM_DECLINED", {LastSummoner}
 end

@@ -165,7 +179,7 @@ function SM:GetDelay()
 		end
 		return ("%d:%s"):format(minutes, seconds)
 	end
-	return ("%d %s"):format(total, L("SECONDS"))
+	return ("%d %s"):format(total, L("SECONDS"):lower())
 end

 function SM:GetRawDelay()
@@ -188,7 +202,7 @@ function SM:SetDelay(amount)
 			end
 			return "SM_SETDELAY_SUCCESS", {("%d:%s"):format(minutes, seconds)}
 		else
-			return "SM_SETDELAY_SUCCESS", {("%d %s"):format(amount, L("SECONDS"))}
+			return "SM_SETDELAY_SUCCESS", {("%d %s"):format(amount, L("SECONDS"):lower())}
 		end
 	end
 	return "SM_SETDELAY_INSTANT"
diff --git a/locales/enUS.lua b/locales/enUS.lua
index 2537e7a..4320683 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -124,7 +124,7 @@ local L = {
 	CM_SET_SM_ISENABLED = "SummonManager is enabled.",
 	CM_SET_SM_ISDISABLED = "SummonManager is disabled.",
 	CM_SET_SM_DELAY_CURRENT = "The current delay for summon announcements is %s.",
-	CM_SET_SM_DELAY_USAGE = "Usage: set sm delay <delay>"
+	CM_SET_SM_DELAY_USAGE = "Usage: set sm delay <delay>",
 	CM_SET_SM_USAGE = "Usage: set sm [enable|disable|toggle|delay]",

 	CM_LOCALE_HELP = "Change locale settings.",
diff --git a/locales/svSE.lua b/locales/svSE.lua
index 240b73a..ede6e08 100644
--- a/locales/svSE.lua
+++ b/locales/svSE.lua
@@ -124,7 +124,7 @@ local L = {
 	CM_SET_SM_ISENABLED = "SummonManager is enabled.",
 	CM_SET_SM_ISDISABLED = "SummonManager is disabled.",
 	CM_SET_SM_DELAY_CURRENT = "The current delay for summon announcements is %s.",
-	CM_SET_SM_DELAY_USAGE = "Usage: set sm delay <delay>"
+	CM_SET_SM_DELAY_USAGE = "Usage: set sm delay <delay>",
 	CM_SET_SM_USAGE = "Användning: set sm [enable|disable|toggle|delay]",

 	CM_LOCALE_HELP = "Change locale settings.",