Quantcast

Add toggle for icon recycle.

Christopher Rosell [07-01-11 - 01:17]
Add toggle for icon recycle.
Filename
config.lua
kungaloosh.lua
diff --git a/config.lua b/config.lua
index ff39943..cf60ba3 100755
--- a/config.lua
+++ b/config.lua
@@ -126,21 +126,30 @@ options.general = {

 					args = {}
 				},
+				icon_recycle = {
+					name = L["Recycle icons in combat"],
+					desc = L["When this is disabled a icon is not recycled until combat has finished."],
+					type = "toggle",
+					order = 5,
+					set = setprofile,
+					get = getprofile
+				},

-				icon_reuse_time = {
-					name = function(info) return L["Reuse icon from dead mob after %d seconds."]:format(getprofile(info)) end,
-					desc = L["When a mob dies the icon it had will not be reused for a certain amount of time."],
+				icon_recycle_time = {
+					name = function(info) return L["Recycle icon from dead mob after %d seconds."]:format(getprofile(info)) end,
+					desc = L["When a mob dies the icon it had will not be recycled until this time has passed."],
 					type = "range",
-					order = 5,
+					order = 6,
 					width = "double",
 					min = 1,
 					max = 1000,
 					softMin = 1,
-					softMax = 15,
+					softMax = 200,
 					step = 1,

 					set = setprofile,
-					get = getprofile
+					get = getprofile,
+					disabled = function(info) return addon.db.profile.icon_recycle end,
 				},
 			},
 		},
diff --git a/kungaloosh.lua b/kungaloosh.lua
index fdbb7a4..5bfb99e 100755
--- a/kungaloosh.lua
+++ b/kungaloosh.lua
@@ -13,7 +13,8 @@ function addon:OnEnable()
 			dynamic_minthreat = true,
 			enabled_in = { dungeon = true, raid = false },
 			raid_icons = { 8, 7, 1, 2 },
-			icon_reuse_time = 50
+			icon_recycle = true,
+			icon_recycle_time = 50
 		}
 	}
 	self.db = LibStub("AceDB-3.0"):New("KungalooshDB", defaults, true)
@@ -63,8 +64,8 @@ function addon:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, cevent, hidecaster,
                                            dguid, dname, dflags, dflags2)
 	if cevent == "UNIT_DIED" then
 		local icon = self:GetRaidIconByGUID(dguid)
-		if icon then
-			self:ScheduleTimer("ResetIcon", self.db.profile.icon_reuse_time, icon)
+		if icon and self.db.icon_recycle then
+			self:ScheduleTimer("ResetIcon", self.db.profile.icon_recycle_time, icon)
 		end
 	end
 end