Back to Home

ESO Lua File v101041

ingame/restyle/keyboard/restylesheet_keyboard.lua

[◄ back to folders ]
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
ZO_RESTYLE_SHEET_CONTAINER =
{
    PRIMARY = 1,
    SECONDARY = 2,
}
-----------------------
-- Restyle Slot Base --
-----------------------
ZO_RestyleSlot_Base = ZO_InitializingObject:Subclass()
ZO_RESTYLE_SLOT_WIDTH = 136
ZO_RESTYLE_SLOT_HEIGHT = 63
ZO_RESTYLE_SLOT_ICON_WIDTH  = 63
ZO_RESTYLE_SLOT_ICON_HEIGHT = ZO_RESTYLE_SLOT_ICON_WIDTH
ZO_RESTYLE_SLOT_ICON_INNER_WIDTH = ZO_RESTYLE_SLOT_ICON_WIDTH - 8
ZO_RESTYLE_SLOT_ICON_INNER_HEIGHT = ZO_RESTYLE_SLOT_ICON_INNER_WIDTH
do
    local GRID_PADDING_X = 30
    local GRID_PADDING_Y = 12
    function ZO_RestyleSlot_Base:Initialize(owner, restyleSlotType, gridData, container)
        self.owner = owner
        local offsetX = (ZO_RESTYLE_SLOT_WIDTH + GRID_PADDING_X) * (gridData.column - 1)
        local offsetY = (ZO_RESTYLE_SLOT_HEIGHT + GRID_PADDING_Y) * (gridData.row - 1)
        local controlName = gridData.controlName or string.format("Row%d_Col%d", gridData.row, gridData.column)
        local control = CreateControlFromVirtual("$(parent)" .. controlName, container, self:GetControlTemplate())
        control:SetAnchor(TOPLEFT, container, TOPLEFT, offsetX, offsetY)
        local itemSlotControl = control:GetNamedChild("ItemSlot")
        itemSlotControl:SetHandler("OnMouseUp", function(_, button, upInside)
            self:OnIconMouseUp(button, upInside)
        end)
        itemSlotControl:SetHandler("OnMouseEnter", function()
            self:OnIconMouseEnter()
        end)
        itemSlotControl:SetHandler("OnMouseExit", function()
            self:OnIconMouseExit()
        end)
        itemSlotControl.iconTexture = itemSlotControl:GetNamedChild("Icon")
        self.control = control
        self.itemSlotControl = itemSlotControl
        self.dyeControls = control:GetNamedChild("Dyes").dyeControls
        self.restyleSlotData = ZO_RestyleSlotData:New(owner:GetRestyleMode(), ZO_RESTYLE_DEFAULT_SET_INDEX, restyleSlotType)
    end
end
function ZO_RestyleSlot_Base:GetControlTemplate()
    return "ZO_RestyleSlotsSheet_Slot_Keyboard"
end
function ZO_RestyleSlot_Base:GetControl()
    return self.control
end
function ZO_RestyleSlot_Base:GetItemSlotControl()
    return self.itemSlotControl
end
function ZO_RestyleSlot_Base:GetDyeControls()
    return self.dyeControls
end
function ZO_RestyleSlot_Base:GetRestyleSlotData()
    return self.restyleSlotData
end
function ZO_RestyleSlot_Base:OnIconMouseUp(button, upInside)
    --To be overriden
end
function ZO_RestyleSlot_Base:OnIconMouseEnter()
    --To be overriden
end
function ZO_RestyleSlot_Base:OnIconMouseExit()
    --To be overriden
end
function ZO_RestyleSlot_Base:SetRestyleSetIndex(restyleSetIndex)
    self.restyleSlotData:SetRestyleSetIndex(restyleSetIndex)
end
function ZO_RestyleSlot_Base:RefreshVisible()
    --Can be overriden
end
----------------------------
-- Equipment Restyle Slot --
----------------------------
ZO_RestyleSlot_Equipment = ZO_RestyleSlot_Base:Subclass()
function ZO_RestyleSlot_Equipment:OnIconMouseEnter()
    ZO_InventorySlot_OnMouseEnter(self.itemSlotControl)
end
function ZO_RestyleSlot_Equipment:OnIconMouseExit()
    ZO_InventorySlot_OnMouseExit(self.itemSlotControl)
end
function ZO_RestyleSlot_Equipment:RefreshVisible()
    local restyleSlotType = self.restyleSlotData:GetRestyleSlotType()
    if restyleSlotType == EQUIP_SLOT_OFF_HAND or restyleSlotType == EQUIP_SLOT_BACKUP_OFF then
        local activeEquipSlot = ZO_Restyle_GetActiveOffhandEquipSlotType()
        self.control:SetHidden(restyleSlotType ~= activeEquipSlot)
    end
end
------------------------------
-- Collectible Restyle Slot --
------------------------------
ZO_RestyleSlot_Collectible = ZO_RestyleSlot_Base:Subclass()
do
    local SHOW_NICKNAME = true
    local SHOW_PURCHASABLE_HINT = true
    local SHOW_BLOCK_REASON = true
    function ZO_RestyleSlot_Collectible:OnIconMouseEnter()
        local collectibleId = self.restyleSlotData:GetId()
        if collectibleId > 0 then
            InitializeTooltip(ItemTooltip, self.itemSlotControl, LEFT, 5, 0, RIGHT)
            local actorCategory = ZO_OUTFIT_MANAGER.GetActorCategoryByRestyleMode(self:GetRestyleSlotData().restyleMode)
            ItemTooltip:SetCollectible(collectibleId, SHOW_NICKNAME, SHOW_PURCHASABLE_HINT, SHOW_BLOCK_REASON, actorCategory)
        else
            InitializeTooltip(InformationTooltip, self.itemSlotControl, LEFT, 5, 0, RIGHT)
            SetTooltipText(InformationTooltip, zo_strformat(SI_CHARACTER_EQUIP_SLOT_FORMAT, GetString("SI_COLLECTIBLECATEGORYTYPE", self.restyleSlotData:GetRestyleSlotType())))
        end
    end
end
function ZO_RestyleSlot_Collectible:OnIconMouseExit()
    ClearTooltip(ItemTooltip)
    ClearTooltip(InformationTooltip)
end
-------------------------------
-- Outfit Style Restyle Slot --
-------------------------------
ZO_RestyleSlot_OutfitStyle = ZO_RestyleSlot_Base:Subclass()
function ZO_RestyleSlot_OutfitStyle:Initialize(...)
    ZO_RestyleSlot_Base.Initialize(self, ...)
    self.itemSlotControl:SetHandler("OnDragStart", function(_, button)
        self:OnIconDragStart(button)
    end)
    self.itemSlotControl:SetHandler("OnReceiveDrag", function(_, button)
        self:OnIconReceiveDrag(button)
    end)
    self.itemSlotControl:SetHandler("OnMouseDoubleClick", function(_, button)
        self:OnMouseDoubleClick(button)
    end)
    self.itemSlotControl.equippedGlow = self.itemSlotControl:GetNamedChild("EquippedGlow")
    self.itemSlotControl.dragCallout = self.itemSlotControl:GetNamedChild("DragCallout")
    self.hiddenCollectibleId = GetOutfitSlotDataHiddenOutfitStyleCollectibleId(self.restyleSlotData:GetRestyleSlotType())
end
function ZO_RestyleSlot_OutfitStyle:GetControlTemplate()
    return "ZO_RestyleOutfitStyleSlotsSheet_Slot_Keyboard"
end
do
    local SHOW_NICKNAME = true
    local SHOW_PURCHASABLE_HINT = true
    local SHOW_BLOCK_REASON = true
    function ZO_RestyleSlot_OutfitStyle:OnIconMouseEnter()
        local collectibleData = self.restyleSlotData:GetPendingCollectibleData()
        if collectibleData then
            InitializeTooltip(ItemTooltip, self.itemSlotControl, LEFT, 5, 0, RIGHT)
            local actorCategory = ZO_OUTFIT_MANAGER.GetActorCategoryByRestyleMode(self:GetRestyleSlotData().restyleMode)
            ItemTooltip:SetCollectible(collectibleData:GetId(), SHOW_NICKNAME, SHOW_PURCHASABLE_HINT, SHOW_BLOCK_REASON, actorCategory)
        else
            InitializeTooltip(InformationTooltip, self.itemSlotControl, LEFT, 5, 0, RIGHT)
            SetTooltipText(InformationTooltip, zo_strformat(SI_CHARACTER_EQUIP_SLOT_FORMAT, GetString("SI_OUTFITSLOT", self.restyleSlotData:GetRestyleSlotType())))
        end
        self.owner:SetMouseOverData(self.restyleSlotData)
    end
end
function ZO_RestyleSlot_OutfitStyle:OnIconMouseExit()
    ClearTooltip(ItemTooltip)
    ClearTooltip(InformationTooltip)
    self.owner:SetMouseOverData(nil)
end
function ZO_RestyleSlot_OutfitStyle:OnIconMouseUp(button, upInside)
    if upInside then
        if button == MOUSE_BUTTON_INDEX_LEFT then
            if not self:HandlePlaceCursorCollectible() then
                ZO_RESTYLE_SHEET_WINDOW_KEYBOARD:NavigateToCollectibleCategoryFromRestyleSlotData(self.restyleSlotData)
            end
        elseif button == MOUSE_BUTTON_INDEX_RIGHT then
            ClearMenu()
            
            local collectibleData = self.restyleSlotData:GetPendingCollectibleData()
            if collectibleData then
                if IsChatSystemAvailableForCurrentPlatform() then
                    --Link in chat
                    AddMenuItem(GetString(SI_ITEM_ACTION_LINK_TO_CHAT), function() ZO_LinkHandler_InsertLink(GetCollectibleLink(collectibleData:GetId(), LINK_STYLE_BRACKETS)) end)
                end
                if collectibleData:IsLocked() and collectibleData:IsPurchasable() then
                    AddMenuItem(GetString(SI_OUTFIT_COLLECTIBLE_SHOW_IN_MARKET), function()
                        local function GoToCrownStore()
                            local searchTerm = zo_strformat(SI_CROWN_STORE_SEARCH_FORMAT_STRING, collectibleData:GetName())
                            ShowMarketAndSearch(searchTerm, MARKET_OPEN_OPERATION_COLLECTIONS_OUTFITS)
                        end
                        if self.owner:AreChangesPending() then
                            ZO_RESTYLE_SHEET_WINDOW_KEYBOARD:ShowRevertRestyleChangesDialog("CONFIRM_REVERT_CHANGES", GoToCrownStore)
                        else
                            GoToCrownStore()
                        end
                    end)
                end
                if ZO_RestyleCanApplyChanges() then
                    AddMenuItem(GetString(SI_OUTFIT_SLOT_CLEAR_ACTION), function()
                        self:ClearOufitStyleFromSlot()
                     end)
                 end
            end
            if ZO_RestyleCanApplyChanges() then
                local slotManipulator = ZO_OUTFIT_MANAGER:GetOutfitSlotManipulatorFromRestyleSlotData(self.restyleSlotData)
                if slotManipulator:IsSlotDataChangePending() then 
                    AddMenuItem(GetString(SI_OUTFIT_SLOT_UNDO_ACTION), function()
                        slotManipulator:ClearPendingChanges()
                    end)
                end
                if self.hiddenCollectibleId > 0 and slotManipulator:GetPendingCollectibleId() ~= self.hiddenCollectibleId then
                    AddMenuItem(GetString(SI_OUTFIT_SLOT_HIDE_ACTION), function()
                        slotManipulator:SetPendingCollectibleIdAndItemMaterialIndex(self.hiddenCollectibleId, ZO_OUTFIT_STYLE_DEFAULT_ITEM_MATERIAL_INDEX)
                    end)
                end
            end
            ShowMenu(self.control)
        end
    end
    self.isDragOrigin = nil
end
function ZO_RestyleSlot_OutfitStyle:OnIconDragStart(button)
    if ZO_RestyleCanApplyChanges() and button == MOUSE_BUTTON_INDEX_LEFT then
        local collectibleData = self.restyleSlotData:GetPendingCollectibleData()
        if collectibleData then
            PickupCollectible(collectibleData:GetId())
            self:ClearOufitStyleFromSlot()
            self.isDragOrigin = true
        end
    end
end
function ZO_RestyleSlot_OutfitStyle:OnIconReceiveDrag(button)
    -- If we were the origin and final destination of the drag, on mouse up will handle things
    if ZO_RestyleCanApplyChanges() and button == MOUSE_BUTTON_INDEX_LEFT and not self.isDragOrigin then
    end
end
do
    local INITIAL_CONTEXT_MENU_REF_COUNT = 1
    function ZO_RestyleSlot_OutfitStyle:OnMouseDoubleClick(button)
        if ZO_RestyleCanApplyChanges() and button == MOUSE_BUTTON_INDEX_LEFT then
            local collectibleData = self.restyleSlotData:GetPendingCollectibleData()
            if collectibleData then
                local entryData =
                {
                    control = self.control,
                    data = collectibleData,
                    preferredOutfitSlot = self.restyleSlotData:GetRestyleSlotType(),
                }
                ZO_OUTFIT_STYLES_PANEL_KEYBOARD:OnRestyleOutfitStyleEntrySelected(entryData, INITIAL_CONTEXT_MENU_REF_COUNT)
            end
        end
    end
end
function ZO_RestyleSlot_OutfitStyle:HandlePlaceCursorCollectible()
    local handled = false
    if not self.itemSlotControl.dragCallout:IsHidden() then
        local collectibleId = GetCursorCollectibleId()
        if collectibleId then
            local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
            if collectibleData then
                local entryData =
                {
                    control = self.control,
                    data = collectibleData,
                    preferredOutfitSlot = self.restyleSlotData:GetRestyleSlotType(),
                }
                ZO_OUTFIT_STYLES_PANEL_KEYBOARD:OnRestyleOutfitStyleEntrySelected(entryData)
            end
            ClearCursor()
            handled = true
        end
    end
    return handled
end
function ZO_RestyleSlot_OutfitStyle:ClearOufitStyleFromSlot()
    local slotManipulator = ZO_OUTFIT_MANAGER:GetOutfitSlotManipulatorFromRestyleSlotData(self.restyleSlotData)
    slotManipulator:Clear()
end
function ZO_RestyleSlot_OutfitStyle:RefreshVisible()
    local restyleSlotType = self.restyleSlotData:GetRestyleSlotType()
    if ZO_OUTFIT_MANAGER:IsOutfitSlotWeapon(restyleSlotType) then
        local actorCategory = ZO_OUTFIT_MANAGER.GetActorCategoryByRestyleMode(self.restyleSlotData.restyleMode)
        local isEquipped = ZO_OUTFIT_MANAGER:IsWeaponOutfitSlotCurrentlyHeld(restyleSlotType, actorCategory)
        self.control:SetHidden(not isEquipped)
    end
end
-------------------------
-- Restyle Slots Sheet --
-------------------------
ZO_RestyleSlotsSheet = ZO_InitializingObject:Subclass()
function ZO_RestyleSlotsSheet:Initialize(parentContainer, slotGridData)
    local control = CreateControlFromVirtual("$(grandparent)" .. self:GetControlShortName(), parentContainer, self:GetTemplate())
    control.object = self
    self.headers =
    {
        [ZO_RESTYLE_SHEET_CONTAINER.PRIMARY] = control:GetNamedChild("PrimaryHeader"),
        [ZO_RESTYLE_SHEET_CONTAINER.SECONDARY] = control:GetNamedChild("SecondaryHeader"),
    }
    self.slotContainers =
    {
        [ZO_RESTYLE_SHEET_CONTAINER.PRIMARY] = control:GetNamedChild("PrimarySlots"),
        [ZO_RESTYLE_SHEET_CONTAINER.SECONDARY] = control:GetNamedChild("SecondarySlots"),
    }
    self.slots = {}
    self:SetupSlotGrid(slotGridData)
    self.pendingLoopAnimationPool = ZO_MetaPool:New(ZO_Pending_Outfit_LoopAnimation_Pool)
    self.control = control
    self.fragment = ZO_FadeSceneFragment:New(control)
    self.fragment:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_FRAGMENT_SHOWING then
            self:OnShowing()
        elseif newState == SCENE_FRAGMENT_SHOWN then
            self:OnShown()
        elseif newState == SCENE_FRAGMENT_HIDING then
            self:OnHiding()
        elseif newState == SCENE_FRAGMENT_HIDDEN then
            self:OnHidden()
        end
    end)
    self:MarkViewDirty()
end
function ZO_RestyleSlotsSheet:RegisterForEvents()
    -- Can be overridden
end
function ZO_RestyleSlotsSheet:SetupSlotGrid(slotGridData)
    ZO_ClearTable(self.slots)
    local slotObjectClass = self:GetSlotObjectClass()
    for containerKey, slotsData in pairs(slotGridData) do
        local container = self.slotContainers[containerKey]
        for restyleSlotType, gridData in pairs(slotsData) do
            self.slots[restyleSlotType] = slotObjectClass:New(self, restyleSlotType, gridData, container)
        end
    end
end
function ZO_RestyleSlotsSheet:GetPendingLoopAnimationPool()
    return self.pendingLoopAnimationPool
end
function ZO_RestyleSlotsSheet:GetSlotsContainer(containerKey)
    return self.slotContainers[containerKey]
end
function ZO_RestyleSlotsSheet:GetRestyleMode()
    assert(false) -- Must be overriden
end
function ZO_RestyleSlotsSheet:GetTemplate()
    return "ZO_RestyleSlotsSheet_Keyboard"
end
function ZO_RestyleSlotsSheet:GetSlotObjectClass()
    assert(false) -- Must be overriden
end
function ZO_RestyleSlotsSheet:GetControlShortName()
    assert(false) -- Must be overriden
end
function ZO_RestyleSlotsSheet:GetFragment()
    return self.fragment
end
    for restyleSlotType, slotObject in pairs(self.slots) do
        for i, dyeControl in ipairs(slotObject:GetDyeControls()) do
            dyeControl:SetHandler("OnMouseUp", function(dyeControl, button, upInside)
                if upInside then
                    onSlotClickedCallback(slotObject:GetRestyleSlotData(), i, button)
                end
            end)
            dyeControl:SetHandler("OnMouseEnter", function(dyeControl)
                self.mousedOverDyeableSlotData = slotObject:GetRestyleSlotData()
                self.mousedOverDyeChannel = i
                onSlotEnterCallback(slotObject:GetRestyleSlotData(), i, dyeControl)
            end)
            dyeControl:SetHandler("OnMouseExit", function(dyeControl)
                self.mousedOverDyeableSlotData = nil
                self.mousedOverDyeChannel = nil
                onSlotExitCallback(slotObject:GetRestyleSlotData(), i)
            end)
        end
    end
end
function ZO_RestyleSlotsSheet:GetMousedOverDyeableSlotInfo()
    return self.mousedOverDyeableSlotData, self.mousedOverDyeChannel
end
function ZO_RestyleSlotsSheet:MarkViewDirty(restyleSlotData)
    if self.fragment:IsShowing() then
        if restyleSlotData then
            self:RefreshSlot(restyleSlotData)
        else
            self:RefreshView()
        end
    else
        self.isViewDirty = true
    end
end
do
    local SUPPRESS_CALLBACKS = true
    function ZO_RestyleSlotsSheet:RefreshView()
        self.pendingLoopAnimationPool:ReleaseAllObjects()
        self.isViewDirty = false
        for _, slotObject in pairs(self.slots) do
            local restyleSlotData = slotObject:GetRestyleSlotData()
            self:RefreshSlot(restyleSlotData, SUPPRESS_CALLBACKS)
        end
        self:OnSheetSlotRefreshed()
    end
end
function ZO_RestyleSlotsSheet:RefreshSlot(restyleSlotData, suppressCallbacks)
    if self:GetRestyleMode() == restyleSlotData:GetRestyleMode() then
        local restyleSlotType = restyleSlotData:GetRestyleSlotType()
        local slotObject = self.slots[restyleSlotType]
        local slotControl = slotObject:GetItemSlotControl()
        if slotControl.pendingLoopAnimationKey then
            self.pendingLoopAnimationPool:ReleaseObject(slotControl.pendingLoopAnimationKey)
        end
        self.slotSetupFunction(slotControl, restyleSlotData)
        local dyeControls = slotObject:GetDyeControls()
        ZO_Dyeing_RefreshDyeableSlotControlDyes(dyeControls, restyleSlotData)
        slotObject:RefreshVisible()
        local changedDyeChannels = restyleSlotData:GetDyeChannelChangedStates()
        for i, hasChanged in ipairs(changedDyeChannels) do
            local dyeControl = dyeControls[i]
            if hasChanged and not dyeControl.dyeChangedControlKey then
                ZO_Restyle_ApplyDyeSlotChangedToControl(dyeControl)
            elseif not hasChanged and dyeControl.dyeChangedControlKey then
                ZO_Pending_Outfit_DyeChanged_Pool:ReleaseObject(dyeControl.dyeChangedControlKey)
                dyeControl.dyeChangedControlKey = nil
            end
        end
        if not suppressCallbacks then
            self:OnSheetSlotRefreshed(restyleSlotData)
        end
    end
end
function ZO_RestyleSlotsSheet:OnSheetSlotRefreshed(restyleSlotData)
    ZO_RESTYLE_SHEET_WINDOW_KEYBOARD:OnSheetSlotRefreshed(restyleSlotData)
end
function ZO_RestyleSlotsSheet:ToggleDyeControlsHightlight(dyeableSlotControls, isHighlighted, dyeChannel)
    if dyeChannel ~= nil then
        dyeableSlotControls[dyeChannel].highlightTexture:SetHidden(not isHighlighted)
    else
        for dyeChannel, dyeControl in ipairs(dyeableSlotControls) do
            dyeControl.highlightTexture:SetHidden(not isHighlighted)
        end
    end
end
function ZO_RestyleSlotsSheet:ToggleDyeableSlotHightlight(dyeableSlot, isHighlighted, dyeChannel)
    if dyeableSlot ~= nil then
        self:ToggleDyeControlsHightlight(self.slots[dyeableSlot]:GetDyeControls(), isHighlighted, dyeChannel)
    else
        for _, slotObject in pairs(self.slots) do
            self:ToggleDyeControlsHightlight(slotObject:GetDyeControls(), isHighlighted, dyeChannel)
        end
    end
end
function ZO_RestyleSlotsSheet:GetRestyleSetIndex()
    local _, slot = next(self.slots)
    return slot:GetRestyleSlotData():GetRestyleSetIndex()
end
function ZO_RestyleSlotsSheet:SetRestyleSetIndex(restyleSetIndex)
    for _, slotObject in pairs(self.slots) do
        slotObject:SetRestyleSetIndex(restyleSetIndex)
    end
    self:MarkViewDirty()
end
function ZO_RestyleSlotsSheet:GetSlots()
    return self.slots
end
function ZO_RestyleSlotsSheet:OnShowing()
    if self.isViewDirty then
        self:RefreshView()
    end
end
function ZO_RestyleSlotsSheet:OnShown()
    -- Can be overridden
end
function ZO_RestyleSlotsSheet:OnHiding()
    -- Can be overridden
end
function ZO_RestyleSlotsSheet:OnHidden()
    -- Can be overridden
end
function ZO_RestyleSlotsSheet:AreChangesPending()
    for _, slotObject in pairs(self.slots) do
        local restyleSlotData = slotObject:GetRestyleSlotData()
        if restyleSlotData:AreTherePendingDyeChanges() then
            return true
        end
    end
    return false
end
function ZO_RestyleSlotsSheet:CanApplyChanges()
    return ZO_RestyleCanApplyChanges() -- Can be overriden
end
function ZO_RestyleSlotsSheet:UndoPendingChanges()
    ZO_RESTYLE_STATION_KEYBOARD:OnPendingDyesChanged()
    PlaySound(SOUNDS.DYEING_UNDO_CHANGES)
end
function ZO_RestyleSlotsSheet:HandleCommitSelection()
    return false -- To be overriden with custom behavior. Return true if handled, false to let restyle do default behavior.
end
function ZO_RestyleSlotsSheet:GetMouseOverData()
    return self.mouseOverData
end
function ZO_RestyleSlotsSheet:SetMouseOverData(data)
    if self.mouseOverData ~= data then
        self.mouseOverData = data
        ZO_RESTYLE_SHEET_WINDOW_KEYBOARD:OnSheetMouseoverDataChanged(data)
    end
end
function ZO_RestyleSlotsSheet:GetRandomizeKeybindText()
    if KEYBOARD_DYEING_FRAGMENT:IsShowing() then
        return GetString(SI_DYEING_RANDOMIZE)
    end
    return nil
end
function ZO_RestyleSlotsSheet:UniformRandomize()
    if KEYBOARD_DYEING_FRAGMENT:IsShowing() then
        ZO_Dyeing_UniformRandomize(self:GetRestyleMode(), self:GetRestyleSetIndex(), function() return ZO_DYEING_MANAGER:GetRandomUnlockedDyeId() end)
        ZO_RESTYLE_STATION_KEYBOARD:OnPendingDyesChanged()
    end
end
-----------------------------
-- Equipment Restyle Sheet --
-----------------------------
ZO_RestyleEquipmentSlotsSheet = ZO_RestyleSlotsSheet:Subclass()
function ZO_RestyleEquipmentSlotsSheet:RegisterForEvents()
    local function MarkViewDirty()
        self:MarkViewDirty()
    end
    self.control:RegisterForEvent(EVENT_INVENTORY_FULL_UPDATE, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, MarkViewDirty)
    self.control:AddFilterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_BAG_ID, BAG_WORN)
    self.control:RegisterForEvent(EVENT_ACTIVE_WEAPON_PAIR_CHANGED, MarkViewDirty)
end
function ZO_RestyleEquipmentSlotsSheet:GetTemplate()
    return "ZO_RestyleEquipmentSlotsSheet_Keyboard"
end
function ZO_RestyleEquipmentSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_EQUIPMENT
end
function ZO_RestyleEquipmentSlotsSheet:GetSlotObjectClass()
    return ZO_RestyleSlot_Equipment
end
function ZO_RestyleEquipmentSlotsSheet:GetControlShortName()
    return "EquipmentSheet"
end
function ZO_RestyleEquipmentSlotsSheet:RefreshView()
    ZO_RestyleSlotsSheet.RefreshView(self)
    local activeWeaponPair = GetActiveWeaponPairInfo()
    local weaponSectionHeaderStringId = activeWeaponPair == ACTIVE_WEAPON_PAIR_MAIN and SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_1 or SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_2
    self.headers[ZO_RESTYLE_SHEET_CONTAINER.SECONDARY]:SetText(GetString(weaponSectionHeaderStringId))
end
------------------------------
-- Collectible Restyle Sheet--
------------------------------
ZO_RestyleCollectibleSlotsSheet = ZO_RestyleSlotsSheet:Subclass()
function ZO_RestyleCollectibleSlotsSheet:RegisterForEvents()
    local function OnCollectibleUpdated(collectibleId)
        local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
        local updatedCollectibleCategoryType = collectibleData:GetCategoryType()
        for slotCollectibleCategoryType, slotData in pairs(self:GetSlots()) do
            if updatedCollectibleCategoryType == slotCollectibleCategoryType then
                self:MarkViewDirty()
                break
            end
        end
    end
    local function OnCollectionUpdated(collectionUpdateType, collectiblesByNewUnlockState)
        if collectionUpdateType == ZO_COLLECTION_UPDATE_TYPE.REBUILD then
            self:MarkViewDirty()
        else
            for _, unlockStateTable in pairs(collectiblesByNewUnlockState) do
                for _, collectibleData in ipairs(unlockStateTable) do
                    local updatedCollectibleCategoryType = collectibleData:GetCategoryType()
                    for slotCollectibleCategoryType, slotData in pairs(self:GetSlots()) do
                        if updatedCollectibleCategoryType == slotCollectibleCategoryType then
                            self:MarkViewDirty()
                            return
                        end
                    end
                end
            end
        end
    end
    local function MarkViewDirty()
        self:MarkViewDirty()
    end
    self.control:RegisterForEvent(EVENT_COLLECTIBLE_DYE_DATA_UPDATED, MarkViewDirty)
    ZO_COLLECTIBLE_DATA_MANAGER:RegisterCallback("OnCollectibleUpdated", OnCollectibleUpdated)
    ZO_COLLECTIBLE_DATA_MANAGER:RegisterCallback("OnCollectionUpdated", OnCollectionUpdated)
end
function ZO_RestyleCollectibleSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_COLLECTIBLE
end
function ZO_RestyleCollectibleSlotsSheet:GetSlotObjectClass()
    return ZO_RestyleSlot_Collectible
end
function ZO_RestyleCollectibleSlotsSheet:GetControlShortName()
    return "CollectibleSheet"
end
-------------------------------------
-- Outfit Style Restyle Slot Sheet --
-------------------------------------
ZO_RestyleOutfitSlotsSheet = ZO_RestyleSlotsSheet:Subclass()
do
    local STACK_COUNT = 1
    local PENDING_ANIMATION_INSET = 0
    function ZO_RestyleOutfitSlotsSheet:Initialize(...)
        ZO_RestyleSlotsSheet.Initialize(self, ...)
        self.slotSetupFunction = function(control, restyleSlotData)
            local slotManipulator = ZO_OUTFIT_MANAGER:GetOutfitSlotManipulatorFromRestyleSlotData(restyleSlotData)
            local icon = slotManipulator:GetSlotAppropriateIcon()
            control.restyleSlotData = restyleSlotData
            control.iconTexture:SetTexture(icon)
            local pendingCollectibleId = slotManipulator and slotManipulator:GetPendingCollectibleId() or 0
            local shownCollectibleIsNotCurrentlyEquipped = pendingCollectibleId == 0 or pendingCollectibleId ~= slotManipulator:GetCurrentCollectibleId()
            control.equippedGlow:SetHidden(shownCollectibleIsNotCurrentlyEquipped)
            local hideDraggableSlotCallout = true
            if self.eligibleDragSlots then
                local restyleSlotType = restyleSlotData:GetRestyleSlotType()
                for _, outfitSlot in ipairs(self.eligibleDragSlots) do
                    if outfitSlot == restyleSlotType then
                        hideDraggableSlotCallout = false
                        break
                    end
                end
            end
            control.dragCallout:SetHidden(hideDraggableSlotCallout)
            if slotManipulator and slotManipulator:IsSlotDataChangePending() then
                local pendingCollectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(pendingCollectibleId)
                local isLocked = pendingCollectibleData and pendingCollectibleData:IsLocked()
                ZO_Restyle_ApplyPendingLoopAnimationToControl(control, self:GetPendingLoopAnimationPool(), PENDING_ANIMATION_INSET, isLocked)
            end
        end
        self.noWeaponsLabel = self.control:GetNamedChild("SecondaryNoWeaponsLabel")
        self.costLabel = self.control:GetNamedChild("Cost")
        self.refreshCostFunction = function()
            self:RefreshCost()
        end
    end
end
function ZO_RestyleOutfitSlotsSheet:OnShowing()
    ZO_RestyleSlotsSheet.OnShowing(self)
    self.costLabel:SetHidden(not ZO_RestyleCanApplyChanges())
    self:RefreshCost()
end
function ZO_RestyleOutfitSlotsSheet:RegisterForEvents()
    local function MarkViewDirty()
        self:MarkViewDirty()
    end
    local function HandleCursorPickup(eventCode, cursorType, ...)
        if cursorType == MOUSE_CONTENT_COLLECTIBLE and ZO_RESTYLE_SCENE:IsShowing() then
            local collectibleId = GetCursorCollectibleId()
            if collectibleId then
                local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
                if collectibleData:IsOutfitStyle() then
                    self.eligibleDragSlots = { GetEligibleOutfitSlotsForCollectible(collectibleId) }
                    self:MarkViewDirty()
                end
            end
        end
    end
    local function HandleCursorDropped()
        self.eligibleDragSlots = nil
        self:MarkViewDirty()
    end
    local function OnPendingDataChanged(actorCategory, outfitIndex, slotIndex)
        local outfitManipulator = outfitIndex and ZO_OUTFIT_MANAGER:GetOutfitManipulator(actorCategory, outfitIndex)
        local outfitSlotManipulator = outfitManipulator and slotIndex and outfitManipulator:GetSlotManipulator(slotIndex)
        local restyleSlotData = outfitSlotManipulator and outfitSlotManipulator:GetRestyleSlotData()
        self:MarkViewDirty(restyleSlotData)
    end
    ZO_OUTFIT_MANAGER:RegisterCallback("PendingDataChanged", OnPendingDataChanged)
    self.control:RegisterForEvent(EVENT_INVENTORY_FULL_UPDATE, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, MarkViewDirty)
    self.control:AddFilterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_BAG_ID, BAG_WORN)
    self.control:RegisterForEvent(EVENT_ACTIVE_WEAPON_PAIR_CHANGED, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_CURSOR_PICKUP, HandleCursorPickup)
    self.control:RegisterForEvent(EVENT_CURSOR_DROPPED, HandleCursorDropped)
end
function ZO_RestyleOutfitSlotsSheet:SetOutfitManipulator(newManipulator)
    if self.currentOutfitManipulator ~= newManipulator then
        if self.currentOutfitManipulator then
            self.currentOutfitManipulator:ClearPendingChanges()
        end
        self.currentOutfitManipulator = newManipulator
        
        self:SetRestyleSetIndex(newManipulator:GetOutfitIndex())
    end
end
function ZO_RestyleOutfitSlotsSheet:GetCurrentOutfitManipulator()
    return self.currentOutfitManipulator
end
function ZO_RestyleOutfitSlotsSheet:GetTemplate()
    return "ZO_RestyleOutfitStylesSlotsSheet_Keyboard"
end
function ZO_RestyleOutfitSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_OUTFIT
end
function ZO_RestyleOutfitSlotsSheet:GetSlotObjectClass()
    return ZO_RestyleSlot_OutfitStyle
end
function ZO_RestyleOutfitSlotsSheet:GetControlShortName()
    return "OutfitStylesSheet"
end
function ZO_RestyleOutfitSlotsSheet:AreChangesPending()
    return self.currentOutfitManipulator and self.currentOutfitManipulator:IsAnyChangePending()
end
function ZO_RestyleOutfitSlotsSheet:CanApplyChanges()
    if self.currentOutfitManipulator then
        return self.currentOutfitManipulator:CanApplyChanges()
    end
    return false
end
function ZO_RestyleOutfitSlotsSheet:UndoPendingChanges()
    if self.currentOutfitManipulator then
        self.currentOutfitManipulator:ClearPendingChanges()
    end
    ZO_RestyleSlotsSheet.UndoPendingChanges(self)
end
function ZO_RestyleOutfitSlotsSheet:HandleCommitSelection()
    local currentOutfitManipulator = self.currentOutfitManipulator
    if currentOutfitManipulator and currentOutfitManipulator:IsAnyChangePending() then
        ZO_Dialogs_ShowDialog("OUTFIT_CONFIRM_COST_KEYBOARD", { outfitManipulator = currentOutfitManipulator } )
        return true
    end
    return false
end
function ZO_RestyleOutfitSlotsSheet:RefreshView()
    ZO_RestyleSlotsSheet.RefreshView(self)
    local activeWeaponPair = GetActiveWeaponPairInfo()
    local weaponSectionHeaderStringId = activeWeaponPair == ACTIVE_WEAPON_PAIR_MAIN and SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_1 or SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_2
    self.headers[ZO_RESTYLE_SHEET_CONTAINER.SECONDARY]:SetText(GetString(weaponSectionHeaderStringId))
    self.noWeaponsLabel:SetHidden(ZO_OUTFIT_MANAGER:HasWeaponsCurrentlyHeldToOverride())
end
function ZO_RestyleOutfitSlotsSheet:OnSheetSlotRefreshed()
    ZO_RestyleSlotsSheet.OnSheetSlotRefreshed(self)
    self:RefreshCost()
end
do
    local function GetCostText(currencyType, cost)
        local currentBalance = GetCurrencyAmount(currencyType, GetCurrencyPlayerStoredLocation(currencyType))
        local currencyFormat = (cost > currentBalance) and ZO_CURRENCY_FORMAT_ERROR_AMOUNT_ICON or ZO_CURRENCY_FORMAT_WHITE_AMOUNT_ICON
       return ZO_Currency_FormatKeyboard(currencyType, cost, currencyFormat)
    end
    function ZO_RestyleOutfitSlotsSheet:RefreshCost()
        local slotsCost, flatCost = self.currentOutfitManipulator:GetAllCostsForPendingChanges()
        -- Slot based cost
        local slotsCostText = GetCostText(CURT_MONEY, slotsCost)
        --Flat cost
        local flatCostText = GetCostText(CURT_STYLE_STONES, flatCost)
        self.costLabel:SetText(zo_strformat(SI_RESTYLE_SHEET_APPLY_COST_FORMAT, slotsCostText, flatCostText))
    end
end
function ZO_RestyleOutfitSlotsSheet:GetRandomizeKeybindText()
    if KEYBOARD_OUTFIT_STYLES_PANEL_FRAGMENT:IsShowing() then
        return GetString(SI_OUTFIT_STYLES_RANDOMIZE)
    else
        return ZO_RestyleSlotsSheet.GetRandomizeKeybindText(self)
    end
end
function ZO_RestyleOutfitSlotsSheet:UniformRandomize()
    if KEYBOARD_OUTFIT_STYLES_PANEL_FRAGMENT:IsShowing() then
        self.currentOutfitManipulator:RandomizeStyleData()
    else
        ZO_RestyleSlotsSheet.UniformRandomize(self)
    end
end
-----------------------------
-- Companion Equipment Restyle Sheet --
-----------------------------
ZO_RestyleCompanionEquipmentSlotsSheet = ZO_RestyleEquipmentSlotsSheet:Subclass()
function ZO_RestyleCompanionEquipmentSlotsSheet:Initialize(...)
    ZO_RestyleEquipmentSlotsSheet.Initialize(self, ...)
    local ALWAYS_HIDE = true
    ZO_WeaponSwap_SetPermanentlyHidden(self.control:GetNamedChild("SecondaryWeaponSwap"), ALWAYS_HIDE)
end
function ZO_RestyleCompanionEquipmentSlotsSheet:RegisterForEvents()
    local function MarkViewDirty()
        self:MarkViewDirty()
    end
    self.control:RegisterForEvent(EVENT_INVENTORY_FULL_UPDATE, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, MarkViewDirty)
    self.control:AddFilterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_BAG_ID, BAG_COMPANION_WORN)
    self.control:RegisterForEvent(EVENT_ACTIVE_WEAPON_PAIR_CHANGED, MarkViewDirty)
end
function ZO_RestyleCompanionEquipmentSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_COMPANION_EQUIPMENT
end
function ZO_RestyleCompanionEquipmentSlotsSheet:GetControlShortName()
    return "CompanionEquipmentSheet"
end
function ZO_RestyleCompanionEquipmentSlotsSheet:RefreshView()
    ZO_RestyleSlotsSheet.RefreshView(self)
    self.headers[ZO_RESTYLE_SHEET_CONTAINER.SECONDARY]:SetText(GetString(SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_1))
end
-------------------------------------
-- Companion Outfit Style Restyle Slot Sheet --
-------------------------------------
ZO_RestyleCompanionOutfitSlotsSheet = ZO_RestyleOutfitSlotsSheet:Subclass()
function ZO_RestyleCompanionOutfitSlotsSheet:Initialize(...)
    ZO_RestyleOutfitSlotsSheet.Initialize(self, ...)
    local ALWAYS_HIDE = true
    ZO_WeaponSwap_SetPermanentlyHidden(self.control:GetNamedChild("SecondaryWeaponSwap"), ALWAYS_HIDE)
    self.noWeaponsLabel:SetText(GetString(SI_OUTFIT_STYLE_SHEET_NO_WEAPONS_COMPANION_WARNING))
end
function ZO_RestyleCompanionOutfitSlotsSheet:RegisterForEvents()
    local function MarkViewDirty()
        self:MarkViewDirty()
    end
    local function HandleCursorPickup(eventCode, cursorType, ...)
        if cursorType == MOUSE_CONTENT_COLLECTIBLE and ZO_RESTYLE_SCENE:IsShowing() then
            local collectibleId = GetCursorCollectibleId()
            if collectibleId then
                local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
                if collectibleData:IsOutfitStyle() then
                    self.eligibleDragSlots = { GetEligibleOutfitSlotsForCollectible(collectibleId) }
                    self:MarkViewDirty()
                end
            end
        end
    end
    local function HandleCursorDropped()
        self.eligibleDragSlots = nil
        self:MarkViewDirty()
    end
    local function OnPendingDataChanged(actorCategory, outfitIndex, slotIndex)
        local outfitManipulator = outfitIndex and ZO_OUTFIT_MANAGER:GetOutfitManipulator(actorCategory, outfitIndex)
        local outfitSlotManipulator = outfitManipulator and slotIndex and outfitManipulator:GetSlotManipulator(slotIndex)
        local restyleSlotData = outfitSlotManipulator and outfitSlotManipulator:GetRestyleSlotData()
        self:MarkViewDirty(restyleSlotData)
    end
    ZO_OUTFIT_MANAGER:RegisterCallback("PendingDataChanged", OnPendingDataChanged)
    self.control:RegisterForEvent(EVENT_INVENTORY_FULL_UPDATE, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, MarkViewDirty)
    self.control:AddFilterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_BAG_ID, BAG_COMPANION_WORN)
    self.control:RegisterForEvent(EVENT_ACTIVE_WEAPON_PAIR_CHANGED, MarkViewDirty)
    self.control:RegisterForEvent(EVENT_CURSOR_PICKUP, HandleCursorPickup)
    self.control:RegisterForEvent(EVENT_CURSOR_DROPPED, HandleCursorDropped)
end
function ZO_RestyleCompanionOutfitSlotsSheet:GetTemplate()
    return "ZO_RestyleOutfitStylesSlotsSheet_Keyboard"
end
function ZO_RestyleCompanionOutfitSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_COMPANION_OUTFIT
end
function ZO_RestyleCompanionOutfitSlotsSheet:GetControlShortName()
    return "CompanionOutfitStylesSheet"
end
function ZO_RestyleCompanionOutfitSlotsSheet:RefreshView()
    ZO_RestyleSlotsSheet.RefreshView(self)
    self.headers[ZO_RESTYLE_SHEET_CONTAINER.SECONDARY]:SetText(GetString(SI_RESTYLE_SHEET_EQUIPMENT_WEAPONS_SET_1))
    self.noWeaponsLabel:SetHidden(ZO_OUTFIT_MANAGER:HasWeaponsCurrentlyHeldToOverride(GAMEPLAY_ACTOR_CATEGORY_COMPANION))
end
-------------------------------------
-- Companion Collectible Style Restyle Slot Sheet --
-------------------------------------
ZO_RestyleCompanionCollectibleSlotsSheet = ZO_RestyleCollectibleSlotsSheet:Subclass()
function ZO_RestyleCompanionCollectibleSlotsSheet:GetRestyleMode()
    return RESTYLE_MODE_COMPANION_COLLECTIBLE
end
function ZO_RestyleCompanionCollectibleSlotsSheet:GetControlShortName()
    return "CompanionCollectibleStylesSheet"
end
do
    ZO_Pending_Outfit_DyeChanged_Pool = ZO_ControlPool:New("ZO_Dyeing_SlotChanged", GuiRoot, "DyeSlotChanged")
        local pool = ZO_Pending_Outfit_DyeChanged_Pool
        local dyeChangedControl, key = pool:AcquireObject()
        dyeChangedControl:SetAnchor(CENTER, control, CENTER)
        dyeChangedControl:SetParent(control)
        dyeChangedControl:SetHidden(false)
        control.dyeChangedControlKey = key
    end
end