-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAtlasQuest.lua
1058 lines (927 loc) · 43 KB
/
AtlasQuest.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
--[[
AtlasQuest, a World of Warcraft addon.
Email me at [email protected]
This file is part of AtlasQuest.
AtlasQuest is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
AtlasQuest is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AtlasQuest; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--]]
-----------------------------------------------------------------------------
-- Colours
-----------------------------------------------------------------------------
local PURPLE = "|cff999999"; -- grey atm -- removed/useless atm
local RED = "|cffff0000";
local REDA = "|cffcc6666";
local WHITE = "|cffFFFFFF";
local GREEN = "|cff1eff00";
local GREY = "|cff9F3FFF"; -- purple now ^^
local BLUE = "|cff0070dd";
local ORANGE = "|cffff6090"; -- it is pink now
local YELLOW = "|cffffff00";
local BLACK = "|c0000000f";
local DARKGREEN = "|cff008000";
local BLUB = "|cffd45e19";
-- Quest Color
local Grau = "|cff9d9d9d"
local Gruen = "|cff1eff00"
local Orange = "|cffFF8000"
local Rot = "|cffFF0000"
local Gelb = "|cffFFd200"
local Blau = "|cff0070dd"
-----------------------------------------------------------------------------
-- Variables
-----------------------------------------------------------------------------
local Initialized = nil; -- the variables are not loaded yet
Allianceorhorde = 1; -- variable that configures whether horde or allianz is shown
AQINSTANZ = 1; -- currently shown instance-pic (see AtlasQuest_Instanzen.lua)
AQINSTATM = ""; -- variable to check whether AQINSTANZ has changed (see function AtlasQuestSetTextandButtons())
--AQ_ShownSide = "Left" -- configures at which side the AQ panel is shown
--AQAtlasAuto (option to show the AQpanel automatically at atlas-startup, 1=yes 2=no)
-- Sets the max number of instances and quests to check for.
local AQMAXINSTANCES = "68"
local AQMAXQUESTS = "23"
-- Set title for AtlasQuest side panel
ATLASQUEST_VERSION = ""..BLUE.."AtlasQuest 4.1.3";
AQ_ShownSide = "Left"
AQAtlasAuto = 1;
AQNOColourCheck = nil;
local AtlasQuest_Defaults = {
["Version"] = "4.1.3",
[UnitName("player")] = {
["ShownSide"] = "Left",
["AtlasAutoShow"] = 2,
["NOColourCheck"] = nil,
["CheckQuestlog"] = nil,
["AutoQuery"] = nil,
["NoQuerySpam"] = "yes",
["CompareTooltip"] = nil,
},
};
AQ = {};
-----------------------------------------------------------------------------
-- Functions
-----------------------------------------------------------------------------
--******************************************
-- Events: OnEvent
--******************************************
-----------------------------------------------------------------------------
-- Called when the player starts the game loads the variables
-----------------------------------------------------------------------------
function AtlasQuest_OnEvent()
if (event == "VARIABLES_LOADED") then
VariablesLoaded = 1; -- data is loaded completely
else
AtlasQuest_Initialize(); -- player enters world / initialize the data
end
end
-----------------------------------------------------------------------------
-- Detects whether the variables have to be loaded
-- or reestablishes them
-----------------------------------------------------------------------------
function AtlasQuest_Initialize()
if (Initialized or (not VariablesLoaded)) then
return;
end
if (not AtlasQuest_Options) then
AtlasQuest_Options = AtlasQuest_Defaults;
DEFAULT_CHAT_FRAME:AddMessage("AtlasQuest Options database not found. Generating...");
elseif (not AtlasQuest_Options[UnitName("player")]) then
DEFAULT_CHAT_FRAME:AddMessage("Generate default database for this character");
AtlasQuest_Options[UnitName("player")] = AtlasQuest_Defaults[UnitName("player")]
end
if (type(AtlasQuest_Options[UnitName("player")]) == "table") then
AQVersionCheck();
AtlasQuest_LoadData();
end
-- Register AQ Tooltip with EquipCompare if enabled.
if (AQCompareTooltip ~= nil) then
if IsAddOnLoaded("EquipCompare") then
EquipCompare_RegisterTooltip(AtlasQuestTooltip);
end
if IsAddOnLoaded("EQCompare") then
EQCompare:RegisterTooltip(AtlasQuestTooltip);
end
else
if IsAddOnLoaded("EquipCompare") then -- Unregister the AtlasQuest Tooltip with EquipCompare if it's enabled
EquipCompare_UnregisterTooltip(AtlasQuestTooltip);
end
if IsAddOnLoaded("EQCompare") then
EQCompare:UnRegisterTooltip(AtlasQuestTooltip);
end
end
Initialized = 1;
end
-----------------------------------------------------------------------------
-- New Version check
-----------------------------------------------------------------------------
function AQVersionCheck()
if (AtlasQuest_Options["Version"] == nil or AtlasQuest_Options["Version"] ~= AtlasQuest_Defaults["Version"] ) then
AtlasQuest_Options["Version"] = AtlasQuest_Defaults["Version"];
DEFAULT_CHAT_FRAME:AddMessage("First load after updating to "..ATLASQUEST_VERSION);
end
end
-----------------------------------------------------------------------------
-- Loads the saved variables
-----------------------------------------------------------------------------
function AtlasQuest_LoadData()
-- Which side
if(AtlasQuest_Options[UnitName("player")]["ShownSide"] ~= nil) then
AQ_ShownSide = AtlasQuest_Options[UnitName("player")]["ShownSide"];
end
-- atlas autoshow
if(AtlasQuest_Options[UnitName("player")]["AtlasAutoShow"] ~= nil) then
AQAtlasAuto = AtlasQuest_Options[UnitName("player")]["AtlasAutoShow"];
end
-- Colour Check? if nil = no cc; if true = cc
AQNOColourCheck = AtlasQuest_Options[UnitName("player")]["ColourCheck"];
-- Finished?
for i=1, AQMAXINSTANCES do
for b=1, AQMAXQUESTS do
AQ[ "AQFinishedQuest_Inst"..i.."Quest"..b ] = AtlasQuest_Options[UnitName("player")]["AQFinishedQuest_Inst"..i.."Quest"..b]
AQ[ "AQFinishedQuest_Inst"..i.."Quest"..b.."_HORDE" ] = AtlasQuest_Options[UnitName("player")]["AQFinishedQuest_Inst"..i.."Quest"..b.."_HORDE"]
end
end
--AQCheckQuestlog
AQCheckQuestlog = AtlasQuest_Options[UnitName("player")]["CheckQuestlog"];
-- AutoQuery option
AQAutoQuery = AtlasQuest_Options[UnitName("player")]["AutoQuery"];
-- Suppress Server Query Text option
AQNoQuerySpam = AtlasQuest_Options[UnitName("player")]["NoQuerySpam"];
-- Comparison Tooltips option
AQCompareTooltip = AtlasQuest_Options[UnitName("player")]["CompareTooltip"];
end
-----------------------------------------------------------------------------
-- Saves the variables
-----------------------------------------------------------------------------
function AtlasQuest_SaveData()
AtlasQuest_Options[UnitName("player")]["ShownSide"] = AQ_ShownSide;
AtlasQuest_Options[UnitName("player")]["AtlasAutoShow"] = AQAtlasAuto;
AtlasQuest_Options[UnitName("player")]["ColourCheck"] = AQNOColourCheck;
AtlasQuest_Options[UnitName("player")]["CheckQuestlog"] = AQCheckQuestlog;
AtlasQuest_Options[UnitName("player")]["AutoQuery"] = AQAutoQuery;
AtlasQuest_Options[UnitName("player")]["NoQuerySpam"] = AQNoQuerySpam;
AtlasQuest_Options[UnitName("player")]["CompareTooltip"] = AQCompareTooltip;
end
--******************************************
-- Events: OnLoad
--******************************************
-----------------------------------------------------------------------------
-- Call OnLoad set Variables and hides the panel
-----------------------------------------------------------------------------
function AQ_OnLoad()
this:RegisterEvent("PLAYER_ENTERING_WORLD");
this:RegisterEvent("VARIABLES_LOADED");
AQSetButtontext(); -- translation for all buttons
if ( AtlasFrame ) then
AQATLASMAP = AtlasMap:GetTexture()
else
AQATLASMAP = 99;
end
--this:RegisterForDrag("LeftButton");
AQSlashCommandfunction();
-- not showed yet
HideUIPanel(AtlasQuestFrame);
HideUIPanel(AtlasQuestInsideFrame);
HideUIPanel(AtlasQuestOptionFrame);
AQUpdateNOW = true;
end
-----------------------------------------------------------------------------
-- Slash command added
-----------------------------------------------------------------------------
function AQSlashCommandfunction()
SlashCmdList["ATLASQ"]=atlasquest_command;
SLASH_ATLASQ1="/aq";
SLASH_ATLASQ2="/atlasquest";
end
-----------------------------------------------------------------------------
-- Set the button text
-----------------------------------------------------------------------------
function AQSetButtontext()
STORYbutton:SetText(AQStoryB);
OPTIONbutton:SetText(AQOptionB);
AQOptionCloseButton:SetText(AQ_OK);
AQAutoshowOptionTEXT:SetText(AQOptionsAutoshowTEXT);
AQLEFTOptionTEXT:SetText(AQOptionsLEFTTEXT);
AQRIGHTOptionTEXT:SetText(AQOptionsRIGHTTEXT);
AQColourOptionTEXT:SetText(AQOptionsCCTEXT);
AQFQ_TEXT:SetText(AQFinishedTEXT);
AQCheckQuestlogTEXT:SetText(AQQLColourChange);
AQAutoQueryTEXT:SetText(AQOptionsAutoQueryTEXT);
AQNoQuerySpamTEXT:SetText(AQOptionsNoQuerySpamTEXT);
AQCompareTooltipTEXT:SetText(AQOptionsCompareTooltipTEXT);
end
-----------------------------------------------------------------------------
-- Slashcommand!! show/hide panel + Version Message
-----------------------------------------------------------------------------
function atlasquest_command(param)
-- Show help text if no /aq command used.
ChatFrame1:AddMessage(RED..AQHelpText);
--help text
if (param == "help") then
ChatFrame1:AddMessage(RED..AQHelpText);
-- hide show function
elseif (param == "show") then
ShowUIPanel(AtlasQuestFrame);
ChatFrame1:AddMessage("Shows AtlasQuest");
elseif (param == "hide") then
HideUIPanel(AtlasQuestFrame);
HideUIPanel(AtlasQuestInsideFrame);
ChatFrame1:AddMessage("Hides AtlasQuest");
-- right/left show function
elseif (param == "right") then
AQRIGHTOption_OnClick();
elseif (param == "left") then
AQLEFTOption_OnClick();
-- Options
elseif ((param == "option") or (param == "config")) then
ShowUIPanel(AtlasQuestOptionFrame);
--test messages
elseif (param == "test") then
AQTestmessages();
-- autoshow
elseif (param == "autoshow") then
AQAutoshowOption_OnClick()
-- CC
elseif (param == "colour") then
AQColourOption_OnClick();
--List of Instances
elseif (param == "list") then
ChatFrame1:AddMessage("Instances, and Numbers (Alphabetical Order):");
ChatFrame1:AddMessage("Blackfathom Deeps: 7");
ChatFrame1:AddMessage("Blackrock Depths: 5");
ChatFrame1:AddMessage("Blackrock Spire (Lower): 8");
ChatFrame1:AddMessage("Blackrock Spire (Upper): 9");
ChatFrame1:AddMessage("Blackwing Lair: 6");
ChatFrame1:AddMessage("Deadmines: 1");
ChatFrame1:AddMessage("Dire Maul: 10");
ChatFrame1:AddMessage("Gnomeregan: 29");
ChatFrame1:AddMessage("Maraudon: 13");
ChatFrame1:AddMessage("Molten Core: 14");
ChatFrame1:AddMessage("Naxxramas: 15");
ChatFrame1:AddMessage("Onyxia's Lair: 16");
ChatFrame1:AddMessage("RageFire Chasm: 3");
ChatFrame1:AddMessage("Razorfen Downs: 17");
ChatFrame1:AddMessage("Razorfen Kraul: 18");
ChatFrame1:AddMessage("Scarlet Monestary: 19");
ChatFrame1:AddMessage("Scholomance: 20");
ChatFrame1:AddMessage("Shadowfang Keep: 21");
ChatFrame1:AddMessage("Stratholme: 22");
ChatFrame1:AddMessage("The Ruins of Ahn Qiraj: 23");
ChatFrame1:AddMessage("The Stockade: 24");
ChatFrame1:AddMessage("The Sunken Temple: 25");
ChatFrame1:AddMessage("The Temple of Ahn Qiraj: 26");
ChatFrame1:AddMessage("Uldaman: 4");
ChatFrame1:AddMessage("Wailing Caverns: 2");
ChatFrame1:AddMessage("Zul Farrak: 27");
ChatFrame1:AddMessage("Zul Gurub: 28");
ChatFrame1:AddMessage("The Crescent Grove: 30"); -- TurtleWOW
ChatFrame1:AddMessage("Hateforge Quarry: 31"); -- TurtleWOW
ChatFrame1:AddMessage("Stormwind Vault: 32"); -- TurtleWOW
ChatFrame1:AddMessage("Black Morass: 33"); -- TurtleWOW
ChatFrame1:AddMessage("Karazhan Crypt: 34"); -- TurtleWOW
ChatFrame1:AddMessage("Gilneas City: 35"); -- TurtleWOW 1.17.0
ChatFrame1:AddMessage("Lower Karazhan Halls: 36"); -- TurtleWOW 1.17.0
ChatFrame1:AddMessage("Emerald Sanctum: 37"); -- TurtleWOW 1.17.0
--List of Alliance Quests
elseif (param == "inst a") then
ChatFrame1:AddMessage(RED..getglobal("Inst"..AQINSTANZ.."Caption"));
ChatFrame1:AddMessage(GREY..getglobal("Inst"..AQINSTANZ.."QAA"));
for q=1,23 do -- 21 original, TurtleWOW 23
ChatFrame1:AddMessage(Orange..getglobal("Inst"..AQINSTANZ.."Quest"..q));
end
--List of Horde Quests
elseif (param == "inst h") then
ChatFrame1:AddMessage(RED..getglobal("Inst"..AQINSTANZ.."Caption"));
ChatFrame1:AddMessage(GREY..getglobal("Inst"..AQINSTANZ.."QAH"));
for q=1,23 do -- 21 original, TurtleWOW 23
ChatFrame1:AddMessage(Orange..getglobal("Inst"..AQINSTANZ.."Quest"..q.."_HORDE"));
end
-- Very temporary fix to /AQ bug. Must find way to check if Param is an Integer. Where's isint()?
elseif (param == "1") then
ChatFrame1:AddMessage(RED..getglobal("Inst"..AQINSTANZ.."Caption"));
--Alliance
ChatFrame1:AddMessage(ORANGE.."Alliance Quest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param));
ChatFrame1:AddMessage("Level: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Level"));
ChatFrame1:AddMessage("Attain: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Attain"));
ChatFrame1:AddMessage("Goal: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Aim"));
ChatFrame1:AddMessage("Start: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Location"));
ChatFrame1:AddMessage("Note: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Note"));
ChatFrame1:AddMessage("Prequest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Prequest"));
ChatFrame1:AddMessage("Postquest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_Folgequest"));
--Horde
ChatFrame1:AddMessage(ORANGE.."Horde Quest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE"));
ChatFrame1:AddMessage("Level: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Level"));
ChatFrame1:AddMessage("Attain: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Attain"));
ChatFrame1:AddMessage("Goal: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Aim"));
ChatFrame1:AddMessage("Start: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Location"));
ChatFrame1:AddMessage("Note: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Note"));
ChatFrame1:AddMessage("Prequest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Prequest"));
ChatFrame1:AddMessage("Postquest: "..getglobal("Inst"..AQINSTANZ.."Quest"..param.."_HORDE_Folgequest"));
end
end
-----------------------------------------------------------------------------
-- Test Messages
-----------------------------------------------------------------------------
function AQTestmessages()
end
--******************************************
-- Events: OnUpdate
--******************************************
-----------------------------------------------------------------------------
-- Check which program is used (Atlas or AlphaMap)
-- hide panel if instance is 99 (nothing)
-----------------------------------------------------------------------------
function AQ_OnUpdate(arg1)
local previousValue = AQINSTANZ;
AQ_AtlasOrAMVISCheck(); -- Show whether atlas or am is shown atm
------- SEE AtlasQuest_Instanzen.lua
if (AtlasORAlphaMap == "Atlas") then
AtlasQuest_Instanzenchecken();
elseif (AtlasORAlphaMap == "AlphaMap") then
AtlasQuest_InstanzencheckAM();
end
-- Hides the panel if the map which is shown no quests have (map = 99)
if ( AQINSTANZ == 99) then
HideUIPanel(AtlasQuestFrame);
HideUIPanel(AtlasQuestInsideFrame);
elseif (( AQINSTANZ ~= previousValue ) or (AQUpdateNOW ~= nil)) then
AtlasQuestSetTextandButtons();
AQUpdateNOW = nil
AQ_SetCaption();
elseif ((AtlasORAlphaMap == "AlphaMap") and (AlphaMapAlphaMapFrame:IsVisible() == nil)) then
HideUIPanel(AtlasQuestFrame);
HideUIPanel(AtlasQuestInsideFrame);
end
end
-----------------------------------------------------------------------------
-- Show whether atlas or am is shown atm
-----------------------------------------------------------------------------
function AQ_AtlasOrAMVISCheck()
if ((AtlasFrame ~= nil) and (AtlasFrame:IsVisible())) then
AtlasORAlphaMap = "Atlas";
elseif (AlphaMapFrame:IsVisible()) then
AtlasORAlphaMap = "AlphaMap";
end
end
-----------------------------------------------------------------------------
-- AlphaMap parent change
-----------------------------------------------------------------------------
function AQ_AtlasOrAlphamap()
if ((AtlasFrame ~= nil) and (AtlasFrame:IsVisible())) then
AtlasORAlphaMap = "Atlas";
--
AtlasQuestFrame:SetParent(AtlasFrame);
if (AQ_ShownSide == "Right" ) then
AtlasQuestFrame:ClearAllPoints();
AtlasQuestFrame:SetPoint("TOP","AtlasFrame", 567, -30); --AtlasQuest right frame position TurtleWOW
else
AtlasQuestFrame:ClearAllPoints();
AtlasQuestFrame:SetPoint("TOP","AtlasFrame", -556, -30); --AtlasQuest left frame position TurtleWOW
end
AtlasQuestInsideFrame:SetParent(AtlasFrame);
AtlasQuestInsideFrame:ClearAllPoints();
AtlasQuestInsideFrame:SetPoint("TOPLEFT","AtlasFrame", 18, -84); --AtlasQuest Description Frame. a little bit lower than AtlasQuest frame so it doesnt cover Atlas Continent and Dungeon menu
elseif ((AlphaMapFrame ~= nil) and (AlphaMapFrame:IsVisible())) then
AtlasORAlphaMap = "AlphaMap";
--
AtlasQuestFrame:SetParent(AlphaMapFrame);
if (AQ_ShownSide == "Right" ) then
AtlasQuestFrame:ClearAllPoints();
AtlasQuestFrame:SetPoint("TOP","AlphaMapFrame", 400, -107);
else
AtlasQuestFrame:ClearAllPoints();
AtlasQuestFrame:SetPoint("TOPLEFT","AlphaMapFrame", -195, -107);
end
AtlasQuestInsideFrame:SetParent(AlphaMapFrame);
AtlasQuestInsideFrame:ClearAllPoints();
AtlasQuestInsideFrame:SetPoint("TOPLEFT","AlphaMapFrame", 1, -108);
end
end
-----------------------------------------------------------------------------
-- Set the ZoneName
-----------------------------------------------------------------------------
function AQ_SetCaption()
Ueberschriftborder:SetText();
if (getglobal("Inst"..AQINSTANZ.."Caption") ~= nil) then
Ueberschriftborder:SetText(getglobal("Inst"..AQINSTANZ.."Caption"))
end
end
-----------------------------------------------------------------------------
-- Set the Buttontext and the buttons if available
-- and check whether its a other inst or not -> works fine
-- added: Check for Questline arrows
-- Questline arrows are shown if InstXQuestYFQuest = "true"
-- QuestStart icon are shown if InstXQuestYPreQuest = "true"
-----------------------------------------------------------------------------
function AtlasQuestSetTextandButtons()
local AQQuestlevelf
local AQQuestfarbe
local AQQuestfarbe2
if (AQINSTATM ~= AQINSTANZ) then
HideUIPanel(AtlasQuestInsideFrame);
end
if (getglobal("Inst"..AQINSTANZ.."General") ~= nil) then
AQGeneralButton:Enable();
else
AQGeneralButton:Disable();
end
if (Allianceorhorde == 1) then
AQINSTATM = AQINSTANZ;
if (getglobal("Inst"..AQINSTANZ.."QAA") ~= nil) then
AtlasQuestAnzahl:SetText(getglobal("Inst"..AQINSTANZ.."QAA"));
else
AtlasQuestAnzahl:SetText("");
end
for b=1, AQMAXQUESTS do
if (getglobal("Inst"..AQINSTANZ.."Quest"..b.."FQuest")) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\Glues\\Login\\UI-BackArrow")
getglobal("AQQuestlineArrow_"..b):Show();
elseif (getglobal("Inst"..AQINSTANZ.."Quest"..b.."PreQuest")) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\GossipFrame\\PetitionGossipIcon")
getglobal("AQQuestlineArrow_"..b):Show();
else
getglobal("AQQuestlineArrow_"..b):Hide();
end
if (AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..b ] == 1) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\GossipFrame\\BinderGossipIcon")
getglobal("AQQuestlineArrow_"..b):Show();
end
AQQuestlevelf = tonumber(getglobal("Inst"..AQINSTANZ.."Quest"..b.."_Level"));
if (getglobal("Inst"..AQINSTANZ.."Quest"..b) ~= nil) then
if ( AQQuestlevelf ~= nil or AQQuestlevelf ~= 0 or AQQuestlevelf ~= "") then
if ( AQQuestlevelf == UnitLevel("player") or AQQuestlevelf == UnitLevel("player") + 2 or AQQuestlevelf == UnitLevel("player") - 2 or AQQuestlevelf == UnitLevel("player") + 1 or AQQuestlevelf == UnitLevel("player") - 1) then
AQQuestfarbe = Gelb;
elseif ( AQQuestlevelf > UnitLevel("player") + 2 and AQQuestlevelf <= UnitLevel("player") + 4) then
AQQuestfarbe = Orange;
elseif ( AQQuestlevelf >= UnitLevel("player") + 5 and AQQuestlevelf ~= 100) then
AQQuestfarbe = Rot;
elseif ( AQQuestlevelf < UnitLevel("player") - 7) then
AQQuestfarbe = Grau;
elseif ( AQQuestlevelf >= UnitLevel("player") - 7 and AQQuestlevelf < UnitLevel("player") - 2) then
AQQuestfarbe = Gruen;
end
if (AQNOColourCheck) then
AQQuestfarbe = Gelb;
end
if ( AQQuestlevelf == 100 or AQCompareQLtoAQ(b)) then
AQQuestfarbe = Blau;
end
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..b ] == 1) then
AQQuestfarbe = WHITE;
end
end
getglobal("AQQuestbutton"..b):Enable();
getglobal("AQBUTTONTEXT"..b):SetText(AQQuestfarbe..getglobal("Inst"..AQINSTANZ.."Quest"..b));
else
getglobal("AQQuestbutton"..b):Disable();
getglobal("AQBUTTONTEXT"..b):SetText();
end
end
end
if (Allianceorhorde == 2) then
AQINSTATM = AQINSTANZ;
if (getglobal("Inst"..AQINSTANZ.."QAH") ~= nil) then
AtlasQuestAnzahl:SetText(getglobal("Inst"..AQINSTANZ.."QAH"));
else
AtlasQuestAnzahl:SetText("");
end
for b=1, AQMAXQUESTS do
if (getglobal("Inst"..AQINSTANZ.."Quest"..b.."FQuest_HORDE")) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\Glues\\Login\\UI-BackArrow")
getglobal("AQQuestlineArrow_"..b):Show();
elseif (getglobal("Inst"..AQINSTANZ.."Quest"..b.."PreQuest_HORDE")) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\GossipFrame\\PetitionGossipIcon")
getglobal("AQQuestlineArrow_"..b):Show();
else
getglobal("AQQuestlineArrow_"..b):Hide();
end
if (AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..b.."_HORDE" ] == 1) then
getglobal("AQQuestlineArrow_"..b):SetTexture("Interface\\GossipFrame\\BinderGossipIcon")
getglobal("AQQuestlineArrow_"..b):Show();
end
if (getglobal("Inst"..AQINSTANZ.."Quest"..b.."_HORDE") ~= nil) then
AQQuestlevelf = tonumber(getglobal("Inst"..AQINSTANZ.."Quest"..b.."_HORDE_Level"));
if ( AQQuestlevelf ~= nil or AQQuestlevelf ~= 0 or AQQuestlevelf ~= "") then
if ( AQQuestlevelf == UnitLevel("player") or AQQuestlevelf == UnitLevel("player") + 2 or AQQuestlevelf == UnitLevel("player") - 2 or AQQuestlevelf == UnitLevel("player") + 1 or AQQuestlevelf == UnitLevel("player") - 1) then
AQQuestfarbe = Gelb;
elseif ( AQQuestlevelf > UnitLevel("player") + 2 and AQQuestlevelf <= UnitLevel("player") + 4) then
AQQuestfarbe = Orange;
elseif ( AQQuestlevelf >= UnitLevel("player") + 5 and AQQuestlevelf ~= 100) then
AQQuestfarbe = Rot;
elseif ( AQQuestlevelf < UnitLevel("player") - 7) then
AQQuestfarbe = Grau;
elseif ( AQQuestlevelf >= UnitLevel("player") - 7 and AQQuestlevelf < UnitLevel("player") - 2) then
AQQuestfarbe = Gruen;
end
if (AQNOColourCheck) then
AQQuestfarbe = Gelb;
end
if ( AQQuestlevelf == 100 or AQCompareQLtoAQ(b)) then
AQQuestfarbe = Blau;
end
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..b.."_HORDE" ] == 1) then
AQQuestfarbe = WHITE;
end
end
getglobal("AQQuestbutton"..b):Enable();
getglobal("AQBUTTONTEXT"..b):SetText(AQQuestfarbe..getglobal("Inst"..AQINSTANZ.."Quest"..b.."_HORDE"));
else
getglobal("AQQuestbutton"..b):Disable();
getglobal("AQBUTTONTEXT"..b):SetText();
end
end
end
end
-----------------------------------------------------------------------------
-- Colours quest blue if they are in your questlog
-----------------------------------------------------------------------------
function AQCompareQLtoAQ(Quest)
local TotalQuestEntries
local CurrentQuestnum
local OnlyQuestNameRemovedNumber
local Questisthere
local x
local y
local z
local count
if (AQCheckQuestlog == nil) then -- Option to turn the check on or off
if (Quest == nil) then -- added for use in button text to change the caption dunno whether i add it or not
Quest = AQSHOWNQUEST;
end
-- TurtleWOW fix for (TW) marked quests. this gonna change new TurtleWOW quests to blue if you have it in your quest log.
if (Quest <= 9) then
if (Allianceorhorde == 1) then
if strfind(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), "(TW)") then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 8)
else
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 4)
end
elseif (Allianceorhorde == 2) then
if strfind(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), "(TW)") then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 8)
else
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 4)
end
end
elseif (Quest > 9) then
if (Allianceorhorde == 1) then
if strfind(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), "(TW)") then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 9)
else
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 5)
end
elseif (Allianceorhorde == 2) then
if strfind(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), "(TW)") then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 9)
else
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 5)
end
end
end
--this checks should be done everytime when the questupdate event gets executed
TotalQuestEntries = GetNumQuestLogEntries();
for CurrentQuestnum=1, TotalQuestEntries do
x, y, z = GetQuestLogTitle(CurrentQuestnum)
TotalQuestsTable = {
[CurrentQuestnum] = x,
};
if ((CT_Core) and (CT_Core:getOption("questLevels") == 1)) then
count = 4;
if (y > 10) then
count = count + 2;
else
count = count + 1;
end
if ((z == ELITE ) or ( z == RAID ) or ( z == "Dungeon" ) or ( z == "Donjon" )) then
count = count + 1;
end
TotalQuestsTable = {
[CurrentQuestnum] = strsub(x, count)
};
end
-- Code from Denival to remove parentheses and anything in it so Color Quests blue option works.
ps, pe = strfind(OnlyQuestNameRemovedNumber," %(.*%)")
if (ps) then
OnlyQuestNameRemovedNumber = strsub(OnlyQuestNameRemovedNumber,1,ps-1)
end
--expect this
if (TotalQuestsTable[CurrentQuestnum] == OnlyQuestNameRemovedNumber) then
Questisthere = 1;
end
end
if (Questisthere == 1) then
return true;
else
return false;
end
--
else
return false;
end
end
--******************************************
-- Events: Atlas_OnShow (Hook Atlas function)
--******************************************
-----------------------------------------------------------------------------
-- Shows the AQ panel with atlas
-- function hooked now! thx dan for his help
-----------------------------------------------------------------------------
original_Atlas_OnShow = Atlas_OnShow; -- new line #1
function Atlas_OnShow()
if ( AQAtlasAuto == 1) then
ShowUIPanel(AtlasQuestFrame);
else
HideUIPanel(AtlasQuestFrame);
end
HideUIPanel(AtlasQuestInsideFrame);
-- AQ_AtlasOrAlphamap();
if (AQ_ShownSide == "Right") then
AtlasQuestFrame:ClearAllPoints();
AtlasQuestFrame:SetPoint("TOP","AtlasFrame", 567, -30); --dont know what it is actualy right now
end
original_Atlas_OnShow(); -- new line #2
end
--******************************************
-- Events: OnEnter/OnLeave SHOW ITEM
--******************************************
-----------------------------------------------------------------------------
-- Hide Tooltip
-----------------------------------------------------------------------------
function AtlasQuestItem_OnLeave()
if(GameTooltip:IsVisible()) then
GameTooltip:Hide();
if ( ShoppingTooltip2:IsVisible() or ShoppingTooltip1.IsVisible) then
ShoppingTooltip2:Hide();
ShoppingTooltip1:Hide();
end
end
if(AtlasQuestTooltip:IsVisible()) then
AtlasQuestTooltip:Hide();
if ( ShoppingTooltip2:IsVisible() or ShoppingTooltip1.IsVisible) then
ShoppingTooltip2:Hide();
ShoppingTooltip1:Hide();
end
end
end
-----------------------------------------------------------------------------
-- Show Tooltip and automatically query server if option is enabled
-----------------------------------------------------------------------------
function AtlasQuestItem_OnEnter()
local SHOWNID
local name
local nameDATA
local colour
local itemName, itemQuality
if ( Allianceorhorde == 1) then
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..AQTHISISSHOWN);
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..AQTHISISSHOWN);
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..AQTHISISSHOWN);
else
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..AQTHISISSHOWN.."_HORDE");
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..AQTHISISSHOWN.."_HORDE");
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..AQTHISISSHOWN.."_HORDE");
end
if (SHOWNID ~= nil) then
if(GetItemInfo(SHOWNID) ~= nil) then
AtlasQuestTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24);
AtlasQuestTooltip:SetHyperlink("item:"..SHOWNID..":0:0:0");
AtlasQuestTooltip:Show();
else
AtlasQuestTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24);
AtlasQuestTooltip:ClearLines();
AtlasQuestTooltip:AddLine(RED..AQERRORNOTSHOWN);
AtlasQuestTooltip:AddLine(AQERRORASKSERVER);
AtlasQuestTooltip:Show();
end
end
end
-----------------------------------------------------------------------------
-- Ask Server right-click
-- + shift click to send link
-- + ctrl click for dressroom
-- BIG THANKS TO Daviesh and ATLASLOOT for the CODE
-----------------------------------------------------------------------------
function AtlasQuestItem_OnClick(arg1)
local SHOWNID
local name
local nameDATA
local colour
local itemName, itemQuality
if ( Allianceorhorde == 1) then
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..AQTHISISSHOWN);
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..AQTHISISSHOWN);
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..AQTHISISSHOWN);
else
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..AQTHISISSHOWN.."_HORDE");
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..AQTHISISSHOWN.."_HORDE");
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..AQTHISISSHOWN.."_HORDE");
end
if(arg1=="RightButton") then
AtlasQuestTooltip:SetOwner(this, "ANCHOR_RIGHT", -(this:GetWidth() / 2), 24);
AtlasQuestTooltip:SetHyperlink("item:"..SHOWNID..":0:0:0");
AtlasQuestTooltip:Show();
if(AQNoQuerySpam == nil) then
DEFAULT_CHAT_FRAME:AddMessage(AQSERVERASK.."["..colour..nameDATA..WHITE.."]"..AQSERVERASKInformation);
end
elseif(IsShiftKeyDown()) then
if (GetItemInfo(SHOWNID)) then
itemName, itemLink, itemQuality = GetItemInfo(SHOWNID);
local r, g, b, hex = GetItemQualityColor(itemQuality);
itemtext = hex..itemName;
ChatFrameEditBox:Insert(hex.."|Hitem:"..SHOWNID..":0:0:0|h["..itemName.."]|h|r");
else
DEFAULT_CHAT_FRAME:AddMessage("Item unsafe! Right click to get the item ID")
ChatFrameEditBox:Insert("["..nameDATA.."]");
end
--If control-clicked, use the dressing room
elseif(IsControlKeyDown() and GetItemInfo(SHOWNID)) then
DressUpItemLink(SHOWNID);
end
end
-----------------------------------------------------------------------------
-- Automatically show Horde or Alliance quests
-- based on player's faction when AtlasQuest is opened.
-----------------------------------------------------------------------------
function AQ_OnShow()
if ( UnitFactionGroup("player") == "Horde") then
Allianceorhorde = 2;
AQHCB:SetChecked(true);
AQACB:SetChecked(false);
else
Allianceorhorde = 1;
AQHCB:SetChecked(false);
AQACB:SetChecked(true);
end
AtlasQuestSetTextandButtons()
end
--NEW VERSION CHECK/UPDATE
--credits to:
--https://github.com/shagu/pfUI/
--https://github.com/Lexiebean/AtlasLoot/
--pfUI.api.strsplit
local function AtlasQuest_strsplit(delimiter, subject)
if not subject then return nil end
local delimiter, fields = delimiter or ":", {}
local pattern = string.format("([^%s]+)", delimiter)
string.gsub(subject, pattern, function(c) fields[table.getn(fields)+1] = c end)
return unpack(fields)
end
--[[
--Update announcing code taken from pfUI
local major, minor, fix = AtlasQuest_strsplit(".", tostring(GetAddOnMetadata("AtlasQuest", "Version")))
local alreadyshown = false
local localversion = tonumber(major*10000 + minor*100 + fix)
local remoteversion = tonumber(AtlasQuest_updateavailable) or 0
local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" }
local groupchannels = { "BATTLEGROUND", "RAID" }
AtlasQuest_updater_ChatFrame_OnEvent = ChatFrame_OnEvent
AtlasQuest_updater = CreateFrame("Frame")
AtlasQuest_updater:RegisterEvent("CHAT_MSG_ADDON")
AtlasQuest_updater:RegisterEvent("PLAYER_ENTERING_WORLD")
AtlasQuest_updater:RegisterEvent("PARTY_MEMBERS_CHANGED")
function ChatFrame_OnEvent(event)
if event == "CHAT_MSG_CHANNEL" then
local type = strsub(event, 10)
local source = strsub(type,1,1)
if type == "CHANNEL" and arg4 then
_,_,source = string.find(arg4,"(%d+)%.")
end
if source then
_,name = GetChannelName(source)
end
if name == "LFT" then
local msg, v, remoteversion = AtlasQuest_strsplit(":", arg1)
if msg == "AtlasQuest" then
local remoteversion = tonumber(remoteversion)
if remoteversion >= 60000 then remoteversion = 0 end --Block for people using some version from another version of WoW.
if v == "VERSION" and remoteversion then
if remoteversion > localversion then
AtlasQuest_updateavailable = remoteversion
if not alreadyshown then
DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasQuest]|r https://forum.turtle-wow.org/viewtopic.php?t=7959")
alreadyshown = true
end
end
end
end
end
end
AtlasQuest_updater_ChatFrame_OnEvent(event);
end
AtlasQuest_updater:SetScript("OnEvent", function()
if event == "CHAT_MSG_ADDON" and arg1 == "AtlasQuest" then
local v, remoteversion = AtlasQuest_strsplit(":", arg2)
local remoteversion = tonumber(remoteversion)
if remoteversion >= 60000 then remoteversion = 0 end --Block for people using some version from another version of WoW.
if v == "VERSION" and remoteversion then
if remoteversion > localversion then
AtlasQuest_updateavailable = remoteversion
if not alreadyshown then
DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasQuest]|r New version available! https://forum.turtle-wow.org/viewtopic.php?t=7959")
alreadyshown = true
end
end
end
end
if event == "PARTY_MEMBERS_CHANGED" then
local groupsize = GetNumRaidMembers() > 0 and GetNumRaidMembers() or GetNumPartyMembers() > 0 and GetNumPartyMembers() or 0
if ( this.group or 0 ) < groupsize then
for _, chan in pairs(groupchannels) do
SendAddonMessage("AtlasQuest", "VERSION:" .. localversion, chan)
end
end
this.group = groupsize
end
if event == "PLAYER_ENTERING_WORLD" then
if not alreadyshown and localversion < remoteversion then
DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasQuest]|r New version available! https://forum.turtle-wow.org/viewtopic.php?t=7959")
AtlasQuest_updateavailable = localversion
alreadyshown = true
end
for _, chan in pairs(loginchannels) do
SendAddonMessage("AtlasQuest", "VERSION:" .. localversion, chan)
end
if GetChannelName("LFT") ~= 0 then
SendChatMessage("AtlasQuest:VERSION:" .. localversion, "CHANNEL", nil, GetChannelName("LFT"))
end
end
end)
]]
--Update announcing code taken from pfUI
local major, minor, fix = AtlasQuest_strsplit(".", tostring(GetAddOnMetadata("AtlasQuest", "Version")))
local alreadyshown = false
local localversion = tonumber(major*10000 + minor*100 + fix)
local remoteversion = tonumber(AtlasQuest_updateavailable) or 0
local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" }
local groupchannels = { "BATTLEGROUND", "RAID" }
AtlasQuest_updater = CreateFrame("Frame")
AtlasQuest_updater:RegisterEvent("CHAT_MSG_ADDON")
AtlasQuest_updater:RegisterEvent("CHAT_MSG_CHANNEL")
AtlasQuest_updater:RegisterEvent("PLAYER_ENTERING_WORLD")
AtlasQuest_updater:RegisterEvent("PARTY_MEMBERS_CHANGED")
AtlasQuest_updater:SetScript("OnEvent", function()
if event == "CHAT_MSG_ADDON" and arg1 == "AtlasQuest" then
local v, remoteversion = AtlasQuest_strsplit(":", arg2)
local remoteversion = tonumber(remoteversion)