This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
forked from gnwl/NotGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.lua
165 lines (141 loc) · 5.96 KB
/
options.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
local L = AceLibrary("AceLocale-2.2"):new("NotGrid")
local DefaultOptions = {
["version"] = 1.129, -- will be the commit number from now on.
["versionchecking"] = true,
["unitwidth"] = 36,
["unitheight"] = 36,
["unitborder"] = 2,
["unitpadding"] = 2,
["unitbgcolor"] = {0,0,0,0.4},
["unitbordercolor"] = {0,0,0,0.8},
["unithealthorientation"] = 1,
["unithealthbartexture"] = "Interface\\AddOns\\NotGrid\\media\\Striped",
["unithealthbarcolor"] = {39/255,186/255,42/255,1},
["unithealthbarbgcolor"] = {0,0,0,0.1},
["unithealthbarbgtexture"] = "Interface\\Buttons\\WHITE8X8",
["unitfont"] = "Fonts\\ARIALN.TTF",
["unitnamehealthtextcolor"] = {1,1,1,1},
["unitnamehealthtextsize"] = 12,
["unithealcommbarcolor"] = {32/255,112/255,11/255,1},
["unithealcommtextcolor"] = {39/255,186/255,42/255,1},
["unithealcommtextsize"] = 10,
["unithealcommtextoffx"] = 0,
["unithealcommtextoffy"] = -10,
["unittrackingiconsize"] = 6,
["unittrackingiconborder"] = 1,
["unittrackingiconbordercolor"] = {0,0,0,1},
["showpowerbar"] = false,
["powersize"] = 3, -- this will be width if the player chooses to make it Verical, or height if they make it Horizontal
["powerposition"] = 3, -- 1=top,2=bottom,3=left,4=right
["colorpowerbarbgbytype"] = false,
["unitpowerbarbgcolor"] = {0,0,0,0.1},
["trackingicon1"] = {"Rejuvenation","Regrowth","Renew",}, -- potentially be better to have the auraname/spelltype be the key, but that introduces other problems to work around
["trackingicon1invert"] = false,
["trackingicon1color"] = {0.37,0.83,0.38},
["trackingicon2"] = {"",},
["trackingicon2invert"] = false,
["trackingicon2color"] = {0.20,0.60,1.00},
["trackingicon3"] = {"Magic",},
["trackingicon3invert"] = false,
["trackingicon3color"] = {0.20,0.60,1.00},
["trackingicon4"] = {"Poison",},
["trackingicon4invert"] = false,
["trackingicon4color"] = {0.00,0.60,0},
["trackingicon5"] = {"Curse",},
["trackingicon5invert"] = false,
["trackingicon5color"] = {0.60,0.00,1.00},
["trackingicon6"] = {"Disease",},
["trackingicon6invert"] = false,
["trackingicon6color"] = {0.60,0.40,0},
["trackingicon7"] = {"Mortal Strike","Mortal Wound","Veil of Shadow","Curse of the Deadwood","Blood Fury","Wound Poison","Hex of Weakness",},
["trackingicon7invert"] = false,
["trackingicon7color"] = {0.80,0,0},
["trackingicon8"] = {"",},
["trackingicon8invert"] = false,
["trackingicon8color"] = {0.20,0.60,1.00},
["trackaggro"] = true,
["aggrowarningcolor"] = {150/255,10/255,10/255,0.8},
["trackmana"] = true,
["manawarningcolor"] = {42/255,69/255,117/255,0.8},
["tracktarget"] = false,
["targetcolor"] = {1,1,1,0.8},
["containerpoint"] = "CENTER",
["containeroffx"] = 0,
["containeroffy"] = 0,
["unitnamehealthoffx"] = 0,
["unitnamehealthoffy"] = 0,
["healththreshhold"] = 90,
["manathreshhold"] = 20,
["namelength"] = 3,
["ooralpha"] = 0.5,
["useproximity"] = true,
["proximityrate"] = 1,
["proximityleeway"] = 4,
["colorunitnamehealthbyclass"] = true,
["colorunithealthbarbyclass"] = true,
["colorunithealthbarbgbyclass"] = false,
["usetbcshamancolor"] = true,
["usepetcolor"] = true,
["petcolor"] = {1,0.74,0},
["smartcenter"] = false,
["showhealcommtext"] = true,
["showhealcommbar"] = true,
["usemapdistances"] = true,
["showwhilesolo"] = true,
["showinparty"] = true,
["showpartyinraid"] = false,
["showpets"] = false,
["showblizzframes"] = true,
["growthdirection"] = 1, -- 1: Group Left to Right, 2: Group Right to Left, 3: Group Top to Bottom, 4: Group Bottom to Top, 5: Unit Top to Bottom.. etc
["cliquehook"] = false, -- keep default false to avoid confusion from new users
["configmode"] = false,
["disablemouseoverincombat"] = false,
["borderartwork"] = false,
["draggable"] = false,
["showmenuhint"] = true,
}
function NotGrid:SetDefaultOptions() -- this will run on initialization and make sure everything is set. We can also use it if we wipe the NotGridOptions table and want to load it up with defaults
for key,value in DefaultOptions do
if not NotGridOptions[key] and not (not NotGridOptions[key] and type(NotGridOptions[key]) == "boolean") then -- if this wasn't set from the saved variable load
NotGridOptions[key] = value
end
end
--if the current version is older than a commit that caused a config change, then set the affected configs back to default
if NotGridOptions.version < 1.112 and type(NotGridOptions.trackingicon1) ~= "table" then -- means they're using old aura handling and we need strings to be tables
for i=1,8 do
NotGridOptions["trackingicon"..i] = DefaultOptions["trackingicon"..i]
end
end
if NotGridOptions.version < 1.106 and NotGridOptions.containerpoint ~= "CENTER" then -- means they used the old drag positioning and it will be set relative to TOPLEFT
NotGridOptions.containerpoint = DefaultOptions.containerpoint
NotGridOptions.containeroffx = DefaultOptions.containeroffx
NotGridOptions.containeroffy = DefaultOptions.containeroffy
end
if NotGridOptions.version < 1.104 and type(NotGridOptions.unithealthorientation) ~= "number" then -- means they used the old editbox config and it will be set as "VERTICAL"/"HORIZONTAL"
NotGridOptions.unithealthorientation = DefaultOptions.unithealthorientation
end
NotGridOptions.version = DefaultOptions.version --update the version
end
--------------------
-- Slash Commands --
--------------------
SLASH_NOTGRID1 = "/notgrid"
SLASH_NOTGRID2 = "/ng"
function SlashCmdList.NOTGRID(msg, editbox)
if msg == "reset" then
for key,value in DefaultOptions do
NotGridOptions[key] = value
end
ReloadUI() -- we have to reloadui to make the config menu update as well
elseif msg == "grid" then
NotGrid.o.unithealthbartexture = "Interface\\AddOns\\NotGrid\\media\\GridGradient"
NotGrid.o.unithealthbarbgtexture = "Interface\\AddOns\\NotGrid\\media\\GridGradient"
NotGrid.o.unithealthbarcolor = {0,0,0,0.65}
NotGrid.o.unithealthbarbgcolor = {0,0,0,1}
NotGrid.o.colorunithealthbarbyclass = false
NotGrid.o.colorunithealthbarbgbyclass = true
ReloadUI()
else
NotGridOptionsMenu:Show()
end
end