-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAtlasQuest_Buttons.lua
683 lines (596 loc) · 29 KB
/
AtlasQuest_Buttons.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
--[[
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
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"
local AQQuestfarbe
-----------------------------------------------------------------------------
-- Buttons
-----------------------------------------------------------------------------
function AQClearALL()
AQPageCount:SetText();
HideUIPanel(AQNextPageButton_Right);
HideUIPanel(AQNextPageButton_Left);
QuestName:SetText("");
QuestLeveltext:SetText("");
Prequesttext:SetText("");
QuestAttainLeveltext:SetText("");
REWARDstext:SetText();
StoryTEXT:SetText();
AQFQ_TEXT:SetText();
HideUIPanel(AQFinishedQuest);
for b=1, 6 do
getglobal("AtlasQuestItemframe"..b.."_Icon"):SetTexture();
getglobal("AtlasQuestItemframe"..b.."_Name"):SetText();
getglobal("AtlasQuestItemframe"..b.."_Extra"):SetText();
getglobal("AtlasQuestItemframe"..b):Disable();
end
end
-----------------------------------------------------------------------------
-- Option button, shows option frame or hides if shown
-----------------------------------------------------------------------------
function AQOPTION1_OnClick()
if (AtlasQuestOptionFrame:IsVisible()) then
HideUIPanel(AtlasQuestOptionFrame);
else
ShowUIPanel(AtlasQuestOptionFrame);
end
end
-----------------------------------------------------------------------------
-- upper right button / to show/close panel
-----------------------------------------------------------------------------
function AQCLOSE_OnClick()
AQ_AtlasOrAlphamap();
if(AtlasQuestFrame:IsVisible()) then
HideUIPanel(AtlasQuestFrame);
HideUIPanel(AtlasQuestInsideFrame);
else
ShowUIPanel(AtlasQuestFrame);
end
AQUpdateNOW = true;
end
-----------------------------------------------------------------------------
-- upper left button on the panel for closing
-----------------------------------------------------------------------------
function AQCLOSE1_OnClick()
HideUIPanel(AtlasQuestFrame);
end
-----------------------------------------------------------------------------
-- inside button to close the quest display
-----------------------------------------------------------------------------
function AQCLOSE2_OnClick()
HideUIPanel(AtlasQuestInsideFrame);
WHICHBUTTON = 0;
end
-----------------------------------------------------------------------------
-- Checkbox for Alliance
-----------------------------------------------------------------------------
function Alliance_OnClick()
Allianceorhorde = 1
AQHCB:SetChecked(false);
AQACB:SetChecked(true);
HideUIPanel(AtlasQuestInsideFrame);
AQUpdateNOW = true;
end
-----------------------------------------------------------------------------
-- Checkbox for Horde
-----------------------------------------------------------------------------
function Horde_OnClick()
Allianceorhorde = 2
AQHCB:SetChecked(true);
AQACB:SetChecked(false);
HideUIPanel(AtlasQuestInsideFrame);
AQUpdateNOW = true;
end
-----------------------------------------------------------------------------
-- Story Button
-----------------------------------------------------------------------------
function AQSTORY1_OnClick()
AQHideAL();
if (AtlasQuestInsideFrame:IsVisible() == nil) then
ShowUIPanel(AtlasQuestInsideFrame);
WHICHBUTTON = STORY;
AQButtonSTORY_SetText();
elseif ( WHICHBUTTON == STORY) then
HideUIPanel(AtlasQuestInsideFrame);
else
WHICHBUTTON = STORY;
AQButtonSTORY_SetText();
end
end
-----------------------------------------------------------------------------
-- Button
-----------------------------------------------------------------------------
function Quest_OnClick(arg1)
if (ChatFrameEditBox:IsVisible() and IsShiftKeyDown()) then
AQInsertQuestInformation();
else
AQHideAL();
StoryTEXT:SetText("");
if (AtlasQuestInsideFrame:IsVisible() == nil) then
ShowUIPanel(AtlasQuestInsideFrame);
WHICHBUTTON = AQSHOWNQUEST;
AQButton_SetText();
elseif ( WHICHBUTTON == AQSHOWNQUEST) then
HideUIPanel(AtlasQuestInsideFrame);
WHICHBUTTON = 0;
else
WHICHBUTTON = AQSHOWNQUEST;
AQButton_SetText();
end
end
end
-----------------------------------------------------------------------------
-- Hide the AtlasLoot Frame if available
-----------------------------------------------------------------------------
function AQHideAL()
if ( AtlasLootItemsFrame ~= nil) then
AtlasLootItemsFrame:Hide(); -- hide atlasloot
end
end
-----------------------------------------------------------------------------
-- Insert Quest Information into the chat box
-----------------------------------------------------------------------------
function AQInsertQuestInformation()
local OnlyQuestNameRemovedNumber
local Quest
Quest = AQSHOWNQUEST;
if (Quest <= 9) then
if (Allianceorhorde == 1) then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 4)
elseif (Allianceorhorde == 2) then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 4)
end
elseif (Quest > 9) then
if (Allianceorhorde == 1) then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest), 5)
elseif (Allianceorhorde == 2) then
OnlyQuestNameRemovedNumber = strsub(getglobal("Inst"..AQINSTANZ.."Quest"..Quest.."_HORDE"), 5)
end
end
if ( Allianceorhorde == 1) then
ChatFrameEditBox:Insert("["..OnlyQuestNameRemovedNumber.."] ["..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Level").."]");
else
ChatFrameEditBox:Insert("["..OnlyQuestNameRemovedNumber.."] ["..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Level").."]");
end
end
-----------------------------------------------------------------------------
-- set the Quest text
-- executed when you push a button
-----------------------------------------------------------------------------
function AQButton_SetText()
local SHOWNID
local name
local nameDATA
local colour
local itemName, itemQuality
AQClearALL();
-- Show the finished button
ShowUIPanel(AQFinishedQuest);
AQFQ_TEXT:SetText(BLUE..AQFinishedTEXT);
--
if ( Allianceorhorde == 1) then
AQColourCheck(1); --CC swaped out (see below)
AQCompareQLtoAQ(Quest)
QuestName:SetText(AQQuestfarbe..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST));
QuestLeveltext:SetText(BLUE..AQDiscription_LEVEL..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Level"));
QuestAttainLeveltext:SetText(BLUE..AQDiscription_ATTAIN..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Attain"));
Prequesttext:SetText(BLUE..AQDiscription_PREQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Prequest").."\n \n"..BLUE..AQDiscription_FOLGEQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Folgequest").."\n \n"..BLUE..AQDiscription_START..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Location").."\n \n"..BLUE..AQDiscription_AIM..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Aim").."\n \n"..BLUE..AQDiscription_NOTE..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Note"));
-----------------------------------------------------------------------------
-- FOR ALPHAMAP SUPPORT
-- If there are other descriptions for alphamap and alphamap is shown then show them
-----------------------------------------------------------------------------
if ((AtlasORAlphaMap == "AlphaMap") and (getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Note_AlphaMap") ~= nil)) then
Prequesttext:SetText(BLUE..AQDiscription_PREQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Prequest").."\n \n"..BLUE..AQDiscription_FOLGEQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Folgequest").."\n \n"..BLUE..AQDiscription_START..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Location_AlphaMap").."\n \n"..BLUE..AQDiscription_AIM..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Aim").."\n \n"..BLUE..AQDiscription_NOTE..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Note_AlphaMap"));
end
for b=1, 6 do
REWARDstext:SetText(getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."Rewardtext"))
if ( getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..b) ~= nil) then
-----------------------------------------------------------------------------
-- Yay for AutoQuery. Boo for odd variable names.
-----------------------------------------------------------------------------
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..b);
if(AQAutoQuery ~= nil) then
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..b);
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..b);
if ( GetItemInfo(SHOWNID) == nil) then
GameTooltip:SetHyperlink("item:"..SHOWNID..":0:0:0");
if(AQNoQuerySpam == nil) then
DEFAULT_CHAT_FRAME:AddMessage(AQSERVERASK.."["..colour..nameDATA..WHITE.."]"..AQSERVERASKAuto);
end
end
end
local _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(SHOWNID);
getglobal("AtlasQuestItemframe"..b.."_Icon"):SetTexture(itemTexture);
getglobal("AtlasQuestItemframe"..b.."_Name"):SetText(AQgetItemInformation(b,"name"));
getglobal("AtlasQuestItemframe"..b.."_Extra"):SetText(AQgetItemInformation(b,"extra"));
getglobal("AtlasQuestItemframe"..b):Enable();
else
getglobal("AtlasQuestItemframe"..b.."_Icon"):SetTexture();
getglobal("AtlasQuestItemframe"..b.."_Name"):SetText();
getglobal("AtlasQuestItemframe"..b.."_Extra"):SetText();
getglobal("AtlasQuestItemframe"..b):Disable();
end
end
end
if ( Allianceorhorde == 2) then
AQColourCheck(0) --CC swaped out (see below)
QuestName:SetText(AQQuestfarbe..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE"));
QuestLeveltext:SetText(BLUE..AQDiscription_LEVEL..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Level"));
QuestAttainLeveltext:SetText(BLUE..AQDiscription_ATTAIN..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Attain"));
Prequesttext:SetText(BLUE..AQDiscription_PREQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Prequest").."\n \n"..BLUE..AQDiscription_FOLGEQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Folgequest").."\n \n"..BLUE..AQDiscription_START..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Location").."\n \n"..BLUE..AQDiscription_AIM..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Aim").."\n \n"..BLUE..AQDiscription_NOTE..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Note"));
-----------------------------------------------------------------------------
-- FOR ALPHAMAP SUPPORT
-- If there are other descriptions for alphamap and alphamap is shown then show them
-----------------------------------------------------------------------------
if ((AtlasORAlphaMap == "AlphaMap") and (getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Note_AlphaMap") ~= nil)) then
Prequesttext:SetText(BLUE..AQDiscription_PREQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Prequest").."\n \n"..BLUE..AQDiscription_FOLGEQUEST..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Folgequest").."\n \n"..BLUE..AQDiscription_START..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Location_AlphaMap").."\n \n"..BLUE..AQDiscription_AIM..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Aim").."\n \n"..BLUE..AQDiscription_NOTE..WHITE..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Note_AlphaMap"));
end
for b=1, 6 do
REWARDstext:SetText(getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."Rewardtext_HORDE"))
if ( getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..b.."_HORDE") ~= nil) then
-----------------------------------------------------------------------------
-- Yay for AutoQuery. Boo for odd variable names.
-----------------------------------------------------------------------------
SHOWNID = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..b.."_HORDE");
if(AQAutoQuery ~= nil) then
colour = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..b.."_HORDE");
nameDATA = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..b.."_HORDE");
if ( GetItemInfo(SHOWNID) == nil) then
GameTooltip:SetHyperlink("item:"..SHOWNID..":0:0:0");
if(AQNoQuerySpam == nil) then
DEFAULT_CHAT_FRAME:AddMessage(AQSERVERASK.."["..colour..nameDATA..WHITE.."]"..AQSERVERASKAuto);
end
end
end
local _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(SHOWNID);
getglobal("AtlasQuestItemframe"..b.."_Icon"):SetTexture(itemTexture);
getglobal("AtlasQuestItemframe"..b.."_Name"):SetText(AQgetItemInformation(b,"name"));
getglobal("AtlasQuestItemframe"..b.."_Extra"):SetText(AQgetItemInformation(b,"extra"));
getglobal("AtlasQuestItemframe"..b):Enable();
else
getglobal("AtlasQuestItemframe"..b.."_Icon"):SetTexture();
getglobal("AtlasQuestItemframe"..b.."_Name"):SetText();
getglobal("AtlasQuestItemframe"..b.."_Extra"):SetText();
getglobal("AtlasQuestItemframe"..b):Disable();
end
end
end
AQQuestFinishedSetChecked();
AQExtendedPages();
end
-----------------------------------------------------------------------------
-- improve the localisation through giving back the right and translated questname
-- sets the description text too
-- adds a error messeage to the description if item not available
-----------------------------------------------------------------------------
function AQgetItemInformation(count,what)
local itemId
local itemtext;
local itemdiscription;
local itemName, itemQuality
if ( Allianceorhorde == 2) then
itemId = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..count.."_HORDE")
itemdiscription = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."description"..count.."_HORDE")
itemTEXTSAVED = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..count.."_HORDE")..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..count.."_HORDE");
else
itemId = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ID"..count)
itemdiscription = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."description"..count)
itemTEXTSAVED = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."ITC"..count)..getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."name"..count);
end
if (GetItemInfo(itemId)) then
itemName, _, itemQuality = GetItemInfo(itemId);
local r, g, b, hex = GetItemQualityColor(itemQuality);
itemtext = hex..itemName;
if (what == "name") then
return itemtext;
elseif (what == "extra") then
return itemdiscription;
end
else
itemtext = itemTEXTSAVED
if (what == "name") then
return itemtext;
elseif (what == "extra") then
itemdiscription = itemdiscription.." "..RED..AQERRORNOTSHOWN;
return itemdiscription;
end
end
end
-----------------------------------------------------------------------------
-- set the Questcolour
-- swaped out to get the code clear
-----------------------------------------------------------------------------
function AQColourCheck(arg1)
local AQQuestlevelf
if (arg1 == 1) then
AQQuestlevelf = tonumber(getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Level"));
--DEFAULT_CHAT_FRAME:AddMessage("BLA");
else
AQQuestlevelf = tonumber(getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Level"));
--DEFAULT_CHAT_FRAME:AddMessage("BLUB");
end
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()) then
AQQuestfarbe = Blau;
end
if (arg1 == 1) then
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST ] == 1) then
AQQuestfarbe = WHITE;
end
else
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE" ] == 1) then
AQQuestfarbe = WHITE;
end
end
end
end
-----------------------------------------------------------------------------
-- set the checkbox for the finished quest check
-- swaped out to get the code clear
-----------------------------------------------------------------------------
function AQQuestFinishedSetChecked()
if ( Allianceorhorde == 1) then
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST ] == 1) then
AQFinishedQuest:SetChecked(true);
else
AQFinishedQuest:SetChecked(false);
end
else
if ( AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE" ] == 1) then
AQFinishedQuest:SetChecked(true);
else
AQFinishedQuest:SetChecked(false);
end
end
end
-----------------------------------------------------------------------------
-- Allow pages
-- InstXXQuestXX_Page = number of pages
-- HideUIPanel(AQNextPageButton_Left); AQPageCount:SetText();
-----------------------------------------------------------------------------
function AQExtendedPages()
local SHIT
-- SHIT is added to make the code smaller it give back the right link for horde or alliance
if ( Allianceorhorde == 1) then --Alliance
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Page")
else
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Page")
end
if (type(SHIT) == "table") then
if (type(SHIT[1]) == "number") then
ShowUIPanel(AQNextPageButton_Right);
AQ_NextPageCount = "Quest";
AQ_CurrentSide = 1;
AQPageCount:SetText(AQ_CurrentSide.."/"..SHIT[1]);
end
end
end
-----------------------------------------------------------------------------
-- Set Story Text
-----------------------------------------------------------------------------
function AQButtonSTORY_SetText()
-- first clear display
AQClearALL();
-- show right story text
if (getglobal("Inst"..AQINSTANZ.."Story") ~= nil) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."Caption"));
if (type(getglobal("Inst"..AQINSTANZ.."Story")) == "table") then
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."Story")["Page1"]);
-- Show Next side button if next site is avaiable
if (getglobal("Inst"..AQINSTANZ.."Story")["Page2"] ~= nil) then
ShowUIPanel(AQNextPageButton_Right);
AQ_CurrentSide = 1;
-- shows total amount of pages
AQPageCount:SetText(AQ_CurrentSide.."/"..getglobal("Inst"..AQINSTANZ.."Story")["MaxPages"])
-- count to make a diffrent between story and normal text
AQ_NextPageCount = "Story";
end
elseif (type(getglobal("Inst"..AQINSTANZ.."Story")) == "string") then
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."Story"));
end
-- added to work with future versions of atlas (before i update e.g. before you dl the update)
elseif (getglobal("Inst"..AQINSTANZ.."Story") == nil) then
QuestName:SetText("not available");
StoryTEXT:SetText("not available");
end
end
-----------------------------------------------------------------------------
-- shows the next side
-----------------------------------------------------------------------------
function AQNextPageR_OnClick()
local SideAfterThis = 0;
local SHIT
SideAfterThis = AQ_CurrentSide + 2;
AQ_CurrentSide = AQ_CurrentSide + 1;
-- first clear display
AQClearALL();
-- it is a story text
if (AQ_NextPageCount == "Story" ) then
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."Story")["Page"..AQ_CurrentSide]);
AQPageCount:SetText(AQ_CurrentSide.."/"..getglobal("Inst"..AQINSTANZ.."Story")["MaxPages"])
if (getglobal("Inst"..AQINSTANZ.."Caption"..AQ_CurrentSide) ~= nil) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."Caption"..AQ_CurrentSide));
else
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."Caption"));
end
-- hide button if no next side
if (getglobal("Inst"..AQINSTANZ.."Story")["Page"..SideAfterThis] == nil) then
HideUIPanel(AQNextPageButton_Right);
else
ShowUIPanel(AQNextPageButton_Right);
end
end
-- it is a quest text
if (AQ_NextPageCount == "Quest" ) then
-- SHIT is added to make the code smaller it give back the right link for horde or alliance
if ( Allianceorhorde == 1) then --Alliance
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Page")
else
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Page")
end
StoryTEXT:SetText(WHITE..SHIT[AQ_CurrentSide])
AQPageCount:SetText(AQ_CurrentSide.."/"..SHIT[1])
-- hide button if no next side
if (SHIT[SideAfterThis] == nil) then
HideUIPanel(AQNextPageButton_Right);
else
ShowUIPanel(AQNextPageButton_Right);
end
end
-- it is a boss text
if (AQ_NextPageCount == "Boss" ) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][1]);
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][2].."\n \n"..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][3]);
-- Show Next side button if next site is avaiable
if (getglobal("Inst"..AQINSTANZ.."General")[SideAfterThis] ~= nil) then
ShowUIPanel(AQNextPageButton_Right);
end
-- shows total amount of pages
AQPageCount:SetText(AQ_CurrentSide.."/"..getn(getglobal("Inst"..AQINSTANZ.."General")))
end
-- Show backwards button
ShowUIPanel(AQNextPageButton_Left);
end
-----------------------------------------------------------------------------
-- shows the side before this side
-----------------------------------------------------------------------------
function AQNextPageL_OnClick()
local SHIT
AQ_CurrentSide = AQ_CurrentSide - 1;
-- it is a story text
if (AQ_NextPageCount == "Story" ) then
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."Story")["Page"..AQ_CurrentSide]);
AQPageCount:SetText(AQ_CurrentSide.."/"..getglobal("Inst"..AQINSTANZ.."Story")["MaxPages"])
if (getglobal("Inst"..AQINSTANZ.."Caption"..AQ_CurrentSide) ~= nil) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."Caption"..AQ_CurrentSide));
else
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."Caption"));
end
-- hide button if first side
if (AQ_CurrentSide == 1) then
HideUIPanel(AQNextPageButton_Left);
end
end
-- it is a quest text
if (AQ_NextPageCount == "Quest" ) then
-- SHIT is added to make the code smaller it give back the right link for horde or alliance
if ( Allianceorhorde == 1) then --Alliance
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_Page")
else
SHIT = getglobal("Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE_Page")
end
if (AQ_CurrentSide == 1) then
AQButton_SetText()
else
StoryTEXT:SetText(WHITE..SHIT[AQ_CurrentSide])
end
AQPageCount:SetText(AQ_CurrentSide.."/"..SHIT[1])
end
-- it is a boss text
if (AQ_NextPageCount == "Boss" ) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][1]);
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][2].."\n \n"..getglobal("Inst"..AQINSTANZ.."General")[AQ_CurrentSide][3]);
-- Show Next side button if next site is avaiable
if (AQ_CurrentSide == 1) then
HideUIPanel(AQNextPageButton_Left);
end
-- shows total amount of pages
AQPageCount:SetText(AQ_CurrentSide.."/"..getn(getglobal("Inst"..AQINSTANZ.."General")))
end
ShowUIPanel(AQNextPageButton_Right);
end
-----------------------------------------------------------------------------
-- Checkbox for the finished quest option
-----------------------------------------------------------------------------
function AQFinishedQuest_OnClick()
if (AQFinishedQuest:GetChecked() and Allianceorhorde == 1) then
AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST ] = 1;
setglobal("AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST , 1);
elseif (AQFinishedQuest:GetChecked() and Allianceorhorde == 2) then
AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE" ] = 1;
elseif ((not AQFinishedQuest:GetChecked()) and (Allianceorhorde == 1)) then
AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST ] = nil;
elseif ((not AQFinishedQuest:GetChecked()) and (Allianceorhorde == 2)) then
AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE" ] = nil;
end
--save everything
if (Allianceorhorde == 1) then
AtlasQuest_Options[UnitName("player")]["AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST] = AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST ]
elseif (Allianceorhorde == 2) then
AtlasQuest_Options[UnitName("player")]["AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE"] = AQ[ "AQFinishedQuest_Inst"..AQINSTANZ.."Quest"..AQSHOWNQUEST.."_HORDE" ]
end
AtlasQuestSetTextandButtons()
AQButton_SetText()
end
-----------------------------------------------------------------------------
-- General Information for the Instance
-----------------------------------------------------------------------------
function AQGeneral_OnClick(arg1)
-- first clear display
AQClearALL();
AQHideAL();
if(AtlasQuestInsideFrame:IsVisible()) then
HideUIPanel(AtlasQuestInsideFrame);
else
ShowUIPanel(AtlasQuestInsideFrame);
end
--
if (getglobal("Inst"..AQINSTANZ.."General") ~= nil) then
QuestName:SetText(BLUE..getglobal("Inst"..AQINSTANZ.."General")[1][1]);
StoryTEXT:SetText(WHITE..getglobal("Inst"..AQINSTANZ.."General")[1][2].."\n \n"..getglobal("Inst"..AQINSTANZ.."General")[1][3]);
-- Show Next side button if next site is avaiable
AQ_NextPageCount = "Boss";
if (getglobal("Inst"..AQINSTANZ.."General")[2] ~= nil) then
ShowUIPanel(AQNextPageButton_Right);
AQ_CurrentSide = 1;
-- shows total amount of pages
AQPageCount:SetText(AQ_CurrentSide.."/"..getn(getglobal("Inst"..AQINSTANZ.."General")))
end
end
end