/
Blizzard_Wardrobe.lua
4950 lines (4415 loc) · 180 KB
/
Blizzard_Wardrobe.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
TRANSMOG_SHAPESHIFT_MIN_ZOOM = -0.3;
local EXCLUSION_CATEGORY_OFFHAND = 1;
local EXCLUSION_CATEGORY_MAINHAND = 2;
local g_selectionBehavior = nil;
local function GetPage(entryIndex, pageSize)
return floor((entryIndex-1) / pageSize) + 1;
end
local function GetAdjustedDisplayIndexFromKeyPress(contentFrame, index, numEntries, key)
if ( key == WARDROBE_PREV_VISUAL_KEY ) then
index = index - 1;
if ( index < 1 ) then
index = numEntries;
end
elseif ( key == WARDROBE_NEXT_VISUAL_KEY ) then
index = index + 1;
if ( index > numEntries ) then
index = 1;
end
elseif ( key == WARDROBE_DOWN_VISUAL_KEY ) then
local newIndex = index + contentFrame.NUM_COLS;
if ( newIndex > numEntries ) then
-- If you're at the last entry, wrap back around; otherwise go to the last entry.
index = index == numEntries and 1 or numEntries;
else
index = newIndex;
end
elseif ( key == WARDROBE_UP_VISUAL_KEY ) then
local newIndex = index - contentFrame.NUM_COLS;
if ( newIndex < 1 ) then
-- If you're at the first entry, wrap back around; otherwise go to the first entry.
index = index == 1 and numEntries or 1;
else
index = newIndex;
end
end
return index;
end
-- ************************************************************************************************************************************************************
-- **** MAIN **********************************************************************************************************************************************
-- ************************************************************************************************************************************************************
WardrobeFrameMixin = CreateFromMixins(CallbackRegistryMixin);
WardrobeFrameMixin:GenerateCallbackEvents(
{
"OnCollectionTabChanged",
});
function WardrobeFrameMixin:OnLoad()
self:SetPortraitToAsset("Interface\\Icons\\INV_Arcane_Orb");
self:SetTitle(TRANSMOGRIFY);
CallbackRegistryMixin.OnLoad(self);
end
-- ************************************************************************************************************************************************************
-- **** TRANSMOG **********************************************************************************************************************************************
-- ************************************************************************************************************************************************************
TransmogFrameMixin = { };
function TransmogFrameMixin:OnLoad()
local race, fileName = UnitRace("player");
local atlas = "transmog-background-race-"..fileName;
self.Inset.BG:SetAtlas(atlas);
self:RegisterEvent("TRANSMOGRIFY_UPDATE");
self:RegisterEvent("TRANSMOGRIFY_ITEM_UPDATE");
self:RegisterEvent("TRANSMOGRIFY_SUCCESS");
-- set up dependency links
self.MainHandButton.dependentSlot = self.MainHandEnchantButton;
self.MainHandEnchantButton.dependencySlot = self.MainHandButton;
self.SecondaryHandButton.dependentSlot = self.SecondaryHandEnchantButton;
self.SecondaryHandEnchantButton.dependencySlot = self.SecondaryHandButton;
self.ShoulderButton.dependentSlot = self.SecondaryShoulderButton;
self.SecondaryShoulderButton.dependencySlot = self.ShoulderButton;
self.ModelScene.ControlFrame:SetModelScene(WardrobeTransmogFrame.ModelScene);
self.ToggleSecondaryAppearanceCheckbox.Label:SetPoint("RIGHT", WardrobeCollectionFrame.ItemsCollectionFrame.PagingFrame.PageText, "LEFT", -40, 0);
end
function TransmogFrameMixin:OnEvent(event, ...)
if ( event == "TRANSMOGRIFY_UPDATE" or event == "TRANSMOGRIFY_ITEM_UPDATE" ) then
local transmogLocation = ...;
-- play sound?
local slotButton = self:GetSlotButton(transmogLocation);
if ( slotButton ) then
local isTransmogrified, hasPending, isPendingCollected, canTransmogrify, cannotTransmogrifyReason, hasUndo = C_Transmog.GetSlotInfo(transmogLocation);
if ( hasUndo ) then
PlaySound(SOUNDKIT.UI_TRANSMOGRIFY_UNDO);
elseif ( not hasPending ) then
if ( slotButton.hadUndo ) then
PlaySound(SOUNDKIT.UI_TRANSMOGRIFY_REDO);
slotButton.hadUndo = nil;
end
end
-- specs button tutorial
if ( hasPending and not hasUndo ) then
if ( not GetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_TRANSMOG_SPECS_BUTTON) ) then
local helpTipInfo = {
text = TRANSMOG_SPECS_BUTTON_TUTORIAL,
buttonStyle = HelpTip.ButtonStyle.Close,
cvarBitfield = "closedInfoFrames",
bitfieldFlag = LE_FRAME_TUTORIAL_TRANSMOG_SPECS_BUTTON,
targetPoint = HelpTip.Point.BottomEdgeCenter,
onAcknowledgeCallback = function() WardrobeCollectionFrame.ItemsCollectionFrame:CheckHelpTip(); end,
acknowledgeOnHide = true,
};
HelpTip:Show(self, helpTipInfo, self.SpecButton);
end
end
end
if ( event == "TRANSMOGRIFY_UPDATE" ) then
StaticPopup_Hide("TRANSMOG_APPLY_WARNING");
elseif ( event == "TRANSMOGRIFY_ITEM_UPDATE" and self.redoApply ) then
self:ApplyPending(0);
end
self:MarkDirty();
elseif ( event == "PLAYER_EQUIPMENT_CHANGED" ) then
local slotID = ...;
self:OnEquipmentChanged(slotID);
elseif ( event == "TRANSMOGRIFY_SUCCESS" ) then
local transmogLocation = ...;
local slotButton = self:GetSlotButton(transmogLocation);
if ( slotButton ) then
slotButton:OnTransmogrifySuccess();
end
elseif ( event == "UNIT_FORM_CHANGED" ) then
local unit = ...;
if ( unit == "player" ) then
self:HandleFormChanged();
end
end
end
function TransmogFrameMixin:HandleFormChanged()
self.needsFormChangedHandling = true;
if IsUnitModelReadyForUI("player") then
local hasAlternateForm, inAlternateForm = C_PlayerInfo.GetAlternateFormInfo();
if ( self.inAlternateForm ~= inAlternateForm ) then
self.inAlternateForm = inAlternateForm;
self:RefreshPlayerModel();
self.needsFormChangedHandling = false;
end
end
end
function TransmogFrameMixin:OnShow()
HideUIPanel(CollectionsJournal);
WardrobeCollectionFrame:SetContainer(WardrobeFrame);
PlaySound(SOUNDKIT.UI_TRANSMOG_OPEN_WINDOW);
self:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");
local hasAlternateForm, inAlternateForm = C_PlayerInfo.GetAlternateFormInfo();
if ( hasAlternateForm ) then
self:RegisterUnitEvent("UNIT_FORM_CHANGED", "player");
self.inAlternateForm = inAlternateForm;
end
self.ModelScene:TransitionToModelSceneID(290, CAMERA_TRANSITION_TYPE_IMMEDIATE, CAMERA_MODIFICATION_TYPE_DISCARD, true);
self:RefreshPlayerModel();
WardrobeFrame:RegisterCallback(WardrobeFrameMixin.Event.OnCollectionTabChanged, self.EvaluateSecondaryAppearanceCheckbox, self);
end
function TransmogFrameMixin:OnHide()
PlaySound(SOUNDKIT.UI_TRANSMOG_CLOSE_WINDOW);
StaticPopup_Hide("TRANSMOG_APPLY_WARNING");
self:UnregisterEvent("PLAYER_EQUIPMENT_CHANGED");
self:UnregisterEvent("UNIT_FORM_CHANGED");
C_PlayerInteractionManager.ClearInteraction(Enum.PlayerInteractionType.Transmogrifier);
WardrobeFrame:UnregisterCallback(WardrobeFrameMixin.Event.OnCollectionTabChanged, self);
end
function TransmogFrameMixin:MarkDirty()
self.dirty = true;
end
function TransmogFrameMixin:OnUpdate()
if self.dirty then
self:Update();
end
if self.needsFormChangedHandling then
self:HandleFormChanged();
end
end
function TransmogFrameMixin:OnEquipmentChanged(slotID)
local resetHands = false;
for i, slotButton in ipairs(self.SlotButtons) do
if slotButton.transmogLocation:GetSlotID() == slotID then
C_Transmog.ClearPending(slotButton.transmogLocation);
if slotButton.transmogLocation:IsEitherHand() then
resetHands = true;
end
self:MarkDirty();
end
end
if resetHands then
-- Have to do this because of possible weirdness with RANGED type combined with other weapon types
local actor = self.ModelScene:GetPlayerActor();
if actor then
actor:UndressSlot(INVSLOT_MAINHAND);
actor:UndressSlot(INVSLOT_OFFHAND);
end
end
if C_Transmog.CanHaveSecondaryAppearanceForSlotID(slotID) then
self:CheckSecondarySlotButtons();
end
end
function TransmogFrameMixin:GetRandomAppearanceID()
if not self.selectedSlotButton or not C_Item.DoesItemExist(self.selectedSlotButton.itemLocation) then
return Constants.Transmog.NoTransmogID;
end
-- we need to skip any appearances that match base or current
local baseItemTransmogInfo = C_Item.GetBaseItemTransmogInfo(self.selectedSlotButton.itemLocation);
local baseInfo = C_TransmogCollection.GetAppearanceInfoBySource(baseItemTransmogInfo.appearanceID);
local baseVisual = baseInfo and baseInfo.appearanceID;
local appliedItemTransmogInfo = C_Item.GetAppliedItemTransmogInfo(self.selectedSlotButton.itemLocation);
local appliedInfo = C_TransmogCollection.GetAppearanceInfoBySource(appliedItemTransmogInfo.appearanceID);
local appliedVisual = appliedInfo and appliedInfo.appearanceID or Constants.Transmog.NoTransmogID;
-- the collection should always be matched with the slot
local visualsList = WardrobeCollectionFrame.ItemsCollectionFrame:GetFilteredVisualsList();
local function GetValidRandom(minIndex, maxIndex)
local range = maxIndex - minIndex + 1;
local startPoint = math.random(minIndex, maxIndex);
for i = minIndex, maxIndex do
local currentIndex = startPoint + i;
if currentIndex > maxIndex then
-- overflow cycles from the beginning
currentIndex = currentIndex - range;
end
local visualInfo = visualsList[currentIndex];
local visualID = visualInfo.visualID;
if visualID ~= baseVisual and visualID ~= appliedVisual and not visualInfo.isHideVisual then
return WardrobeCollectionFrame.ItemsCollectionFrame:GetAnAppearanceSourceFromVisual(visualID, true);
end
end
return nil;
end
-- first try favorites
local numFavorites = 0;
for i, visualInfo in ipairs(visualsList) do
-- favorites are all at the front
if not visualInfo.isFavorite then
numFavorites = i - 1;
break;
end
end
if numFavorites > 0 then
local appearanceID = GetValidRandom(1, numFavorites);
if appearanceID then
return appearanceID;
end
end
-- now try the rest
if numFavorites < #visualsList then
local appearanceID = GetValidRandom(numFavorites + 1, #visualsList);
if appearanceID then
return appearanceID;
end
end
-- This is the case of only 1, maybe 2 collected appearances
return Constants.Transmog.NoTransmogID;
end
function TransmogFrameMixin:ToggleSecondaryForSelectedSlotButton()
local transmogLocation = self.selectedSlotButton and self.selectedSlotButton.transmogLocation;
-- if on the main slot, switch to secondary
if transmogLocation.modification == Enum.TransmogModification.Main then
transmogLocation = TransmogUtil.GetTransmogLocation(transmogLocation.slotID, transmogLocation.type, Enum.TransmogModification.Secondary);
end
local isSecondaryTransmogrified = TransmogUtil.IsSecondaryTransmoggedForItemLocation(self.selectedSlotButton.itemLocation);
local toggledOn = self.ToggleSecondaryAppearanceCheckbox:GetChecked();
if toggledOn then
-- if the item does not already have secondary then set a random pending, otherwise clear any pending
if not isSecondaryTransmogrified then
local pendingInfo;
local randomAppearanceID = self:GetRandomAppearanceID();
if randomAppearanceID == Constants.Transmog.NoTransmogID then
pendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.ToggleOn);
else
pendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Apply, randomAppearanceID);
end
C_Transmog.SetPending(transmogLocation, pendingInfo);
else
C_Transmog.ClearPending(transmogLocation);
end
else
-- if the item already has secondary then it's a toggle off, otherwise clear any pending
if isSecondaryTransmogrified then
local pendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.ToggleOff);
C_Transmog.SetPending(transmogLocation, pendingInfo);
else
C_Transmog.ClearPending(transmogLocation);
end
end
self:CheckSecondarySlotButtons();
end
function TransmogFrameMixin:CheckSecondarySlotButtons()
local headButton = self.HeadButton;
local mainShoulderButton = self.ShoulderButton;
local secondaryShoulderButton = self.SecondaryShoulderButton;
local secondaryShoulderTransmogged = TransmogUtil.IsSecondaryTransmoggedForItemLocation(secondaryShoulderButton.itemLocation);
local pendingInfo = C_Transmog.GetPending(secondaryShoulderButton.transmogLocation);
local showSecondaryShoulder = false;
if not pendingInfo then
showSecondaryShoulder = secondaryShoulderTransmogged;
elseif pendingInfo.type == Enum.TransmogPendingType.ToggleOff then
showSecondaryShoulder = false;
else
showSecondaryShoulder = true;
end
secondaryShoulderButton:SetShown(showSecondaryShoulder);
self.ToggleSecondaryAppearanceCheckbox:SetChecked(showSecondaryShoulder);
if showSecondaryShoulder then
headButton:SetPoint("TOP", -121, -15);
secondaryShoulderButton:SetPoint("TOP", mainShoulderButton, "BOTTOM", 0, -10);
else
headButton:SetPoint("TOP", -121, -41);
secondaryShoulderButton:SetPoint("TOP", mainShoulderButton, "TOP");
end
if not showSecondaryShoulder and self.selectedSlotButton == secondaryShoulderButton then
self:SelectSlotButton(mainShoulderButton);
end
end
function TransmogFrameMixin:HasActiveSecondaryAppearance()
local checkbox = self.ToggleSecondaryAppearanceCheckbox;
return checkbox:IsShown() and checkbox:GetChecked();
end
function TransmogFrameMixin:SelectSlotButton(slotButton, fromOnClick)
if self.selectedSlotButton then
self.selectedSlotButton:SetSelected(false);
end
self.selectedSlotButton = slotButton;
if slotButton then
slotButton:SetSelected(true);
if (fromOnClick and WardrobeCollectionFrame.activeFrame ~= WardrobeCollectionFrame.ItemsCollectionFrame) then
WardrobeCollectionFrame:ClickTab(WardrobeCollectionFrame.ItemsTab);
end
if ( WardrobeCollectionFrame.activeFrame == WardrobeCollectionFrame.ItemsCollectionFrame ) then
local _, _, selectedSourceID = TransmogUtil.GetInfoForEquippedSlot(slotButton.transmogLocation);
local forceGo = slotButton.transmogLocation:IsIllusion();
local forTransmog = true;
local effectiveCategory;
if slotButton.transmogLocation:IsEitherHand() then
effectiveCategory = C_Transmog.GetSlotEffectiveCategory(slotButton.transmogLocation);
end
WardrobeCollectionFrame.ItemsCollectionFrame:GoToSourceID(selectedSourceID, slotButton.transmogLocation, forceGo, forTransmog, effectiveCategory);
WardrobeCollectionFrame.ItemsCollectionFrame:SetTransmogrifierAppearancesShown(true);
end
else
WardrobeCollectionFrame.ItemsCollectionFrame:SetTransmogrifierAppearancesShown(false);
end
self:EvaluateSecondaryAppearanceCheckbox();
end
function TransmogFrameMixin:EvaluateSecondaryAppearanceCheckbox()
local showToggleCheckbox = false;
if self.selectedSlotButton and WardrobeCollectionFrame.activeFrame == WardrobeCollectionFrame.ItemsCollectionFrame then
showToggleCheckbox = C_Transmog.CanHaveSecondaryAppearanceForSlotID(self.selectedSlotButton.transmogLocation.slotID);
end
self.ToggleSecondaryAppearanceCheckbox:SetShown(showToggleCheckbox);
end
function TransmogFrameMixin:GetSelectedTransmogLocation()
if self.selectedSlotButton then
return self.selectedSlotButton.transmogLocation;
end
return nil;
end
function TransmogFrameMixin:RefreshPlayerModel()
if self.ModelScene.previousActor then
self.ModelScene.previousActor:ClearModel();
self.ModelScene.previousActor = nil;
end
local actor = self.ModelScene:GetPlayerActor();
if actor then
local sheatheWeapons = false;
local autoDress = true;
local hideWeapons = false;
local useNativeForm = true;
local _, raceFilename = UnitRace("Player");
if(raceFilename == "Dracthyr" or raceFilename == "Worgen") then
useNativeForm = not self.inAlternateForm;
end
actor:SetModelByUnit("player", sheatheWeapons, autoDress, hideWeapons, useNativeForm);
self.ModelScene.previousActor = actor;
end
self:Update();
end
function TransmogFrameMixin:Update()
self.dirty = false;
for i, slotButton in ipairs(self.SlotButtons) do
slotButton:Update();
end
for i, slotButton in ipairs(self.SlotButtons) do
slotButton:RefreshItemModel();
end
self:UpdateApplyButton();
self.OutfitDropDown:UpdateSaveButton();
self:CheckSecondarySlotButtons();
if not self.selectedSlotButton or not self.selectedSlotButton:IsEnabled() then
-- select first valid slot or clear selection
local validSlotButton;
for i, slotButton in ipairs(self.SlotButtons) do
if slotButton:IsEnabled() and slotButton.transmogLocation:IsAppearance() then
validSlotButton = slotButton;
break;
end
end
self:SelectSlotButton(validSlotButton);
else
self:SelectSlotButton(self.selectedSlotButton);
end
end
function TransmogFrameMixin:SetPendingTransmog(transmogID, category)
if self.selectedSlotButton then
local transmogLocation = self.selectedSlotButton.transmogLocation;
if transmogLocation:IsSecondary() then
local currentPendingInfo = C_Transmog.GetPending(transmogLocation);
if currentPendingInfo and currentPendingInfo.type == Enum.TransmogPendingType.Apply then
self.selectedSlotButton.priorTransmogID = currentPendingInfo.transmogID;
end
end
local pendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Apply, transmogID, category);
C_Transmog.SetPending(transmogLocation, pendingInfo);
end
end
function TransmogFrameMixin:UpdateApplyButton()
local cost = C_Transmog.GetApplyCost();
local canApply;
if cost and cost > GetMoney() then
SetMoneyFrameColor("WardrobeTransmogMoneyFrame", "red");
else
SetMoneyFrameColor("WardrobeTransmogMoneyFrame");
if cost then
canApply = true;
end
end
if StaticPopup_FindVisible("TRANSMOG_APPLY_WARNING") then
canApply = false;
end
MoneyFrame_Update("WardrobeTransmogMoneyFrame", cost or 0, true); -- always show 0 copper
self.ApplyButton:SetEnabled(canApply);
self.ModelScene.ClearAllPendingButton:SetShown(canApply);
end
function TransmogFrameMixin:GetSlotButton(transmogLocation)
for i, slotButton in ipairs(self.SlotButtons) do
if slotButton.transmogLocation:IsEqual(transmogLocation) then
return slotButton;
end
end
end
function TransmogFrameMixin:ApplyPending(lastAcceptedWarningIndex)
if ( lastAcceptedWarningIndex == 0 or not self.applyWarningsTable ) then
self.applyWarningsTable = C_Transmog.GetApplyWarnings();
end
self.redoApply = nil;
if ( self.applyWarningsTable and lastAcceptedWarningIndex < #self.applyWarningsTable ) then
lastAcceptedWarningIndex = lastAcceptedWarningIndex + 1;
local data = {
["link"] = self.applyWarningsTable[lastAcceptedWarningIndex].itemLink,
["useLinkForItemInfo"] = true,
["warningIndex"] = lastAcceptedWarningIndex;
};
StaticPopup_Show("TRANSMOG_APPLY_WARNING", self.applyWarningsTable[lastAcceptedWarningIndex].text, nil, data);
self:UpdateApplyButton();
-- return true to keep static popup open when chaining warnings
return true;
else
local success = C_Transmog.ApplyAllPending(GetCVarBool("transmogCurrentSpecOnly"));
if ( success ) then
self:OnTransmogApplied();
PlaySound(SOUNDKIT.UI_TRANSMOG_APPLY);
self.applyWarningsTable = nil;
-- outfit tutorial
if ( not GetCVarBitfield("closedInfoFrames", LE_FRAME_TUTORIAL_TRANSMOG_OUTFIT_DROPDOWN) ) then
local outfits = C_TransmogCollection.GetOutfits();
if ( #outfits == 0 ) then
local helpTipInfo = {
text = TRANSMOG_OUTFIT_DROPDOWN_TUTORIAL,
buttonStyle = HelpTip.ButtonStyle.Close,
cvarBitfield = "closedInfoFrames",
bitfieldFlag = LE_FRAME_TUTORIAL_TRANSMOG_OUTFIT_DROPDOWN,
targetPoint = HelpTip.Point.RightEdgeCenter,
offsetX = -18,
onAcknowledgeCallback = function() WardrobeCollectionFrame.ItemsCollectionFrame:CheckHelpTip(); end,
acknowledgeOnHide = true,
};
HelpTip:Show(self, helpTipInfo, self.OutfitDropDown);
end
end
else
-- it's retrieving item info
self.redoApply = true;
end
return false;
end
end
function TransmogFrameMixin:OnTransmogApplied()
local dropDown = self.OutfitDropDown;
if dropDown.selectedOutfitID and dropDown:IsOutfitDressed() then
dropDown:OnOutfitApplied(dropDown.selectedOutfitID);
end
end
WardrobeOutfitMixin = CreateFromMixins(WardrobeOutfitFrameMixin);
function WardrobeOutfitMixin:OnOutfitApplied(outfitID)
self:SaveLastOutfit(outfitID);
end
function WardrobeOutfitMixin:LoadOutfit(outfitID)
if ( not outfitID ) then
return;
end
C_Transmog.LoadOutfit(outfitID);
end
function WardrobeOutfitMixin:GetItemTransmogInfoList()
local playerActor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
if playerActor then
return playerActor:GetItemTransmogInfoList();
end
return nil;
end
function WardrobeOutfitMixin:GetLastOutfitID()
local specIndex = GetSpecialization();
return tonumber(GetCVar("lastTransmogOutfitIDSpec"..specIndex));
end
TransmogSlotButtonMixin = { };
function TransmogSlotButtonMixin:OnLoad()
local slotID, textureName = GetInventorySlotInfo(self.slot);
self.slotID = slotID;
self.transmogLocation = TransmogUtil.GetTransmogLocation(slotID, self.transmogType, self.modification);
if self.transmogLocation:IsAppearance() then
self.Icon:SetTexture(textureName);
else
self.Icon:SetTexture(ENCHANT_EMPTY_SLOT_FILEDATAID);
end
self.itemLocation = ItemLocation:CreateFromEquipmentSlot(slotID);
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
end
function TransmogSlotButtonMixin:OnClick(mouseButton)
local isTransmogrified, hasPending, isPendingCollected, canTransmogrify, cannotTransmogrifyReason, hasUndo = C_Transmog.GetSlotInfo(self.transmogLocation);
-- save for sound to play on TRANSMOGRIFY_UPDATE event
self.hadUndo = hasUndo;
if mouseButton == "RightButton" then
if hasPending or hasUndo then
local newPendingInfo;
-- for secondary this action might require setting a different pending instead of clearing current pending
if self.transmogLocation:IsSecondary() then
if not TransmogUtil.IsSecondaryTransmoggedForItemLocation(self.itemLocation) then
local currentPendingInfo = C_Transmog.GetPending(self.transmogLocation);
if currentPendingInfo.type == Enum.TransmogPendingType.ToggleOn then
if self.priorTransmogID then
newPendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Apply, self.priorTransmogID);
else
newPendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.ToggleOn);
end
else
self.priorTransmogID = currentPendingInfo.transmogID;
newPendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.ToggleOn);
end
end
end
if newPendingInfo then
C_Transmog.SetPending(self.transmogLocation, newPendingInfo);
else
C_Transmog.ClearPending(self.transmogLocation);
end
PlaySound(SOUNDKIT.UI_TRANSMOG_REVERTING_GEAR_SLOT);
self:OnUserSelect();
elseif isTransmogrified then
PlaySound(SOUNDKIT.UI_TRANSMOG_REVERTING_GEAR_SLOT);
local newPendingInfo = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Revert);
C_Transmog.SetPending(self.transmogLocation, newPendingInfo);
self:OnUserSelect();
end
else
PlaySound(SOUNDKIT.UI_TRANSMOG_GEAR_SLOT_CLICK);
self:OnUserSelect();
end
if self.UndoButton then
self.UndoButton:Hide();
end
self:OnEnter();
end
function TransmogSlotButtonMixin:OnUserSelect()
local fromOnClick = true;
self:GetParent():SelectSlotButton(self, fromOnClick);
end
function TransmogSlotButtonMixin:OnEnter()
local isTransmogrified, hasPending, isPendingCollected, canTransmogrify, cannotTransmogrifyReason, hasUndo = C_Transmog.GetSlotInfo(self.transmogLocation);
if ( self.transmogLocation:IsIllusion() ) then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT", 0, 0);
GameTooltip:SetText(WEAPON_ENCHANTMENT);
local baseSourceID, baseVisualID, appliedSourceID, appliedVisualID, pendingSourceID, pendingVisualID, hasPendingUndo = C_Transmog.GetSlotVisualInfo(self.transmogLocation);
if ( self.invalidWeapon ) then
GameTooltip:AddLine(TRANSMOGRIFY_ILLUSION_INVALID_ITEM, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b, true);
elseif ( hasPending or hasUndo or canTransmogrify ) then
if ( baseSourceID > 0 ) then
local name = C_TransmogCollection.GetIllusionStrings(baseSourceID);
GameTooltip:AddLine(name, GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b);
end
if ( hasUndo ) then
GameTooltip:AddLine(TRANSMOGRIFY_TOOLTIP_REVERT, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b);
elseif ( pendingSourceID > 0 ) then
GameTooltip:AddLine(WILL_BE_TRANSMOGRIFIED_HEADER, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b);
local name = C_TransmogCollection.GetIllusionStrings(pendingSourceID);
GameTooltip:AddLine(name, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b);
elseif ( appliedSourceID > 0 ) then
GameTooltip:AddLine(TRANSMOGRIFIED_HEADER, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b);
local name = C_TransmogCollection.GetIllusionStrings(appliedSourceID);
GameTooltip:AddLine(name, TRANSMOGRIFY_FONT_COLOR.r, TRANSMOGRIFY_FONT_COLOR.g, TRANSMOGRIFY_FONT_COLOR.b);
end
else
if not C_Item.DoesItemExist(self.itemLocation) then
GameTooltip:AddLine(TRANSMOGRIFY_INVALID_NO_ITEM, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, true);
else
GameTooltip:AddLine(TRANSMOGRIFY_ILLUSION_INVALID_ITEM, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, true);
end
end
GameTooltip:Show();
else
if ( self.UndoButton and canTransmogrify and isTransmogrified and not ( hasPending or hasUndo ) ) then
self.UndoButton:Show();
end
GameTooltip:SetOwner(self, "ANCHOR_RIGHT", 14, 0);
if not canTransmogrify and not hasUndo then
GameTooltip:SetText(_G[self.slot]);
local tag = TRANSMOG_INVALID_CODES[cannotTransmogrifyReason];
local errorMsg;
if ( tag == "CANNOT_USE" ) then
local errorCode, errorString = C_Transmog.GetSlotUseError(self.transmogLocation);
errorMsg = errorString;
else
errorMsg = tag and _G["TRANSMOGRIFY_INVALID_"..tag];
end
if ( errorMsg ) then
GameTooltip:AddLine(errorMsg, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b, true);
end
GameTooltip:Show();
else
GameTooltip:SetTransmogrifyItem(self.transmogLocation);
end
end
WardrobeTransmogFrame.ModelScene.ControlFrame:Show();
self.UpdateTooltip = GenerateClosure(self.OnEnter, self);
end
function TransmogSlotButtonMixin:OnLeave()
if ( self.UndoButton and not self.UndoButton:IsMouseOver() ) then
self.UndoButton:Hide();
end
WardrobeTransmogFrame.ModelScene.ControlFrame:Hide();
GameTooltip:Hide();
self.UpdateTooltip = nil;
end
function TransmogSlotButtonMixin:OnShow()
self:Update();
end
function TransmogSlotButtonMixin:OnHide()
self.priorTransmogID = nil;
end
function TransmogSlotButtonMixin:SetSelected(selected)
self.SelectedTexture:SetShown(selected);
end
function TransmogSlotButtonMixin:OnTransmogrifySuccess()
self:Animate();
self:GetParent():MarkDirty();
self.priorTransmogID = nil;
end
function TransmogSlotButtonMixin:Animate()
-- don't do anything if already animating;
if self.AnimFrame:IsShown() then
return;
end
local isTransmogrified = C_Transmog.GetSlotInfo(self.transmogLocation);
if isTransmogrified then
self.AnimFrame.Transition:Show();
else
self.AnimFrame.Transition:Hide();
end
self.AnimFrame:Show();
self.AnimFrame.Anim:Play();
end
function TransmogSlotButtonMixin:OnAnimFinished()
self.AnimFrame:Hide();
self:Update();
end
function TransmogSlotButtonMixin:Update()
if not self:IsShown() then
return;
end
local isTransmogrified, hasPending, isPendingCollected, canTransmogrify, cannotTransmogrifyReason, hasUndo, isHideVisual, texture = C_Transmog.GetSlotInfo(self.transmogLocation);
local baseTexture = GetInventoryItemTexture("player", self.transmogLocation.slotID);
if C_Transmog.IsSlotBeingCollapsed(self.transmogLocation) then
-- This will indicate a pending change for the item
hasPending = true;
isPendingCollected = true;
canTransmogrify = true;
end
local hasChange = (hasPending and canTransmogrify) or hasUndo;
if self.transmogLocation:IsAppearance() then
if canTransmogrify or hasChange then
if hasUndo then
self.Icon:SetTexture(baseTexture);
else
self.Icon:SetTexture(texture);
end
self.NoItemTexture:Hide();
else
local tag = TRANSMOG_INVALID_CODES[cannotTransmogrifyReason];
local slotID, defaultTexture = GetInventorySlotInfo(self.slot);
if tag == "SLOT_FOR_FORM" then
if texture then
self.Icon:SetTexture(texture);
else
self.Icon:SetTexture(defaultTexture);
end
elseif tag == "NO_ITEM" or tag == "SLOT_FOR_RACE" then
self.Icon:SetTexture(defaultTexture);
else
self.Icon:SetTexture(texture);
end
self.NoItemTexture:Show();
end
else
-- check for weapons lacking visual attachments
local sourceID = self.dependencySlot:GetEffectiveTransmogID();
if sourceID ~= Constants.Transmog.NoTransmogID and not WardrobeCollectionFrame.ItemsCollectionFrame:CanEnchantSource(sourceID) then
-- clear anything in the enchant slot, otherwise cost and Apply button state will still reflect anything pending
C_Transmog.ClearPending(self.transmogLocation);
isTransmogrified = false; -- handle legacy, this weapon could have had an illusion applied previously
canTransmogrify = false;
self.invalidWeapon = true;
else
self.invalidWeapon = false;
end
if ( hasPending or hasUndo or canTransmogrify ) then
self.Icon:SetTexture(texture or ENCHANT_EMPTY_SLOT_FILEDATAID);
self.NoItemTexture:Hide();
else
self.Icon:SetColorTexture(0, 0, 0);
self.NoItemTexture:Show();
end
end
self:SetEnabled(canTransmogrify or hasUndo);
-- show transmogged border if the item is transmogrified and doesn't have a pending transmogrification or is animating
local showStatusBorder = false;
if hasPending then
showStatusBorder = hasUndo or (isPendingCollected and canTransmogrify);
else
showStatusBorder = isTransmogrified and not hasChange and not self.AnimFrame:IsShown();
end
self.StatusBorder:SetShown(showStatusBorder);
-- show ants frame is the item has a pending transmogrification and is not animating
if ( hasChange and (hasUndo or isPendingCollected) and not self.AnimFrame:IsShown() ) then
self.PendingFrame:Show();
if ( hasUndo ) then
self.PendingFrame.Undo:Show();
else
self.PendingFrame.Undo:Hide();
end
else
self.PendingFrame:Hide();
end
if ( isHideVisual and not hasUndo ) then
if ( self.HiddenVisualIcon ) then
if ( canTransmogrify ) then
self.HiddenVisualCover:Show();
self.HiddenVisualIcon:Show();
else
self.HiddenVisualCover:Hide();
self.HiddenVisualIcon:Hide();
end
end
local baseTexture = GetInventoryItemTexture("player", self.transmogLocation.slotID);
self.Icon:SetTexture(baseTexture);
else
if ( self.HiddenVisualIcon ) then
self.HiddenVisualCover:Hide();
self.HiddenVisualIcon:Hide();
end
end
end
function TransmogSlotButtonMixin:GetEffectiveTransmogID()
if not C_Item.DoesItemExist(self.itemLocation) then
return Constants.Transmog.NoTransmogID;
end
local function GetTransmogIDFrom(fn)
local itemTransmogInfo = fn(self.itemLocation);
return TransmogUtil.GetRelevantTransmogID(itemTransmogInfo, self.transmogLocation);
end
local pendingInfo = C_Transmog.GetPending(self.transmogLocation);
if pendingInfo then
if pendingInfo.type == Enum.TransmogPendingType.Apply then
return pendingInfo.transmogID;
elseif pendingInfo.type == Enum.TransmogPendingType.Revert then
return GetTransmogIDFrom(C_Item.GetBaseItemTransmogInfo);
elseif pendingInfo.type == Enum.TransmogPendingType.ToggleOff then
return Constants.Transmog.NoTransmogID;
end
end
local appliedTransmogID = GetTransmogIDFrom(C_Item.GetAppliedItemTransmogInfo);
-- if nothing is applied, get base
if appliedTransmogID == Constants.Transmog.NoTransmogID then
return GetTransmogIDFrom(C_Item.GetBaseItemTransmogInfo);
else
return appliedTransmogID;
end
end
function TransmogSlotButtonMixin:RefreshItemModel()
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
if not actor then
return;
end
-- this slot will be handled by the dependencySlot
if self.dependencySlot then
return;
end
local appearanceID = self:GetEffectiveTransmogID();
local secondaryAppearanceID = Constants.Transmog.NoTransmogID;
local illusionID = Constants.Transmog.NoTransmogID;
if self.dependentSlot then
if self.transmogLocation:IsEitherHand() then
illusionID = self.dependentSlot:GetEffectiveTransmogID();
else
secondaryAppearanceID = self.dependentSlot:GetEffectiveTransmogID();
end
end
if appearanceID ~= Constants.Transmog.NoTransmogID then
local slotID = self.transmogLocation.slotID;
local itemTransmogInfo = ItemUtil.CreateItemTransmogInfo(appearanceID, secondaryAppearanceID, illusionID);
local currentItemTransmogInfo = actor:GetItemTransmogInfo(slotID);
-- need the main category for mainhand
local mainHandCategoryID;
local isLegionArtifact = false;
if self.transmogLocation:IsMainHand() then
mainHandCategoryID = C_Transmog.GetSlotEffectiveCategory(self.transmogLocation);
isLegionArtifact = TransmogUtil.IsCategoryLegionArtifact(mainHandCategoryID);
itemTransmogInfo:ConfigureSecondaryForMainHand(isLegionArtifact);
end
-- update only if there is a change or it can recurse (offhand is processed first and mainhand might override offhand)
if not itemTransmogInfo:IsEqual(currentItemTransmogInfo) or isLegionArtifact then
-- don't specify a slot for ranged weapons
if mainHandCategoryID and TransmogUtil.IsCategoryRangedWeapon(mainHandCategoryID) then
slotID = nil;
end
actor:SetItemTransmogInfo(itemTransmogInfo, slotID);
end
end
end
WardrobeTransmogClearAllPendingButtonMixin = {};
function WardrobeTransmogClearAllPendingButtonMixin:OnClick()
PlaySound(SOUNDKIT.UI_TRANSMOG_REVERTING_GEAR_SLOT);
for index, button in ipairs(WardrobeTransmogFrame.SlotButtons) do
C_Transmog.ClearPending(button.transmogLocation);
end
end
function WardrobeTransmogClearAllPendingButtonMixin:OnEnter()
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(TRANSMOGRIFY_CLEAR_ALL_PENDING);
end
function WardrobeTransmogClearAllPendingButtonMixin:OnLeave()
GameTooltip:Hide();
end
-- ************************************************************************************************************************************************************
-- **** COLLECTION ********************************************************************************************************************************************
-- ************************************************************************************************************************************************************
local MAIN_HAND_INV_TYPE = 21;
local OFF_HAND_INV_TYPE = 22;
local RANGED_INV_TYPE = 15;
local TAB_ITEMS = 1;
local TAB_SETS = 2;
local TABS_MAX_WIDTH = 185;
local WARDROBE_MODEL_SETUP = {
["HEADSLOT"] = { useTransmogSkin = false, useTransmogChoices = false, obeyHideInTransmogFlag = false, slots = { CHESTSLOT = true, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = false } },
["SHOULDERSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["BACKSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["CHESTSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["TABARDSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["SHIRTSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["WRISTSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["HANDSSLOT"] = { useTransmogSkin = false, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = true, HANDSSLOT = false, LEGSSLOT = true, FEETSLOT = true, HEADSLOT = true } },
["WAISTSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["LEGSSLOT"] = { useTransmogSkin = true, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = false, HANDSSLOT = false, LEGSSLOT = false, FEETSLOT = false, HEADSLOT = true } },
["FEETSLOT"] = { useTransmogSkin = false, useTransmogChoices = true, obeyHideInTransmogFlag = true, slots = { CHESTSLOT = true, HANDSSLOT = true, LEGSSLOT = true, FEETSLOT = false, HEADSLOT = true } },
}
local function GetUseTransmogSkin(slot)
local modelSetupTable = WARDROBE_MODEL_SETUP[slot];
if not modelSetupTable or modelSetupTable.useTransmogSkin then
return true;
end
-- this exludes head slot
if modelSetupTable.useTransmogChoices then
local transmogLocation = TransmogUtil.GetTransmogLocation(slot, Enum.TransmogType.Appearance, Enum.TransmogModification.Main);
if transmogLocation then
if not C_PlayerInfo.HasVisibleInvSlot(transmogLocation.slotID) then
return true;
end
end
end
return false;
end
local WARDROBE_MODEL_SETUP_GEAR = {
["CHESTSLOT"] = 78420,
["LEGSSLOT"] = 78425,
["FEETSLOT"] = 78427,
["HANDSSLOT"] = 78426,
["HEADSLOT"] = 78416,
}
local SET_MODEL_PAN_AND_ZOOM_LIMITS = {
["Draenei2"] = { maxZoom = 2.2105259895325, panMaxLeft = -0.56983226537705, panMaxRight = 0.82581323385239, panMaxTop = -0.17342753708363, panMaxBottom = -2.6428601741791 },
["Draenei3"] = { maxZoom = 3.0592098236084, panMaxLeft = -0.33429977297783, panMaxRight = 0.29183092713356, panMaxTop = -0.079871296882629, panMaxBottom = -2.4141833782196 },
["Worgen2"] = { maxZoom = 1.9605259895325, panMaxLeft = -0.64045578241348, panMaxRight = 0.59410041570663, panMaxTop = -0.11050206422806, panMaxBottom = -2.2492413520813 },
["Worgen3"] = { maxZoom = 2.9013152122498, panMaxLeft = -0.2526838183403, panMaxRight = 0.38198262453079, panMaxTop = -0.10407017171383, panMaxBottom = -2.4137926101685 },
["Worgen3Alt"] = { maxZoom = 3.3618412017822, panMaxLeft = -0.19753229618072, panMaxRight = 0.26802557706833, panMaxTop = -0.073476828634739, panMaxBottom = -1.9255120754242 },
["Worgen2Alt"] = { maxZoom = 2.9605259895325, panMaxLeft = -0.33268970251083, panMaxRight = 0.36896070837975, panMaxTop = -0.14780110120773, panMaxBottom = -2.1662468910217 },
["Scourge2"] = { maxZoom = 3.1710526943207, panMaxLeft = -0.3243542611599, panMaxRight = 0.5625838637352, panMaxTop = -0.054175414144993, panMaxBottom = -1.7261047363281 },
["Scourge3"] = { maxZoom = 2.7105259895325, panMaxLeft = -0.35650563240051, panMaxRight = 0.41562974452972, panMaxTop = -0.07072202116251, panMaxBottom = -1.877711892128 },
["Orc2"] = { maxZoom = 2.5526309013367, panMaxLeft = -0.64236557483673, panMaxRight = 0.77098786830902, panMaxTop = -0.075792260468006, panMaxBottom = -2.0818419456482 },
["Orc3"] = { maxZoom = 3.2960524559021, panMaxLeft = -0.22763830423355, panMaxRight = 0.32022559642792, panMaxTop = -0.038521766662598, panMaxBottom = -2.0473554134369 },
["Gnome3"] = { maxZoom = 2.9605259895325, panMaxLeft = -0.29900181293488, panMaxRight = 0.35779395699501, panMaxTop = -0.076380833983421, panMaxBottom = -0.99909907579422 },
["Gnome2"] = { maxZoom = 2.8552639484406, panMaxLeft = -0.2777853012085, panMaxRight = 0.29651582241058, panMaxTop = -0.095201380550861, panMaxBottom = -1.0263166427612 },
["Dwarf2"] = { maxZoom = 2.9605259895325, panMaxLeft = -0.50352156162262, panMaxRight = 0.4159924685955, panMaxTop = -0.07211934030056, panMaxBottom = -1.4946432113648 },
["Dwarf3"] = { maxZoom = 2.8947370052338, panMaxLeft = -0.37057432532311, panMaxRight = 0.43383255600929, panMaxTop = -0.084960877895355, panMaxBottom = -1.7173190116882 },
["BloodElf3"] = { maxZoom = 3.1644730567932, panMaxLeft = -0.2654082775116, panMaxRight = 0.28886350989342, panMaxTop = -0.049619361758232, panMaxBottom = -1.9943760633469 },