vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- Font Colors |
2 | BM_WHITE = HIGHLIGHT_FONT_COLOR_CODE; |
||
3 | BM_RED = RED_FONT_COLOR_CODE; |
||
4 | BM_ORANGE = "|cffff8020"; |
||
5 | BM_YELLOW = "|cffffff20"; |
||
6 | BM_GREEN = GREEN_FONT_COLOR_CODE; |
||
7 | BM_GRAY = GRAY_FONT_COLOR_CODE; |
||
8 | BM_NORMAL = NORMAL_FONT_COLOR_CODE; |
||
9 | BM_FONT_OFF = FONT_COLOR_CODE_CLOSE; |
||
10 | |||
11 | BRL_ZONE_RANGE = BM_WHITE .. BRL_TOOLTIP_CRANGE .. BM_FONT_OFF; |
||
12 | BRL_INSTANCE_TEXT = "%s%s (%d+ " .. BRL_TOOLTIP_TO .. " %d+)" .. BM_FONT_OFF; -- Instance (35+ to 45+) |
||
13 | BRL_WORLDMAP_TEXT = "(%d-%d)" .. "\n\n" .. BM_FONT_OFF; |
||
14 | |||
15 | |||
16 | BM_REC_LEVEL_TOOLTIP_TEXT = ""; |
||
17 | BM_REC_LEVEL_TOOLTIP_SHORT = ""; |
||
18 | BM_REC_ZONE = ""; |
||
19 | BM_PLAYER_LEVEL = 0; |
||
20 | |||
21 | -- ***SAVED VARIABLES*** -- |
||
22 | BRL_STARTUP = {}; |
||
23 | BRL_STARTUP.m_Loaded = false; |
||
24 | BRL_STARTUP.m_strPlayer = ""; |
||
25 | BRL_CONFIG = {}; |
||
26 | |||
27 | -- **Default values** |
||
28 | DEFAULT_BRL_ZONE_INFO_ENABLE = true; |
||
29 | DEFAULT_BRL_TOOLTIP_ENABLE = true; |
||
30 | DEFAULT_BRL_MAP_TEXT_ENABLE = true; |
||
31 | DEFAULT_BRL_TOOLTIP_OFFSET_LEFT = true; |
||
32 | DEFAULT_BRL_TOOLTIP_OFFSET_BOTTOM = true; |
||
33 | DEFAULT_BRL_SHOW_TOOLTIP_FACTION = false; |
||
34 | DEFAULT_BRL_SHOW_TOOLTIP_INSTANCE = true; |
||
35 | DEFAULT_BRL_SHOW_TOOLTIP_CONTINENT= false; |
||
36 | DEFAULT_BRL_BORDER_ALPHASLIDER = 1; |
||
37 | BRL_SET_LEFT_RIGHT = "LEFT"; |
||
38 | BRL_SET_BOTTOM_TOP = "BOTTOM"; |
||
39 | |||
40 | |||
41 | function BM_Rec_Level_OnLoad() |
||
42 | this:RegisterEvent("VARIABLES_LOADED"); |
||
43 | this:RegisterEvent("PLAYER_ENTERING_WORLD"); |
||
44 | end |
||
45 | |||
46 | function BM_Rec_Level_OnEvent() |
||
47 | if (event == "VARIABLES_LOADED") then |
||
48 | BRL_initialize(); |
||
49 | elseif (event == "PLAYER_ENTERING_WORLD" ) then |
||
50 | this:UnregisterEvent("PLAYER_ENTERING_WORLD"); |
||
51 | this:RegisterEvent("PLAYER_LEAVING_WORLD"); |
||
52 | this:RegisterEvent("MINIMAP_ZONE_CHANGED"); |
||
53 | this:RegisterEvent("ZONE_CHANGED_NEW_AREA"); |
||
54 | this:RegisterEvent("PLAYER_LEVEL_UP"); |
||
55 | BM_Rec_Level_Update_Text(); |
||
56 | elseif (event == "PLAYER_LEAVING_WORLD" ) then |
||
57 | this:UnregisterEvent("PLAYER_LEAVING_WORLD"); |
||
58 | this:UnregisterEvent("MINIMAP_ZONE_CHANGED"); |
||
59 | this:UnregisterEvent("ZONE_CHANGED_NEW_AREA"); |
||
60 | this:UnregisterEvent("PLAYER_LEVEL_UP"); |
||
61 | this:RegisterEvent("PLAYER_ENTERING_WORLD"); |
||
62 | else |
||
63 | BM_Rec_Level_Update_Text(); |
||
64 | end |
||
65 | end |
||
66 | |||
67 | function BRL_initialize() |
||
68 | -- double check that we are getting the player's name update |
||
69 | if (BRL_STARTUP.m_Loaded == false) then |
||
70 | -- add the realm to the "player's name" for the config settings |
||
71 | BRL_STARTUP.m_strPlayer = GetCVar("realmName") .. "|" .. UnitName("player"); |
||
72 | |||
73 | -- Make sure BM_CONFIG is ready |
||
74 | if (not BRL_CONFIG) then |
||
75 | BRL_CONFIG = { }; |
||
76 | end |
||
77 | |||
78 | if (not BRL_CONFIG[BRL_STARTUP.m_strPlayer]) then |
||
79 | BRL_CONFIG[BRL_STARTUP.m_strPlayer] = { }; |
||
80 | end |
||
81 | |||
82 | -- Zone Info Box Show/Hide |
||
83 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable == nil) then |
||
84 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable = DEFAULT_BRL_ZONE_INFO_ENABLE; |
||
85 | end |
||
86 | -- Tooltip Show/Hide |
||
87 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable == nil) then |
||
88 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable = DEFAULT_BRL_TOOLTIP_ENABLE; |
||
89 | end |
||
90 | -- Map Text Show/Hide |
||
91 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable == nil) then |
||
92 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable = DEFAULT_BRL_MAP_TEXT_ENABLE; |
||
93 | end |
||
94 | -- Tooltip Offset Left/Right |
||
95 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left == nil) then |
||
96 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left = DEFAULT_BRL_TOOLTIP_OFFSET_LEFT; |
||
97 | end |
||
98 | -- Tooltip Offset Bottom/Top |
||
99 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom == nil) then |
||
100 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom = DEFAULT_BRL_TOOLTIP_OFFSET_BOTTOM; |
||
101 | end |
||
102 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha == nil) then |
||
103 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha = DEFAULT_BRL_BORDER_ALPHASLIDER; |
||
104 | end |
||
105 | |||
106 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable == false) then |
||
107 | BM_Rec_Level:Hide(); |
||
108 | BM_Rec_Level_Text_Frame:Hide(); |
||
109 | else |
||
110 | BM_Rec_Level:Show(); |
||
111 | BM_Rec_Level_Text_Frame:Show(); |
||
112 | end |
||
113 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable == false) then |
||
114 | BM_Rec_WorldMap_Frame:Hide(); |
||
115 | else |
||
116 | BM_Rec_WorldMap_Frame:Show(); |
||
117 | end |
||
118 | |||
119 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom == false) then |
||
120 | BRL_SET_BOTTOM_TOP = "TOP"; |
||
121 | else |
||
122 | BRL_SET_BOTTOM_TOP = "BOTTOM"; |
||
123 | end |
||
124 | |||
125 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left == false) then |
||
126 | BRL_SET_LEFT_RIGHT = "RIGHT"; |
||
127 | else |
||
128 | BRL_SET_LEFT_RIGHT = "LEFT"; |
||
129 | end |
||
130 | |||
131 | BM_Rec_Level:SetAlpha(BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha); |
||
132 | |||
133 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction == nil ) then |
||
134 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction = DEFAULT_BRL_SHOW_TOOLTIP_FACTION; |
||
135 | end |
||
136 | |||
137 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance == nil ) then |
||
138 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance = DEFAULT_BRL_SHOW_TOOLTIP_INSTANCE; |
||
139 | end |
||
140 | |||
141 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent == nil ) then |
||
142 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent = DEFAULT_BRL_SHOW_TOOLTIP_CONTINENT; |
||
143 | end |
||
144 | |||
145 | |||
146 | -- variables are loaded, ready to go |
||
147 | BRL_STARTUP.m_Loaded = true; |
||
148 | |||
149 | |||
150 | if (DEFAULT_CHAT_FRAME) then |
||
151 | DEFAULT_CHAT_FRAME:AddMessage(BRL_LOADED .. BRL_LOADED_INFO); |
||
152 | else |
||
153 | UIErrorsFrame:AddMessage(BRL_LOADED, 1.0, 1.0, 1.0, 1.0, UIERRORS_HOLD_TIME); |
||
154 | end |
||
155 | end |
||
156 | end |
||
157 | |||
158 | function BM_Get_Color(low,high) |
||
159 | -- PlayerLevel <= low for zone - 4 == RED |
||
160 | -- PlayerLevel < low for zone == ORANGE |
||
161 | -- PlayerLevel <= high == YELLOW |
||
162 | -- PlayerLevel < high + 5 == GREEN |
||
163 | -- Otherwise == GRAY |
||
164 | local playerLevel = UnitLevel("player"); |
||
165 | if (playerLevel <= (low-4)) then |
||
166 | return BM_RED; |
||
167 | elseif (playerLevel < low) then |
||
168 | return BM_ORANGE; |
||
169 | elseif (playerLevel <= high) then |
||
170 | return BM_YELLOW; |
||
171 | elseif (playerLevel < (high+5)) then |
||
172 | return BM_GREEN; |
||
173 | else |
||
174 | return BM_GRAY; |
||
175 | end |
||
176 | end |
||
177 | |||
178 | function BM_Get_Instance_Text(index,colors) |
||
179 | local instanceColor = BM_WHITE; |
||
180 | if ( BM_INSTANCES[index] == nil ) then |
||
181 | return ""; |
||
182 | end |
||
183 | if (colors) then |
||
184 | instanceColor = BM_Get_Color(BM_INSTANCES[index].low,BM_INSTANCES[index].high); |
||
185 | end |
||
186 | return format(BRL_INSTANCE_TEXT, instanceColor, BM_INSTANCES[index].zone, |
||
187 | BM_INSTANCES[index].low, BM_INSTANCES[index].high ); |
||
188 | end |
||
189 | |||
190 | function BM_Rec_Level_Update_Text() |
||
191 | local playerLevel = UnitLevel("player"); |
||
192 | local zoneColor; |
||
193 | BM_REC_LEVEL_BUTTON_TEXT = ""; |
||
194 | for i = 0, table.getn(BM_RECOMMEND), 1 do |
||
195 | if (string.find(BM_RECOMMEND[i].zone, GetZoneText())) then |
||
196 | BM_Rec_Level_Update_Tooltip_Text(i); |
||
197 | if (BM_RECOMMEND[i].faction == BRL_CITY) then |
||
198 | BM_REC_LEVEL_BUTTON_TEXT = BM_WHITE .. BRL_FACTION[BM_RECOMMEND[i].faction] .. BM_FONT_OFF; |
||
199 | else |
||
200 | zoneColor = BM_Get_Color(BM_RECOMMEND[i].low,BM_RECOMMEND[i].high); |
||
201 | BM_REC_LEVEL_BUTTON_TEXT = zoneColor .. format("%d-%d", BM_RECOMMEND[i].low, BM_RECOMMEND[i].high) .. BM_FONT_OFF; |
||
202 | end |
||
203 | end |
||
204 | end |
||
205 | BM_Rec_Level_Text:SetText(BRL_ZONE_RANGE .. BM_REC_LEVEL_BUTTON_TEXT); |
||
206 | return |
||
207 | end |
||
208 | |||
209 | function BM_Rec_Level_Update_Tooltip_Text(index) |
||
210 | local player_level = UnitLevel("player"); |
||
211 | local c,i; |
||
212 | local tempText,tempText2; |
||
213 | |||
214 | BM_REC_LEVEL_TOOLTIP_TEXT = ""; |
||
215 | BM_REC_LEVEL_TOOLTIP_SHORT = ""; |
||
216 | tempText = BRL_TOOLTIP_CZONE .. BM_WHITE .. GetZoneText() .. BM_FONT_OFF; |
||
217 | |||
218 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance ) then |
||
219 | if ( BM_RECOMMEND[index].instances[0] ~= nil ) then |
||
220 | for c = 0, table.getn(BM_RECOMMEND[index].instances), 1 do |
||
221 | tempText = tempText .. "\n" .. BRL_TOOLTIP_CINSTANCES .. |
||
222 | BM_Get_Instance_Text(BM_RECOMMEND[index].instances[c], false); |
||
223 | end |
||
224 | end |
||
225 | end |
||
226 | |||
227 | tempText = tempText .. "\n\n" .. BM_WHITE .. BRL_TOOLTIP_RECOMMEND .. BM_FONT_OFF; |
||
228 | tempText2 = tempText; |
||
229 | |||
230 | for i = 0, table.getn(BM_RECOMMEND), 1 do |
||
231 | if ( BM_RECOMMEND[i].low <= player_level and |
||
232 | BM_RECOMMEND[i].high >= player_level ) then |
||
233 | if ( (BM_RECOMMEND[i].faction == BRL_CONTESTED) or (UnitFactionGroup("player") == BRL_FACTION[BM_RECOMMEND[i].faction]) ) then |
||
234 | |||
235 | -- Add zone name and level range. |
||
236 | tempText = tempText .. |
||
237 | "\n" .. BRL_TOOLTIP_RZONE .. BM_WHITE .. BM_RECOMMEND[i].zone .. |
||
238 | " (" .. BM_RECOMMEND[i].low .. "-" .. BM_RECOMMEND[i].high .. ")" .. BM_FONT_OFF; |
||
239 | tempText2 = tempText2 .. |
||
240 | "\n" .. BRL_TOOLTIP_RZONE .. BM_WHITE .. BM_RECOMMEND[i].zone .. |
||
241 | " (" .. BM_RECOMMEND[i].low .. "-" .. BM_RECOMMEND[i].high .. ")" .. BM_FONT_OFF; |
||
242 | |||
243 | -- Show faction |
||
244 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction ) then |
||
245 | tempText = tempText .. "\n" .. BRL_TOOLTIP_RFACTION .. BM_WHITE .. |
||
246 | BRL_FACTION[BM_RECOMMEND[i].faction] .. BM_FONT_OFF; |
||
247 | tempText2 = tempText2 .. " [" .. BRL_FACTION[BM_RECOMMEND[i].faction] .. "]"; |
||
248 | end |
||
249 | |||
250 | -- show continent |
||
251 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent ) then |
||
252 | tempText = tempText .. "\n" .. BRL_TOOLTIP_RCONTINENT .. BM_WHITE .. |
||
253 | BRL_CONTINENT[BM_RECOMMEND[i].continent] .. BM_FONT_OFF; |
||
254 | tempText2 = tempText2 .. " (" .. BRL_CONTINENT[BM_RECOMMEND[i].continent] .. ")"; |
||
255 | end |
||
256 | |||
257 | -- add any instances |
||
258 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance) then |
||
259 | if ( BM_RECOMMEND[i].instances[0] ~= nil ) then |
||
260 | for c = 0, table.getn(BM_RECOMMEND[i].instances), 1 do |
||
261 | tempText = tempText .. "\n" .. BRL_TOOLTIP_RINSTANCES .. |
||
262 | BM_Get_Instance_Text(BM_RECOMMEND[i].instances[c], false); |
||
263 | end |
||
264 | end |
||
265 | end |
||
266 | if ( BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance or |
||
267 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent or |
||
268 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction ) then |
||
269 | tempText = tempText .. "\n"; -- Extra linebreak if we show more then just zone name |
||
270 | end |
||
271 | end |
||
272 | end |
||
273 | end |
||
274 | |||
275 | tempText = tempText .. "\n\n" .. BM_WHITE .. BRL_TOOLTIP_RECOMMEND_INSTANCES .. BM_FONT_OFF; |
||
276 | tempText2 = tempText2 .. "\n\n" .. BM_WHITE .. BRL_TOOLTIP_RECOMMEND_INSTANCES .. BM_FONT_OFF; |
||
277 | for i = 0, table.getn(BM_INSTANCES), 1 do |
||
278 | if ( BM_INSTANCES[i].low <= player_level and |
||
279 | BM_INSTANCES[i].high >= player_level ) then |
||
280 | tempText = tempText .. "\n" .. BRL_TOOLTIP_RZONE .. BM_Get_Instance_Text(i,false); |
||
281 | tempText2 = tempText2 .. "\n" .. BRL_TOOLTIP_RZONE .. BM_Get_Instance_Text(i,false); |
||
282 | end |
||
283 | end |
||
284 | |||
285 | BM_REC_LEVEL_TOOLTIP_TEXT = tempText; |
||
286 | BM_REC_LEVEL_TOOLTIP_SHORT = tempText2; |
||
287 | return |
||
288 | end |
||
289 | |||
290 | -- when the mouse goes over the main frame, this gets called |
||
291 | function BM_Rec_Level_OnEnter() |
||
292 | BRL_STARTUP.m_strPlayer = GetCVar("realmName") .. "|" .. UnitName("player"); |
||
293 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable) then |
||
294 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable == true) then |
||
295 | if (BRL_SET_BOTTOM_TOP == "BOTTOM") then |
||
296 | GameTooltip:SetOwner(this, "ANCHOR_NONE"); |
||
297 | GameTooltip:SetPoint("TOP" .. BRL_SET_LEFT_RIGHT, "BM_Rec_Level", "BOTTOM" .. BRL_SET_LEFT_RIGHT, 0, 0); |
||
298 | -- set the tool tip text |
||
299 | GameTooltip:SetText(BRL_TOOPTIP_TITLE,nil,nil,nil,1); |
||
300 | GameTooltip:AddLine(BM_REC_LEVEL_TOOLTIP_TEXT); |
||
301 | GameTooltip:Show(); |
||
302 | elseif (BRL_SET_BOTTOM_TOP == "TOP") then |
||
303 | GameTooltip:SetOwner(this, "ANCHOR_NONE"); |
||
304 | GameTooltip:SetPoint("BOTTOM" .. BRL_SET_LEFT_RIGHT, "BM_Rec_Level", "TOP" .. BRL_SET_LEFT_RIGHT, 0, 0); |
||
305 | -- set the tool tip text |
||
306 | GameTooltip:SetText(BRL_TOOPTIP_TITLE,nil,nil,nil,1); |
||
307 | GameTooltip:AddLine(BM_REC_LEVEL_TOOLTIP_TEXT); |
||
308 | GameTooltip:Show(); |
||
309 | end |
||
310 | end |
||
311 | end |
||
312 | end |
||
313 | |||
314 | function BM_Rec_Level_OnLeave() |
||
315 | BRL_STARTUP.m_strPlayer = GetCVar("realmName") .. "|" .. UnitName("player"); |
||
316 | if (BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable == true) then |
||
317 | -- put the tool tip in the default position |
||
318 | GameTooltip_SetDefaultAnchor(GameTooltip, UIParent); |
||
319 | GameTooltip:Hide(); |
||
320 | end |
||
321 | end |
||
322 | |||
323 | function BM_WorldMapButton_OnUpdate() |
||
324 | local player_level = UnitLevel("player"); |
||
325 | local zoneColor; |
||
326 | if (WorldMapFrame.areaName ~= nil) then |
||
327 | for i = 0, table.getn(BM_RECOMMEND), 1 do |
||
328 | if (string.find(BM_RECOMMEND[i].zone, WorldMapFrame.areaName)) then |
||
329 | zoneColor = BM_Get_Color(BM_RECOMMEND[i].low, BM_RECOMMEND[i].high); |
||
330 | zoneText = zoneColor .. format(BRL_WORLDMAP_TEXT, BM_RECOMMEND[i].low, BM_RECOMMEND[i].high); |
||
331 | if ( BM_RECOMMEND[i].instances[0] ~= nil ) then |
||
332 | zoneText = zoneText .. BM_NORMAL .. BRL_TOOLTIP_CINSTANCES .. "\n" .. BM_FONT_OFF; |
||
333 | for c = 0, table.getn(BM_RECOMMEND[i].instances), 1 do |
||
334 | zoneText = zoneText .. BM_Get_Instance_Text(BM_RECOMMEND[i].instances[c], true) .. "\n"; |
||
335 | end |
||
336 | end |
||
337 | BM_Rec_WorldMap_Text:SetText(zoneText); |
||
338 | end |
||
339 | end |
||
340 | else |
||
341 | BM_Rec_WorldMap_Text:SetText(""); |
||
342 | end |
||
343 | |||
344 | if (WorldMapFrame.poiHighlight == 1) then |
||
345 | for i = 0, table.getn(BM_RECOMMEND), 1 do |
||
346 | if (string.find(BM_RECOMMEND[i].zone, WorldMapFrameAreaLabel:GetText())) then |
||
347 | zoneText = BM_WHITE .. BRL_FACTION[BM_RECOMMEND[i].faction] .. "\n\n" .. BM_FONT_OFF; |
||
348 | if (BM_RECOMMEND[i].instances ~= nil) then |
||
349 | zoneText = zoneText .. BM_NORMAL .. BRL_TOOLTIP_RINSTANCES .. "\n" .. BM_FONT_OFF; |
||
350 | for c = 0, table.getn(BM_RECOMMEND[i].instances), 1 do |
||
351 | zoneText = zoneText .. BM_Get_Instance_Text(BM_RECOMMEND[i].instances[c], true) .. "\n"; |
||
352 | end |
||
353 | end |
||
354 | BM_Rec_WorldMap_Text:SetText(zoneText); |
||
355 | end |
||
356 | end |
||
357 | end |
||
358 | end |
||
359 | |||
360 | function BRL_Zone_Info_Enable(msg) |
||
361 | if (msg == false) then |
||
362 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable = false; |
||
363 | BM_Rec_Level:Hide(); |
||
364 | BM_Rec_Level_Text_Frame:Hide(); |
||
365 | else |
||
366 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable = true; |
||
367 | BM_Rec_Level:Show(); |
||
368 | BM_Rec_Level_Text_Frame:Show(); |
||
369 | end |
||
370 | end |
||
371 | |||
372 | function BRL_Tooltip_Enable(msg) |
||
373 | if (msg == false) then |
||
374 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable = false; |
||
375 | else |
||
376 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable = true; |
||
377 | end |
||
378 | end |
||
379 | |||
380 | function BRL_Map_Text_Enable(msg) |
||
381 | if (msg == false) then |
||
382 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable = false; |
||
383 | BM_Rec_WorldMap_Frame:Hide(); |
||
384 | else |
||
385 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable = true; |
||
386 | BM_Rec_WorldMap_Frame:Show(); |
||
387 | end |
||
388 | end |
||
389 | |||
390 | function BRL_Tooltip_Offset_Left(msg) |
||
391 | if (msg == false) then |
||
392 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left = false; |
||
393 | BRL_SET_LEFT_RIGHT = "RIGHT"; |
||
394 | else |
||
395 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left = true; |
||
396 | BRL_SET_LEFT_RIGHT = "LEFT"; |
||
397 | end |
||
398 | end |
||
399 | |||
400 | function BRL_Tooltip_Offset_Bottom(msg) |
||
401 | if (msg == false) then |
||
402 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom = false; |
||
403 | BRL_SET_BOTTOM_TOP = "TOP"; |
||
404 | else |
||
405 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom = true; |
||
406 | BRL_SET_BOTTOM_TOP = "BOTTOM"; |
||
407 | end |
||
408 | end |
||
409 | |||
410 | function BRL_Show_Tooltip_Faction(msg) |
||
411 | if (msg == false) then |
||
412 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction = false; |
||
413 | else |
||
414 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction = true; |
||
415 | end |
||
416 | BM_Rec_Level_Update_Text(); |
||
417 | end |
||
418 | |||
419 | function BRL_Show_Tooltip_Instance(msg) |
||
420 | if (msg == false) then |
||
421 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance = false; |
||
422 | else |
||
423 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance = true; |
||
424 | end |
||
425 | BM_Rec_Level_Update_Text(); |
||
426 | end |
||
427 | |||
428 | function BRL_Show_Tooltip_Continent(msg) |
||
429 | if (msg == false) then |
||
430 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent = false; |
||
431 | else |
||
432 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent = true; |
||
433 | end |
||
434 | BM_Rec_Level_Update_Text(); |
||
435 | end |
||
436 | |||
437 | function BRL_Border_Alpha(msg) |
||
438 | if (msg < 0 or msg > 1) then |
||
439 | UIErrorsFrame:AddMessage(BRL_ERROR_MESSAGE_1, 1.0, 0.0, 0.0, 1.0, UIERRORS_HOLD_TIME); |
||
440 | else |
||
441 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha = msg; |
||
442 | BM_Rec_Level:SetAlpha(BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha); |
||
443 | end |
||
444 | end |
||
445 | |||
446 | function BRL_Reset_SlashHandler() |
||
447 | StaticPopup_Show("BRL_RESET_ALL"); |
||
448 | end |
||
449 | |||
450 | function BRL_Reset_Everything() |
||
451 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].zone_info_enable = DEFAULT_BRL_ZONE_INFO_ENABLE; |
||
452 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_enable = DEFAULT_BRL_TOOLTIP_ENABLE; |
||
453 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].map_text_enable = DEFAULT_BRL_MAP_TEXT_ENABLE; |
||
454 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_left = DEFAULT_BRL_TOOLTIP_OFFSET_LEFT; |
||
455 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].tooltip_offset_bottom = DEFAULT_BRL_TOOLTIP_OFFSET_BOTTOM; |
||
456 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_faction = DEFAULT_BRL_SHOW_TOOLTIP_FACTION; |
||
457 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_instance = DEFAULT_BRL_SHOW_TOOLTIP_INSTANCE; |
||
458 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].show_tooltip_continent = DEFAULT_BRL_SHOW_TOOLTIP_CONTINENT; |
||
459 | BRL_CONFIG[BRL_STARTUP.m_strPlayer].border_alpha = DEFAULT_BRL_BORDER_ALPHASLIDER; |
||
460 | BM_Rec_Level:ClearAllPoints(); |
||
461 | BM_Rec_Level:SetPoint("CENTER", "UIParent", "CENTER", 0, 0); |
||
462 | BM_Rec_Level:Show(); |
||
463 | BM_Rec_Level_Text_Frame:Show(); |
||
464 | BRL_SET_BOTTOM_TOP = "BOTTOM"; |
||
465 | BRL_SET_LEFT_RIGHT = "LEFT"; |
||
466 | end |