GridStatusAurasExt

9 - Add Class Filter to Aura Groups

What is the enhancement in mind? How should it look and feel?

Allow all aura groups to specify which classes they apply to, like standard Grid Auras.

Please provide any additional information below.

Simple, elegant solution provided below. Concept and most code copied from core GridStatusAuras.

@@ -39,6 +39,15 @@
     Poison = {r = 0, g = 0.6, b = 0, a = 1.0},
     Curse = {r = 0.8, g = 0, b = 1, a = 1.0},
 }
+
+local classes = { }
+do
+	local t = { }
+	FillLocalizedClassList(t, false)
+	for token, name in pairs(t) do
+		classes[token:lower()] = name
+	end
+end

@@ -225,6 +234,30 @@
                 end,
                 order = 149,
             }
+	elseif setting == "classes" then
+	    set = {
+		type = "group",
+		name = L["Class Filter"],
+		desc = L["Show status for the selected classes."],
+		order = 150,
+		type = "group", dialogInline = true,
+		args = {},
+	    }
+	    for class, name in pairs(classes) do
+		local class, name = class,name
+		set.args[class] = {
+			type = "toggle",
+			name = name,
+			desc = string.format(L["Show on %s."], name),
+			get = function()
+				return GridStatusAurasExt.db.profile[status][class] ~= false
+			end,
+			set = function(_, v)
+				GridStatusAurasExt.db.profile[status][class] = v
+				GridStatusAurasExt:UpdateAllUnitAuras()
+			end,
+		}
+	    end

@@ -245,7 +278,8 @@
                 "auraheader",
                 "addbyid","addbyname",
                 "colorbytype",
-                "mobauras"})
+                "mobauras",
+		"classes"})

@@ -266,7 +300,7 @@
         end,
         getOpts = function(status)
             local opts = {}
-            addOptionsForSettings(opts, status, {"ignorepets","auraheader","addbyid","addbyname","onlybuffs","onlydebuffs"})
+            addOptionsForSettings(opts, status, {"ignorepets","auraheader","addbyid","addbyname","onlybuffs","onlydebuffs","classes"})

@@ -287,7 +321,7 @@
         end,
         getOpts = function(status)
             local opts = {}
-            addOptionsForSettings(opts, status, {"ignorepets","auraheader","addbyid","addbyname"})
+            addOptionsForSettings(opts, status, {"ignorepets","auraheader","addbyid","addbyname","classes"})

@@ -324,7 +358,7 @@
                     order = 182,
                 },
             }
-            addOptionsForSettings(opts, status, {"ignorepets","auraheader","colorbytype"})
+            addOptionsForSettings(opts, status, {"ignorepets","auraheader","colorbytype","classes"})

@@ -1021,6 +1056,11 @@
     end
     
     local isPet = isGUIDPet(guid)
+    
+    local _, class = UnitClass(unit)
+	if class then
+	    class = strlower(class)
+    end

@@ -1048,7 +1088,7 @@
     for status, data in pairs(groupList) do
         if data.settings.mobAuras == isTarget then
-            if not(data.settings.ignorePets and isPet) and data.active == (not data.settings.allMissing) then
+            if not(data.settings.ignorePets and isPet) and data.active == (not data.settings.allMissing) and data.settings[class] ~= false then
Name Description Size MD5
GridStatusAurasExt.lua Updated File from latest ... 37.1 KiB 4c69e38632bd...
User When Change
JBSil Oct 11, 2011 at 22:39 UTC

Added attachment GridStatusAurasExt.lua

JBSil Oct 11, 2011 at 22:21 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Last updated
Oct 11, 2011
Reported
Oct 11, 2011
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees