From 5315268d255d87733ceac7652860304211a70e54 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Mon, 9 Feb 2015 20:36:57 +0100 Subject: [PATCH] Added methods to options module to get option values. --- src/options.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/options.lua b/src/options.lua index 5390be3..73df7e9 100644 --- a/src/options.lua +++ b/src/options.lua @@ -1,3 +1,10 @@ +-- +-- options.lua +-- +-- Contains options setup and management +-- + + local addonName, addonTable = ... -- Set up module @@ -56,7 +63,7 @@ local function createOptionsTable() max = 100, step = 1, name = "Min Parses Per Player/Fight", - desc = "The minimum number of parses to keep for a specific player and fight. These parses will not be removed even if they are older than the max parse age.", + desc = "The minimum number of parses to keep for a specific player, spec and fight. These parses will not be removed even if they are older than the max parse age.", disabled = function() return not addon.db.realm.options.purgeEnabled; end, } }, @@ -87,6 +94,22 @@ function options:ShowOptionsFrame() InterfaceOptionsFrame_OpenToCategory(self.optionsFrame); end +-- +-- Helper Methods for accessing db option properties +-- + +function options:GetPurgeEnabled() + return addon.db.realm.options["purgeEnabled"]; +end + +function options:GetPurgeMaxParseAge() + return addon.db.realm.options["purgeMaxParseAge"]; +end + +function options:GetPurgeMinPlayerParsesPerFight() + return addon.db.realm.options["purgeMinPlayerParsesPerFight"]; +end + function options:OnEnable() LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable(addonName, options.GetOptionsTable); self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(addonName); -- 1.7.9.5