Skip to content

Commit 2d264a1

Browse files
committed
moved things around
deleted support for MPlus (anyone even uses chievos there?!) and pvp (what chievos are even relevant in SL?)
1 parent 939991f commit 2d264a1

20 files changed

+653
-1413
lines changed

Config.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
-- upvalue the globals
2+
local _G = getfenv(0)
3+
local LibStub = _G.LibStub
4+
local GetAddOnMetadata = _G.GetAddOnMetadata
5+
local InterfaceOptionsFrame_OpenToCategory = _G.InterfaceOptionsFrame_OpenToCategory
6+
7+
local name = ...
8+
local LazyCurve = LibStub("AceAddon-3.0"):GetAddon(name);
9+
if not LazyCurve then return end
10+
11+
LazyCurve.Config = LazyCurve.Config or {}
12+
local Config = LazyCurve.Config
13+
14+
Config.version = GetAddOnMetadata(name, "Version") or ""
15+
16+
function Config:GetOptions()
17+
return {
18+
type = 'group',
19+
get = function(info) return Config:GetConfig(info[#info]); end,
20+
set = function(info, value) return Config:SetConfig(info[#info], value); end,
21+
args = {
22+
version = {
23+
order = 0,
24+
type = "description",
25+
name = "Version: " .. self.version
26+
},
27+
advertise = {
28+
name = "Selfpromotion",
29+
desc = "Adds <LazyCurve> before each 'LazyCurve' whisper",
30+
descStyle = 'inline',
31+
width = "full",
32+
order = 1,
33+
type = "toggle",
34+
},
35+
whisperOnApply = {
36+
name = "Enable auto-linking on LFG application",
37+
desc = "Automatically whispers your best achievement(s) when applying to a raid.",
38+
descStyle = 'inline',
39+
width = "full",
40+
order = 2,
41+
type = "toggle",
42+
},
43+
disableAutolinkReminder = {
44+
name = "Disable the reminder when automatically whispering",
45+
width = "full",
46+
order = 3,
47+
type = "toggle",
48+
},
49+
mythicThreshold = {
50+
name = "Which mythic boss is the first relevant boss to link together with curve.",
51+
width = 3,
52+
order = 4,
53+
type = "range",
54+
min = 0,
55+
softMax = 10,
56+
step = 1,
57+
bigStep = 1,
58+
},
59+
mythicThresholdDesc = {
60+
type = "description",
61+
order = 5,
62+
name = "Set to 0 to disable linking mythic achievements on LFG applying (except for edge/last boss kill). Set to 1 or higher to start linking achievements from that boss.",
63+
},
64+
},
65+
}
66+
end
67+
68+
function Config:Initialize()
69+
self:RegisterOptions()
70+
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("LazyCurve", "LazyCurve")
71+
end
72+
73+
function Config:RegisterOptions()
74+
LibStub("AceConfig-3.0"):RegisterOptionsTable("LazyCurve", self:GetOptions())
75+
end
76+
77+
function Config:OpenConfig()
78+
-- after a reload, you need to open to category twice to actually open the correct page
79+
InterfaceOptionsFrame_OpenToCategory('LazyCurve')
80+
InterfaceOptionsFrame_OpenToCategory('LazyCurve')
81+
end
82+
83+
function Config:GetConfig(property)
84+
return LazyCurve.DB[property];
85+
end
86+
87+
function Config:SetConfig(property, value)
88+
LazyCurve.DB[property] = value;
89+
end

0 commit comments

Comments
 (0)