-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathArcanum.lua
3670 lines (3371 loc) · 143 KB
/
Arcanum.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
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-------------------------------------------------------------------------------------------------------
-- Arcanum
-- Addon pour Mage inspiré du célébre Necrosis
-- Gestion des buffs, des portails et Compteur de Composants
-- Remerciements aux auteurs de Necrosis
-- Auteur Lenny415
-- Serveur:
-- Uliss, Nausicaa, Solcarlus, Thémys on Medivh EU
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
-- FONCTIONS GENERALES EN RELATION AVEC LE FICHIER XML
------------------------------------------------------------------------------------------------------
Default_ArcanumConfig = {
Version = ArcanumData.Version;
ChatType = true;
Tooltip = 1;
PortalMessage = true;
InsideDisplay = 1;
Display = {true, --DisplayHearthstone
true,--DisplayManaGem
true,--DisplayEvocation
true,--DisplayIceBlock
true,--DisplayColdSnap
true,--DisplayIntell
true,--DisplayArmor
true,--DisplayBandage
};
HealthColor = {
r = 0,
g = 1,
b = 0,
};
ManaColor = {
r = 0,
g = 0,
b = 1,
};
ButtonColor = {
r = 0,
g = 1,
b = 1,
};
MinimapIcon = true;
MinimapIconPos = 360;
EvocationLimit = 20;
LevelBuff = true;
ConsumeFood = "Right";
RandMount = false;
ReagentSort = true;
ReagentContainer = 3;
ReagentBuy = true;
Powder = 20;
Teleport = 10;
Portal = 10;
InterfaceVersion = 1;
BuffType = 0;
BuffButton = true;
ArmorButton = true;
MagicButton = true;
PortalButton = true;
MountButton = true;
FoodButton = true;
WaterButton = true;
ManaGemButton = true;
LeftClick = 1;
MiddleClick = 2;
RightClick = 3;
ButtonsOrder = {1,2,3,4,5,6,7,8,9,10};
LastBuff = 4;
LastArmor = 2;
LastMagic = 7;
LastPortal = 1;
LastMount = 1;
ArcanumLockServ = true;
Toggle = true;
NoDragAll = false;
BuffMenuPos = "x";
ArmorMenuPos = "x";
MagicMenuPos = "x";
PortalMenuPos = "x";
MountMenuPos = "x";
ArcanumButtonxPos = 550;
ArcanumButtonyPos = 450;
ArcanumButtonScale = 100;
ArcanumAngle = 108;
ArcanumLanguage = GetLocale();
}
-- Variables utilisés pour la gestion des composants
-- (principalement comptage)
local ArcanumArcanePowder = nil;
local ArcanumRuneOfTeleportation = nil;
local ArcanumRuneOfPortals = nil;
local ArcanumLightFeathers = nil;
local ReagentBought = false;
local LastItemsCount = nil;
local FoodLocationCount, WaterLocationCount;
local WaterCount = nil;
local WaterLocation = {nil,nil,nil};
local FoodCount = nil;
local FoodLocation = {nil,nil,nil};
local ManaGemCount = nil;
local ManaGemExists = {nil, nil, nil, nil};
local ManaGemLocation = {{nil,nil}, {nil,nil}, {nil,nil}, {nil,nil}};
local IceblockDone = false;
local IceblockWait = false;
local IceblockWaitTimer = nil;
local HearthstoneLocation = {nil,nil};
local MountLocation = {nil,nil};
local MountName = {nil};
local MountIcon = {nil};
local AQMountLocation = {nil,nil};
local AQMountName = {nil};
local AQMountIcon = {nil};
local MountAQ = nil;
local MerchantOpened = false;
local PlayerName, PlayerLevel = nil;
local Loaded = false;
local PlayerZone = nil;
local playerClass, englishClass = nil;
local TPMess = 0;
local RandMount = 0;
Dest = {"Darnassus", "Ironforge", "Stormwind", "Orgrimmar", "Thunder Bluff", "Undercity"};
-- Menus : Permet l'affichage des menus de buff...
local BuffShow = false;
local BuffMenuShow = false;
local ArmorShow = false;
local ArmorMenuShow = false;
local MagicShow = false;
local MagicMenuShow = false;
local PortalShow = false;
local PortalMenuShow = false;
local MountShow = false;
local MountMenuShow = false;
-- Menus : Permet la disparition progressive du menu des buffs (transparence)
local AlphaBuffMenu = 1;
local AlphaBuffVar = 0;
local BuffVisible = false;
-- Menus : Permet la disparition progressive du menu des armures (transparence)
local AlphaArmorMenu = 1;
local AlphaArmorVar = 0;
local ArmorVisible = false;
-- Menus : Permet la disparition progressive du menu des magies (transparence)
local AlphaMagicMenu = 1;
local AlphaMagicVar = 0;
local MagicVisible = false;
-- Menus : Permet la disparition progressive du menu des portails (transparence)
local AlphaPortalMenu = 1;
local AlphaPortalVar = 0;
local PortalVisible = false;
-- Menus : Permet la disparition progressive du menu des montures (transparence)
local AlphaMountMenu = 1;
local AlphaMountVar = 0;
local MountVisible = false;
local AlphaDisplay = 1;
local AlphaDisplayVar = 0;
local DisplayFadingLimit = 0;
local DisplayFadingWay = -1;
-- Liste des boutons disponible pour le démoniste dans chaque menu
local BuffMenuCreate = {};
local ArmorMenuCreate = {};
local MagicMenuCreate = {};
local PortalMenuCreate = {};
local MountMenuCreate = {};
local xBuffMenuPos = nil;
local xArmorMenuPos = nil;
local xMagicMenuPos = nil;
local xPortalMenuPos = nil;
local xMountMenuPos = nil;
local yBuffMenuPos = nil;
local yArmorMenuPos = nil;
local yMagicMenuPos = nil;
local yPortalMenuPos = nil;
local yMountMenuPos = nil;
local UIPath = "Interface\\AddOns\\Arcanum\\UI\\"
local ArcanumLeftButtonClick = {};
local ArcanumMiddleButtonClick = {};
local ArcanumRightButtonClick = {};
local ArcanumInsideDisplayClick = {};
local Buff_Minlvl = {1, 4, 17, 32, 46};
local Amplify_Minlvl = {18, 30, 42, 54};
local Dampen_Minlvl = {12, 24, 36, 48, 60};
local Water_Minlvl = {0, 5, 15, 25, 35, 45, 55};
local ArcanumTradeNB = 1;
local ArcanumTradeFoodNB = 1;
local ArcanumTradeWaterNB = 1;
local ArcanumTradeNow = false;
local ArcanumTradeOpened = false;
local ArcanumTradeAccept = false;
local ArcanumTradeAcceptT = 0;
local ArcanumTradeAcceptTimer = 1.5;
local IceblockReady = false;
local IceblockCounter = 0;
local SelectedOrderButton;
local ArcanumT = 0;
local ArcanumButtonDisplayT = 1;
local ArcanumButtonDisplayTimer = 10;
local ArcanumButtonDisplayValue = 1;
local ArcanumButtonDisplayImage = nil;
local ArcanumButtonDisplayFlashing = false;
local ArcanumButtonDisplayTexture;
local ArcanumButtonDisplayTexture = {nil, nil, nil, nil, nil, nil, nil, nil};
local CoolDown = {
{nil, true, HearthstoneLocation[1], HearthstoneLocation[2]},
{nil, true, ManaGemLocation[1][1], ManaGemLocation[1][2]},
{nil, true, ARCANUM_SPELL_TABLE.ID[26], nil},
{nil, true, ARCANUM_SPELL_TABLE.ID[32], nil},
{nil, true, ARCANUM_SPELL_TABLE.ID[33], nil},
{nil, true, ARCANUM_SPELL_TABLE.ID[26], nil},
{nil, true, ARCANUM_SPELL_TABLE.ID[32], nil},
{nil, true, ARCANUM_SPELL_TABLE.ID[33], nil},
};
------------------------------------------------------------------------------------------------------
-- FONCTIONS DE L'INTERFACE
------------------------------------------------------------------------------------------------------
-- Fonction applique au chargement
function Arcanum_OnLoad()
playerClass, englishClass = UnitClass("player");
if englishClass == "MAGE" then
this:RegisterForDrag("LeftButton");
this:RegisterForClicks("LeftButtonUp", "MiddleButtonUp", "RightButtonUp");
-- Enregistrement des événements interceptés par ARCANUM
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:RegisterEvent("PLAYER_LEAVING_WORLD");
this:RegisterEvent("BAG_UPDATE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS");
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF");
this:RegisterEvent("CHAT_MSG_SPELL_BREAK_AURA");
this:RegisterEvent("PLAYER_REGEN_DISABLED");
this:RegisterEvent("PLAYER_REGEN_ENABLED");
this:RegisterEvent("SPELLCAST_START");
this:RegisterEvent("SPELLCAST_FAILED");
this:RegisterEvent("SPELLCAST_INTERRUPTED");
this:RegisterEvent("SPELLCAST_STOP");
this:RegisterEvent("LEARNED_SPELL_IN_TAB");
this:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER");
this:RegisterEvent("PLAYER_TARGET_CHANGED");
this:RegisterEvent("TRADE_REQUEST");
this:RegisterEvent("TRADE_REQUEST_CANCEL");
this:RegisterEvent("TRADE_SHOW");
this:RegisterEvent("TRADE_CLOSED");
this:RegisterEvent("TRADE_ACCEPT_UPDATE");
this:RegisterEvent("TRADE_PLAYER_ITEM_CHANGED");
this:RegisterEvent("MERCHANT_SHOW");
this:RegisterEvent("MERCHANT_CLOSED");
this:RegisterEvent("PLAYER_LEVEL_UP");
-- Enregistrement des commandes console
SlashCmdList["Arcanum"] = Arcanum_Slash;
SLASH_Arcanum1 = "/arcanum";
SLASH_Arcanum2 = "/arca";
end
end
-- Fonction d'initialisation
function Arcanum_Initialize()
if englishClass == "MAGE" then
-- On charge (ou on créé) la configuration pour le joueur et on l'affiche sur la console
if ArcanumConfig == nil or ArcanumConfig.Version ~= Default_ArcanumConfig.Version then
ArcanumConfig = {};
ArcanumConfig = Default_ArcanumConfig;
if (ArcanumConfig.ArcanumLanguage == "enUS") or (ArcanumConfig.ArcanumLanguage == "enGB") then
Arcanum_Localization_Dialog_En();
elseif (ArcanumConfig.ArcanumLanguage == "deDE") then
Arcanum_Localization_Dialog_De();
else
Arcanum_Localization_Dialog_Fr();
end
Arcanum_Msg(ARCANUM_MESSAGE.Interface.DefaultConfig, "USER");
ArcanumButton:ClearAllPoints();
else
if (ArcanumConfig.ArcanumLanguage == "enUS") or (ArcanumConfig.ArcanumLanguage == "enGB") then
Arcanum_Localization_Dialog_En();
elseif (ArcanumConfig.ArcanumLanguage == "deDE") then
Arcanum_Localization_Dialog_De();
else
Arcanum_Localization_Dialog_Fr();
end
Arcanum_Msg(ARCANUM_MESSAGE.Interface.UserConfig, "USER");
end
-- Recupertation du nom du joueur
PlayerName = UnitName("player");
PlayerLevel = UnitLevel("player");
Arcanum_LoadConfig();
-- Chargement des sorts du joueur
Arcanum_SpellSetup();
if ArcanumConfig.LastPortal == 1 then
for i = 14, 19 do
if ARCANUM_SPELL_TABLE.ID[i] ~= nil then
ArcanumConfig.LastPortal = i;
break;
end
end
end
if ARCANUM_SPELL_TABLE.ID[2] == nil then
ArcanumConfig.LastArmor = 1;
end
--Chargements de l'UI et décompte des composants
Arcanum_BagExplore();
Arcanum_InitButtons();
if (ArcanumConfig.ArcanumLockServ == false) then
Arcanum_UpdateMenuPos();
else
Arcanum_UpdateButtonsScale();
end
Arcanum_ButtonSetup();
Arcanum_LoadIcons();
ArcanumMinimapButtonTexture:SetTexture(ARCANUM_SPELL_TABLE.Texture[4]);
ArcanumMinimapButtonTexture2:SetTexture(UIPath.."ButtonCircle");
ArcanumMinimapButtonTexture2:SetVertexColor(ArcanumConfig.ButtonColor.r, ArcanumConfig.ButtonColor.g, ArcanumConfig.ButtonColor.b);
ArcanumButtonTexture:SetTexture(UIPath.."ArcanumN");
ArcanumOrderButtonTexture:SetTexture(UIPath.."ArcanumN");
ArcanumOrderButtonTexture2:SetTexture(UIPath.."Overlay");
ArcanumButtonTexture3:SetTexture(UIPath.."Overlay");
if ArcanumConfig.Toggle == false then
Arcanum_HideUI();
Arcanum_Msg(ARCANUM_MESSAGE.Interface.InitOff, "USER");
else
Arcanum_Msg(ARCANUM_MESSAGE.Interface.InitOn, "USER");
end
else
ArcanumConfig = {};
Arcanum_HideUI();
end
end
-- Fonction permettant le dplacement d'lments de Arcanum sur l'écran
function Arcanum_OnDragStart(button)
if (button == "ArcanumIcon") then GameTooltip:Hide(); end
button:StartMoving();
end
-- Fonction arrêtant le déplacement d'éléments de ARCANUM sur l'écran
function Arcanum_OnDragStop(button)
if (button == "ArcanumIcon") then Arcanum_BuildTooltip("OVERALL"); end
button:StopMovingOrSizing();
end
-- Fonction lance la mise jour de l'interface (main) -- toutes les 0,1 secondes environ
function Arcanum_OnUpdate()
--Si c'est la premiere update on initialize
if Loaded == false then
Arcanum_Initialize();
Loaded = true;
end
if englishClass == "MAGE" then
Arcanum_MenuFading();
Arcanum_DisplayFading();
ArcanumT = ArcanumT + arg1;
if ArcanumT >= ArcanumButtonDisplayT then
ArcanumButtonDisplayT = ArcanumButtonDisplayT + 0.5;
Arcanum_Cooldown();
ArcanumButton_TextDisplay();
end
if ArcanumT >= ArcanumButtonDisplayTimer then
ArcanumButton_ImageDisplay();
ArcanumT = 0;
ArcanumButtonDisplayT = 1;
end
if ArcanumTradeAccept == true then
ArcanumTradeAcceptT = ArcanumTradeAcceptT + arg1
if ArcanumTradeAcceptT > ArcanumTradeAcceptTimer then
ArcanumTradeAccept = false
AcceptTrade();
end
end
if IceblockDone == true then
IceblockCounter = IceblockCounter + arg1;
if IceblockCounter >= 3 then
IceblockReady = true;
IceblockCounter = 0;
end
end
-- On met jour la localisation du joueur
PlayerZone = GetRealZoneText();
end
end
function Arcanum_OnEvent(event)
if (not Loaded) or englishClass ~= "MAGE" then
return;
end
if (event == "PLAYER_ENTERING_WORLD") then
this:RegisterEvent("BAG_UPDATE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS");
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF");
this:RegisterEvent("CHAT_MSG_SPELL_BREAK_AURA");
this:RegisterEvent("PLAYER_REGEN_DISABLED");
this:RegisterEvent("PLAYER_REGEN_ENABLED");
this:RegisterEvent("SPELLCAST_START");
this:RegisterEvent("SPELLCAST_FAILED");
this:RegisterEvent("SPELLCAST_INTERRUPTED");
this:RegisterEvent("SPELLCAST_STOP");
this:RegisterEvent("LEARNED_SPELL_IN_TAB");
this:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE");
this:RegisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER");
this:RegisterEvent("PLAYER_TARGET_CHANGED");
this:RegisterEvent("TRADE_REQUEST");
this:RegisterEvent("TRADE_REQUEST_CANCEL");
this:RegisterEvent("TRADE_SHOW");
this:RegisterEvent("TRADE_CLOSED");
this:RegisterEvent("TRADE_ACCEPT_UPDATE");
this:RegisterEvent("TRADE_PLAYER_ITEM_CHANGED");
this:RegisterEvent("MERCHANT_SHOW");
this:RegisterEvent("MERCHANT_CLOSED");
this:RegisterEvent("PLAYER_LEVEL_UP");
elseif (event == "PLAYER_LEAVING_WORLD") then
this:UnregisterEvent("BAG_UPDATE");
this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS");
this:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_SELF");
this:UnregisterEvent("CHAT_MSG_SPELL_BREAK_AURA");
this:UnregisterEvent("PLAYER_REGEN_DISABLED");
this:UnregisterEvent("PLAYER_REGEN_ENABLED");
this:UnregisterEvent("SPELLCAST_START");
this:UnregisterEvent("SPELLCAST_FAILED");
this:UnregisterEvent("SPELLCAST_INTERRUPTED");
this:UnregisterEvent("SPELLCAST_STOP");
this:UnregisterEvent("LEARNED_SPELL_IN_TAB");
this:UnregisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE");
this:UnregisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE");
this:UnregisterEvent("CHAT_MSG_SPELL_AURA_GONE_OTHER");
this:UnregisterEvent("PLAYER_TARGET_CHANGED");
this:UnregisterEvent("TRADE_REQUEST");
this:UnregisterEvent("TRADE_REQUEST_CANCEL");
this:UnregisterEvent("TRADE_SHOW");
this:UnregisterEvent("TRADE_CLOSED");
this:UnregisterEvent("TRADE_ACCEPT_UPDATE");
this:UnregisterEvent("TRADE_PLAYER_ITEM_CHANGED");
this:UnregisterEvent("MERCHANT_SHOW");
this:UnregisterEvent("MERCHANT_CLOSED");
this:UnregisterEvent("PLAYER_LEVEL_UP");
-- Changement de couleur suivant le mode Combat
elseif (event == "PLAYER_REGEN_DISABLED") then
Arcanum_CombatDisableIcons();
elseif (event == "PLAYER_REGEN_ENABLED") then
Arcanum_CombatEnableIcons();
-- Si un nouveau sort est apris, on rafraichie le tableau des sorts
elseif (event == "LEARNED_SPELL_IN_TAB") then
Arcanum_SpellSetup();
Arcanum_ButtonSetup();
Arcanum_CreateMenu();
Arcanum_LoadIcons();
-- Gestion de la fin de l'incantation des sorts
elseif (event == "SPELLCAST_STOP") then
Arcanum_SpellManagement();
-- Quand le mage commence incanter un sort, on intercepte le nom de celui-ci
-- On sauve également le nom de la cible du sort ainsi que son niveau
elseif (event == "SPELLCAST_START") then
SpellCastName = arg1;
SpellTargetName = UnitName("target");
if not SpellTargetName then
SpellTargetName = "";
end
SpellTargetLevel = UnitLevel("target");
if not SpellTargetLevel then
SpellTargetLevel = "";
end
-- Quand le mage stoppe son incantation, on relache le nom de celui-ci
elseif (event == "SPELLCAST_FAILED") or (event == "SPELLCAST_INTERRUPTED") then
SpellCastName = nil;
SpellCastRank = nil;
SpellTargetName = nil;
SpellTargetLevel = nil;
elseif event == "CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE" then
elseif event == "CHAT_MSG_SPELL_AURA_GONE_OTHER" then
elseif event == "TRADE_REQUEST" or event == "TRADE_SHOW" then
if ArcanumTradeNow == true then
Arcanum_Trade();
ArcanumTradeOpened = true;
ArcanumTradeAcceptT = 0;
ArcanumtTradeAccept = true;
ArcanumTradeNow = false;
end
elseif event == "TRADE_REQUEST_CANCEL" or event == "TRADE_CLOSED" then
ArcanumTradeNB = 1;
ArcanumTradeFoodNB = 1;
ArcanumTradeWaterNB = 1;
ArcanumTradeOpened = false;
elseif event=="TRADE_ACCEPT_UPDATE" then
elseif event=="TRADE_PLAYER_ITEM_CHANGED" then
ArcanumTradeNB = ArcanumTradeNB + 1;
elseif (event == "BAG_UPDATE") then
Arcanum_BagExplore();
Arcanum_CreateMenu();
Arcanum_LoadIconsV();
Arcanum_EDIcons();
if (ArcanumConfig.Powder > ArcanumArcanePowder or ArcanumConfig.Teleport > ArcanumRuneOfTeleportation or ArcanumConfig.Portal > ArcanumRuneOfPortals) then
ReagentBought = false;
end
elseif (event == "MERCHANT_SHOW") then
MerchantOpened = true;
if ArcanumConfig.ReagentBuy == true then
if ReagentBought == false then
Arcanum_AutoBuy();
end
end
elseif (event == "MERCHANT_CLOSED") then
MerchantOpened = false;
elseif (event == "PLAYER_LEVEL_UP") then
PlayerLevel = UnitLevel("player");
end
end
-- Gestion du clic sur Arcanum
-- Clique gauche: Passe Arcanum en mode buff Individuel/Classe
-- Clique droit: Pierre de Foyer
function Arcanum_OnClick(button)
if (button == "LeftButton") then
Arcanum_Click(ArcanumConfig.LeftClick);
elseif (button == "MiddleButton") then
Arcanum_Click(ArcanumConfig.MiddleClick);
elseif (button == "RightButton") then
Arcanum_Click(ArcanumConfig.RightClick);
end
end
-- Création et Affichage des bulles d'aides
function Arcanum_BuildTooltip(button, anchor, type)
--on verifie que les aides sont activés
if (ArcanumConfig.Tooltip == 1) then
-- Definie à qui apartient la bulle d'aide
GameTooltip:SetOwner(button, anchor);
if (type == "Mount") then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TRANSLATION.Mounting.." "..MountName[ArcanumConfig.LastMount].."\n"..ARCANUM_MESSAGE.Tooltip.MiddleClick..ARCANUM_TRANSLATION.Hearth));
if (CoolDown[1][1] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.Cooldown..CoolDown[1][1]));
end
elseif (type == "Buff") and ArcanumConfig.LastBuff ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastBuff].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastBuff]));
elseif (type == "ArcaneIntellect") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[4]));
elseif (type == "ArcaneBrilliance") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[5]));
elseif (type == "Magic") and ArcanumConfig.LastMagic ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastMagic].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastMagic]));
elseif (type == "AmplifyMagic") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[7]));
elseif (type == "DampenMagic") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[6]));
elseif (type == "Armor") and ArcanumConfig.LastArmor ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastArmor].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastArmor]));
elseif (type == "FrostArmor") then
if (ARCANUM_SPELL_TABLE.ID[2] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[2]));
elseif (ARCANUM_SPELL_TABLE.ID[1] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[1]));
end
elseif (type == "MageArmor") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[3]));
elseif (type == "Food") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[8]));
elseif (type == "Water") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[9]));
elseif (type == "ManaGem") then
if (ARCANUM_SPELL_TABLE.ID[13] ~= nil and ManaGemExists[1] == false) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[13]));
elseif (ARCANUM_SPELL_TABLE.ID[12] ~= nil and ManaGemExists[2] == false) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[12]));
elseif (ARCANUM_SPELL_TABLE.ID[11] ~= nil and ManaGemExists[3] == false) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[11]));
elseif (ARCANUM_SPELL_TABLE.ID[10] ~= nil and ManaGemExists[4] == false) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[10]));
end
elseif (type == "Portal") and ArcanumConfig.LastPortal ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastPortal].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastPortal]));
elseif (type == "Teleport1") then
if (ARCANUM_SPELL_TABLE.ID[14] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[14]));
elseif (ARCANUM_SPELL_TABLE.ID[17] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[17]));
end
elseif (type == "Teleport2") then
if (ARCANUM_SPELL_TABLE.ID[15] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[15]));
elseif (ARCANUM_SPELL_TABLE.ID[18] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[18]));
end
elseif (type == "Teleport3") then
if (ARCANUM_SPELL_TABLE.ID[16] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[16]));
elseif (ARCANUM_SPELL_TABLE.ID[19] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[19]));
end
elseif (type == "Portal1") then
if (ARCANUM_SPELL_TABLE.ID[20] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[20]));
elseif (ARCANUM_SPELL_TABLE.ID[23] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[23]));
end
elseif (type == "Portal2") then
if (ARCANUM_SPELL_TABLE.ID[21] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[21]));
elseif (ARCANUM_SPELL_TABLE.ID[24] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[24]));
end
elseif (type == "Portal3") then
if (ARCANUM_SPELL_TABLE.ID[22] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[22]));
elseif (ARCANUM_SPELL_TABLE.ID[25] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg("Mana : "..ARCANUM_SPELL_TABLE.Mana[25]));
end
-- Soit c'est le bouton principal
elseif (type == "Main") then
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumArcanePowder).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.ArcanePowder));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumRuneOfTeleportation).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.RuneOfTeleportation));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumRuneOfPortals).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.RuneOfPortals));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumLightFeathers).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.LightFeathers));
GameTooltip:AddLine(" ");
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.LeftClick..ARCANUM_CLICK[ArcanumConfig.LeftClick]));
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.MiddleClick..ARCANUM_CLICK[ArcanumConfig.MiddleClick]));
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.RightClick..ARCANUM_CLICK[ArcanumConfig.RightClick]));
elseif (type == "Minimap") then
GameTooltip:AddLine(Arcanum_ColoredMsg("Arcanum").."|CFFFFFFFF: ".."\n"..ARCANUM_MESSAGE.Tooltip.Minimap);
elseif (type == "SpellTimer") then
Arcanum_MoneyToggle();
ArcanumTooltip:SetBagItem(HearthstoneLocation[1], HearthstoneLocation[2]);
local itemName = tostring(ArcanumTooltipTextLeft5:GetText());
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA[type].Text));
if string.find(itemName, ARCANUM_TRANSLATION.Cooldown) then
GameTooltip:AddLine(Arcanum_MsgAddColor(ARCANUM_TRANSLATION.Hearth.." - "..itemName));
else
GameTooltip:AddLine(Arcanum_MsgAddColor(ARCANUM_TOOLTIP_DATA[type].Right..GetBindLocation()));
end
end
-- On affiche
GameTooltip:Show();
elseif (ArcanumConfig.Tooltip == 2) then
-- Definie qui apartient la bulle d'aide
GameTooltip:SetOwner(button, anchor);
if (type == "Mount") then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TRANSLATION.Mounting.." "..MountName[ArcanumConfig.LastMount].."\n"..ARCANUM_MESSAGE.Tooltip.MiddleClick..ARCANUM_TRANSLATION.Hearth));
if (CoolDown[1][1] ~= nil) then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.Cooldown..CoolDown[1][1]));
end
elseif (type == "Buff") and ArcanumConfig.LastBuff ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastBuff].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastBuff]));
elseif (type == "ArcaneIntellect") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[4],1);
elseif (type == "ArcaneBrilliance") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[5],1);
elseif (type == "Magic") and ArcanumConfig.LastMagic ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastMagic].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastMagic]));
elseif (type == "AmplifyMagic") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[7],1);
elseif (type == "DampenMagic") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[6],1);
elseif (type == "Armor") and ArcanumConfig.LastArmor ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastArmor].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastArmor]));
elseif (type == "FrostArmor") then
if (ARCANUM_SPELL_TABLE.Mana[2] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[2],1);
elseif (ARCANUM_SPELL_TABLE.Mana[1] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[1],1);
end
elseif (type == "MageArmor") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[3],1);
elseif (type == "Food") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[8],1);
elseif (type == "Water") then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[9],1);
elseif (type == "ManaGem") then
if (ARCANUM_SPELL_TABLE.ID[13] ~= nil and ManaGemExists[1] == false) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[13],1);
elseif (ARCANUM_SPELL_TABLE.ID[12] ~= nil and ManaGemExists[2] == false) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[12],1);
elseif (ARCANUM_SPELL_TABLE.ID[11] ~= nil and ManaGemExists[3] == false) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[11],1);
elseif (ARCANUM_SPELL_TABLE.ID[10] ~= nil and ManaGemExists[4] == false) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[10],1);
end
elseif (type == "Portal") and ArcanumConfig.LastPortal ~= 0 then
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA.LastSpell.."\n"..ARCANUM_SPELL_TABLE.Name[ArcanumConfig.LastPortal].."\nMana : "..ARCANUM_SPELL_TABLE.Mana[ArcanumConfig.LastPortal]));
elseif (type == "Teleport1") then
if (ARCANUM_SPELL_TABLE.ID[14] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[14],1);
elseif (ARCANUM_SPELL_TABLE.ID[17] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[17],1);
end
elseif (type == "Teleport2") then
if (ARCANUM_SPELL_TABLE.ID[15] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[15],1);
elseif (ARCANUM_SPELL_TABLE.ID[18] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[18],1);
end
elseif (type == "Teleport3") then
if (ARCANUM_SPELL_TABLE.ID[16] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[16],1);
elseif (ARCANUM_SPELL_TABLE.ID[19] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[19],1);
end
elseif (type == "Portal1") then
if (ARCANUM_SPELL_TABLE.ID[20] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[20],1);
elseif (ARCANUM_SPELL_TABLE.ID[23] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[23],1);
end
elseif (type == "Portal2") then
if (ARCANUM_SPELL_TABLE.ID[21] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[21],1);
elseif (ARCANUM_SPELL_TABLE.ID[24] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[24],1);
end
elseif (type == "Portal3") then
if (ARCANUM_SPELL_TABLE.ID[22] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[22],1);
elseif (ARCANUM_SPELL_TABLE.ID[25] ~= nil) then
GameTooltip:SetSpell(ARCANUM_SPELL_TABLE.ID[25],1);
end
-- Soit c'est le bouton principal
elseif (type == "Main") then
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumArcanePowder).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.ArcanePowder));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumRuneOfTeleportation).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.RuneOfTeleportation));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumRuneOfPortals).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.RuneOfPortals));
GameTooltip:AddLine(Arcanum_MsgAddColor("<white>"..ArcanumLightFeathers).." "..Arcanum_ColoredMsg(ARCANUM_ITEM.LightFeathers));
GameTooltip:AddLine(" ");
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.LeftClick..ARCANUM_CLICK[ArcanumConfig.LeftClick]));
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.MiddleClick..ARCANUM_CLICK[ArcanumConfig.MiddleClick]));
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_MESSAGE.Tooltip.RightClick..ARCANUM_CLICK[ArcanumConfig.RightClick]));
elseif (type == "Minimap") then
GameTooltip:AddLine("|CFF0050FFAr|CFF0080FFca|CFF00B0FFnum|CFFFFFFFF: ".."\n"..ARCANUM_MESSAGE.Tooltip.Minimap);
elseif (type == "SpellTimer") then
Arcanum_MoneyToggle();
ArcanumTooltip:SetBagItem(HearthstoneLocation[1], HearthstoneLocation[2]);
local itemName = tostring(ArcanumTooltipTextLeft5:GetText());
GameTooltip:AddLine(Arcanum_ColoredMsg(ARCANUM_TOOLTIP_DATA[type].Text));
if string.find(itemName, ARCANUM_TRANSLATION.Cooldown) then
GameTooltip:AddLine(Arcanum_MsgAddColor(ARCANUM_TRANSLATION.Hearth.." - "..itemName));
else
GameTooltip:AddLine(Arcanum_MsgAddColor(ARCANUM_TOOLTIP_DATA[type].Right..GetBindLocation()));
end
end
-- On affiche
GameTooltip:Show();
end
end
function Arcanum_CallToolTip(Id)
ToolTipList = {
{},
{},
{},
{"Buff", "ArcaneIntellect", "ArcaneBrilliance"},
{"Armor", "FrostArmor", "MageArmor"},
{"Magic", "DampenMagic", "AmplifyMagic"},
{},
{"Portal", "Teleport1", "Portal1"},
{nil, "Teleport2", "Portal2"},
{nil, "Teleport3", "Portal3"},
};
if ArcanumConfig.InterfaceVersion == 1 then
Arcanum_BuildTooltip(this,"ANCHOR_CURSOR",ToolTipList[Id][1]);
else
if ArcanumConfig.BuffType == 0 then
Arcanum_BuildTooltip(this,"ANCHOR_CURSOR",ToolTipList[Id][2]);
else
Arcanum_BuildTooltip(this,"ANCHOR_CURSOR",ToolTipList[Id][3]);
end
end
end
------------------------------------------------------------------------------------------------------
-- FONCTIONS DE CHARGEMENT DE LA CONFIGURATION
------------------------------------------------------------------------------------------------------
function Arcanum_LoadConfig()
if (ArcanumConfig.ChatType) then ArcanumChatType_Button:SetChecked(1); end
if (ArcanumConfig.PortalMessage) then ArcanumPortalMessage_Button:SetChecked(1); end
if (ArcanumConfig.Display[1]) then ArcanumDisplayHearthStone_Button:SetChecked(1); end
if (ArcanumConfig.Display[2]) then ArcanumDisplayManaGem_Button:SetChecked(1); end
if (ArcanumConfig.Display[3]) then ArcanumDisplayEvocation_Button:SetChecked(1); end
if (ArcanumConfig.Display[4]) then ArcanumDisplayIceBlock_Button:SetChecked(1); end
if (ArcanumConfig.Display[5]) then ArcanumDisplayColdSnap_Button:SetChecked(1); end
if (ArcanumConfig.Display[6]) then ArcanumDisplayIntell_Button:SetChecked(1); end
if (ArcanumConfig.Display[7]) then ArcanumDisplayArmor_Button:SetChecked(1); end
if (ArcanumConfig.Display[8]) then ArcanumDisplayBandage_Button:SetChecked(1); end
if (ArcanumConfig.Toggle) then ArcanumToggle_Button:SetChecked(1); end
if (ArcanumConfig.NoDragAll) then
ArcanumLock_Button:SetChecked(1);
Arcanum_NoDrag();
ArcanumButton:RegisterForDrag("");
end
if (ArcanumConfig.ArcanumLockServ) then ArcanumIconsLock_Button:SetChecked(1); end
if (ArcanumConfig.BuffMenuPos == "y") then ArcanumBuffMenu_Button:SetChecked(1); end
if (ArcanumConfig.ArmorMenuPos == "y") then ArcanumArmorMenu_Button:SetChecked(1); end
if (ArcanumConfig.MagicMenuPos == "y") then ArcanumMagicMenu_Button:SetChecked(1); end
if (ArcanumConfig.PortalMenuPos == "y") then ArcanumPortalMenu_Button:SetChecked(1); end
if (ArcanumConfig.MountMenuPos == "y") then ArcanumMountMenu_Button:SetChecked(1); end
if (ArcanumConfig.ReagentSort) then ArcanumReagentSort_Button:SetChecked(1); end
if (ArcanumConfig.ReagentBuy) then ArcanumReagentBuy_Button:SetChecked(1); end
if (ArcanumConfig.LevelBuff) then ArcanumLevelBuff_Button:SetChecked(1); end
if ArcanumConfig.ConsumeFood == "Right" then
ArcanumConsumeRightFood_Button:SetChecked(1);
else
ArcanumConsumeLeftFood_Button:SetChecked(1);
end
if (ArcanumConfig.RandMount) then ArcanumRandMount_Button:SetChecked(1); end
if (ArcanumConfig.InterfaceVersion == 1)then
ArcanumInterfaceVersion_Button:SetChecked(1);
else
ArcanumInterfaceVersion2_Button:SetChecked(1);
end
if (ArcanumConfig.BuffButton) then ArcanumBuffButton_Button:SetChecked(1); end
if (ArcanumConfig.ArmorButton) then ArcanumArmorButton_Button:SetChecked(1); end
if (ArcanumConfig.MagicButton) then ArcanumMagicButton_Button:SetChecked(1); end
if (ArcanumConfig.PortalButton) then ArcanumPortalButton_Button:SetChecked(1); end
if (ArcanumConfig.MountButton) then ArcanumMountButton_Button:SetChecked(1); end
if (ArcanumConfig.FoodButton) then ArcanumFoodButton_Button:SetChecked(1); end
if (ArcanumConfig.WaterButton) then ArcanumWaterButton_Button:SetChecked(1); end
if (ArcanumConfig.ManaGemButton) then ArcanumManaGemButton_Button:SetChecked(1); end
if (ArcanumConfig.MinimapIcon) then ArcanumMinimapIcon_Button:SetChecked(1); end
if ArcanumConfig.ArcanumLanguage == "deDE" then
ArcanumLanguage_Slider:SetValue(3);
elseif ArcanumConfig.ArcanumLanguage == "enUS" then
ArcanumLanguage_Slider:SetValue(2);
else
ArcanumLanguage_Slider:SetValue(1);
end
ArcanumLanguage_SliderText:SetText(Arcanum_ColoredMsg("Langue / Language / Sprache"));
ArcanumLanguage_SliderLow:SetText("");
ArcanumLanguage_SliderHigh:SetText("");
-- Paramtères des glissières
ArcanumTooltip_SliderText:SetText(Arcanum_ColoredMsg("Tooltips"));
ArcanumTooltip_SliderLow:SetText("");
ArcanumTooltip_SliderHigh:SetText("");
ArcanumTooltip_Slider:SetValue(ArcanumConfig.Tooltip);
ArcanumEvocationLimit_Slider:SetValue(ArcanumConfig.EvocationLimit);
ArcanumEvocationLimit_SliderLow:SetText("0 %");
ArcanumEvocationLimit_SliderHigh:SetText("100 %");
ArcanumBag_Slider:SetValue(4 - ArcanumConfig.ReagentContainer);
ArcanumBag_SliderLow:SetText("5");
ArcanumBag_SliderHigh:SetText("1");
ArcanumPowder_EditBox:SetTextColor(0,0.5,1);
ArcanumPowder_EditBox:SetNumber(ArcanumConfig.Powder);
ArcanumPowder_EditBox:SetNumeric(true);
ArcanumTeleport_EditBox:SetTextColor(0,0.5,1);
ArcanumTeleport_EditBox:SetNumber(ArcanumConfig.Teleport);
ArcanumTeleport_EditBox:SetNumeric(true);
ArcanumPortal_EditBox:SetTextColor(0,0.5,1);
ArcanumPortal_EditBox:SetNumber(ArcanumConfig.Portal);
ArcanumPortal_EditBox:SetNumeric(true);
ArcanumButtonRotate_Slider:SetValue(ArcanumConfig.ArcanumAngle);
ArcanumButtonRotate_SliderLow:SetText("0");
ArcanumButtonRotate_SliderHigh:SetText("360");
ArcanumButtonScale_Slider:SetValue(ArcanumConfig.ArcanumButtonScale);
ArcanumButtonScale_SliderLow:SetText("50 %");
ArcanumButtonScale_SliderHigh:SetText("150 %");
ArcanumButton:SetScale(ArcanumConfig.ArcanumButtonScale / 100);
ArcanumMinimapRotate_Slider:SetValue(ArcanumConfig.MinimapIconPos);
ArcanumMinimapRotate_SliderLow:SetText("0");
ArcanumMinimapRotate_SliderHigh:SetText("360");
if ArcanumConfig.NoDragAll then
Arcanum_NoDrag();
ArcanumButton:RegisterForDrag("");
else
Arcanum_Drag();
ArcanumButton:RegisterForDrag("LeftButton");
end
Arcanum_LanguageInitialize();
end
function Arcanum_LanguageInitialize()
ArcanumLocalization();
-- Localisation du XML
ArcanumVersion:SetText(Arcanum_ColoredMsg(ArcanumData.AppName).."|CFFFFFFFF "..ArcanumData.Version.." by "..ArcanumData.Author);
ArcanumGeneralPageText:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.Menu1));
ArcanumMessagePlayer_Section:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.MessageMenu1));
ArcanumChatType_Option:SetText(ARCANUM_CONFIGURATION.ChatType);
ArcanumPortalMessage_Option:SetText(ARCANUM_CONFIGURATION.PortalMessage);
ArcanumButtonDisplay_Section:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ArcanumButtonDisplay));
ArcanumInsideDisplayDD:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.InsideDisplay));
ArcanumDisplayHearthStone_Option:SetText(ARCANUM_CONFIGURATION.DisplayHearthStone);
ArcanumDisplayManaGem_Option:SetText(ARCANUM_CONFIGURATION.DisplayManaGem);
ArcanumDisplayEvocation_Option:SetText(ARCANUM_CONFIGURATION.DisplayEvocation);
ArcanumDisplayIceBlock_Option:SetText(ARCANUM_CONFIGURATION.DisplayIceBlock);
ArcanumDisplayColdSnap_Option:SetText(ARCANUM_CONFIGURATION.DisplayColdSnap);
ArcanumDisplayIntell_Option:SetText(ARCANUM_CONFIGURATION.DisplayIntell);
ArcanumDisplayArmor_Option:SetText(ARCANUM_CONFIGURATION.DisplayArmor);
ArcanumDisplayBandage_Option:SetText(ARCANUM_CONFIGURATION.DisplayBandage);
ArcanumHealthColor_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.HealthColor));
ArcanumManaColor_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ManaColor));
ArcanumButtonColor_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ButtonColor));
ArcanumLevelBuff_Option:SetText(ARCANUM_CONFIGURATION.LevelBuff);
ArcanumEvocationLimit_SliderText:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.EvocationLimit));
ArcanumConsumeLeftFood_Option:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ConsumeLeftFood));
ArcanumConsumeRightFood_Option:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ConsumeRightFood));
ArcanumRandMount_Option:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.RandMount));
ArcanumDeleteFood_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.DeleteFood));
ArcanumDeleteWater_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.DeleteWater));
ArcanumDeleteManaGem_Button:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.DeleteManaGem));
ArcanumReagentSort_Option:SetText(ARCANUM_CONFIGURATION.ReagentSort);
ArcanumBag_SliderText:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ReagentBag));
ArcanumReagentBuy_Option:SetText(ARCANUM_CONFIGURATION.ReagentBuy);
ArcanumReagent_Section:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.Reagent));
ArcanumPowder_Section:SetText(ARCANUM_CONFIGURATION.Powder);
ArcanumTeleport_Section:SetText(ARCANUM_CONFIGURATION.Teleport);
ArcanumPortal_Section:SetText(ARCANUM_CONFIGURATION.Portal);
ArcanumToggle_Option:SetText(ARCANUM_CONFIGURATION.Toggle);
ArcanumInterfaceVersion_Option:SetText(ARCANUM_CONFIGURATION.InterfaceVersion);
ArcanumInterfaceVersion2_Option:SetText(ARCANUM_CONFIGURATION.InterfaceVersion2);
ArcanumLock_Option:SetText(ARCANUM_CONFIGURATION.Lock);
ArcanumIconsLock_Option:SetText(ARCANUM_CONFIGURATION.IconsLock);
ArcanumMenuPosition_Section:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.MenuPosition));
ArcanumBuffMenu_Option:SetText(ARCANUM_CONFIGURATION.BuffMenu);
ArcanumArmorMenu_Option:SetText(ARCANUM_CONFIGURATION.ArmorMenu);
ArcanumMagicMenu_Option:SetText(ARCANUM_CONFIGURATION.MagicMenu);
ArcanumPortalMenu_Option:SetText(ARCANUM_CONFIGURATION.PortalMenu);
ArcanumMountMenu_Option:SetText(ARCANUM_CONFIGURATION.MountMenu);
ArcanumButtonRotate_SliderText:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ArcanumRotation));
ArcanumButtonScale_SliderText:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.ArcanumSize));
ArcanumButton_Option:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.Button));
ArcanumOrder_Option:SetText(Arcanum_ColoredMsg(ARCANUM_CONFIGURATION.Order));
ArcanumBuffButton_Option:SetText(ARCANUM_CONFIGURATION.BuffButton);
ArcanumArmorButton_Option:SetText(ARCANUM_CONFIGURATION.ArmorButton);
ArcanumMagicButton_Option:SetText(ARCANUM_CONFIGURATION.MagicButton);
ArcanumPortalButton_Option:SetText(ARCANUM_CONFIGURATION.PortalButton);
ArcanumMountButton_Option:SetText(ARCANUM_CONFIGURATION.MountButton);