vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | NL_NEED_FRAME_LEFT_INDENT = 20 |
2 | NL_NEED_FRAME_TOP_INDENT = 30 |
||
3 | NL_NEED_FRAME_SPACING = 25 |
||
4 | |||
5 | NLNeedFrameName = "NLConfigNeedsFrame"; |
||
6 | NLMainFrameName = "NLConfigFrame"; |
||
7 | |||
8 | |||
9 | |||
10 | -------------------------------------------------------- |
||
11 | -- NL_GetConfigForCurrentPlayer |
||
12 | -------- |
||
13 | -- Get the configuration for this player. |
||
14 | -------------------------------------------------------- |
||
15 | function NL_GetConfigForCurrentPlayer( doDefaults ) |
||
16 | if( NL_CONFIGS == nil ) then |
||
17 | NL_CONFIGS = {}; |
||
18 | end |
||
19 | |||
20 | local sName = UnitName("player") .. " " .. GetCVar("realmName"); |
||
21 | |||
22 | if( doDefaults or NL_CONFIGS[sName] == nil or NL_CONFIGS[sName].Version == nil or NL_CONFIGS[sName].Version < 2 ) then |
||
23 | NL_CONFIGS[sName] = {}; |
||
24 | if( NL_CONFIGS[sName].Version and NL_CONFIGS[sName].Version < 2 ) then |
||
25 | NL_Msg("IMPORTANT NOTE: Version 2.00 of Needy List has reset your Needy List configuration."); |
||
26 | end |
||
27 | NL_CONFIGS[sName].Needs = {}; |
||
28 | |||
29 | local NeedsList = NL_CONFIGS[sName].Needs; |
||
30 | local numNeeds = 0; |
||
31 | |||
32 | -- top priority need is always STICKIED |
||
33 | NeedsList[numNeeds] = {Name="NeverShow",Toggle=0,BGColor={r = 0.0, g = 0.0, b = 1.0, opacity = 0.5},Filter={Type="Units",Names=""}}; |
||
34 | numNeeds = numNeeds + 1; |
||
35 | |||
36 | NeedsList[numNeeds] = {Name="Sticky",Toggle=0,BGColor={r = 0.0, g = 0.0, b = 1.0, opacity = 0.5},Filter={Type="Units",Names=""}}; |
||
37 | numNeeds = numNeeds + 1; |
||
38 | |||
39 | NeedsList[numNeeds] = {Name="Health",Toggle=1,BGColor={r = 1.0, g = 0.0, b = 0.0, opacity = 0.8},Threshold=75,Filter={Type="Everyone"}}; |
||
40 | NL_CONFIGS[sName].HealthNeedIndex = numNeeds; |
||
41 | numNeeds = numNeeds + 1; |
||
42 | |||
43 | if( NL_PLAYERCLASS == NL_PRIEST_NAME or NL_PLAYERCLASS == NL_PALADIN_NAME ) then |
||
44 | NeedsList[numNeeds] = {Name="Magic",Type="DEBUFF",Toggle=1,BGColor={r = 1.0, g = 0.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
45 | numNeeds = numNeeds + 1; |
||
46 | end |
||
47 | |||
48 | if( NL_PLAYERCLASS == NL_SHAMAN_NAME or NL_PLAYERCLASS == NL_DRUID_NAME or NL_PLAYERCLASS == NL_PALADIN_NAME ) then |
||
49 | NeedsList[numNeeds] = {Name="Poison",Type="DEBUFF",Toggle=1,BGColor={r = 1.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
50 | numNeeds = numNeeds + 1; |
||
51 | end |
||
52 | |||
53 | if( NL_PLAYERCLASS == NL_SHAMAN_NAME or NL_PLAYERCLASS == NL_PRIEST_NAME or NL_PLAYERCLASS == NL_PALADIN_NAME ) then |
||
54 | NeedsList[numNeeds] = {Name="Disease",Type="DEBUFF",Toggle=1,BGColor={r = 0.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
55 | numNeeds = numNeeds + 1; |
||
56 | end |
||
57 | |||
58 | if( NL_PLAYERCLASS == NL_MAGE_NAME or NL_PLAYERCLASS == NL_DRUID_NAME ) then |
||
59 | NeedsList[numNeeds] = {Name="Curse",Type="DEBUFF",Toggle=1,BGColor={r = 0.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
60 | numNeeds = numNeeds + 1; |
||
61 | end |
||
62 | |||
63 | -- for priests specifically |
||
64 | if( NL_PLAYERCLASS == NL_PRIEST_NAME ) then |
||
65 | |||
66 | NeedsList[numNeeds] = {Name="Fortitude",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
67 | numNeeds = numNeeds + 1; |
||
68 | |||
69 | NeedsList[numNeeds] = {Name="ShadowProt",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
70 | numNeeds = numNeeds + 1; |
||
71 | |||
72 | NeedsList[numNeeds] = {Name="PWShield",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 0.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
73 | numNeeds = numNeeds + 1; |
||
74 | |||
75 | NeedsList[numNeeds] = {Name="DivineSpirit",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8}}; |
||
76 | NeedsList[numNeeds].Filter = NLGetSpecialFilter(true, false); |
||
77 | numNeeds = numNeeds + 1; |
||
78 | |||
79 | if( UnitRace("player") == NL_DWARF_NAME ) then |
||
80 | NeedsList[numNeeds] = {Name="FearWard",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 1.0, b = 0.5, opacity = 0.8},Filter={Type="Everyone"}}; |
||
81 | numNeeds = numNeeds + 1; |
||
82 | elseif( UnitRace("player") == NL_UNDEAD_NAME ) then |
||
83 | NeedsList[numNeeds] = {Name="TouchOfWeakness",Type="BUFF",Toggle=0,BGColor={r = 0.0, g = 1.0, b = 0.5, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
84 | numNeeds = numNeeds + 1; |
||
85 | elseif( UnitRace("player") == NL_HUMAN_NAME ) then |
||
86 | NeedsList[numNeeds] = {Name="Feedback",Type="BUFF",Toggle=0,BGColor={r = 0.8, g = 0.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
87 | numNeeds = numNeeds + 1; |
||
88 | elseif( UnitRace("player") == NL_TROLL_NAME ) then |
||
89 | NeedsList[numNeeds] = {Name="Shadowguard",Type="BUFF",Toggle=0,BGColor={r = 0.8, g = 0.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
90 | numNeeds = numNeeds + 1; |
||
91 | end |
||
92 | |||
93 | NeedsList[numNeeds] = {Name="InnerFire",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 0.5, b = 0.5, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
94 | numNeeds = numNeeds + 1; |
||
95 | end |
||
96 | |||
97 | -- for druids specifically |
||
98 | if( NL_PLAYERCLASS == NL_DRUID_NAME ) then |
||
99 | NeedsList[numNeeds] = {Name="Mark",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
100 | numNeeds = numNeeds + 1; |
||
101 | |||
102 | NeedsList[numNeeds] = {Name="Thorns",Type="BUFF",Toggle=0,BGColor={r = 0.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
103 | numNeeds = numNeeds + 1; |
||
104 | |||
105 | NeedsList[numNeeds] = {Name="Clarity",Type="BUFF",Toggle=0,BGColor={r = 0.4, g = 0.4, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
106 | numNeeds = numNeeds + 1; |
||
107 | |||
108 | NeedsList[numNeeds] = {Name="Mana",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Threshold=25}; |
||
109 | NeedsList[numNeeds].Filter = NLGetSpecialFilter(true, false); |
||
110 | NL_CONFIGS[sName].ManaNeedIndex = numNeeds; |
||
111 | numNeeds = numNeeds + 1; |
||
112 | end |
||
113 | |||
114 | -- for paladins specifically |
||
115 | if( NL_PLAYERCLASS == NL_PALADIN_NAME ) then |
||
116 | NeedsList[numNeeds] = {Name="BlessMight",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
117 | numNeeds = numNeeds + 1; |
||
118 | |||
119 | NeedsList[numNeeds] = {Name="BlessWisdom",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8}}; |
||
120 | NeedsList[numNeeds].Filter = NLGetSpecialFilter(true, false); |
||
121 | numNeeds = numNeeds + 1; |
||
122 | |||
123 | NeedsList[numNeeds] = {Name="BlessKings",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
124 | numNeeds = numNeeds + 1; |
||
125 | |||
126 | NeedsList[numNeeds] = {Name="BlessSalvation",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
127 | numNeeds = numNeeds + 1; |
||
128 | |||
129 | NeedsList[numNeeds] = {Name="BlessLight",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
130 | numNeeds = numNeeds + 1; |
||
131 | |||
132 | NeedsList[numNeeds] = {Name="BlessSanctuary",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
133 | numNeeds = numNeeds + 1; |
||
134 | end |
||
135 | |||
136 | -- for mages specifically |
||
137 | if( NL_PLAYERCLASS == NL_MAGE_NAME ) then |
||
138 | NeedsList[numNeeds] = {Name="Intellect",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8}}; |
||
139 | NeedsList[numNeeds].Filter = NLGetSpecialFilter(true, false); |
||
140 | numNeeds = numNeeds + 1; |
||
141 | |||
142 | NeedsList[numNeeds] = {Name="MageArmor",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
143 | numNeeds = numNeeds + 1; |
||
144 | |||
145 | NeedsList[numNeeds] = {Name="FrostArmor",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
146 | numNeeds = numNeeds + 1; |
||
147 | |||
148 | NeedsList[numNeeds] = {Name="IceArmor",Type="BUFF",Toggle=1,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
149 | numNeeds = numNeeds + 1; |
||
150 | |||
151 | NeedsList[numNeeds] = {Name="DampenMagic",Type="BUFF",Toggle=0,BGColor={r = 0.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
152 | numNeeds = numNeeds + 1; |
||
153 | |||
154 | NeedsList[numNeeds] = {Name="AmplifyMagic",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 0.5, b = 0.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
155 | numNeeds = numNeeds + 1; |
||
156 | |||
157 | NeedsList[numNeeds] = {Name="ManaShield",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
158 | numNeeds = numNeeds + 1; |
||
159 | end |
||
160 | |||
161 | -- for warlocks specifically |
||
162 | if( NL_PLAYERCLASS == NL_WARLOCK_NAME ) then |
||
163 | NeedsList[numNeeds] = {Name="Soulstone",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
164 | numNeeds = numNeeds + 1; |
||
165 | |||
166 | NeedsList[numNeeds] = {Name="DemonArmor",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 0.0, b = 0.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
167 | numNeeds = numNeeds + 1; |
||
168 | |||
169 | NeedsList[numNeeds] = {Name="DemonSkin",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 0.0, b = 0.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
170 | numNeeds = numNeeds + 1; |
||
171 | |||
172 | NeedsList[numNeeds] = {Name="UnendingBreath",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
173 | numNeeds = numNeeds + 1; |
||
174 | |||
175 | NeedsList[numNeeds] = {Name="DetectLesserInvis",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
176 | numNeeds = numNeeds + 1; |
||
177 | |||
178 | NeedsList[numNeeds] = {Name="DetectInvis",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
179 | numNeeds = numNeeds + 1; |
||
180 | |||
181 | NeedsList[numNeeds] = {Name="DetectGreaterInvis",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Everyone"}}; |
||
182 | numNeeds = numNeeds + 1; |
||
183 | |||
184 | NeedsList[numNeeds] = {Name="FireShield",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 0.5, b = 0.5, opacity = 0.8}}; |
||
185 | NeedsList[numNeeds].Filter = NLGetSpecialFilter(false, true); |
||
186 | NeedsList[numNeeds].Filter.Demon = false; |
||
187 | numNeeds = numNeeds + 1; |
||
188 | end |
||
189 | |||
190 | -- for rogues specifically |
||
191 | if( NL_PLAYERCLASS == NL_ROGUE_NAME ) then |
||
192 | NeedsList[numNeeds] = {Name="DetectTraps",Type="BUFF",Toggle=1,BGColor={r = 1.0, g = 1.0, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
193 | numNeeds = numNeeds + 1; |
||
194 | |||
195 | NeedsList[numNeeds] = {Name="MainhandPoison",Type="ENCHANT",Toggle=0,BGColor={r = 0.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
196 | numNeeds = numNeeds + 1; |
||
197 | |||
198 | NeedsList[numNeeds] = {Name="OffhandPoison",Type="ENCHANT",Toggle=0,BGColor={r = 0.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
199 | numNeeds = numNeeds + 1; |
||
200 | end |
||
201 | |||
202 | -- for shaman specifically |
||
203 | if( NL_PLAYERCLASS == NL_SHAMAN_NAME ) then |
||
204 | NeedsList[numNeeds] = {Name="LightningShield",Type="BUFF",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
205 | numNeeds = numNeeds + 1; |
||
206 | |||
207 | NeedsList[numNeeds] = {Name="Rockbiter",Type="ENCHANT",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 0.5, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
208 | numNeeds = numNeeds + 1; |
||
209 | |||
210 | NeedsList[numNeeds] = {Name="Flametongue",Type="ENCHANT",Toggle=0,BGColor={r = 1.0, g = 0.5, b = 0.5, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
211 | numNeeds = numNeeds + 1; |
||
212 | |||
213 | NeedsList[numNeeds] = {Name="Frostbrand",Type="ENCHANT",Toggle=0,BGColor={r = 0.5, g = 0.5, b = 1.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
214 | numNeeds = numNeeds + 1; |
||
215 | |||
216 | NeedsList[numNeeds] = {Name="Windfury",Type="ENCHANT",Toggle=0,BGColor={r = 0.75, g = 0.75, b = 0.75, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
217 | numNeeds = numNeeds + 1; |
||
218 | end |
||
219 | |||
220 | if( NL_PLAYERCLASS == NL_PRIEST_NAME or NL_PLAYERCLASS == NL_DRUID_NAME or NL_PLAYERCLASS == NL_PALADIN_NAME or NL_PLAYERCLASS == NL_SHAMAN_NAME ) then |
||
221 | NeedsList[numNeeds] = {Name="Resurrection",Toggle=1,BGColor={r = 0.5, g = 0.5, b = 0.5, opacity = 0.8},Filter={Type="Everyone"}}; |
||
222 | NL_CONFIGS[sName].ResurrectionNeedIndex = numNeeds; |
||
223 | numNeeds = numNeeds + 1; |
||
224 | end |
||
225 | |||
226 | if( NL_PLAYERCLASS == NL_WARRIOR_NAME ) then |
||
227 | NeedsList[numNeeds] = {Name="BattleShout",Type="BUFF",Toggle=0,BGColor={r = 1.0, g = 0.5, b = 0.5, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
228 | numNeeds = numNeeds + 1; |
||
229 | end |
||
230 | |||
231 | NeedsList[numNeeds] = {Name="WellFed",Toggle=0,BGColor={r = 1.0, g = 1.0, b = 0.0, opacity = 0.8},Filter={Type="Units",Names=UnitName("player")}}; |
||
232 | numNeeds = numNeeds + 1; |
||
233 | |||
234 | NL_CONFIGS[sName].NumNeeds = numNeeds; |
||
235 | end |
||
236 | |||
237 | if( not NL_CONFIGS[sName].ShowHealth ) then NL_CONFIGS[sName].ShowHealth = 1; end |
||
238 | if( not NL_CONFIGS[sName].ShowMana ) then NL_CONFIGS[sName].ShowMana = 0; end |
||
239 | if( not NL_CONFIGS[sName].FrameWidth ) then NL_CONFIGS[sName].FrameWidth = 80; end |
||
240 | if( not NL_CONFIGS[sName].MaxUnits ) then NL_CONFIGS[sName].MaxUnits = 10; end |
||
241 | if( not NL_CONFIGS[sName].UseWhenSolo ) then NL_CONFIGS[sName].UseWhenSolo = 1; end |
||
242 | if( not NL_CONFIGS[sName].UseInParty ) then NL_CONFIGS[sName].UseInParty = 1; end |
||
243 | if( not NL_CONFIGS[sName].UseInRaid ) then NL_CONFIGS[sName].UseInRaid = 1; end |
||
244 | if( not NL_CONFIGS[sName].AutoSort ) then NL_CONFIGS[sName].AutoSort = 1; end |
||
245 | if( not NL_CONFIGS[sName].ShowTooltips ) then NL_CONFIGS[sName].ShowTooltips = 1; end |
||
246 | if( not NL_CONFIGS[sName].LargeNeedIcons ) then NL_CONFIGS[sName].LargeNeedIcons = 1; end |
||
247 | if( not NL_CONFIGS[sName].UseCastParty ) then NL_CONFIGS[sName].UseCastParty = 1; end |
||
248 | if( not NL_CONFIGS[sName].ShowHealthNum ) then NL_CONFIGS[sName].ShowHealthNum = 0; end |
||
249 | if( not NL_CONFIGS[sName].ShowNeeds ) then NL_CONFIGS[sName].ShowNeeds = 1; end |
||
250 | if( not NL_CONFIGS[sName].ShowBuffs ) then NL_CONFIGS[sName].ShowBuffs = 0; end |
||
251 | if( not NL_CONFIGS[sName].ShowHealBuffs ) then NL_CONFIGS[sName].ShowHealBuffs = 0; end |
||
252 | if( not NL_CONFIGS[sName].ShowDebuffs ) then NL_CONFIGS[sName].ShowDebuffs = 0; end |
||
253 | if( not NL_CONFIGS[sName].SwapNeedsAndDetails ) then |
||
254 | NL_CONFIGS[sName].SwapNeedsAndDetails = 0; |
||
255 | elseif( NL_CONFIGS[sName].SwapNeedsAndDetails == 1 ) then |
||
256 | -- change the anchor points on all the needs and details frames |
||
257 | NLAnchorDetails("target", false); |
||
258 | NLAnchorDetails("player", false); |
||
259 | NLAnchorDetails("pet", false); |
||
260 | for i=1, 4 do |
||
261 | NLAnchorDetails("party"..i, false); |
||
262 | NLAnchorDetails("partypet"..i, false); |
||
263 | end |
||
264 | for i=1, 40 do |
||
265 | NLAnchorDetails("raid"..i, false); |
||
266 | NLAnchorDetails("raidpet"..i, false); |
||
267 | end |
||
268 | end |
||
269 | if( not NL_CONFIGS[sName].InvertList ) then NL_CONFIGS[sName].InvertList = 0; end |
||
270 | if( not NL_CONFIGS[sName].ColorByClass ) then NL_CONFIGS[sName].ColorByClass = 0; end |
||
271 | if( not NL_CONFIGS[sName].BlackListDelay ) then NL_CONFIGS[sName].BlackListDelay = 5; end |
||
272 | if( not NL_CONFIGS[sName].ShowTargetFrame ) then NL_CONFIGS[sName].ShowTargetFrame = 0; end |
||
273 | if( not NL_CONFIGS[sName].ResurrectionNeedIndex ) then |
||
274 | for i=1, NL_CONFIGS[sName].NumNeeds - 1 do |
||
275 | if( NL_CONFIGS[sName].Needs[i].Name == "Resurrection" ) then |
||
276 | NL_CONFIGS[sName].ResurrectionNeedIndex = i; |
||
277 | end |
||
278 | end |
||
279 | end |
||
280 | |||
281 | NL_CONFIGS[sName].Version = NL_CURRENT_VERSION; |
||
282 | |||
283 | return NL_CONFIGS[sName]; |
||
284 | end |
||
285 | |||
286 | function NLGetSpecialFilter(manaUsersOnly, myPartyOnly) |
||
287 | local newFilter = {}; |
||
288 | |||
289 | newFilter.Type="Multi"; |
||
290 | newFilter.Names = {}; |
||
291 | newFilter.Names[NL_PRIEST_NAME]=true; |
||
292 | newFilter.Names[NL_MAGE_NAME]=true; |
||
293 | newFilter.Names[NL_HUNTER_NAME]=true; |
||
294 | newFilter.Names[NL_WARLOCK_NAME]=true; |
||
295 | newFilter.Names[NL_DRUID_NAME]=true; |
||
296 | newFilter.Names[NL_DEMON_NAME]=true; |
||
297 | if( not manaUsersOnly ) then |
||
298 | newFilter.Names[NL_WARRIOR_NAME] = true; |
||
299 | newFilter.Names[NL_ROGUE_NAME] = true; |
||
300 | newFilter.Names[NL_BEAST_NAME] = true; |
||
301 | end |
||
302 | if( UnitFactionGroup( "player" ) == "Horde" ) then |
||
303 | newFilter.Names[NL_SHAMAN_NAME] = true; |
||
304 | else |
||
305 | newFilter.Names[NL_PALADIN_NAME] = true; |
||
306 | end |
||
307 | if( not myPartyOnly ) then |
||
308 | newFilter.Names["Party 1"] = true; |
||
309 | newFilter.Names["Party 2"] = true; |
||
310 | newFilter.Names["Party 3"] = true; |
||
311 | newFilter.Names["Party 4"] = true; |
||
312 | newFilter.Names["Party 5"] = true; |
||
313 | newFilter.Names["Party 6"] = true; |
||
314 | newFilter.Names["Party 7"] = true; |
||
315 | newFilter.Names["Party 8"] = true; |
||
316 | end |
||
317 | newFilter.Names["My Party"] = true; |
||
318 | |||
319 | return newFilter; |
||
320 | end |
||
321 | |||
322 | function NL_InitializeConfigFrame() |
||
323 | getglobal(NLMainFrameName .. "_CheckButtonUseWhenSolo"):SetChecked(NLConfig.UseWhenSolo); |
||
324 | getglobal(NLMainFrameName .. "_CheckButtonUseInParty"):SetChecked(NLConfig.UseInParty); |
||
325 | getglobal(NLMainFrameName .. "_CheckButtonUseInRaid"):SetChecked(NLConfig.UseInRaid); |
||
326 | getglobal(NLMainFrameName .. "_CheckButtonShowHealth"):SetChecked(NLConfig.ShowHealth); |
||
327 | getglobal(NLMainFrameName .. "_CheckButtonShowMana"):SetChecked(NLConfig.ShowMana); |
||
328 | getglobal(NLMainFrameName .. "_CheckButtonShowNeeds"):SetChecked(NLConfig.ShowNeeds); |
||
329 | getglobal(NLMainFrameName .. "_CheckButtonShowBuffs"):SetChecked(NLConfig.ShowBuffs); |
||
330 | getglobal(NLMainFrameName .. "_CheckButtonShowHealBuffs"):SetChecked(NLConfig.ShowHealBuffs); |
||
331 | getglobal(NLMainFrameName .. "_CheckButtonShowDebuffs"):SetChecked(NLConfig.ShowDebuffs); |
||
332 | getglobal(NLMainFrameName .. "_CheckButtonSwapNeedsAndDetails"):SetChecked(NLConfig.SwapNeedsAndDetails); |
||
333 | getglobal(NLMainFrameName .. "_CheckButtonUseCastParty"):SetChecked(NLConfig.UseCastParty); |
||
334 | getglobal(NLMainFrameName .. "_CheckButtonShowHealthNum"):SetChecked(NLConfig.ShowHealthNum); |
||
335 | getglobal(NLMainFrameName .. "_CheckButtonShowHealthLost"):SetChecked(NLConfig.ShowHealthLost); |
||
336 | getglobal(NLMainFrameName .. "_CheckButtonAutoSort"):SetChecked(NLConfig.AutoSort); |
||
337 | getglobal(NLMainFrameName .. "_CheckButtonInvertList"):SetChecked(NLConfig.InvertList); |
||
338 | getglobal(NLMainFrameName .. "_CheckButtonShowTooltips"):SetChecked(NLConfig.ShowTooltips); |
||
339 | getglobal(NLMainFrameName .. "_CheckButtonLargeNeedIcons"):SetChecked(NLConfig.LargeNeedIcons); |
||
340 | getglobal(NLMainFrameName .. "_CheckButtonSpellNotify"):SetChecked(NLConfig.SpellNotify); |
||
341 | getglobal(NLMainFrameName .. "_CheckButtonHideHeader"):SetChecked(NLConfig.HideHeader); |
||
342 | getglobal(NLMainFrameName .. "_CheckButtonColorByClass"):SetChecked(NLConfig.ColorByClass); |
||
343 | getglobal(NLMainFrameName .. "_SliderFrameWidth"):SetValue(NLConfig.FrameWidth); |
||
344 | getglobal(NLMainFrameName .. "_BlackListDelay"):SetNumber(NLConfig.BlackListDelay); |
||
345 | getglobal(NLMainFrameName .. "_MaxUnits"):SetNumber(NLConfig.MaxUnits); |
||
346 | getglobal(NLMainFrameName .. "_CheckButtonShowTargetFrame"):SetChecked(NLConfig.ShowTargetFrame); |
||
347 | end |
||
348 | |||
349 | function NL_SaveConfig() |
||
350 | if( getglobal(NLMainFrameName .. "_CheckButtonUseWhenSolo"):GetChecked() == nil ) then |
||
351 | NLConfig.UseWhenSolo = 0; |
||
352 | else |
||
353 | NLConfig.UseWhenSolo = 1; |
||
354 | end |
||
355 | if( getglobal(NLMainFrameName .. "_CheckButtonUseInParty"):GetChecked() == nil ) then |
||
356 | NLConfig.UseInParty = 0; |
||
357 | else |
||
358 | NLConfig.UseInParty = 1; |
||
359 | end |
||
360 | if( getglobal(NLMainFrameName .. "_CheckButtonUseInRaid"):GetChecked() == nil ) then |
||
361 | NLConfig.UseInRaid = 0; |
||
362 | else |
||
363 | NLConfig.UseInRaid = 1; |
||
364 | end |
||
365 | |||
366 | if( getglobal(NLMainFrameName .. "_CheckButtonShowHealth"):GetChecked() == nil ) then |
||
367 | NLConfig.ShowHealth = 0; |
||
368 | else |
||
369 | NLConfig.ShowHealth = 1; |
||
370 | end |
||
371 | if( getglobal(NLMainFrameName .. "_CheckButtonShowMana"):GetChecked() == nil ) then |
||
372 | NLConfig.ShowMana = 0; |
||
373 | else |
||
374 | NLConfig.ShowMana = 1; |
||
375 | end |
||
376 | if( getglobal(NLMainFrameName .. "_CheckButtonShowNeeds"):GetChecked() == nil ) then |
||
377 | NLConfig.ShowNeeds = 0; |
||
378 | else |
||
379 | NLConfig.ShowNeeds = 1; |
||
380 | end |
||
381 | if( getglobal(NLMainFrameName .. "_CheckButtonShowBuffs"):GetChecked() == nil ) then |
||
382 | NLConfig.ShowBuffs = 0; |
||
383 | else |
||
384 | NLConfig.ShowBuffs = 1; |
||
385 | end |
||
386 | if( getglobal(NLMainFrameName .. "_CheckButtonShowHealBuffs"):GetChecked() == nil ) then |
||
387 | NLConfig.ShowHealBuffs = 0; |
||
388 | else |
||
389 | NLConfig.ShowHealBuffs = 1; |
||
390 | end |
||
391 | if( getglobal(NLMainFrameName .. "_CheckButtonShowDebuffs"):GetChecked() == nil ) then |
||
392 | NLConfig.ShowDebuffs = 0; |
||
393 | else |
||
394 | NLConfig.ShowDebuffs = 1; |
||
395 | end |
||
396 | if( getglobal(NLMainFrameName .. "_CheckButtonUseCastParty"):GetChecked() == nil ) then |
||
397 | NLConfig.UseCastParty = 0; |
||
398 | else |
||
399 | NLConfig.UseCastParty = 1; |
||
400 | end |
||
401 | if( getglobal(NLMainFrameName .. "_CheckButtonShowHealthNum"):GetChecked() == nil ) then |
||
402 | NLConfig.ShowHealthNum = 0; |
||
403 | else |
||
404 | NLConfig.ShowHealthNum = 1; |
||
405 | end |
||
406 | if( getglobal(NLMainFrameName .. "_CheckButtonShowHealthLost"):GetChecked() == nil ) then |
||
407 | NLConfig.ShowHealthLost = 0; |
||
408 | else |
||
409 | NLConfig.ShowHealthLost = 1; |
||
410 | end |
||
411 | if( getglobal(NLMainFrameName .. "_CheckButtonAutoSort"):GetChecked() == nil ) then |
||
412 | NLConfig.AutoSort = 0; |
||
413 | else |
||
414 | NLConfig.AutoSort = 1; |
||
415 | end |
||
416 | if( getglobal(NLMainFrameName .. "_CheckButtonSpellNotify"):GetChecked() == nil ) then |
||
417 | NLConfig.SpellNotify = 0; |
||
418 | else |
||
419 | NLConfig.SpellNotify = 1; |
||
420 | end |
||
421 | if( getglobal(NLMainFrameName .. "_CheckButtonHideHeader"):GetChecked() == nil ) then |
||
422 | NLConfig.HideHeader = 0; |
||
423 | else |
||
424 | NLConfig.HideHeader = 1; |
||
425 | end |
||
426 | if( getglobal(NLMainFrameName .. "_CheckButtonShowTooltips"):GetChecked() == nil ) then |
||
427 | NLConfig.ShowTooltips = 0; |
||
428 | else |
||
429 | NLConfig.ShowTooltips = 1; |
||
430 | end |
||
431 | if( getglobal(NLMainFrameName .. "_CheckButtonLargeNeedIcons"):GetChecked() == nil ) then |
||
432 | NLConfig.LargeNeedIcons = 0; |
||
433 | else |
||
434 | NLConfig.LargeNeedIcons = 1; |
||
435 | end |
||
436 | if( getglobal(NLMainFrameName .. "_CheckButtonSwapNeedsAndDetails"):GetChecked() == nil ) then |
||
437 | -- change the anchor points on all the needs and details frames |
||
438 | NLAnchorDetails("target", true); |
||
439 | NLAnchorDetails("player", true); |
||
440 | NLAnchorDetails("pet", true); |
||
441 | for i=1, 4 do |
||
442 | NLAnchorDetails("party"..i, true); |
||
443 | NLAnchorDetails("partypet"..i, true); |
||
444 | end |
||
445 | for i=1, 40 do |
||
446 | NLAnchorDetails("raid"..i, true); |
||
447 | NLAnchorDetails("raidpet"..i, true); |
||
448 | end |
||
449 | NLConfig.SwapNeedsAndDetails = 0; |
||
450 | else |
||
451 | -- change the anchor points on all the needs and details frames |
||
452 | NLAnchorDetails("target", false); |
||
453 | NLAnchorDetails("player", false); |
||
454 | NLAnchorDetails("pet", false); |
||
455 | for i=1, 4 do |
||
456 | NLAnchorDetails("party"..i, false); |
||
457 | NLAnchorDetails("partypet"..i, false); |
||
458 | end |
||
459 | for i=1, 40 do |
||
460 | NLAnchorDetails("raid"..i, false); |
||
461 | NLAnchorDetails("raidpet"..i, false); |
||
462 | end |
||
463 | NLConfig.SwapNeedsAndDetails = 1; |
||
464 | end |
||
465 | if( getglobal(NLMainFrameName .. "_CheckButtonInvertList"):GetChecked() == nil ) then |
||
466 | NLConfig.InvertList = 0; |
||
467 | else |
||
468 | NLConfig.InvertList = 1; |
||
469 | end |
||
470 | |||
471 | if( getglobal(NLMainFrameName .. "_CheckButtonColorByClass"):GetChecked() == nil ) then |
||
472 | NLConfig.ColorByClass = 0; |
||
473 | else |
||
474 | NLConfig.ColorByClass = 1; |
||
475 | end |
||
476 | |||
477 | if( getglobal(NLMainFrameName .. "_CheckButtonShowTargetFrame"):GetChecked() == nil ) then |
||
478 | NLConfig.ShowTargetFrame = 0; |
||
479 | else |
||
480 | NLConfig.ShowTargetFrame = 1; |
||
481 | end |
||
482 | |||
483 | NLConfig.FrameWidth = getglobal(NLMainFrameName .. "_SliderFrameWidth"):GetValue(); |
||
484 | NLConfig.BlackListDelay = getglobal(NLMainFrameName .. "_BlackListDelay"):GetNumber(); |
||
485 | NLConfig.MaxUnits = getglobal(NLMainFrameName .. "_MaxUnits"):GetNumber(); |
||
486 | |||
487 | |||
488 | NL_CheckIfEnabled(); |
||
489 | |||
490 | if( NL_ENABLED ) then |
||
491 | NLHeader:Hide(); |
||
492 | NLHeader:Show(); |
||
493 | end |
||
494 | end |
||
495 | |||
496 | function NLAnchorDetails( member, side ) |
||
497 | if( side ) then |
||
498 | getglobal("NLMember" .. member .. "BuffsDetails"):ClearAllPoints(); |
||
499 | getglobal("NLMember" .. member .. "BuffsDetails"):SetPoint("BOTTOMRIGHT", "NLMember" .. member, "BOTTOMLEFT", 5, 0); |
||
500 | getglobal("NLMember" .. member .. "DebuffsDetails"):ClearAllPoints(); |
||
501 | getglobal("NLMember" .. member .. "DebuffsDetails"):SetPoint("BOTTOMRIGHT", "NLMember" .. member .. "BuffsDetails", "BOTTOMLEFT", 5, 0); |
||
502 | getglobal("NLMember" .. member .. "NeedsDetails"):ClearAllPoints(); |
||
503 | getglobal("NLMember" .. member .. "NeedsDetails"):SetPoint("BOTTOMLEFT", "NLMember" .. member, "BOTTOMRIGHT", -5, 0); |
||
504 | else |
||
505 | getglobal("NLMember" .. member .. "BuffsDetails"):ClearAllPoints(); |
||
506 | getglobal("NLMember" .. member .. "BuffsDetails"):SetPoint("BOTTOMLEFT", "NLMember" .. member, "BOTTOMRIGHT", -5, 0); |
||
507 | getglobal("NLMember" .. member .. "DebuffsDetails"):ClearAllPoints(); |
||
508 | getglobal("NLMember" .. member .. "DebuffsDetails"):SetPoint("BOTTOMLEFT", "NLMember" .. member .. "BuffsDetails", "BOTTOMRIGHT", -5, 0); |
||
509 | getglobal("NLMember" .. member .. "NeedsDetails"):ClearAllPoints(); |
||
510 | getglobal("NLMember" .. member .. "NeedsDetails"):SetPoint("BOTTOMRIGHT", "NLMember" .. member, "BOTTOMLEFT", 5, 0); |
||
511 | end |
||
512 | end |
||
513 | |||
514 | function NL_InitializeConfigSpellsFrame() |
||
515 | if( not NLConfig.HealSpells ) then |
||
516 | return; |
||
517 | end |
||
518 | |||
519 | if( NLConfig.HealSpells[1] ) then |
||
520 | getglobal("NLConfigSpellsFrameHeal1"):SetText(NLConfig.HealSpells[1]); |
||
521 | else |
||
522 | getglobal("NLConfigSpellsFrameHeal1"):SetText(""); |
||
523 | end |
||
524 | if( NLConfig.HealSpells[2] ) then |
||
525 | getglobal("NLConfigSpellsFrameHeal2"):SetText(NLConfig.HealSpells[2]); |
||
526 | else |
||
527 | getglobal("NLConfigSpellsFrameHeal2"):SetText(""); |
||
528 | end |
||
529 | if( NLConfig.HealSpells[3] ) then |
||
530 | getglobal("NLConfigSpellsFrameHeal3"):SetText(NLConfig.HealSpells[3]); |
||
531 | else |
||
532 | getglobal("NLConfigSpellsFrameHeal3"):SetText(""); |
||
533 | end |
||
534 | if( NLConfig.HealSpells[4] ) then |
||
535 | getglobal("NLConfigSpellsFrameHeal4"):SetText(NLConfig.HealSpells[4]); |
||
536 | else |
||
537 | getglobal("NLConfigSpellsFrameHeal4"):SetText(""); |
||
538 | end |
||
539 | if( NLConfig.HealSpells[5] ) then |
||
540 | getglobal("NLConfigSpellsFrameHeal5"):SetText(NLConfig.HealSpells[5]); |
||
541 | else |
||
542 | getglobal("NLConfigSpellsFrameHeal5"):SetText(""); |
||
543 | end |
||
544 | end |
||
545 | |||
546 | function NL_SaveSpellsConfig() |
||
547 | if( not NLConfig.HealSpells ) then |
||
548 | NLConfig.HealSpells = {}; |
||
549 | end |
||
550 | if( getglobal("NLConfigSpellsFrameHeal1"):GetText() == "" ) then |
||
551 | NLConfig.HealSpells[1] = nil; |
||
552 | else |
||
553 | NLConfig.HealSpells[1] = getglobal("NLConfigSpellsFrameHeal1"):GetText(); |
||
554 | end |
||
555 | if( getglobal("NLConfigSpellsFrameHeal2"):GetText() == "" ) then |
||
556 | NLConfig.HealSpells[2] = nil; |
||
557 | else |
||
558 | NLConfig.HealSpells[2] = getglobal("NLConfigSpellsFrameHeal2"):GetText(); |
||
559 | end |
||
560 | if( getglobal("NLConfigSpellsFrameHeal3"):GetText() == "" ) then |
||
561 | NLConfig.HealSpells[3] = nil; |
||
562 | else |
||
563 | NLConfig.HealSpells[3] = getglobal("NLConfigSpellsFrameHeal3"):GetText(); |
||
564 | end |
||
565 | if( getglobal("NLConfigSpellsFrameHeal4"):GetText() == "" ) then |
||
566 | NLConfig.HealSpells[4] = nil; |
||
567 | else |
||
568 | NLConfig.HealSpells[4] = getglobal("NLConfigSpellsFrameHeal4"):GetText(); |
||
569 | end |
||
570 | if( getglobal("NLConfigSpellsFrameHeal5"):GetText() == "" ) then |
||
571 | NLConfig.HealSpells[5] = nil; |
||
572 | else |
||
573 | NLConfig.HealSpells[5] = getglobal("NLConfigSpellsFrameHeal5"):GetText(); |
||
574 | end |
||
575 | end |
||
576 | |||
577 | function NL_InitializeConfigNeedsFrame() |
||
578 | -- loop through all allowed need monitors for this char |
||
579 | for i = 0, NLConfig.NumNeeds - 1 do |
||
580 | local CurrentNeed = NLConfig.Needs[i]; |
||
581 | if( CurrentNeed == nil ) then |
||
582 | return; |
||
583 | end |
||
584 | |||
585 | if( CurrentNeed.Name == "Health" ) then |
||
586 | NLConfigNeedsFrameNeedHealth_EditBox:SetNumber( CurrentNeed.Threshold ); |
||
587 | end |
||
588 | |||
589 | if( CurrentNeed.Name == "Mana" ) then |
||
590 | NLConfigNeedsFrameNeedMana_EditBox:SetNumber( CurrentNeed.Threshold ); |
||
591 | end |
||
592 | |||
593 | local frame = getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name); |
||
594 | |||
595 | frame:ClearAllPoints(); |
||
596 | frame:SetPoint("TOPLEFT", NLNeedFrameName, "TOPLEFT", NL_NEED_FRAME_LEFT_INDENT, -NL_NEED_FRAME_TOP_INDENT - i * NL_NEED_FRAME_SPACING ); |
||
597 | getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name .. "_CheckButton"):SetChecked(CurrentNeed.Toggle); |
||
598 | |||
599 | frame.r = CurrentNeed.BGColor.r; |
||
600 | frame.g = CurrentNeed.BGColor.g; |
||
601 | frame.b = CurrentNeed.BGColor.b; |
||
602 | getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name .. "_ColorSwatchNormalTexture"):SetVertexColor( frame.r, frame.g, frame.b ); |
||
603 | frame.swatchFunc = function() NLConfig_SetColor(CurrentNeed.Name); end; |
||
604 | frame.cancelFunc = function() NLConfig_CancelColor(CurrentNeed.Name); end; |
||
605 | |||
606 | getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name):Show(); |
||
607 | getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name).Priority = i; |
||
608 | |||
609 | if( CurrentNeed.Filter ~= nil ) then |
||
610 | getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name).Filter = CurrentNeed.Filter; |
||
611 | end |
||
612 | end |
||
613 | end |
||
614 | |||
615 | function NL_SaveNeedsConfig() |
||
616 | -- if the frame's priority doesn't match the need priority, update the need priority |
||
617 | for i = 0, NLConfig.NumNeeds - 1 do |
||
618 | local frame = getglobal( NLNeedFrameName .. "Need" .. NLConfig.Needs[i].Name ); |
||
619 | -- move the frame that was |
||
620 | if( frame.Priority ~= i ) then |
||
621 | local tempNeed = NLConfig.Needs[frame.Priority]; |
||
622 | NLConfig.Needs[frame.Priority] = NLConfig.Needs[i]; |
||
623 | NLConfig.Needs[i] = tempNeed; |
||
624 | i = i - 1; |
||
625 | end |
||
626 | end |
||
627 | |||
628 | for i = 0, NLConfig.NumNeeds - 1 do |
||
629 | local CurrentNeed = NLConfig.Needs[i]; |
||
630 | if( CurrentNeed == nil ) then |
||
631 | return; |
||
632 | end |
||
633 | |||
634 | if( CurrentNeed.Name == "Health" ) then |
||
635 | CurrentNeed.Threshold = getglobal(NLNeedFrameName .. "NeedHealth_EditBox"):GetNumber(); |
||
636 | NLConfig.HealthNeedIndex = i; |
||
637 | end |
||
638 | |||
639 | if( CurrentNeed.Name == "Mana" ) then |
||
640 | CurrentNeed.Threshold = getglobal(NLNeedFrameName .. "NeedMana_EditBox"):GetNumber(); |
||
641 | NLConfig.ManaNeedIndex = i; |
||
642 | end |
||
643 | |||
644 | if( CurrentNeed.Name == "Resurrection" ) then |
||
645 | NLConfig.ResurrectionNeedIndex = i; |
||
646 | end |
||
647 | |||
648 | if( getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name .. "_CheckButton"):GetChecked() == nil ) then |
||
649 | CurrentNeed.Toggle = 0; |
||
650 | else |
||
651 | CurrentNeed.Toggle = 1; |
||
652 | end |
||
653 | |||
654 | local frame = getglobal( NLNeedFrameName .. "Need" .. CurrentNeed.Name ); |
||
655 | |||
656 | CurrentNeed.BGColor.r = frame.r; |
||
657 | CurrentNeed.BGColor.g = frame.g; |
||
658 | CurrentNeed.BGColor.b = frame.b; |
||
659 | |||
660 | if( getglobal( NLNeedFrameName .. "Need" .. CurrentNeed.Name ).Filter ~= nil ) then |
||
661 | CurrentNeed.Filter = getglobal(NLNeedFrameName .. "Need" .. CurrentNeed.Name).Filter; |
||
662 | end |
||
663 | end |
||
664 | end |
||
665 | |||
666 | function NL_OpenColorPicker(button) |
||
667 | CloseMenus(); |
||
668 | if ( not button ) then |
||
669 | button = this; |
||
670 | end |
||
671 | ColorPickerFrame.func = button.swatchFunc; |
||
672 | ColorPickerFrame:SetColorRGB(button.r, button.g, button.b); |
||
673 | ColorPickerFrame.previousValues = {r = button.r, g = button.g, b = button.b, opacity = button.opacity}; |
||
674 | ColorPickerFrame.cancelFunc = button.cancelFunc; |
||
675 | ColorPickerFrame:Show(); |
||
676 | end |
||
677 | |||
678 | function NLConfig_SetColor(needName) |
||
679 | local frame = getglobal( NLNeedFrameName .. "Need" .. needName ); |
||
680 | local r,g,b = ColorPickerFrame:GetColorRGB(); |
||
681 | getglobal( NLNeedFrameName .. "Need" .. needName .. "_ColorSwatchNormalTexture"):SetVertexColor(r,g,b); |
||
682 | frame.r = r; |
||
683 | frame.g = g; |
||
684 | frame.b = b; |
||
685 | end |
||
686 | |||
687 | function NLConfig_CancelColor(needName) |
||
688 | local frame = getglobal( NLNeedFrameName .. "Need" .. needName ); |
||
689 | local CurrentNeed = NLConfig.Needs[frame.Priority]; |
||
690 | |||
691 | frame.r = CurrentNeed.BGColor.r; |
||
692 | frame.g = CurrentNeed.BGColor.g; |
||
693 | frame.b = CurrentNeed.BGColor.b; |
||
694 | getglobal( NLNeedFrameName .. "Need" .. needName .. "_ColorSwatchNormalTexture"):SetVertexColor( frame.r, frame.g, frame.b ); |
||
695 | end |
||
696 | |||
697 | function NL_SwapNeedFrames( frame1, frame2 ) |
||
698 | -- swap these frames |
||
699 | local tempPriority = frame1.Priority; |
||
700 | frame1.Priority = frame2.Priority; |
||
701 | frame2.Priority = tempPriority; |
||
702 | |||
703 | frame1:ClearAllPoints(); |
||
704 | frame1:SetPoint("TOPLEFT", NLNeedFrameName, "TOPLEFT", NL_NEED_FRAME_LEFT_INDENT, -NL_NEED_FRAME_TOP_INDENT - frame1.Priority * NL_NEED_FRAME_SPACING ); |
||
705 | frame2:ClearAllPoints(); |
||
706 | frame2:SetPoint("TOPLEFT", NLNeedFrameName, "TOPLEFT", NL_NEED_FRAME_LEFT_INDENT, -NL_NEED_FRAME_TOP_INDENT - frame2.Priority * NL_NEED_FRAME_SPACING ); |
||
707 | end |
||
708 | |||
709 | function NL_PopulateUnitFilterFrame( filter ) |
||
710 | if( filter == nil or filter.Type ~= "Units" ) then |
||
711 | return; |
||
712 | end |
||
713 | |||
714 | if( filter.Names ~= nil ) then |
||
715 | NLFilterListFrameUnitsSubframeNames:SetText( filter.Names ); |
||
716 | else |
||
717 | NLFilterListFrameUnitsSubframeNames:SetText( "" ); |
||
718 | end |
||
719 | end |
||
720 | |||
721 | function NL_PopulatePartyFilterFrame( filter ) |
||
722 | if( filter == nil or filter.Type ~= "Multi" ) then |
||
723 | return; |
||
724 | end |
||
725 | |||
726 | if( filter.Names == nil ) then |
||
727 | filter.Names = {}; |
||
728 | end |
||
729 | |||
730 | for i=1, 8 do |
||
731 | local frame = getglobal( "NLFilterListFrameMultiSubframeParty" .. i ); |
||
732 | if( filter.Names["Party "..i] ) then |
||
733 | frame:SetBackdropColor(0.5, 0.5, 1, 1); |
||
734 | frame.Flagged = true; |
||
735 | else |
||
736 | frame:SetBackdropColor(0, 0, 0.5, 1); |
||
737 | frame.Flagged = false; |
||
738 | end |
||
739 | end |
||
740 | |||
741 | if( filter.Names["My Party"] ) then |
||
742 | NLFilterListFrameMultiSubframeParty9:SetBackdropColor(0.5, 0.5, 1, 1); |
||
743 | NLFilterListFrameMultiSubframeParty9.Flagged = true; |
||
744 | else |
||
745 | NLFilterListFrameMultiSubframeParty9:SetBackdropColor(0, 0, 0.5, 1); |
||
746 | NLFilterListFrameMultiSubframeParty9.Flagged = false; |
||
747 | end |
||
748 | end |
||
749 | |||
750 | function NL_SelectAllPartyFilterFrame() |
||
751 | for i=1, 9 do |
||
752 | local frame = getglobal( "NLFilterListFrameMultiSubframeParty" .. i ); |
||
753 | frame:SetBackdropColor(0.5, 0.5, 1, 1); |
||
754 | frame.Flagged = true; |
||
755 | getglobal(NLFilterListFrame.NeedFrame).Filter.Names[ getglobal( frame:GetName() .. "Text" ):GetText() ] = true; |
||
756 | end |
||
757 | end |
||
758 | |||
759 | function NL_SelectNonePartyFilterFrame() |
||
760 | for i=1, 9 do |
||
761 | local frame = getglobal( "NLFilterListFrameMultiSubframeParty" .. i ); |
||
762 | frame:SetBackdropColor(0, 0, 0.5, 1); |
||
763 | frame.Flagged = false; |
||
764 | getglobal(NLFilterListFrame.NeedFrame).Filter.Names[ getglobal( frame:GetName() .. "Text" ):GetText() ] = false; |
||
765 | end |
||
766 | end |
||
767 | |||
768 | function NL_PopulateClassFilterFrame( filter ) |
||
769 | if( filter == nil or filter.Type ~= "Multi" ) then |
||
770 | return; |
||
771 | end |
||
772 | |||
773 | if( filter.Names == nil ) then |
||
774 | filter.Names = {}; |
||
775 | end |
||
776 | |||
777 | for i = 1, 10 do |
||
778 | local frame = getglobal( "NLFilterListFrameMultiSubframeClass" .. i ); |
||
779 | |||
780 | local class = NLClassLists[i][UnitFactionGroup("player")]; |
||
781 | if( filter.Names[class] ) then |
||
782 | frame:SetBackdropColor(0.5, 0.5, 1, 1); |
||
783 | frame.Flagged = true; |
||
784 | else |
||
785 | frame:SetBackdropColor(0, 0, 0.5, 1); |
||
786 | frame.Flagged = false; |
||
787 | end |
||
788 | frame:Show(); |
||
789 | end |
||
790 | end |
||
791 | |||
792 | function NL_SelectAllClassFilterFrame() |
||
793 | for i = 1, 10 do |
||
794 | local frame = getglobal( "NLFilterListFrameMultiSubframeClass" .. i ); |
||
795 | frame:SetBackdropColor(0.5, 0.5, 1, 1); |
||
796 | frame.Flagged = true; |
||
797 | getglobal(NLFilterListFrame.NeedFrame).Filter.Names[ getglobal( frame:GetName() .. "Text" ):GetText() ] = true; |
||
798 | end |
||
799 | end |
||
800 | |||
801 | function NL_SelectNoneClassFilterFrame() |
||
802 | for i = 1, 10 do |
||
803 | local frame = getglobal( "NLFilterListFrameMultiSubframeClass" .. i ); |
||
804 | frame:SetBackdropColor(0, 0, 0.5, 1); |
||
805 | frame.Flagged = false; |
||
806 | getglobal(NLFilterListFrame.NeedFrame).Filter.Names[ getglobal( frame:GetName() .. "Text" ):GetText() ] = true; |
||
807 | end |
||
808 | end |