-
Notifications
You must be signed in to change notification settings - Fork 0
/
EN_UnitFrames.lua
605 lines (551 loc) · 21.5 KB
/
EN_UnitFrames.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
--[[
Enigma Unit Frames 8.0.7 Main Script
Notice for developers:
- How to release new version?
update 'EUF_Version' and 'VERSION in EUF_CurrentOptions' to new version number
DO NOT update the 'COMPATIBLEVERSION in EUF_CurrentOptions' unless
you revise the structure of EUF_CurrentOptions, and want users to reset to default setting again.
]]
EUF_Version = "8.0.7"
EUF_AddonId = "EUF";
EUF_AddonName = "Enigma Unit Frames";
EUF_SysAddonName = "EN_UnitFrames";
EN_RealmName = GetRealmName();
EN_PlayerName = UnitName("player");
count = 0;
if not EN_RealmName then
EN_RealmName = "Enigma";
end;
if not EN_PlayerName then
EN_PlayerName = "Unknown";
end;
EN_PlayerId = EN_RealmName .. "." .. EN_PlayerName;
EN_MAX_PLAYER_LEVEL = {
[0] = 60,
[1] = 70,
[2] = 80,
[3] = 85,
[4] = 90,
[5] = 100,
[6] = 110,
[7] = 120
};
EUF_CurrentOptions = {};
local EUF_DefaultOptions= {
["VERSION"] = "8.0.7",
["COMPATIBLEVERSION"] = "7.0.4",
["PLAYERHP"] = 1,
["PLAYERMP"] = 1,
["PLAYERXP"] = 1,
["PLAYERXPAUTO"] = 1,
["PLAYERRARE"] = 1,
["PLAYERFRM"] = 0,
["PLAYER3DPORTRAIT"] = 0,
["PLAYERPOSITION"] = 1,
["PLAYERPOSITIONAUTO"] = 1,
["PLAYERPOSITIONMANA"] = 0,
["PLAYERPOSITIONSPEED"] = 0,
["PLAYERHPPERCENT"] = 1,
["PLAYERMPPERCENT"] = 1,
["PLAYERMANAFILTER"] = 0,
["PLAYEREXTBAR"] = 0,
["PLAYERAUTOHEALTHCOLOR"] = 1,
["PLAYERCLASSICONBIG"] = 0,
["PLAYERCLASSICONSMALL"] = 1,
["PLAYERPETHPMP"] = 1,
["TARGETHP"] = 1,
["TARGETMP"] = 1,
["TARGETHPPERCENT"] = 1,
["TARGETMPPERCENT"] = 1,
["TARGETPERCENTINSIDE"] = 0,
["TARGETINFO"] = 1,
["TARGETINFORACE"] = 1,
["TARGETINFOCLASS"] = 1,
["TARGETINFOELITE"] = 1,
["TARGETINFOLEVEL"] = 1,
["TARGETINFOTARGET"] = 0,
["TARGETINFOBROKENSHIELD"] = 1,
["TARGET3DPORTRAIT"] = 0,
["TARGETOTWARNING"] = 1,
["TARGETINDICATOR"] = 1,
["TARGETAUTOHEALTHCOLOR"] = 1,
["TARGETACCTUALHPMP"] = 1,
["TARGETCLASSICONBIG"] = 0,
["TARGETCLASSICONSMALL"] = 1,
["TARGETTARGETFRAME"] = 1,
["TARGETTARGETHPMPBAR"] = 1,
["TARGETTARGETHPPERCENT"] = 1,
["TARGETTARGETHPPERCENTCOLOR"] = 1,
["TARGETTARGETTARGETFRAME"] = 1,
["MOVINGTARGETTARGETFRAME"] = 1,
["FOCUSHP"] = 1,
["FOCUSHPPERCENT"] = 1,
["FOCUSPERCENTINSIDE"] = 0,
["FOCUSCLASSICONBIG"] = 0,
["FOCUSCLASSICONSMALL"] = 1,
["FOCUS3DPORTRAIT"] = 0,
["PARTYHP"] = 1,
["PARTYMP"] = 1,
["PARTYHPPERCENT"] = 0,
["PARTYMPPERCENT"] = 0,
["PARTYMANAFILTER"] = 0,
["PARTY3DPORTRAIT"] = 0,
["PARTYSHOW"] = 1,
["PARTYLEVEL"] = 1,
["PARTYCLASS"] = 1,
["PARTYCLASSABRV"] = 0,
["PARTYCOLOR"] = 1,
["PARTYAUTOHEALTHCOLOR"] = 1,
["PARTYCLASSICONBIG"] = 0,
["PARTYCLASSICONSMALL"] = 1,
["PARTYBUFF"] = 1,
["PARTYBUFFPOSITIONX"] = 0,
["PARTYBUFFPOSITIONY"] = 0,
["PARTYDEBUFFPOSITIONX"] = 0,
["PARTYDEBUFFPOSITIONY"] = 0,
["PARTYTARGET"] = 1,
["PARTYTARGETPOSITIONX"] = 0,
["PARTYTARGETPOSITIONY"] = 0,
["PARTYCAST"] = 1,
["PARTYCASTPOSITIONX"] = 0,
["PARTYCASTPOSITIONY"] = 0,
["STATUSFONTSIZE"] = 0,
};
function EUF_OnLoad(this)
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:RegisterEvent("ADDON_LOADED");
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("UPDATE_SHAPESHIFT_FORM");
this:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED");
this:RegisterEvent("ADDON_LOADED");
-- Slash Command Handler
SLASH_EUF1 = "/euf";
SLASH_EUF2 = "/enigmaunitframes";
SlashCmdList[EUF_AddonId] = function(msg)
InterfaceOptionsFrame_OpenToCategory("EN_UnitFrames");
EN_Msg(EUF_AddonName .. " " .. EUF_Version .. " (http://www.wowace.com/addons/en_unitframes/) ");
end;
end
function EUF_OnEvent(self, event, ...)
local name = ...;
if event == "ADDON_LOADED" and name == EUF_SysAddonName then
--EN_Msg("EUF_OnEvent: "..event);
EUF_Options_Init();
if EUF_FrameClassIcon_Update then
EUF_FrameClassIcon_Update();
end;
if EUF_PartyInfo_Update then
EUF_PartyInfo_Update();
end;
if EUF_TargetInfo_Update then
EUF_TargetInfo_Update();
end;
EN_Msg(string.format("%s %s loaded.", EUF_AddonName, EUF_Version));
EN_Msg(EUF_TEXT_OPTION_HELP);
elseif event == "PLAYER_ENTERING_WORLD" then
--EN_Msg("EUF_OnEvent: "..event);
EUF_PlayerFrameFrm_Update();
EUF_PlayerFrameExtBar_Update();
EUF_PlayerFrameXp_Update();
EUF_ObjectDisplay_Update(EUF_PlayerFrameXP, EUF_CanXPBarShow());
EUF_ObjectDisplay_Update(EUF_PlayerFrameXPBar, EUF_CanXPBarShow());
EUF_HidePartyToggle();
PartyTarget_Toggle();
PartyBuff_Toggle();
elseif event == "PLAYER_SPECIALIZATION_CHANGED" or event == "UPDATE_SHAPESHIFT_FORM" then
EUF_ObjectDisplay_Update(EUF_PlayerFrameXP, EUF_CanXPBarShow());
EUF_ObjectDisplay_Update(EUF_PlayerFrameXPBar, EUF_CanXPBarShow());
elseif event == "VARIABLES_LOADED" then
--EN_Msg("EUF_OnEvent: "..event);
-- hooksecurefunc
hooksecurefunc("SetCVar",
function(cvar, value, scriptArg)
if cvar == "useCompactPartyFrames" then
if tonumber(value) ~= 0 and not EUF_CurrentOptions["PARTYSHOW"] == 0 then
EUF_Options_Update("PARTYSHOW", 0);
elseif tonumber(value) == 0 and EUF_CurrentOptions["PARTYSHOW"] == 0 then
EUF_Options_Update("PARTYSHOW", 1);
end
-- elseif cvar == "statusTextDisplay" then
-- if tonumber(value) ~= 0 then
-- if EUF_CurrentOptions["PLAYERHP"] == 0 then
-- EUF_Options_Update("PLAYERHP", 1);
-- EUF_OptionFramePLAYERHP:SetChecked(true);
-- end;
-- if EUF_CurrentOptions["PLAYERMP"] == 0 then
-- EUF_Options_Update("PLAYERMP", 1);
-- EUF_OptionFramePLAYERMP:SetChecked(true);
-- end;
-- if EUF_CurrentOptions["TARGETHP"] == 0 then
-- EUF_Options_Update("TARGETHP", 1);
-- EUF_OptionFrameTARGETHP:SetChecked(true);
-- end;
-- if EUF_CurrentOptions["TARGETMP"] == 0 then
-- EUF_Options_Update("TARGETMP", 1);
-- EUF_OptionFrameTARGETMP:SetChecked(true);
-- end;
-- if EUF_CurrentOptions["PARTYHP"] == 0 then
-- EUF_Options_Update("PARTYHP", 1);
-- EUF_OptionFramePARTYHP:SetChecked(true);
-- end;
-- if EUF_CurrentOptions["PARTYMP"] == 0 then
-- EUF_Options_Update("PARTYMP", 1);
-- EUF_OptionFramePARTYMP:SetChecked(true);
-- end;
-- elseif tonumber(value) == 0 then
-- if EUF_CurrentOptions["PLAYERHP"] ~= 0 then
-- EUF_Options_Update("PLAYERHP", 0);
-- EUF_OptionFramePLAYERHP:SetChecked(false);
-- end;
-- if EUF_CurrentOptions["PLAYERMP"] ~= 0 then
-- EUF_Options_Update("PLAYERMP", 0);
-- EUF_OptionFramePLAYERMP:SetChecked(false);
-- end;
-- if EUF_CurrentOptions["TARGETHP"] ~= 0 then
-- EUF_Options_Update("TARGETHP", 0);
-- EUF_OptionFrameTARGETHP:SetChecked(false);
-- end;
-- if EUF_CurrentOptions["TARGETMP"] ~= 0 then
-- EUF_Options_Update("TARGETMP", 0);
-- EUF_OptionFrameTARGETMP:SetChecked(false);
-- end;
-- if EUF_CurrentOptions["PARTYHP"] ~= 0 then
-- EUF_Options_Update("PARTYHP", 0);
-- EUF_OptionFramePARTYHP:SetChecked(false);
-- end;
-- if EUF_CurrentOptions["PARTYMP"] ~= 0 then
-- EUF_Options_Update("PARTYMP", 0);
-- EUF_OptionFramePARTYMP:SetChecked(false);
-- end;
-- end
end
end
);
if tonumber(GetCVar("useCompactPartyFrames")) ~= 0 then
EUF_Options_Update("PARTYSHOW", 0);
getglobal("EUF_OptionFramePARTYSHOW"):SetChecked(false);
EN_Msg(EUF_TEXT_WARN_RAIDSTYLEPARTY);
else
EUF_Options_Update("PARTYSHOW", 1);
getglobal("EUF_OptionFramePARTYSHOW"):SetChecked(true);
end;
-- if tonumber(GetCVar("statusText")) ~= 0 then
-- if EUF_CurrentOptions["TARGETHP"] == 0 and EUF_CurrentOptions["TARGETMP"] == 0 then
-- EUF_Options_Update("TARGETHP", 1);
-- EUF_Options_Update("TARGETMP", 1);
-- getglobal("EUF_OptionFrameTARGETHP"):SetChecked(true);
-- getglobal("EUF_OptionFrameTARGETMP"):SetChecked(true);
-- end;
-- if EUF_CurrentOptions["PARTYHP"] == 0 and EUF_CurrentOptions["PARTYMP"] == 0 then
-- EUF_Options_Update("PARTYHP", 1);
-- EUF_Options_Update("PARTYMP", 1);
-- getglobal("EUF_OptionFramePARTYHP"):SetChecked(true);
-- getglobal("EUF_OptionFramePARTYMP"):SetChecked(true);
-- end;
-- else
-- EUF_Options_Update("TARGETHP", 0);
-- EUF_Options_Update("TARGETMP", 0);
-- getglobal("EUF_OptionFrameTARGETHP"):SetChecked(false);
-- getglobal("EUF_OptionFrameTARGETMP"):SetChecked(false);
-- EUF_Options_Update("PARTYHP", 0);
-- EUF_Options_Update("PARTYMP", 0);
-- getglobal("EUF_OptionFramePARTYHP"):SetChecked(false);
-- getglobal("EUF_OptionFramePARTYMP"):SetChecked(false);
-- end;
end;
end
function DisableBlizzardFrame(frame)
if not frame then
return;
end
frame:UnregisterAllEvents();
frame:SetScript("OnEvent", nil);
frame:SetScript("OnUpdate", nil);
frame:SetScript("OnSizeChanged", nil);
frame:EnableMouse(false);
frame:EnableKeyboard(false);
frame:Hide();
frame:SetAlpha(0);
frame:SetScale(0.01);
RegisterStateDriver(frame, "visibility", "hide");
end
function EUF_Options_Init()
if not EUF_Options then
EUF_Options = {};
end;
EUF_CurrentOptions = EUF_Options[EN_PlayerId];
if not EUF_CurrentOptions then
EUF_OptionsDefault_Load();
EN_Msg(EUF_AddonId, EUF_TEXT_OPTION_DEFAULT);
end;
if (not EUF_CurrentOptions["VERSION"]) or (EUF_DefaultOptions["COMPATIBLEVERSION"] > EUF_CurrentOptions["VERSION"]) then
EUF_OptionsDefault_Load();
EN_Msg(EUF_AddonId, EUF_TEXT_OPTION_NOTCOMPATIBLE);
end;
-- clear the version, and update the version number later no matter whether the default settings are loaded
EUF_CurrentOptions["VERSION"] = nil;
local index, value;
for index, value in pairs(EUF_DefaultOptions) do
if not EUF_CurrentOptions[index] then
EUF_CurrentOptions[index] = value;
end;
end;
EUF_CurrentOptions["VERSION"] = EUF_Version;
end
function EUF_OptionsDefault_Load()
if not EUF_Options then
EUF_Options = {};
end;
EUF_Options[EN_PlayerId] = {};
for index, value in pairs(EUF_DefaultOptions) do
EUF_Options[EN_PlayerId][index] = value;
end;
EUF_CurrentOptions = EUF_Options[EN_PlayerId];
end
function EUF_Options_Update(oOptionId, oValue)
if not oOptionId or not oValue then
-- EN_Msg("return: "..oOptionId.." value: "..tostring(oValue));
return -1;
end;
local optionId = string.upper(oOptionId);
local value = tonumber(oValue);
if not EUF_CurrentOptions[optionId] or EUF_CurrentOptions[optionId] == value then
-- EN_Msg("return: "..oOptionId.." value: "..tostring(oValue));
return;
end;
EUF_CurrentOptions[optionId] = value;
if (optionId == "PLAYERHP") or (optionId == "PLAYERMP") or (optionId == "PLAYERHPPERCENT") or (optionId == "PLAYERMPPERCENT") then
-- EN_Msg("Option Update: "..optionId.." value: "..tostring(value));
if EUF_PlayerFrameDisplay_Update then
EUF_PlayerFrameDisplay_Update();
end;
elseif (optionId == "PLAYERPOSITION") or (optionId == "PLAYERPOSITIONMANA") or (optionId == "PLAYERPOSITIONSPEED") then
if EUF_PlayerFrameDisplay_Update then
EUF_PlayerFrameDisplay_Update();
end;
elseif (optionId == "PLAYERXP") or (optionId == "PLAYERXPAUTO") then
if EUF_PlayerFrameDisplay_Update then
EUF_ObjectDisplay_Update(EUF_PlayerFrameXP, EUF_CanXPBarShow());
EUF_ObjectDisplay_Update(EUF_PlayerFrameXPBar, EUF_CanXPBarShow());
end;
elseif (optionId == "PLAYERPOSITIONAUTO") then
if EUF_PlayerFramePosition_Update then
EUF_PlayerFramePosition_Update();
end;
elseif (optionId == "PLAYERAUTOHEALTHCOLOR") then
if EUF_PlayerFrameHPMP_Update then
EUF_PlayerFrameHPMP_Update();
end;
elseif (optionId == "PLAYERFRM") then
if EUF_PlayerFrameFrm_Update then
EUF_PlayerFrameFrm_Update();
end;
elseif (optionId == "PLAYERRARE") then
if EUF_PlayerFrameFrm_Update then
EUF_PlayerFrameFrm_Update();
end;
elseif (optionId == "PLAYEREXTBAR") then
if EUF_PlayerFrameExtBar_Update and EUF_PlayerFrameExtBar_Update then
EUF_PlayerFrameExtBar_Update();
EUF_PlayerFrameXp_Update();
end;
elseif (optionId == "PLAYERCLASSICONBIG") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("player", "Big", value);
end;
elseif (optionId == "PLAYERCLASSICONSMALL") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("player", "Small", value);
end;
elseif (optionId == "PLAYERPETHPMP") then
if EUF_PetFrameDisplay_Update then
EUF_PetFrameDisplay_Update();
end;
elseif (optionId == "PARTYHP") or (optionId == "PARTYMP") then
-- if tonumber(GetCVar("statusText")) == 0 then
-- value = 0;
-- EUF_CurrentOptions[optionId] = value;
-- end;
-- EN_Msg("Option Update: "..optionId.." value: "..tostring(value));
if EUF_PartyFrameDisplay_Update then
EUF_PartyFrameDisplay_Update();
end;
elseif (optionId == "PARTYHPPERCENT") or (optionId == "PARTYMPPERCENT") then
-- EN_Msg("Option Update: "..optionId.." value: "..tostring(value));
if EUF_PartyFrameDisplay_Update then
EUF_PartyFrameDisplay_Update();
end;
elseif (optionId == "PARTYAUTOHEALTHCOLOR") or (optionId == "PARTYMANAFILTER") then
if EUF_PartyFrameHPMP_Update then
EUF_PartyFrameHPMP_Update();
end;
elseif (optionId == "PARTYTIME") then
if BuffFrame_UpdateDuration then
BuffFrame_UpdateDuration();
end;
elseif (optionId == "PARTYLEVEL") or (optionId == "PARTYCLASS") or (optionId == "PARTYCLASSABRV") then
if EUF_FramePartyInfo_Update then
EUF_FramePartyInfo_Update();
end;
elseif (optionId == "PARTYCOLOR") then
if EUF_PartyMember_CheckClass then
EUF_PartyMember_CheckClass();
end;
elseif (optionId == "PARTYCLASSICONBIG") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("party", "Big", value);
end;
elseif (optionId == "PARTYCLASSICONSMALL") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("party", "Small", value);
end;
elseif (optionId == "PARTYSHOW") then
if EUF_HidePartyToggle then
EUF_HidePartyToggle();
end;
elseif (optionId == "TARGETHP") or (optionId == "TARGETMP") then
-- if tonumber(GetCVar("statusText")) == 0 then
-- value = 0;
-- EUF_CurrentOptions[optionId] = value;
-- end;
-- EN_Msg("Option Update: "..optionId.." value: "..tostring(value));
if EUF_TargetFrameDisplay_Update then
EUF_TargetFrameDisplay_Update();
end;
elseif (optionId == "TARGETHPPERCENT") or (optionId == "TARGETMPPERCENT") then
if EUF_TargetFrameDisplay_Update then
EUF_TargetFrameDisplay_Update();
end;
elseif (optionId == "TARGETAUTOHEALTHCOLOR") then
if EUF_TargetFrameHPMP_Update then
EUF_TargetFrameHPMP_Update();
end;
elseif (optionId == "TARGETACCTUALHPMP") then
if EUF_HP_Update then
EUF_HP_Update("target");
end;
elseif (optionId == "TARGETINDICATOR") then
if EUF_TargetHitIndicator_OnEvent and EUF_TargetHitIndicator_OnUpdate then
EUF_TargetHitIndicator_OnEvent(event);
EUF_TargetHitIndicator_OnUpdate(elapsed);
end;
elseif (optionId == "TARGETINFO") then
if EUF_TargetInfoDisplay_Update then
EUF_TargetInfoDisplay_Update();
end;
elseif (optionId == "TARGETINFOLEVEL") or (optionId == "TARGETINFORACE") or (optionId == "TARGETINFOCLASS") or (optionId == "TARGETINFOELITE") then
if EUF_TargetInfoClass_Update then
EUF_TargetInfoClass_Update();
end;
elseif (optionId == "TARGETINFOBROKENSHIELD") then
if EUF_TargetInfoDisplay_Update then
EUF_TargetInfoDisplay_Update();
end;
elseif (optionId == "TARGETTARGETHPPERCENT") then
if EUF_TargetTargetHpPercentDisplay_Update then
EUF_TargetTargetHpPercentDisplay_Update();
end;
elseif (optionId == "TARGETCLASSICONBIG") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("target", "Big", value);
end;
elseif (optionId == "TARGETCLASSICONSMALL") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("target", "Small", value);
end;
elseif (optionId == "FOCUSCLASSICONBIG") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("focus", "Big", value);
end;
elseif (optionId == "FOCUSCLASSICONSMALL") then
if EUF_ClassIcon_Update then
EUF_ClassIcon_Update("focus", "Small", value);
end;
elseif (optionId == "TARGETOTWARNING") then
if TARGETOTWARNING_OnUpdate then
TARGETOTWARNING_OnUpdate();
end;
elseif (optionId == "PLAYER3DPORTRAIT") or (optionId == "PARTY3DPORTRAIT") or (optionId == "TARGET3DPORTRAIT") or (optionId == "FOCUS3DPORTRAIT") then
if EUF_3DPortrait_OnUpdate then
EUF_3DPortrait_OnUpdate();
end;
elseif (optionId == "PARTYTARGET") then
PartyTarget_UpdateAll();
elseif (optionId == "PARTYBUFF") then
PartyBuff_Toggle();
elseif (optionId == "FOCUSHP") or (optionId == "FOCUSHPPERCENT") or (optionId == "FOCUSPERCENTINSIDE") then
TgFocusFrameHealthBarText_UpdateTextString(TgFocusFrameHealthBar);
elseif optionId == "PARTYBUFFPOSITIONX" or optionId == "PARTYBUFFPOSITIONY" then
PartyBuffPositionUpdate();
elseif optionId == "PARTYDEBUFFPOSITIONX" or optionId == "PARTYDEBUFFPOSITIONY" then
PartyDebuffPositionUpdate();
elseif optionId == "PARTYTARGETPOSITIONX" or optionId == "PARTYTARGETPOSITIONY" then
PartyTargetPositionUpdate();
elseif optionId == "PARTYCASTPOSITIONX" or optionId == "PARTYCASTPOSITIONY" then
PartyCastPositionUpdate();
elseif optionId == "STATUSFONTSIZE" then
StatusFontSizeUpdate();
else
return -1;
end;
end
function EUF_GetPercentColor(value, valueMax)
local r = 0;
local g = 1;
local b = 0;
if (value and valueMax) then
local valuePercent = tonumber(value) / tonumber(valueMax);
if valuePercent >= 0 and valuePercent <= 1 then
if (valuePercent > 0.5) then
r = (1.0 - valuePercent) * 2;
g = 1.0;
else
r = 1.0;
g = valuePercent * 2;
end;
end;
end;
if r < 0 then
r = 0;
elseif r > 1 then
r = 1;
end;
if g < 0 then
g = 0;
elseif g > 1 then
g = 1;
end;
if b < 0 then
b = 0;
elseif b > 1 then
b = 1;
end;
return r, g, b;
end
function EN_Msg(Msg1, Msg2)
local msg = "";
if Msg2 then
msg = Msg2;
end;
if Msg1 then
if msg == "" then
msg = "|cffff9900" .. Msg1 .. "|r"
else
msg = "|cffff9900[" .. Msg1 .. "]|r " .. msg;
end;
end;
DEFAULT_CHAT_FRAME:AddMessage(msg,1,1,1);
end
function EUF_ObjectDisplay_Update(obj, status)
if status == 1 then
obj:Show();
else
obj:Hide();
end;
end
function Place( obj, arg1, arg2, arg3, arg4, arg5 )
--obj:ClearAllPoints();
if obj then
obj:SetPoint( arg1, arg2, arg3, arg4, arg5 );
end;
end