Quantcast

Da new option and some BS

Darthpred [06-21-15 - 09:29]
Da new option and some BS
Filename
ElvUI_SLE/core/globals.lua
ElvUI_SLE/core/modules.lua
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/load_modules.xml
ElvUI_SLE/modules/raidroleicons.lua
ElvUI_SLE/options/unitframes_c.lua
diff --git a/ElvUI_SLE/core/globals.lua b/ElvUI_SLE/core/globals.lua
index 72e0ed7..576e647 100755
--- a/ElvUI_SLE/core/globals.lua
+++ b/ElvUI_SLE/core/globals.lua
@@ -71,6 +71,7 @@ SLE.SpecialChatIcons = {
 			["Рыжа"] = friend,
 			["Шензори"] = classTable.hunter,
 			--Some people
+			["Маразм"] = classTable.shaman,
 			["Брэгар"] = test
 		},
 		["Пиратскаябухта"] = {
diff --git a/ElvUI_SLE/core/modules.lua b/ElvUI_SLE/core/modules.lua
index c1192b3..6be7ad1 100644
--- a/ElvUI_SLE/core/modules.lua
+++ b/ElvUI_SLE/core/modules.lua
@@ -25,6 +25,7 @@ local modules = {
 	['SLE_Garrison'] = { 'AceEvent-3.0' },
 	['SLE_ErrorFrame'] = { },
 	['SLE_Quests'] = { 'AceEvent-3.0' },
+	['SLE_BlizzRaid'] = { 'AceEvent-3.0' },
 	['SLE'] = {'AceHook-3.0', 'AceEvent-3.0'},
 }

diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index e8cd11e..974cc0c 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -460,6 +460,8 @@ P['sle'] = {
 			['garrison'] = "FULL",
 		},
 	},
+
+	['blizzraidroles'] = false,
 }

 P.chat.editboxhistory = 5
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 87a16b9..e5820e8 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -473,6 +473,9 @@ L["This options will allow you to detach your classbar from player's frame and m
 L["Power Text Position"] = "Позиция текста ресурса"
 L["Position power text on this bar of chosen frame"] = "Позиционировать текст ресурса относительно выбранной полосы на каждой рамке"
 L["Choose what icon set will unitframes and chat use."] = "Набор иконок для использования на рамках юнитов и в чате."
+L["Use role icons in Blizzard raid manager"] = "Показывать иконки в менеджере рейда Blizzard"
+L["Show/hide role icons in raid manager \"O -> Raid\"."] = "Показывать/скрывать иконки роли в менеджере рейда \"О -> Рейд\""
+

 L["Enhanced Vehicle Bar"] = "Улучшенный контроль машин"
 L["A different look/feel vehicle bar based on work by Azilroka"] = "Использовать улучшенную панель управления средствами передвижения, основанную на коде Azilroka"
diff --git a/ElvUI_SLE/modules/load_modules.xml b/ElvUI_SLE/modules/load_modules.xml
index 0c71cd8..6629c56 100644
--- a/ElvUI_SLE/modules/load_modules.xml
+++ b/ElvUI_SLE/modules/load_modules.xml
@@ -28,4 +28,5 @@
 	<Script file='vehicle.lua'/>
 	<Script file='errorframe.lua'/>
 	<Script file='quests.lua'/>
+	<Script file='raidroleicons.lua'/>
 </Ui>
diff --git a/ElvUI_SLE/modules/raidroleicons.lua b/ElvUI_SLE/modules/raidroleicons.lua
new file mode 100644
index 0000000..b36f2bb
--- /dev/null
+++ b/ElvUI_SLE/modules/raidroleicons.lua
@@ -0,0 +1,42 @@
+local E, L, V, P, G = unpack(ElvUI);
+local SLE = E:GetModule('SLE')
+local B = E:GetModule("SLE_BlizzRaid")
+local GetNumGroupMembers, IsInGroup, IsInRaid = GetNumGroupMembers, IsInGroup, IsInRaid
+local PLAYER_REALM = gsub(E.myrealm,'[%s%-]','')
+
+function B:CreateAndUpdateIcons()
+	-- if not IsInGroup() then return end
+	local members = GetNumGroupMembers()
+	for i = 1, members do
+		local frame = _G["RaidGroupButton"..i]
+		if frame and not frame.subframes then E:Delay(1, B.CreateAndUpdateIcons); return end
+		if not frame.sleicon then
+			frame.sleicon = CreateFrame("Frame", nil, frame)
+			frame.sleicon:SetSize(14, 14)
+			frame.sleicon:SetPoint("RIGHT", frame.subframes.level, "LEFT", 2, 0)
+			RaiseFrameLevel(frame.sleicon)
+
+			frame.sleicon.texture = frame.sleicon:CreateTexture(nil, "OVERLAY")
+			frame.sleicon.texture:SetAllPoints(frame.sleicon)
+		end
+		local unit = IsInRaid() and "raid" or "party"
+		local role = UnitGroupRolesAssigned(unit..i)
+		local name, realm = UnitName(unit..i)
+		local texture = ""
+		if (role and role ~= "NONE") and name and E.db.sle.roleicons and E.db.sle.blizzraidroles then
+			name = (realm and realm ~= '') and name..'-'..realm or name ..'-'..PLAYER_REALM;
+			texture = SLE.rolePaths[E.db.sle.roleicons][role]
+		end
+		frame.sleicon.texture:SetTexture(texture)
+	end
+end
+
+function B:RaidLoaded(event, addon)
+	if addon == "Blizzard_RaidUI" then
+		B:CreateAndUpdateIcons()
+		hooksecurefunc("RaidGroupFrame_Update", B.CreateAndUpdateIcons)
+		self:UnregisterEvent(event)
+	end
+end
+
+B:RegisterEvent("ADDON_LOADED", "RaidLoaded")
\ No newline at end of file
diff --git a/ElvUI_SLE/options/unitframes_c.lua b/ElvUI_SLE/options/unitframes_c.lua
index b8d14d0..6186d58 100644
--- a/ElvUI_SLE/options/unitframes_c.lua
+++ b/ElvUI_SLE/options/unitframes_c.lua
@@ -70,6 +70,14 @@ local function configTable()
 							["MiirGui"] = "MiirGui ".."|T"..texPath.."mg-tank:15:15:0:0:64:64:2:56:2:56|t ".."|T"..texPath.."mg-healer:15:15:0:0:64:64:2:56:2:56|t ".."|T"..texPath.."mg-dps:15:15:0:0:64:64:2:56:2:56|t ",
 						},
 					},
+					blizzraidroles = {
+						order = 3,
+						type = "toggle",
+						name = L["Use role icons in Blizzard raid manager"],
+						desc = L["Show/hide role icons in raid manager \"O -> Raid\"."],
+						get = function(info) return E.db.sle.blizzraidroles end,
+						set = function(info, value) E.db.sle.blizzraidroles = value; E:GetModule("SLE_BlizzRaid"):CreateAndUpdateIcons() end,
+					},
 				},
 			},
 		},