Back to Home

ESO Lua File v100021

publicallingames/tooltip/itemtooltips.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
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
local FORCE_FULL_DURABILITY = true
local DONT_FORCE_FULL_DURABILITY = false
local NOT_EQUIPPED = false
local NO_CREATOR_NAME = nil
local DONT_SHOW_PLAYER_LOCKED = false
local NO_PREVIEW_VALUE = nil
local NO_ITEM_NAME = nil
local NO_TRADE_BOP_DATA = nil
ZO_ENCHANT_DIFF_ADD = "add"
ZO_ENCHANT_DIFF_REMOVE = "remove"
ZO_ENCHANT_DIFF_NONE = "none"
ZO_ITEM_TOOLTIP_INVENTORY_TITLE_COUNT = "inventory"
ZO_ITEM_TOOLTIP_BANK_TITLE_COUNT = "bank"
ZO_ITEM_TOOLTIP_INVENTORY_AND_BANK_TITLE_COUNT = "inventoryAndBank"
ZO_ITEM_TOOLTIP_CRAFTBAG_TITLE_COUNT = "craftbag"
ZO_ITEM_TOOLTIP_INVENTORY_AND_BANK_AND_CRAFTBAG_TITLE_COUNT = "inventoryAndBankAndCraftbag"
--Section Generators
function ZO_Tooltip:AddItemTitle(itemLink, name)
    name = name or GetItemLinkName(itemLink)
    local quality = GetItemLinkQuality(itemLink)
    local qualityStyle = ZO_TooltipStyles_GetItemQualityStyle(quality)
    self:AddLine(zo_strformat(SI_TOOLTIP_ITEM_NAME, name), qualityStyle, self:GetStyle("title"))
end
function ZO_Tooltip:AddTypeSlotUniqueLine(itemLink, itemType, section, text1, text2)
    if not text1 then
        return
    end
    
    local unique = IsItemLinkUnique(itemLink)
    local uniqueEquipped = IsItemLinkUniqueEquipped(itemLink)
    local formatSuffix
    if unique then
        formatSuffix = "_UNIQUE"
    elseif uniqueEquipped then
        formatSuffix = "_UNIQUE_EQUIPPED"
    else
        formatSuffix = ""
    end
    local lineText
    if itemType == ITEMTYPE_ARMOR then
        local armorType = GetItemLinkArmorType(itemLink)
        if text2 and armorType ~= ARMORTYPE_NONE then
            local format = _G["SI_ITEM_FORMAT_STR_TEXT1_ARMOR2"..formatSuffix]
            lineText = zo_strformat(format, text1, text2)
        else
            lineText = zo_strformat(SI_ITEM_FORMAT_STR_BROAD_TYPE, text1)
        end
    else
        if text2 then
            local format = _G["SI_ITEM_FORMAT_STR_TEXT1_TEXT2"..formatSuffix]
            lineText = zo_strformat(format, text1, text2)
        else
            local format = _G["SI_ITEM_FORMAT_STR_TEXT1"..formatSuffix]
            lineText = zo_strformat(format, text1)
        end
    end
    if lineText then
        section:AddLine(lineText)
    end
end
function ZO_Tooltip:AddTopSection(itemLink, showPlayerLocked, tradeBoPData)
    local topSection = self:AcquireSection(self:GetStyle("topSection"))
    --Item Type Info
    local itemType, specializedItemType = GetItemLinkItemType(itemLink)
    local specializedItemTypeText = ZO_GetSpecializedItemTypeText(itemType, specializedItemType)
    local equipType = GetItemLinkEquipType(itemLink)
    if(itemType == ITEMTYPE_SIEGE) then
        local siegeType = GetItemLinkSiegeType(itemLink)
        if(siegeType ~= SIEGE_TYPE_NONE) then
            topSection:AddLine(GetString("SI_SIEGETYPE", siegeType))
        end
    elseif(itemType == ITEMTYPE_COSTUME) then
        self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText)
    elseif(itemType == ITEMTYPE_RECIPE) then
        local craftingSkillType = GetItemLinkRecipeCraftingSkillType(itemLink)
        if IsItemLinkRecipeKnown(itemLink) then
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText, GetCraftingSkillName(craftingSkillType))
        else
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, GetString(SI_ITEM_FORMAT_STR_UNKNOWN_RECIPE), GetCraftingSkillName(craftingSkillType))
        end
    elseif itemType == ITEMTYPE_FURNISHING then
        local furnitureDataId = GetItemLinkFurnitureDataId(itemLink)
        local categoryId, subcategoryId = GetFurnitureDataCategoryInfo(furnitureDataId)
        self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText, GetFurnitureCategoryName(categoryId))
    elseif(itemType ~= ITEMTYPE_NONE and equipType ~= EQUIP_TYPE_INVALID) then
        local weaponType = GetItemLinkWeaponType(itemLink)
        if itemType == ITEMTYPE_ARMOR and weaponType == WEAPONTYPE_NONE then
            local armorType = GetItemLinkArmorType(itemLink)
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, GetString("SI_EQUIPTYPE", equipType), GetString("SI_ARMORTYPE", armorType))
        elseif weaponType ~= WEAPONTYPE_NONE then
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, GetString("SI_WEAPONTYPE", weaponType), GetString("SI_EQUIPTYPE", equipType))
        elseif itemType == ITEMTYPE_POISON then
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText)
        end
    elseif(itemType == ITEMTYPE_LURE and IsItemLinkConsumable(itemLink)) then
        self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, GetString(SI_ITEM_SUB_TYPE_BAIT))
    elseif(GetItemLinkBookTitle(itemLink)) then
        local itemTypeText = (specializedItemType ~= SPECIALIZED_ITEMTYPE_NONE) and specializedItemTypeText or GetString(SI_ITEM_SUB_TYPE_BOOK)
        self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, itemTypeText)
    elseif(DoesItemLinkStartQuest(itemLink) or DoesItemLinkFinishQuest(itemLink)) then
        self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, GetString(SI_ITEM_FORMAT_STR_QUEST_ITEM))
    else
        local craftingSkillType = GetItemLinkCraftingSkillType(itemLink)
        if(craftingSkillType ~= CRAFTING_TYPE_INVALID) then
            local craftingSkillName = GetCraftingSkillName(craftingSkillType)
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText, craftingSkillName)
        elseif(itemType ~= ITEMTYPE_NONE) then
            self:AddTypeSlotUniqueLine(itemLink, itemType, topSection, specializedItemTypeText)
        end
    end
    self:AddTopLinesToTopSection(topSection, itemLink, showPlayerLocked, tradeBoPData)
    self:AddSectionEvenIfEmpty(topSection)
end
function ZO_Tooltip:AddTopLinesToTopSection(topSection, itemLink, showPlayerLocked, tradeBoPData)
    local topSubsection = topSection:AcquireSection(self:GetStyle("topSubsectionItemDetails"))
    
    -- Bound and/or Player Locked
    local boundLabel
    if tradeBoPData then
        boundLabel = zo_iconFormat(ZO_TRADE_BOP_ICON, 24, 24)
    else
        local bindType = GetItemLinkBindType(itemLink)
        if IsItemLinkBound(itemLink) then
            boundLabel = GetString(SI_ITEM_FORMAT_STR_BOUND)
        elseif bindType ~= BIND_TYPE_NONE and bindType ~= BIND_TYPE_UNSET then
            boundLabel = GetString("SI_BINDTYPE", bindType)
        end
    end
    if showPlayerLocked then
        topSubsection:AddLine(zo_iconTextFormat("EsoUI/Art/Tooltips/icon_lock.dds", 24, 24, boundLabel), self:GetStyle("bind"))
    elseif boundLabel then
        topSubsection:AddLine(boundLabel, self:GetStyle("bind"))
    end
    -- Stolen
    if IsItemLinkStolen(itemLink) then
        topSubsection:AddLine(zo_iconTextFormat("EsoUI/Art/Inventory/inventory_stolenItem_icon.dds", 24, 24, GetString(SI_GAMEPAD_ITEM_STOLEN_LABEL)), self:GetStyle("stolen"))
    end
    --Item counts
    local bagCount, bankCount, craftBagCount = GetItemLinkStacks(itemLink)
    if bagCount > 0 then
        topSubsection:AddLine(zo_iconTextFormat("EsoUI/Art/Tooltips/icon_bag.dds", 24, 24, bagCount))
    end
    if bankCount > 0 then
        topSubsection:AddLine(zo_iconTextFormat("EsoUI/Art/Tooltips/icon_bank.dds", 24, 24, bankCount))
    end
    if craftBagCount > 0 then
        topSubsection:AddLine(zo_iconTextFormat("EsoUI/Art/Tooltips/icon_craft_bag.dds", 24, 24, craftBagCount))
    end
    topSection:AddSectionEvenIfEmpty(topSubsection)
end
function ZO_Tooltip:AddBaseStats(itemLink, ignoreLevel)
    local statsSection = self:AcquireSection(self:GetStyle("baseStatsSection"))
    local hideItemLevel = ignoreLevel or ShouldHideTooltipRequiredLevel(itemLink)
    --Damage/Armor
    local weaponPower = GetItemLinkWeaponPower(itemLink)
    if(weaponPower > 0) then
        local statValuePair = statsSection:AcquireStatValuePair(self:GetStyle("statValuePair"))
        statValuePair:SetStat(GetString(SI_ITEM_FORMAT_STR_DAMAGE), self:GetStyle("statValuePairStat"))
        statValuePair:SetValue(weaponPower, self:GetStyle("statValuePairValue"))
        statsSection:AddStatValuePair(statValuePair)
    else
        local CONSIDER_CONDITION = true
        local armorRating = GetItemLinkArmorRating(itemLink, not CONSIDER_CONDITION)
        if(armorRating > 0) then
            local effectiveArmorRating = GetItemLinkArmorRating(itemLink, CONSIDER_CONDITION)
            local valueText
            local damagedStyle
            if(effectiveArmorRating == armorRating) then
                valueText = effectiveArmorRating
                damagedStyle = nil
            else
                valueText = zo_strformat(SI_ITEM_FORMAT_STR_EFFECTIVE_VALUE_OF_MAX, effectiveArmorRating, armorRating)
                damagedStyle = self:GetStyle("degradedStat")
            end
            local statValuePair = statsSection:AcquireStatValuePair(self:GetStyle("statValuePair"))
            statValuePair:SetStat(GetString(SI_ITEM_FORMAT_STR_ARMOR), self:GetStyle("statValuePairStat"))
            statValuePair:SetValue(valueText, damagedStyle, self:GetStyle("statValuePairValue"))
            statsSection:AddStatValuePair(statValuePair)
        end
    end
    --Required Level/Champ Rank
    if(not hideItemLevel) then
        local requiredLevel = GetItemLinkRequiredLevel(itemLink)
        local requiredChampionPoints = GetItemLinkRequiredChampionPoints(itemLink)
        if(requiredLevel > 0 or requiredChampionPoints > 0) then
            if requiredLevel > 0 then
                local levelStatValuePair = statsSection:AcquireStatValuePair(self:GetStyle("statValuePair"))
                levelStatValuePair:SetStat(GetString(SI_ITEM_FORMAT_STR_LEVEL), self:GetStyle("statValuePairStat"))
                local failedStyle = requiredLevel > GetUnitLevel("player") and self:GetStyle("failed") or nil
                levelStatValuePair:SetValue(requiredLevel, failedStyle, self:GetStyle("statValuePairValue"))
                statsSection:AddStatValuePair(levelStatValuePair)
            end
            if requiredChampionPoints > 0 then
                local championStatValuePair = statsSection:AcquireStatValuePair(self:GetStyle("statValuePair"))
                championStatValuePair:SetStat(zo_iconTextFormatNoSpace(GetGamepadChampionPointsIcon(), 32, 32, GetString(SI_ITEM_FORMAT_STR_CHAMPION)), self:GetStyle("statValuePairStat"))
                local failedStyle = requiredChampionPoints > GetPlayerChampionPointsEarned() and self:GetStyle("failed") or nil
                championStatValuePair:SetValue(requiredChampionPoints, failedStyle, self:GetStyle("statValuePairValue"))
                statsSection:AddStatValuePair(championStatValuePair)
            end
        end
    end
    self:AddSection(statsSection)
end
function ZO_Tooltip:AddItemValue(itemLink, ignoreLevel)
    local statsSection = self:AcquireSection(self:GetStyle("valueStatsSection"))
    local hideItemLevel = ignoreLevel or ShouldHideTooltipRequiredLevel(itemLink)
    --Value
    local CONSIDER_CONDITION = true
    local value = GetItemLinkValue(itemLink, not CONSIDER_CONDITION)
    if value > 0 then
        local effectiveValue = GetItemLinkValue(itemLink, CONSIDER_CONDITION)
        local finalValue = value
        if(effectiveValue ~= value) then
            finalValue = zo_strformat(SI_ITEM_FORMAT_STR_EFFECTIVE_VALUE_OF_MAX, effectiveValue, value)
        end
        local valueString = zo_strformat(SI_GAMEPAD_TOOLTIP_ITEM_VALUE_FORMAT, finalValue, ZO_Currency_GetGamepadFormattedCurrencyIcon(CURT_MONEY))
        statsSection:AddLine(valueString, self:GetStyle("statValuePairValue"))
    end
    self:AddSection(statsSection)
end
local MIN_CONDITION_OR_CHARGE = 0
local MAX_CONDITION = 100
function ZO_Tooltip:AddConditionBar(itemLink, previewConditionToAdd)
    local condition = GetItemLinkCondition(itemLink)
    self:AddConditionOrChargeBar(itemLink, condition, MAX_CONDITION, previewConditionToAdd)
end
function ZO_Tooltip:AddEnchantChargeBar(itemLink, forceFullDurability, previewChargeToAdd)
    local maxCharges = GetItemLinkMaxEnchantCharges(itemLink)
    local charges = forceFullDurability and maxCharges or GetItemLinkNumEnchantCharges(itemLink)
    self:AddConditionOrChargeBar(itemLink, charges, maxCharges, previewChargeToAdd)
end
function ZO_Tooltip:AddPoisonInfo(itemLink, equipSlot)
    local hasPoison, poisonCount, poisonHeader, poisonItemLink = GetItemPairedPoisonInfo(equipSlot)
    if hasPoison then
        --Poison Count
        local poisonCountSection = self:AcquireSection(self:GetStyle("poisonCountSection"))
        local poisonCountString = zo_iconTextFormatNoSpace("EsoUI/Art/Tooltips/icon_poison.dds", 40, 40, poisonCount)
        poisonCountSection:AddLine(poisonCountString, self:GetStyle("poisonCount"))
        self:AddSection(poisonCountSection)
        --Poison Name
        local equippedPoisonSection = self:AcquireSection(self:GetStyle("equippedPoisonSection"))
        equippedPoisonSection:AddLine(poisonHeader, self:GetStyle("bodyHeader"))
        self:AddSection(equippedPoisonSection)
        --Poison Ability
        self:AddOnUseAbility(poisonItemLink)
    end
end
function ZO_Tooltip:AddConditionOrChargeBar(itemLink, value, maxValue, previewValueToAdd)
    local bar = nil
    if previewValueToAdd then
        bar = self:AcquireItemImprovementStatusBar(itemLink, value, maxValue, previewValueToAdd)
    else
        bar = self:AcquireStatusBar(self:GetStyle("conditionOrChargeBar"))
        bar:SetMinMax(MIN_CONDITION_OR_CHARGE, maxValue)
        bar:SetValue(value)
    end
    local barSection = self:AcquireSection(self:GetStyle("conditionOrChargeBarSection"))
    barSection:AddStatusBar(bar)
    self:AddSection(barSection)
end
function ZO_Tooltip:AcquireItemImprovementStatusBar(itemLink, value, maxValue, valueToAdd)
    local improvementBar = self:AcquireStatusBar(self:GetStyle("itemImprovementConditionOrChargeBar"))
    improvementBar:SetMinMax(MIN_CONDITION_OR_CHARGE, maxValue)
    local newValue = zo_clamp(value + valueToAdd, MIN_CONDITION_OR_CHARGE, maxValue)
    improvementBar:SetValueAndPreviewValue(value, newValue)
    return improvementBar
end
function ZO_Tooltip:AddEnchant(itemLink, enchantDiffMode, equipSlot)
    enchantDiffMode = enchantDiffMode or ZO_ENCHANT_DIFF_NONE
    local enchantSection = self:AcquireSection(self:GetStyle("bodySection"))
    local hasEnchant, enchantHeader, enchantDescription = GetItemLinkEnchantInfo(itemLink)
    if hasEnchant then
        enchantSection:AddLine(enchantHeader, self:GetStyle("bodyHeader"))
        if enchantDiffMode == ZO_ENCHANT_DIFF_NONE then
            if IsItemAffectedByPairedPoison(equipSlot) then
                local suppressedStyle = self:GetStyle("suppressedAbility")
                enchantSection:AddLine(GetString(SI_TOOLTIP_ENCHANT_SUPPRESSED_BY_POISON), suppressedStyle, self:GetStyle("bodyDescription"))
            else
                enchantSection:AddLine(enchantDescription, self:GetStyle("bodyDescription"))
            end
        end
    end
    self:AddSection(enchantSection)
    if hasEnchant and enchantDiffMode ~= ZO_ENCHANT_DIFF_NONE then
        local diffColorStyle, icon
        if enchantDiffMode == ZO_ENCHANT_DIFF_ADD then
            diffColorStyle = self:GetStyle("enchantDiffAdd")
            icon = "EsoUI/Art/Buttons/pointsPlus_up.dds"
        elseif enchantDiffMode == ZO_ENCHANT_DIFF_REMOVE then
            diffColorStyle = self:GetStyle("enchantDiffRemove")
            icon = "EsoUI/Art/Buttons/pointsMinus_up.dds"
        else
            -- If this assert is hit, support needs to be added for the additional
            -- enchant diff modes, which do not exist at the time of writing.
            assert(false)
        end
        local enchantmentDescriptionSection = self:AcquireSection(diffColorStyle, self:GetStyle("enchantDiff"))
        local diffSection = self:AcquireSection(self:GetStyle("enchantDiffTextureContainer"))
        diffSection:AddTexture(icon, self:GetStyle("enchantDiffTexture"))
        enchantmentDescriptionSection:AddSection(diffSection)
        enchantmentDescriptionSection:AddLine(enchantDescription, self:GetStyle("bodyDescription"))
        self:AddSection(enchantmentDescriptionSection)
    end
end
function ZO_Tooltip:AddItemAbilityScalingRange(section, minLevel, maxLevel, isChampionPoints)
    local text
    if isChampionPoints then
        text = zo_strformat(SI_ITEM_ABILITY_SCALING_CHAMPION_POINTS_RANGE, zo_iconFormat(GetGamepadChampionPointsIcon(), 40, 40), minLevel, maxLevel)
    else
        text = zo_strformat(SI_ITEM_ABILITY_SCALING_LEVEL_RANGE, minLevel, maxLevel)
    end
    section:AddLine(text, self:GetStyle("bodyDescription"))
end
function ZO_Tooltip:AddOnUseAbility(itemLink)
    local onUseAbilitySection = self:AcquireSection(self:GetStyle("bodySection"))
    local cooldownRemainingSection = self:AcquireSection(self:GetStyle("bodySection"))
    local hasAbility, abilityHeader, abilityDescription, cooldown, hasScaling, minLevel, maxLevel, isChampionPoints, remainingCooldown = GetItemLinkOnUseAbilityInfo(itemLink)
    if hasAbility then
        if abilityHeader ~= "" then
            onUseAbilitySection:AddLine(zo_strformat(SI_ABILITY_TOOLTIP_DESCRIPTION_HEADER, abilityHeader), self:GetStyle("bodyHeader"))
        end
        if abilityDescription ~= "" then
            if cooldown == 0 then
                onUseAbilitySection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_ON_USE, abilityDescription), self:GetStyle("bodyDescription"))
            else
                local cooldownString = ZO_FormatTimeMilliseconds(cooldown, TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES, TIME_FORMAT_PRECISION_SECONDS)
                onUseAbilitySection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_ON_USE_COOLDOWN, abilityDescription, cooldownString), self:GetStyle("bodyDescription"))
            end
            if hasScaling then
                self:AddItemAbilityScalingRange(onUseAbilitySection, minLevel, maxLevel, isChampionPoints)
            end
            if cooldown > ZO_ONE_MINUTE_IN_MILLISECONDS and remainingCooldown > 0 then
                if remainingCooldown < ZO_ONE_MINUTE_IN_MILLISECONDS then
                    cooldownRemainingSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_ON_USE_REMAINING_COOLDOWN, GetString(SI_STR_TIME_LESS_THAN_MINUTE_SHORT)), self:GetStyle("bodyDescription"))
                else
                    local formattedRemainingCooldown = ZO_FormatTimeMilliseconds(remainingCooldown, TIME_FORMAT_STYLE_SHOW_LARGEST_TWO_UNITS, TIME_FORMAT_PRECISION_SECONDS, TIME_FORMAT_DIRECTION_DESCENDING)
                    cooldownRemainingSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_ON_USE_REMAINING_COOLDOWN, formattedRemainingCooldown), self:GetStyle("bodyDescription"))
                end
            end
        end
    else
        local traitAbilities = {}
        local maxCooldown = 0
        for i = 1, GetMaxTraits() do
            local hasTraitAbility, traitAbilityDescription, traitCooldown, traitHasScaling, traitMinLevel, traitMaxLevel, traitIsChampionPoints = GetItemLinkTraitOnUseAbilityInfo(itemLink, i)
            if hasTraitAbility then
                table.insert(traitAbilities,
                {
                    description = traitAbilityDescription,
                    hasScaling = traitHasScaling,
                    minLevel = traitMinLevel,
                    maxLevel = traitMaxLevel,
                    isChampionPoints = traitIsChampionPoints,
                })
                if traitCooldown > maxCooldown then
                    maxCooldown = traitCooldown
                end
            end
        end
        for i, traitAbility in ipairs(traitAbilities) do
            local text
            if i == #traitAbilities then
                if maxCooldown == 0 then
                    text = zo_strformat(SI_ITEM_FORMAT_STR_ON_USE, traitAbility.description)
                else
                    local cooldownString = ZO_FormatTimeMilliseconds(maxCooldown, TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES, TIME_FORMAT_PRECISION_SECONDS)
                    text = zo_strformat(SI_ITEM_FORMAT_STR_ON_USE_COOLDOWN, traitAbility.description, cooldownString)
                end
            else
                text = zo_strformat(SI_ITEM_FORMAT_STR_ON_USE_MULTI_EFFECT, traitAbility.description)
            end
            onUseAbilitySection:AddLine(text, self:GetStyle("bodyDescription"))
        end
        --We assume that if multiple trait abilities have scaling, they all have the same scaling
        for _, traitAbility in ipairs(traitAbilities) do
            if traitAbility.hasScaling then
                self:AddItemAbilityScalingRange(onUseAbilitySection, traitAbility.minLevel, traitAbility.maxLevel, traitAbility.isChampionPoints)
                break
            end
        end
    end
    self:AddSection(onUseAbilitySection)
    self:AddSection(cooldownRemainingSection)
end
function ZO_Tooltip:AddTrait(itemLink, extraData)
    local traitType, traitDescription = GetItemLinkTraitInfo(itemLink)
    if traitType ~= ITEM_TRAIT_TYPE_NONE and traitDescription ~= "" then
        local traitName = GetString("SI_ITEMTRAITTYPE", traitType)
        if traitName ~= "" then
            local traitSection = self:AcquireSection(self:GetStyle("bodySection"))
            local traitInformation = GetItemTraitInformationFromItemLink(itemLink)
            local traitInformationIconPath = GetPlatformTraitInformationIcon(traitInformation)
            local formattedTraitName
            if traitInformationIconPath then
                formattedTraitName = zo_strformat(SI_ITEM_FORMAT_STR_ITEM_TRAIT_WITH_ICON_HEADER, zo_iconFormat(traitInformationIconPath, 32, 32), traitName)
            else
                formattedTraitName = zo_strformat(SI_ITEM_FORMAT_STR_ITEM_TRAIT_HEADER, traitName)
            end
            local additionalTooltipStyle
            if extraData and extraData.showTraitAsNew then
                additionalTooltipStyle = self:GetStyle("succeeded")
            end
            traitSection:AddLine(formattedTraitName, self:GetStyle("bodyHeader"), additionalTooltipStyle)
            traitSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_ITEM_TRAIT_DESCRIPTION, traitDescription), self:GetStyle("bodyDescription"), additionalTooltipStyle)
            self:AddSection(traitSection)
        end
    end
end
function ZO_Tooltip:AddSet(itemLink, equipped)
    local hasSet, setName, numBonuses, numEquipped, maxEquipped = GetItemLinkSetInfo(itemLink)
    if(hasSet) then
        local setSection = self:AcquireSection(self:GetStyle("bodySection"))
        setSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_SET_NAME, setName, numEquipped, maxEquipped), self:GetStyle("bodyHeader"))
        for i = 1, numBonuses do
            local numRequired, bonusDescription = GetItemLinkSetBonusInfo(itemLink, equipped, i)
            if(numEquipped >= numRequired) then
                setSection:AddLine(bonusDescription, self:GetStyle("activeBonus"), self:GetStyle("bodyDescription"))
            else
                setSection:AddLine(bonusDescription, self:GetStyle("inactiveBonus"), self:GetStyle("bodyDescription"))
            end
        end
        self:AddSection(setSection)
    end
end
function ZO_Tooltip:AddPoisonSystemDescription()
    local poisonSystemDescriptionSection = self:AcquireSection(self:GetStyle("bodySection"))
    poisonSystemDescriptionSection:AddLine(GetString(SI_POISON_SYSTEM_INFO), self:GetStyle("flavorText"))
    self:AddSection(poisonSystemDescriptionSection)
end
function ZO_Tooltip:AddFlavorText(itemLink)
    local flavorText = GetItemLinkFlavorText(itemLink)
    if(flavorText ~= "") then
        local flavorSection = self:AcquireSection(self:GetStyle("bodySection"))
        flavorSection:AddLine(flavorText, self:GetStyle("flavorText"))
        self:AddSection(flavorSection)
    end
end
function ZO_Tooltip:AddCreator(itemLink, creatorName)
    if creatorName then
        local creatorSection = self:AcquireSection(self:GetStyle("bodySection"))
        if(creatorName ~= "") then
            local itemType = GetItemLinkItemType(itemLink)
            if(itemType == ITEMTYPE_TABARD) then
                creatorSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_TABARD, creatorName), self:GetStyle("bodyDescription"))
            else
                creatorSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_CREATOR, creatorName), self:GetStyle("bodyDescription"))
            end
        else
            if(IsItemLinkCrafted(itemLink)) then
                creatorSection:AddLine(GetString(SI_ITEM_FORMAT_STR_CRAFTED), self:GetStyle("bodyDescription"))
            end
        end
        self:AddSection(creatorSection)
    end
end
function ZO_Tooltip:AddMaterialLevels(itemLink)
    local levelsDescription = GetItemLinkMaterialLevelDescription(itemLink)
    if(levelsDescription ~= "") then
        local levelsSection = self:AcquireSection(self:GetStyle("bodySection"))
        levelsSection:AddLine(levelsDescription, self:GetStyle("bodyDescription"))
        self:AddSection(levelsSection)
    end
end
function ZO_Tooltip:AddItemTags(itemLink)
    local numItemTags = GetItemLinkNumItemTags(itemLink)
    if numItemTags > 0 then
        local itemTagStrings = {}
        -- Build a map of tag category -> table of tags in that category
        for i = 1, numItemTags do
            local itemTagDescription, itemTagCategory = GetItemLinkItemTagInfo(itemLink, i)
            if itemTagDescription ~= "" then
                if not itemTagStrings[itemTagCategory] then
                    itemTagStrings[itemTagCategory] = {}
                end
                table.insert(itemTagStrings[itemTagCategory], zo_strformat(SI_TOOLTIP_ITEM_TAG_FORMATER, itemTagDescription)) 
            end
        end
        -- Iterate through categories, and build a section for each category with tags in it
        for i = TAG_CATEGORY_MIN_VALUE, TAG_CATEGORY_MAX_VALUE do
            if itemTagStrings[i] then
                local itemTagsSection = self:AcquireSection(self:GetStyle("itemTagsSection"))
                local categoryName = GetString("SI_ITEMTAGCATEGORY", i)
                if categoryName ~= "" then
                    itemTagsSection:AddLine(categoryName, self:GetStyle("itemTagTitle"))
                end
                itemTagsSection:AddLine(table.concat(itemTagStrings[i], GetString(SI_LIST_COMMA_SEPARATOR)), self:GetStyle("itemTagDescription"))
                self:AddSection(itemTagsSection)
            end
        end
    end
end
--Layout Functions
function ZO_Tooltip:LayoutGenericItem(itemLink, equipped, creatorName, forceFullDurability, previewValueToAdd, itemName, equipSlot, showPlayerLocked, tradeBoPData, extraData)
    self:AddTopSection(itemLink, showPlayerLocked, tradeBoPData)
    self:AddItemTitle(itemLink, itemName)
    self:AddBaseStats(itemLink)
    if DoesItemLinkHaveArmorDecay(itemLink) then
        self:AddConditionBar(itemLink, previewValueToAdd)
    elseif equipped and IsItemAffectedByPairedPoison(equipSlot) then
        self:AddPoisonInfo(itemLink, equipSlot)
    elseif DoesItemLinkHaveEnchantCharges(itemLink) then
        self:AddEnchantChargeBar(itemLink, forceFullDurability, previewValueToAdd)
    end
    local enchantDiffMode
    if extraData then
        enchantDiffMode = extraData.enchantDiffMode
    end
    self:AddEnchant(itemLink, enchantDiffMode, equipSlot)
    self:AddOnUseAbility(itemLink)
    self:AddTrait(itemLink, extraData)
    self:AddSet(itemLink, equipped)
    if GetItemLinkItemType(itemLink) == ITEMTYPE_POISON then
        self:AddPoisonSystemDescription()
    end
    self:AddFlavorText(itemLink)
    -- We don't want crafted furniture to show who made it, since it will get cleared once placed in a house
    -- TODO: If we implement saving the creator name, add back in LayoutItemCreator call (ESO-495280)
    if not IsItemLinkPlaceableFurniture(itemLink) then
        self:AddCreator(itemLink, creatorName)
    end
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
    self:AddItemValue(itemLink)
end
function ZO_Tooltip:LayoutVendorTrash(itemLink, itemName, extraData)
    self:AddItemTitle(itemLink, itemName)
    self:AddBaseStats(itemLink)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:AddItemValue(itemLink)
end
function ZO_Tooltip:LayoutBooster(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local boosterDescriptionSection = self:AcquireSection(self:GetStyle("bodySection"))
    local toQuality = GetItemLinkQuality(itemLink)
    local fromQuality = zo_max(ITEM_QUALITY_TRASH, toQuality - 1)
    local toQualityText = GetString("SI_ITEMQUALITY", toQuality)
    local fromQualityText = GetString("SI_ITEMQUALITY", fromQuality)
    toQualityText = GetItemQualityColor(toQuality):Colorize(toQualityText)
    fromQualityText = GetItemQualityColor(fromQuality):Colorize(fromQualityText)
    boosterDescriptionSection:AddLine(zo_strformat(SI_ENCHANTMENT_BOOSTER_DESCRIPTION, fromQualityText, toQualityText), self:GetStyle("bodyDescription"))
    self:AddSection(boosterDescriptionSection)
    self:AddItemTags(itemLink)
end
do
    local FORMATTED_CHAMPION_RANK_ICON = zo_iconFormat(GetGamepadChampionPointsIcon(), 40, 40)
    function ZO_Tooltip:LayoutInlineGlyph(itemLink, itemName)
        self:AddItemTitle(itemLink, itemName)
        self:AddEnchant(itemLink)
        local minLevel, minChampionPoints = GetItemLinkGlyphMinLevels(itemLink)
        if(minLevel or minChampionPoints) then
            local requirementsSection = self:AcquireSection(self:GetStyle("bodySection"))
            if minChampionPoints then
                requirementsSection:AddLine(zo_strformat(SI_ENCHANTING_GLYPH_REQUIRED_SINGLE_CHAMPION_POINTS_GAMEPAD, FORMATTED_CHAMPION_RANK_ICON, minChampionPoints), self:GetStyle("bodyDescription"))
            else
                requirementsSection:AddLine(zo_strformat(SI_ENCHANTING_GLYPH_REQUIRED_SINGLE_LEVEL, minLevel), self:GetStyle("bodyDescription"))
            end
            self:AddSection(requirementsSection)
        end
        self:AddFlavorText(itemLink)
    end
end
function ZO_Tooltip:LayoutGlyph(itemLink, creatorName, itemName, tradeBoPData, extraData)
    self:AddTopSection(itemLink, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
    self:LayoutInlineGlyph(itemLink, itemName)
    self:AddCreator(itemLink, creatorName)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
end
function ZO_Tooltip:LayoutSiege(itemLink, itemName, tradeBoPData, extraData)
    self:AddTopSection(itemLink, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
    self:AddItemTitle(itemLink, itemName)
    local maxHP = GetItemLinkSiegeMaxHP(itemLink)
    if maxHP > 0 then
        local statsSection = self:AcquireSection(self:GetStyle("statsSection"))
        local statValuePair = statsSection:AcquireStatValuePair()
        statValuePair:SetStat(GetString(SI_SIEGE_TOOLTIP_TOUGHNESS), self:GetStyle("statValuePairStat"))
        statValuePair:SetValue(zo_strformat(SI_SIEGE_TOOLTIP_TOUGHNESS_FORMAT, maxHP), self:GetStyle("statValuePairValue"))
        statsSection:AddStatValuePair(statValuePair)
        self:AddSection(statsSection)
    end
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
end
function ZO_Tooltip:LayoutTool(itemLink, itemName, tradeBoPData, extraData)
    self:AddTopSection(itemLink, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
    self:AddItemTitle(itemLink, itemName)
    self:AddBaseStats(itemLink)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
    self:AddItemValue(itemLink)
end
function ZO_Tooltip:LayoutSoulGem(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    self:AddBaseStats(itemLink)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:AddItemValue(itemLink)
end
function ZO_Tooltip:LayoutAvARepair(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
end
do
    local function AddDyeSwatchSection(dyeId, section, entryStyle, swatchStyle)
        local entrySection = section:AcquireSection()
        local dyeName, known, rarity, hueCategory, achievementId, r, g, b = GetDyeInfoById(dyeId)
        entrySection:AddColorAndTextSwatch(r, g, b, 1, dyeName, swatchStyle)
        section:AddSection(entrySection)
    end
    function ZO_Tooltip:LayoutDyeStamp(itemLink, itemName, extraData)
        self:AddTopSection(itemLink)
        self:AddItemTitle(itemLink, itemName)
        local onUseType = GetItemLinkItemUseType(itemLink)
        local descriptionSection = self:AcquireSection(self:GetStyle("bodySection"))
        if onUseType == ITEM_USE_TYPE_ITEM_DYE_STAMP then
            descriptionSection:AddLine(GetString(SI_DYE_STAMP_ITEM_DESCRIPTION), self:GetStyle("bodyDescription"))
        elseif onUseType == ITEM_USE_TYPE_COSTUME_DYE_STAMP then
            descriptionSection:AddLine(GetString(SI_DYE_STAMP_COSTUME_DESCRIPTION), self:GetStyle("bodyDescription"))
        end
        self:AddSection(descriptionSection)
        -- list of dyes in stamp
        local primaryDefId, secondaryDefId, accentDefId = GetItemLinkDyeIds(itemLink)
        local dyesSection = self:AcquireSection(self:GetStyle("dyesSection"))
        local swatchStyle = self:GetStyle("dyeSwatchStyle")
        local entryStyle = self:GetStyle("dyeSwatchEntrySection")
        AddDyeSwatchSection(primaryDefId, dyesSection, entryStyle, swatchStyle)
        AddDyeSwatchSection(secondaryDefId, dyesSection, entryStyle, swatchStyle)
        AddDyeSwatchSection(accentDefId, dyesSection, entryStyle, swatchStyle)
        self:AddSection(dyesSection)
        self:AddFlavorText(itemLink)
        self:AddItemTags(itemLink)
        local dyeStampId = GetItemLinkDyeStampId(itemLink)
        local errorSection = self:AcquireSection(self:GetStyle("bodySection"))
        if not IsCharacterPreviewingAvailable() then
            errorSection:AddLine(GetString(SI_DYE_STAMP_NOT_USABLE_NOW), self:GetStyle("dyeStampError"))
        elseif onUseType == ITEM_USE_TYPE_ITEM_DYE_STAMP then
            local useResult = CanPlayerUseItemDyeStamp(dyeStampId)
            if useResult == DYE_STAMP_USE_RESULT_NO_ACTIVE_ITEMS then
                errorSection:AddLine(GetString(SI_DYE_STAMP_REQUIRES_EQUIPMENT), self:GetStyle("dyeStampError"))
            elseif useResult == DYE_STAMP_USE_RESULT_NO_VALID_ITEMS then
                errorSection:AddLine(GetString(SI_DYE_STAMP_SAME_DYE_DATA), self:GetStyle("dyeStampError"))
            end
        elseif onUseType == ITEM_USE_TYPE_COSTUME_DYE_STAMP then
            local useResult = CanPlayerUseCostumeDyeStamp(dyeStampId)
            if useResult == DYE_STAMP_USE_RESULT_NO_ACTIVE_COLLECTIBLES then
                errorSection:AddLine(GetString(SI_DYE_STAMP_REQUIRES_COLLECTIBLE), self:GetStyle("dyeStampError"))
            elseif useResult == DYE_STAMP_USE_RESULT_NO_VALID_COLLECTIBLES then
                errorSection:AddLine(GetString(SI_DYE_STAMP_SAME_DYE_DATA), self:GetStyle("dyeStampError"))
            elseif useResult == DYE_STAMP_USE_RESULT_COLLECTIBLES_NOT_ACTIVE then
                errorSection:AddLine(GetString(SI_DYE_STAMP_COLLECTIBLES_HIDDEN), self:GetStyle("dyeStampError"))
            end
        end
        self:AddSection(errorSection)
    end
end
function ZO_Tooltip:LayoutMasterWritItem(itemLink, tradeBoPData, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink)
    local writDescription = self:AcquireSection(self:GetStyle("bodySection"))
    writDescription:AddLine(GenerateMasterWritBaseText(itemLink), self:GetStyle("bodyDescription"))
    self:AddSection(writDescription)
    local rewardDescription = self:AcquireSection(self:GetStyle("bodySection"))
    rewardDescription:AddLine(GenerateMasterWritRewardText(itemLink), self:GetStyle("bodyDescription"))
    self:AddSection(rewardDescription)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
end
function ZO_Tooltip:LayoutBook(itemLink, tradeBoPData)
    self:AddTopSection(itemLink, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
    self:AddItemTitle(itemLink)
    local knownSection = self:AcquireSection(self:GetStyle("bodySection"))
    if(IsItemLinkBookKnown(itemLink)) then
        knownSection:AddLine(GetString(SI_LORE_LIBRARY_IN_LIBRARY), self:GetStyle("bodyDescription"))
    else
        knownSection:AddLine(GetString(SI_LORE_LIBRARY_USE_TO_LEARN), self:GetStyle("bodyDescription"))
    end
    self:AddSection(knownSection)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
end
function ZO_Tooltip:LayoutLure(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutQuestStartOrFinishItem(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutProvisionerRecipe(itemLink, itemName, tradeBoPData, extraData)
    self:AddTopSection(itemLink, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
    self:AddItemTitle(itemLink, itemName)
    local IGNORE_LEVEL = true
    self:AddBaseStats(itemLink, IGNORE_LEVEL)
    local resultItemLink = GetItemLinkRecipeResultItemLink(itemLink)
    if(resultItemLink ~= "") then
        self:AddOnUseAbility(resultItemLink)
    end
    --Ingredients
    local numIngredients = GetItemLinkRecipeNumIngredients(itemLink)
    if(numIngredients > 0) then
        local ingredientsSection = self:AcquireSection(self:GetStyle("bodySection"))
        ingredientsSection:AddLine(GetString(SI_PROVISIONER_INGREDIENTS_HEADER), self:GetStyle("bodyHeader"))
        for i = 1, numIngredients do
            local ingredientName, numOwned, numRequired = GetItemLinkRecipeIngredientInfo(itemLink, i)
            local hasIngredientStyle
            if numOwned >= numRequired then
                hasIngredientStyle = self:GetStyle("hasIngredient")
            else
                hasIngredientStyle = self:GetStyle("doesntHaveIngredient")
            end
            local ingredientNameWithRequiredQuantity = zo_strformat(SI_RECIPE_INGREDIENT_WITH_COUNT, ingredientName, numRequired)
            ingredientsSection:AddLine(zo_strformat(SI_NUMBERED_LIST_ENTRY, i, ingredientNameWithRequiredQuantity), hasIngredientStyle, self:GetStyle("bodyDescription"))
        end
        self:AddSection(ingredientsSection)
    end
    --Requirements
    local requirementsSection = self:AcquireSection(self:GetStyle("bodySection"))
    requirementsSection:AddLine(GetString(SI_PROVISIONER_REQUIREMENTS_HEADER), self:GetStyle("bodyHeader"))
    for tradeskillIndex = 1, GetItemLinkRecipeNumTradeskillRequirements(itemLink) do
        local tradeskill, levelReq = GetItemLinkRecipeTradeskillRequirement(itemLink, tradeskillIndex)
        local rankSuccessStyle
        if level < levelReq then
            rankSuccessStyle = self:GetStyle("failed")
        else
            rankSuccessStyle = self:GetStyle("succeeded")
        end
        local levelPassiveAbilityId = GetTradeskillLevelPassiveAbilityId(tradeskill)
        local levelPassiveAbilityName = GetAbilityName(levelPassiveAbilityId)            
        requirementsSection:AddLine(zo_strformat(SI_RECIPE_REQUIRES_LEVEL_PASSIVE, levelPassiveAbilityName, levelReq),  rankSuccessStyle, self:GetStyle("bodyDescription"))
    end
    
    local requiredQuality = GetItemLinkRecipeQualityRequirement(itemLink)
    if requiredQuality > 0 then
        local quality = GetNonCombatBonus(NON_COMBAT_BONUS_PROVISIONING_RARITY_LEVEL)
        local qualitySuccessStyle
        if(quality >= requiredQuality) then
            qualitySuccessStyle = self:GetStyle("succeeded")
        else
            qualitySuccessStyle = self:GetStyle("failed")
        end
        --Only exclusively provisioning system recipes have a quality requirement
        requirementsSection:AddLine(zo_strformat(SI_PROVISIONER_REQUIRES_RECIPE_QUALITY, requiredQuality),  qualitySuccessStyle, self:GetStyle("bodyDescription"))
    end
    self:AddSection(requirementsSection)
    --Use to learn
    local useToLearnOrKnownSection = self:AcquireSection(self:GetStyle("bodySection"))
    if(IsItemLinkRecipeKnown(itemLink)) then
        useToLearnOrKnownSection:AddLine(GetString(SI_RECIPE_ALREADY_KNOWN), self:GetStyle("bodyDescription"))
    else
        useToLearnOrKnownSection:AddLine(GetString(SI_GAMEPAD_PROVISIONER_USE_TO_LEARN_RECIPE), self:GetStyle("bodyDescription"))
    end
    self:AddSection(useToLearnOrKnownSection)
    self:AddItemTags(itemLink)
    self:LayoutTradeBoPInfo(tradeBoPData)
    self:AddItemValue(itemLink)
end
function ZO_Tooltip:LayoutReagent(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local traitSection
    for i = 1, GetMaxTraits() do
        local known, name = GetItemLinkReagentTraitInfo(itemLink, i)
        if known ~= nil then
            if not traitSection then
                traitSection = self:AcquireSection(self:GetStyle("bodySection"))
                traitSection:AddLine(GetString(SI_CRAFTING_COMPONENT_TOOLTIP_TRAITS), self:GetStyle("bodyHeader"))
            end
            local displayName
            local knownStyle
            if known then
                displayName = name
                knownStyle = self:GetStyle("traitKnown")
            else
                displayName = GetString(SI_CRAFTING_COMPONENT_TOOLTIP_UNKNOWN_TRAIT)
                knownStyle = self:GetStyle("traitUnknown")
            end
            traitSection:AddLine(zo_strformat(SI_NUMBERED_LIST_ENTRY, i, displayName), knownStyle, self:GetStyle("bodyDescription")) 
        end
    end
    if traitSection then
        self:AddSection(traitSection)
    end
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutEnchantingRune(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local known, name = GetItemLinkEnchantingRuneName(itemLink)
    if known ~= nil then
        local translationSection = self:AcquireSection(self:GetStyle("bodySection"))
        translationSection:AddLine(GetString(SI_ENCHANTING_TRANSLATION_HEADER), self:GetStyle("bodyHeader"))
        if known then
            translationSection:AddLine(zo_strformat(SI_ENCHANTING_TRANSLATION_KNOWN, name), self:GetStyle("bodyDescription"))
        else
            translationSection:AddLine(GetString(SI_ENCHANTING_TRANSLATION_UNKNOWN), self:GetStyle("bodyDescription"))
        end
        self:AddSection(translationSection)
    end
    local runeClassification = GetItemLinkEnchantingRuneClassification(itemLink)
    local requiredRank = GetItemLinkRequiredCraftingSkillRank(itemLink)
    if runeClassification == ENCHANTING_RUNE_POTENCY then
        local requiredRankStyle
        if GetNonCombatBonus(NON_COMBAT_BONUS_ENCHANTING_LEVEL) >= requiredRank then
            requiredRankStyle = self:GetStyle("succeeded")
        else
            requiredRankStyle = self:GetStyle("failed")
        end
        local requirementSection = self:AcquireSection(self:GetStyle("bodySection"))
        requirementSection:AddLine(zo_strformat(SI_ENCHANTING_REQUIRES_POTENCY_IMPROVEMENT, requiredRank), requiredRankStyle, self:GetStyle("bodyDescription"))
        self:AddSection(requirementSection)
    elseif runeClassification == ENCHANTING_RUNE_ASPECT then
        local requiredRankStyle
        if GetNonCombatBonus(NON_COMBAT_BONUS_ENCHANTING_RARITY_LEVEL) >= requiredRank then
            requiredRankStyle = self:GetStyle("succeeded")
        else
            requiredRankStyle = self:GetStyle("failed")
        end
        local requirementSection = self:AcquireSection(self:GetStyle("bodySection"))
        requirementSection:AddLine(zo_strformat(SI_ENCHANTING_REQUIRES_ASPECT_IMPROVEMENT, requiredRank), requiredRankStyle, self:GetStyle("bodyDescription"))
        self:AddSection(requirementSection)
    end
end
function ZO_Tooltip:LayoutAlchemyBase(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local requiredLevel = GetItemLinkRequiredLevel(itemLink)
    local requiredChampionPoints = GetItemLinkRequiredChampionPoints(itemLink)
    local itemType = GetItemLinkItemType(itemLink)
    local itemTypeString = GetString((itemType == ITEMTYPE_POTION_BASE) and SI_ITEM_FORMAT_STR_POTION or SI_ITEM_FORMAT_STR_POISON)
    if requiredLevel > 0 or requiredChampionPoints > 0 then
        local createsSection = self:AcquireSection(self:GetStyle("bodySection"))
        if requiredChampionPoints > 0 then
            createsSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_CREATES_ALCHEMY_ITEM_OF_CHAMPION_POINTS, requiredChampionPoints, itemTypeString), self:GetStyle("bodyDescription"))
        else
            createsSection:AddLine(zo_strformat(SI_ITEM_FORMAT_STR_CREATES_ALCHEMY_ITEM_OF_LEVEL, requiredLevel, itemTypeString), self:GetStyle("bodyDescription"))
        end
        self:AddSection(createsSection)
    end
    local requirementSection = self:AcquireSection(self:GetStyle("bodySection"))
    local requirementStyle
    local requiredRank = GetItemLinkRequiredCraftingSkillRank(itemLink)
    if GetNonCombatBonus(NON_COMBAT_BONUS_ALCHEMY_LEVEL) >= requiredRank then
        requirementStyle = self:GetStyle("succeeded")
    else
        requirementStyle = self:GetStyle("failed")
    end
    requirementSection:AddLine(zo_strformat(SI_REQUIRES_ALCHEMY_SOLVENT_PURIFICATION, requiredRank), requirementStyle, self:GetStyle("bodyDescription"))
    self:AddSection(requirementSection)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutIngredient(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    self:AddFlavorText(itemLink)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutStyleMaterial(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local styleSection = self:AcquireSection(self:GetStyle("bodySection"))
    local style = GetItemLinkItemStyle(itemLink)
    local descriptionString = SI_ITEM_FORMAT_STR_STYLE_MATERIAL
    if style == GetUniversalStyleId() then
        descriptionString = SI_ITEM_DESCRIPTION_UNIVERSAL_STYLE
    end
    styleSection:AddLine(zo_strformat(descriptionString, GetItemStyleName(style)), self:GetStyle("bodyDescription"))
    self:AddSection(styleSection)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutRawMaterial(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local refinedItemLink = GetItemLinkRefinedMaterialItemLink(itemLink)
    if(refinedItemLink ~= "") then
        local refinedSection = self:AcquireSection(self:GetStyle("bodySection"))
        local refinedItemName = GetItemLinkName(refinedItemLink)
        local quality = GetItemLinkQuality(refinedItemLink)
        local qualityColor = GetItemQualityColor(quality)
        local minRawMats = GetSmithingRefinementMinRawMaterial()
        local maxRawMats = GetSmithingRefinementMaxRawMaterial()
        refinedSection:AddLine(zo_strformat(SI_TOOLTIP_ITEM_FORMAT_REFINES_TO, minRawMats, maxRawMats, qualityColor:Colorize(refinedItemName)), self:GetStyle("bodyDescription"))
        self:AddSection(refinedSection)
        self:AddMaterialLevels(refinedItemLink)
    end
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutMaterial(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    self:AddMaterialLevels(itemLink)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutArmorTrait(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local traitDescriptionSection = self:AcquireSection(self:GetStyle("bodySection"))
    traitDescriptionSection:AddLine(GetString(SI_ITEM_FORMAT_STR_ARMOR_TRAIT), self:GetStyle("bodyDescription"))
    self:AddSection(traitDescriptionSection)
    self:AddTrait(itemLink, extraData)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutWeaponTrait(itemLink, itemName, extraData)
    self:AddTopSection(itemLink)
    self:AddItemTitle(itemLink, itemName)
    local traitDescriptionSection = self:AcquireSection(self:GetStyle("bodySection"))
    traitDescriptionSection:AddLine(GetString(SI_ITEM_FORMAT_STR_WEAPON_TRAIT), self:GetStyle("bodyDescription"))
    self:AddSection(traitDescriptionSection)
    self:AddTrait(itemLink, extraData)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutAlchemyPreview(itemLink, itemTypeString, prospectiveAlchemyResult)
    if prospectiveAlchemyResult == PROSPECTIVE_ALCHEMY_RESULT_KNOWN and itemLink and itemLink ~= "" then
        local icon = GetItemLinkIcon(itemLink)
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:AddTopSection(itemLink)
        self:AddItemTitle(itemLink)
        self:AddBaseStats(itemLink)
        self:AddOnUseAbility(itemLink)
    else
        if self.icon then
            self.icon:SetHidden(true)
        end
        
        local title, description
        if prospectiveAlchemyResult == PROSPECTIVE_ALCHEMY_RESULT_UNCRAFTABLE then
            title = zo_strformat(SI_ALCHEMY_NO_RESULT, itemTypeString)
            description = GetString(SI_ALCHEMY_NO_EFFECTS)
        else
            title = zo_strformat(SI_ALCHEMY_UNKNOWN_RESULT, itemTypeString)
            description = zo_strformat(SI_ALCHEMY_UNKNOWN_EFFECTS, itemTypeString)
        end
        self:AddLine(title, self:GetStyle("title"))
        local alchemySection = self:AcquireSection(self:GetStyle("bodySection"))
        alchemySection:AddLine(description, self:GetStyle("bodyDescription"))
        self:AddSection(alchemySection)
    end
end
function ZO_Tooltip:LayoutEnchantingCraftingItem(itemLink, icon, creator, extraData)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:LayoutGlyph(itemLink, creator, extraData)
    else
        if self.icon then
            self.icon:SetHidden(true)
        end
        
        self:AddLine(GetString(SI_ENCHANTING_UNKNOWN_RESULT), self:GetStyle("title"))
        local enchantingSection = self:AcquireSection(self:GetStyle("bodySection"))
        enchantingSection:AddLine(GetString(SI_ENCHANTING_UNKNOWN_RESULT), self:GetStyle("bodyDescription"))
        self:AddSection(enchantingSection)
    end
end
function ZO_Tooltip:LayoutEnchantingPreview(potencyRuneBagId, potencyRuneSlotIndex, essenceRuneBagId, essenceRuneSlotIndex, aspectRuneBagId, aspectRuneSlotIndex, extraData)
    local _, icon, _, _, _, _ = GetEnchantingResultingItemInfo(potencyRuneBagId, potencyRuneSlotIndex, essenceRuneBagId, essenceRuneSlotIndex, aspectRuneBagId, aspectRuneSlotIndex)
    local itemLink = GetEnchantingResultingItemLink(potencyRuneBagId, potencyRuneSlotIndex, essenceRuneBagId, essenceRuneSlotIndex, aspectRuneBagId, aspectRuneSlotIndex)
    self:LayoutEnchantingCraftingItem(itemLink, icon, extraData)
end
function ZO_Tooltip:LayoutStoreItemFromLink(itemLink, icon)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        local stackCount = 1 -- currently stores only sell single items not stacks
        self:LayoutItemWithStackCountSimple(itemLink, stackCount)
    end
end
function ZO_Tooltip:LayoutStoreWindowItem(itemData)
    if itemData.entryType == STORE_ENTRY_TYPE_COLLECTIBLE then
        self:LayoutCollectibleFromLink(itemData.itemLink)
    elseif itemData.entryType == STORE_ENTRY_TYPE_QUEST_ITEM then
        self:LayoutQuestItem(itemData.questItemId)
    else
        self:LayoutStoreItemFromLink(itemData.itemLink, itemData.icon)
    end
    local buyable = itemData.dataSource.meetsRequirementsToBuy
    --itemData.dataSource.slotIndex is the entryIndex
    local errorStringId = GetStoreEntryBuyRequirementErrorId(itemData.dataSource.slotIndex)
    if errorStringId > 0 then
        local errorString = GetErrorString(errorStringId)
        if errorString ~= "" then
            local style
            if buyable then
                style = "requirementPass"
            else
                style = "requirementFail"
            end
            local styleSection = self:AcquireSection(self:GetStyle("bodySection"))
            styleSection:AddLine(errorString, self:GetStyle(style))
            self:AddSection(styleSection)
        end
    end
end
function ZO_Tooltip:LayoutBuyBackItem(itemIndex, icon)
    local itemLink = GetBuybackItemLink(itemIndex)
    self:LayoutStoreItemFromLink(itemLink, icon)
end
function ZO_Tooltip:LayoutQuestRewardItem(rewardIndex, icon)
    local itemLink = GetQuestRewardItemLink(rewardIndex)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:LayoutItem(itemLink, NOT_EQUIPPED, NO_CREATOR_NAME, FORCE_FULL_DURABILITY)
    end
end
function ZO_Tooltip:LayoutUniversalStyleItem(itemLink)
    self:AddTopSection(itemLink)
    local stackCount = GetCurrentSmithingStyleItemCount(GetUniversalStyleId())
    local itemName = GetItemLinkName(itemLink)
    if stackCount then
        itemName = zo_strformat(SI_GAMEPAD_SMITHING_TOOLTIP_UNIVERSAL_STYLE_ITEM_TITLE, itemName, stackCount)
    end
    self:AddLine(itemName, self:GetStyle("title"))
    local styleSection = self:AcquireSection(self:GetStyle("bodySection"))
    local style = GetItemLinkItemStyle(itemLink)
    styleSection:AddLine(GetString(SI_CRAFTING_UNIVERSAL_STYLE_ITEM_TOOLTIP), self:GetStyle("bodyDescription"))
    styleSection:AddLine(GetString(SI_CRAFTING_UNIVERSAL_STYLE_ITEM_CROWN_STORE_TOOLTIP), self:GetStyle("bodyDescription"))
    self:AddSection(styleSection)
    self:AddItemTags(itemLink)
end
function ZO_Tooltip:LayoutTradeBoPInfo(tradeBoPData)
    if tradeBoPData then
        local timeRemaining = tradeBoPData.timeRemaining
        local tradeBoPSection = self:AcquireSection(self:GetStyle("bodySection"), self:GetStyle("itemTradeBoPSection"))
        local formattedTimeRemaining
        if timeRemaining > ZO_ONE_MINUTE_IN_SECONDS then
            formattedTimeRemaining = zo_round(timeRemaining / ZO_ONE_MINUTE_IN_SECONDS) * ZO_ONE_MINUTE_IN_SECONDS
            formattedTimeRemaining = ZO_FormatTime(formattedTimeRemaining, TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT, TIME_FORMAT_PRECISION_SECONDS, TIME_FORMAT_DIRECTION_DESCENDING)
        else
            formattedTimeRemaining = GetString(SI_STR_TIME_LESS_THAN_MINUTE)
        end
        local statValuePairTimer = tradeBoPSection:AcquireStatValuePair(self:GetStyle("statValuePair"), self:GetStyle("fullWidth"))
        statValuePairTimer:SetStat(GetString(SI_ITEM_FORMAT_STR_TRADE_BOP_TIMER_HEADER), self:GetStyle("statValuePairStat"), self:GetStyle("itemTradeBoPHeader"))
        statValuePairTimer:SetValue(formattedTimeRemaining, self:GetStyle("statValuePairValue"))
        tradeBoPSection:AddStatValuePair(statValuePairTimer)
        tradeBoPSection:AddLine(GetString(SI_ITEM_FORMAT_STR_TRADE_BOP_PLAYERS_HEADER), self:GetStyle("statValuePairStat"), self:GetStyle("itemTradeBoPHeader"))
        tradeBoPSection:AddLine(tradeBoPData.namesString, self:GetStyle("statValuePairValue"), self:GetStyle("fullWidth"))
        self:AddSection(tradeBoPSection)
    end
end
function ZO_Tooltip:SetProvisionerResultItem(recipeListIndex, recipeIndex)
    local _, icon = GetRecipeResultItemInfo(recipeListIndex, recipeIndex)
    local itemLink = GetRecipeResultItemLink(recipeListIndex, recipeIndex)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:LayoutItem(itemLink, NOT_EQUIPPED)
    end
end
do
    local LAYOUT_FUNCTIONS =
    {
        [ITEMTYPE_RECIPE] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutProvisionerRecipe(itemLink, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_BLACKSMITHING_BOOSTER] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutBooster(itemLink, itemName, extraData) end,
        [ITEMTYPE_WOODWORKING_BOOSTER] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutBooster(itemLink, itemName, extraData) end,
        [ITEMTYPE_CLOTHIER_BOOSTER] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutBooster(itemLink, itemName, extraData) end,
        [ITEMTYPE_GLYPH_WEAPON] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutGlyph(itemLink, creatorName, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_GLYPH_ARMOR] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutGlyph(itemLink, creatorName, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_GLYPH_JEWELRY] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutGlyph(itemLink, creatorName, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_REAGENT] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutReagent(itemLink, itemName, extraData) end,
        [ITEMTYPE_POTION_BASE] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutAlchemyBase(itemLink, itemName, extraData) end,
        [ITEMTYPE_POISON_BASE] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutAlchemyBase(itemLink, itemName, extraData) end,
        [ITEMTYPE_INGREDIENT] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutIngredient(itemLink, itemName, extraData) end,
        [ITEMTYPE_STYLE_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutStyleMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_BLACKSMITHING_RAW_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutRawMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_CLOTHIER_RAW_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutRawMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_WOODWORKING_RAW_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutRawMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_BLACKSMITHING_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_CLOTHIER_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_WOODWORKING_MATERIAL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutMaterial(itemLink, itemName, extraData) end,
        [ITEMTYPE_ARMOR_TRAIT] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutArmorTrait(itemLink, itemName, extraData) end,
        [ITEMTYPE_WEAPON_TRAIT] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutWeaponTrait(itemLink, itemName, extraData) end,
        [ITEMTYPE_SIEGE] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutSiege(itemLink, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_TOOL] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutTool(itemLink, itemName, tradeBoPData, extraData) end,
        [ITEMTYPE_SOUL_GEM] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutSoulGem(itemLink, itemName, extraData) end,
        [ITEMTYPE_AVA_REPAIR] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutAvARepair(itemLink, itemName, extraData) end,
        [ITEMTYPE_DYE_STAMP] = function(self, itemLink, creatorName, itemName, tradeBoPData, extraData) self:LayoutDyeStamp(itemLink, itemName, extraData) end,
    }
    --TODO: Get creatorName from itemLink?
    -- extraData is a table of optional parameters or additional information for tooltip layouts that aren't generic or commonly used
    -- AvailableOptions:
    -- enchantDiffMode - Controls the display of enchantment information as being added, removed, or default
    -- showTraitAsNew - Displays the trait information of an item as if it's being added to the item or otherwise new
    function ZO_Tooltip:LayoutItem(itemLink, equipped, creatorName, forceFullDurability, previewValueToAdd, itemName, equipSlot, showPlayerLocked, tradeBoPData, extraData)
        local isValidItemLink = itemLink ~= ""
        if isValidItemLink then
            --first do checks that can't be determined from the item type
            if IsItemLinkVendorTrash(itemLink) then
                self:LayoutVendorTrash(itemLink, itemName, extraData)
            elseif DoesItemLinkStartQuest(itemLink) or DoesItemLinkFinishQuest(itemLink) then
                if GetItemLinkItemType(itemLink) == ITEMTYPE_MASTER_WRIT then
                    self:LayoutMasterWritItem(itemLink, tradeBoPData, extraData)
                else
                    self:LayoutQuestStartOrFinishItem(itemLink, itemName, extraData)
                end
            else
                -- now attempt to layout the itemlink by the item type
                local itemType = GetItemLinkItemType(itemLink)
                if IsItemLinkEnchantingRune(itemLink) then
                    self:LayoutEnchantingRune(itemLink, itemName, extraData)
                elseif itemType == ITEMTYPE_LURE and IsItemLinkConsumable(itemLink) then
                    self:LayoutLure(itemLink, itemName, extraData)
                else
                    local layoutFunction = LAYOUT_FUNCTIONS[itemType]
                    if layoutFunction then
                        layoutFunction(self, itemLink, creatorName, itemName, tradeBoPData, extraData)
                    else
                        if IsItemLinkBook(itemLink) then
                            self:LayoutBook(itemLink, tradeBoPData)
                        else -- fallback to our default layout
                            if equipped == NOT_EQUIPPED then
                                equipSlot = EQUIP_SLOT_NONE
                            end
                            self:LayoutGenericItem(itemLink, equipped, creatorName, forceFullDurability, previewValueToAdd, itemName, equipSlot, showPlayerLocked, tradeBoPData, extraData)
                        end
                    end
                end
            end
        end
        return isValidItemLink
    end
end
function ZO_Tooltip:LayoutItemWithStackCount(itemLink, equipped, creatorName, forceFullDurability, previewValueToAdd, customOrBagStackCount, equipSlot, showPlayerLocked, tradeBoPData, extraData)
    local isValidItemLink = itemLink ~= ""
    if isValidItemLink then
        local stackCount
        local bagCount, bankCount, craftBagCount = GetItemLinkStacks(itemLink)
        if customOrBagStackCount == ZO_ITEM_TOOLTIP_INVENTORY_TITLE_COUNT then
            stackCount = bagCount
        elseif customOrBagStackCount == ZO_ITEM_TOOLTIP_BANK_TITLE_COUNT then
            stackCount = bankCount
        elseif customOrBagStackCount == ZO_ITEM_TOOLTIP_INVENTORY_AND_BANK_TITLE_COUNT then
            stackCount = bagCount + bankCount
        elseif customOrBagStackCount == ZO_ITEM_TOOLTIP_CRAFTBAG_TITLE_COUNT then
            stackCount = craftBagCount
        elseif customOrBagStackCount == ZO_ITEM_TOOLTIP_INVENTORY_AND_BANK_AND_CRAFTBAG_TITLE_COUNT then
            stackCount = bagCount + bankCount + craftBagCount
        else
            stackCount = customOrBagStackCount
        end
        local itemName = GetItemLinkName(itemLink)
        if stackCount and stackCount > 1 then
            itemName = zo_strformat(SI_TOOLTIP_ITEM_NAME_WITH_QUANTITY, itemName, stackCount)
        end
        return self:LayoutItem(itemLink, equipped, creatorName, forceFullDurability, previewValueToAdd, itemName, equipSlot, showPlayerLocked, tradeBoPData, extraData)
    end
end
function ZO_Tooltip:LayoutItemWithStackCountSimple(itemLink, customOrBagStackCount)
    return self:LayoutItemWithStackCount(itemLink, NOT_EQUIPPED, NO_CREATOR_NAME, DONT_FORCE_FULL_DURABILITY, NO_PREVIEW_VALUE, customOrBagStackCount, EQUIP_SLOT_NONE)
end
-- "Specific Layout Functions"
function ZO_Tooltip:LayoutBagItem(bagId, slotIndex, showCombinedCount, extraData)
    local itemLink = GetItemLink(bagId, slotIndex)
    local showPlayerLocked = IsItemPlayerLocked(bagId, slotIndex)
    local equipped = bagId == BAG_WORN
    local equipSlot = equipped and slotIndex or EQUIP_SLOT_NONE
    local showCraftBagCount = ZO_ITEM_TOOLTIP_SHOW_CRAFTBAG_BODY_COUNT
    local stackCount = ZO_ITEM_TOOLTIP_INVENTORY_TITLE_COUNT
    if showCombinedCount then
        stackCount = ZO_ITEM_TOOLTIP_INVENTORY_AND_BANK_AND_CRAFTBAG_TITLE_COUNT
    else
        if bagId == BAG_BANK then
            stackCount = ZO_ITEM_TOOLTIP_BANK_TITLE_COUNT
        elseif bagId == BAG_BACKPACK then
            stackCount = ZO_ITEM_TOOLTIP_INVENTORY_TITLE_COUNT
        elseif bagId == BAG_VIRTUAL then
            showBankCount = ZO_ITEM_TOOLTIP_HIDE_BANK_BODY_COUNT
            showCraftBagCount = ZO_ITEM_TOOLTIP_HIDE_CRAFTBAG_BODY_COUNT
            stackCount = ZO_ITEM_TOOLTIP_CRAFTBAG_TITLE_COUNT
        elseif equipped then
            if slotIndex == EQUIP_SLOT_POISON or slotIndex == EQUIP_SLOT_BACKUP_POISON then
                stackCount = select(2, GetItemInfo(BAG_WORN, slotIndex))
            else
                stackCount = 1
            end
        end
    end
    local tradeBoPData
    if IsItemBoPAndTradeable(bagId, slotIndex) then
        tradeBoPData =
        {
            timeRemaining = GetItemBoPTimeRemainingSeconds(bagId, slotIndex),
            namesString = GetItemBoPTradeableDisplayNamesString(bagId, slotIndex),
        }
    end
    return self:LayoutItemWithStackCount(itemLink, equipped, GetItemCreatorName(bagId, slotIndex), DONT_FORCE_FULL_DURABILITY, NO_PREVIEW_VALUE, stackCount, equipSlot, showPlayerLocked, tradeBoPData, extraData)
end
function ZO_Tooltip:LayoutTradeItem(who, tradeIndex)
    local itemLink = GetTradeItemLink(who, tradeIndex, LINK_STYLE_DEFAULT)
    local equipped = false
    local name, icon, stack, quality, creator, sellPrice, meetsUsageRequirement, equipType, itemStyle = GetTradeItemInfo(who, tradeIndex)
    local tradeBoPData
    if IsTradeItemBoPAndTradeable(who, tradeIndex) then
        tradeBoPData =
        {
            timeRemaining = GetTradeItemBoPTimeRemainingSeconds(who, tradeIndex),
            namesString = GetTradeItemBoPTradeableDisplayNamesString(who, tradeIndex),
        }
    end
    return self:LayoutItemWithStackCount(itemLink, equipped, creator, DONT_FORCE_FULL_DURABILITY, NO_PREVIEW_VALUE, stack, EQUIP_SLOT_NONE, DONT_SHOW_PLAYER_LOCKED, tradeBoPData)
end
function ZO_Tooltip:LayoutPendingSmithingItem(patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex)
    local _, _, icon = GetSmithingPatternInfo(patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex)
    local itemLink = GetSmithingPatternResultLink(patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:LayoutItem(itemLink, NOT_EQUIPPED)
    end
end
function ZO_Tooltip:LayoutPendingEnchantedItem(itemBagId, itemIndex, enchantmentBagId, enchantmentIndex)
    local itemLink = GetEnchantedItemResultingItemLink(itemBagId, itemIndex, enchantmentBagId, enchantmentIndex)
    local extraData =
    {
        enchantDiffMode = ZO_ENCHANT_DIFF_ADD,
    }
    self:LayoutItem(itemLink, NOT_EQUIPPED, NO_CREATOR_NAME, FORCE_FULL_DURABILITY, NO_PREVIEW_VALUE, NO_ITEM_NAME, EQUIP_SLOT_NONE, DONT_SHOW_PLAYER_LOCKED, NO_TRADE_BOP_DATA, extraData)
end
function ZO_Tooltip:LayoutPendingItemChargeOrRepair(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex, improvementFunc)
    local itemLink = GetItemLink(itemBagId, itemSlotIndex)
    local previewValueToAdd = improvementFunc(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex)
    local extraData =
    {
        enchantDiffMode = ZO_ENCHANT_DIFF_ADD,
    }
    self:LayoutItem(itemLink, NOT_EQUIPPED, NO_CREATOR_NAME, DONT_FORCE_FULL_DURABILITY, previewValueToAdd, NO_ITEM_NAME, EQUIP_SLOT_NONE, DONT_SHOW_PLAYER_LOCKED, NO_TRADE_BOP_DATA, extraData)
end
function ZO_Tooltip:LayoutPendingItemCharge(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex)
    self:LayoutPendingItemChargeOrRepair(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex, GetAmountSoulGemWouldChargeItem)
end
function ZO_Tooltip:LayoutPendingItemRepair(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex)
    self:LayoutPendingItemChargeOrRepair(itemBagId, itemSlotIndex, improvementKitBagId, improvementKitIndex, GetAmountRepairKitWouldRepairItem)
end
function ZO_Tooltip:LayoutImprovedSmithingItem(itemToImproveBagId, itemToImproveSlotIndex, craftingSkillType)
    local _, icon = GetSmithingImprovedItemInfo(itemToImproveBagId, itemToImproveSlotIndex, craftingSkillType)
    local itemLink = GetSmithingImprovedItemLink(itemToImproveBagId, itemToImproveSlotIndex, craftingSkillType)
    if itemLink and itemLink ~= "" then
        if self.icon then
            self.icon:SetTexture(icon)
            self.icon:SetHidden(false)
        end
        self:LayoutItem(itemLink, NOT_EQUIPPED)
    end
end
function ZO_Tooltip:LayoutResearchSmithingItem(traitType, traitDescription)
    if self.icon then
        self.icon:SetHidden(true)
    end
    self:AddLine(traitType, self:GetStyle("title"))
    local bodySection = self:AcquireSection(self:GetStyle("bodySection"))
    bodySection:AddLine(traitDescription, self:GetStyle("bodyDescription"))
    self:AddSection(bodySection)
end
function ZO_Tooltip:LayoutQuestItem(questItemId)
    local header = GetString(SI_ITEM_FORMAT_STR_QUEST_ITEM)
    local itemName = GetQuestItemName(questItemId)
    local tooltipText = GetQuestItemTooltipText(questItemId)
    local topSection = self:AcquireSection(self:GetStyle("topSection"))
    topSection:AddLine(header)
    local topSubsection = topSection:AcquireSection(self:GetStyle("topSubsection"))
    topSection:AddSectionEvenIfEmpty(topSubsection)
    self:AddSectionEvenIfEmpty(topSection)
    local qualityStyle = ZO_TooltipStyles_GetItemQualityStyle(1) --quest items are always white
    self:AddLine(zo_strformat(SI_TOOLTIP_ITEM_NAME, itemName), qualityStyle, self:GetStyle("title"))
    local flavorSection = self:AcquireSection(self:GetStyle("bodySection"))
    flavorSection:AddLine(tooltipText, self:GetStyle("flavorText"))
    self:AddSection(flavorSection)
end
function ZO_Tooltip:LayoutItemStatComparison(bagId, slotId, comparisonSlot)
    local statDeltaLookup = ZO_GetStatDeltaLookupFromItemComparisonReturns(CompareBagItemToCurrentlyEquipped(bagId, slotId, comparisonSlot))
    for _, statGroup in ipairs(ZO_INVENTORY_STAT_GROUPS) do
        local statSection = self:AcquireSection(self:GetStyle("itemComparisonStatSection"))
        for _, stat in ipairs(statGroup) do
            
            local statName = zo_strformat(SI_STAT_NAME_FORMAT, GetString("SI_DERIVEDSTATS", stat))
            local currentValue = GetPlayerStat(stat)
            local statDelta = statDeltaLookup[stat] or 0
            local valueToShow = currentValue + statDelta
            
            if stat == STAT_SPELL_CRITICAL or stat == STAT_CRITICAL_STRIKE then
                local newPercent = GetCriticalStrikeChance(valueToShow)
                valueToShow = zo_strformat(SI_STAT_VALUE_PERCENT, newPercent)
            end
            local colorStyle = self:GetStyle("itemComparisonStatValuePairDefaultColor")
            if statDelta ~= 0 then
                local icon
                if statDelta > 0 then
                    colorStyle = self:GetStyle("succeeded")
                    icon = "EsoUI/Art/Buttons/Gamepad/gp_upArrow.dds"
                else
                    colorStyle = self:GetStyle("failed")
                    icon = "EsoUI/Art/Buttons/Gamepad/gp_downArrow.dds"
                end
                valueToShow = valueToShow .. zo_iconFormatInheritColor(icon, 24, 24)
            end
            local statValuePair = statSection:AcquireStatValuePair(self:GetStyle("itemComparisonStatValuePair"))
            statValuePair:SetStat(statName, self:GetStyle("statValuePairStat"))
            statValuePair:SetValue(valueToShow, self:GetStyle("itemComparisonStatValuePairValue"), colorStyle)
            statSection:AddStatValuePair(statValuePair)
        end
        self:AddSection(statSection)
    end
end
do
    local FORMAT_EXTRA_OPTIONS =
    {
        showCap = true,
    }
    function ZO_Tooltip:AddCurrencyLocationSection(mainSection, currencyLocation)
        local IS_PLURAL = false
        local IS_UPPER = false
        local locationSection
        local locationCurrenciesSection
        for currencyType = CURT_ITERATION_BEGIN, CURT_ITERATION_END do
            if CanCurrencyBeStoredInLocation(currencyType, currencyLocation) then
                if not locationCurrenciesSection then
                    locationSection = mainSection:AcquireSection(self:GetStyle("currencyLocationSection"))
                    
                    --Title
                    locationSection:AddLine(GetString("SI_CURRENCYLOCATION", currencyLocation), self:GetStyle("currencyLocationTitle"))
                    --Currencies Section
                    locationCurrenciesSection = locationSection:AcquireSection(self:GetStyle("currencyLocationCurrenciesSection"))
                end
                
                --Currency Count
                local statValuePair = locationCurrenciesSection:AcquireStatValuePair(self:GetStyle("currencyStatValuePair"))
                statValuePair:SetStat(GetCurrencyName(currencyType, IS_PLURAL, IS_UPPER), self:GetStyle("currencyStatValuePairStat"))
                local amount = GetCurrencyAmount(currencyType, currencyLocation)
                FORMAT_EXTRA_OPTIONS.currencyLocation = currencyLocation
                local valueString = ZO_Currency_FormatGamepad(currencyType, amount, ZO_CURRENCY_FORMAT_WHITE_AMOUNT_ICON, FORMAT_EXTRA_OPTIONS)
                statValuePair:SetValue(valueString, self:GetStyle("currencyStatValuePairValue"))
                locationCurrenciesSection:AddStatValuePair(statValuePair)
            end 
        end
        if locationSection then
            locationSection:AddSection(locationCurrenciesSection)
            mainSection:AddSection(locationSection)
        end
    end
    function ZO_Tooltip:LayoutCurrencies()  
        local currencyMainSection = self:AcquireSection(self:GetStyle("currencyMainSection"))
        self:AddCurrencyLocationSection(currencyMainSection, CURRENCY_LOCATION_CHARACTER)
        self:AddCurrencyLocationSection(currencyMainSection, CURRENCY_LOCATION_ACCOUNT)        
        
        self:AddSection(currencyMainSection)
    end
end
function ZO_Tooltip:LayoutBankCurrencies()
    local bankCurrencyMainSection = self:AcquireSection(self:GetStyle("bankCurrencyMainSection"))
    local IS_PLURAL = false
    local IS_UPPER = false
    for currencyType = CURT_ITERATION_BEGIN, CURT_ITERATION_END do
        if CanCurrencyBeStoredInLocation(currencyType, CURRENCY_LOCATION_BANK) then
            local currencySection = self:AcquireSection(self:GetStyle("bankCurrencySection"))
            local name = GetCurrencyName(currencyType, IS_PLURAL, IS_UPPER)
            local bankedStatValuePair = currencySection:AcquireStatValuePair(self:GetStyle("currencyStatValuePair"))
            local header = zo_strformat(SI_GAMEPAD_BANK_CURRENCY_AMOUNT_BANKED_HEADER_FORMAT, name)
            local valueString = zo_strformat(SI_GAMEPAD_TOOLTIP_ITEM_VALUE_FORMAT, ZO_CommaDelimitNumber(GetCurrencyAmount(currencyType, CURRENCY_LOCATION_BANK)), ZO_Currency_GetPlatformFormattedCurrencyIcon(currencyType))
            bankedStatValuePair:SetStat(header, self:GetStyle("currencyStatValuePairStat"))
            bankedStatValuePair:SetValue(valueString, self:GetStyle("currencyStatValuePairValue"))
            currencySection:AddStatValuePair(bankedStatValuePair)
            local carriedStatValuePair = currencySection:AcquireStatValuePair(self:GetStyle("currencyStatValuePair"))
            local header = zo_strformat(SI_GAMEPAD_BANK_CURRENCY_AMOUNT_CARRIED_HEADER_FORMAT, name)
            local valueString = zo_strformat(SI_GAMEPAD_TOOLTIP_ITEM_VALUE_FORMAT, ZO_CommaDelimitNumber(GetCurrencyAmount(currencyType, GetCurrencyPlayerStoredLocation(currencyType))), ZO_Currency_GetPlatformFormattedCurrencyIcon(currencyType))
            carriedStatValuePair:SetStat(header, self:GetStyle("currencyStatValuePairStat"))
            carriedStatValuePair:SetValue(valueString, self:GetStyle("currencyStatValuePairValue"))
            currencySection:AddStatValuePair(carriedStatValuePair)
            bankCurrencyMainSection:AddSection(currencySection)
        end
    end
    self:AddSection(bankCurrencyMainSection)
end
function ZO_Tooltip:LayoutGuildStoreSearchResult(itemLink, customOrBagStackCount, sellerName)
    self:LayoutItemWithStackCountSimple(itemLink, customOrBagStackCount)
    if sellerName then
        local sellerNameSection = self:AcquireSection(self:GetStyle("bodySection"))
        sellerNameSection:AddLine(zo_strformat(SI_TRADING_HOUSE_SEARCH_RESULT_SELLER_FORMATTER, sellerName), self:GetStyle("bodyDescription"))
        self:AddSection(sellerNameSection)
    end
end
function ZO_Tooltip:LayoutUnknownRetraitTrait(traitName, requiredResearchString)
    self:AddLine(traitName, self:GetStyle("title"))
    local bodySection = self:AcquireSection(self:GetStyle("bodySection"))
    bodySection:AddLine(requiredResearchString, self:GetStyle("bodyDescription"), self:GetStyle("failed"))
    self:AddSection(bodySection)
end