Back to Home

ESO Lua File v100036

ingame/giftinventory/keyboard/giftinventorysent_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
ZO_GiftInventorySent_Keyboard = ZO_GiftInventoryCategory_Keyboard:Subclass()
function ZO_GiftInventorySent_Keyboard:New(...)
    return ZO_GiftInventoryCategory_Keyboard.New(self, ...)
end
function ZO_GiftInventorySent_Keyboard:Initialize(control)
    ZO_GiftInventoryCategory_Keyboard.Initialize(self, control, "sent")
    
    local SENT_TYPE = 1
    self:AddSupportedGiftState(GIFT_STATE_SENT, SENT_TYPE, "ZO_GiftInventorySent_Keyboard_Row", 52, function(control, data) self:SetupSent(control, data) end)
    self.sortHeaderGroup:SelectHeaderByKey("expirationTimeStampS")
    self:SetSortFunction(function(leftEntry, rightEntry) return ZO_GiftInventory_Manager.CompareSent(leftEntry.data, rightEntry.data, self.currentSortKey, self.currentSortOrder) end)
    self:SetEmptyText(GetString(SI_GIFT_INVENTORY_NO_SENT_GIFTS))
end
function ZO_GiftInventorySent_Keyboard:SetupSent(control, gift)
    self:SetupRow(control, gift)
    local iconTexture = control:GetNamedChild("Icon")
    iconTexture:SetTexture(gift:GetIcon())
    self:SetupStackCount(control, gift)
    local nameLabel = control:GetNamedChild("Name")
    -- Override default ZO_SortFilterList default color with quality color for name
    nameLabel.normalColor = gift:GetQualityColor()
    nameLabel.selectedColor = gift:GetQualityColor()
    nameLabel:SetText(gift:GetFormattedName())
    local recipientNameLabel = control:GetNamedChild("RecipientName")
    recipientNameLabel:SetText(gift:GetUserFacingPlayerName())
    local expiresLabel = control:GetNamedChild("Expires")
end
    GIFT_INVENTORY_SENT_KEYBOARD:Row_OnMouseEnter(self)
end
    GIFT_INVENTORY_SENT_KEYBOARD:Row_OnMouseExit(self)
end
    GIFT_INVENTORY_SENT_KEYBOARD:Row_OnMouseUp(self, button, upInside)
end
    GIFT_INVENTORY_SENT_KEYBOARD = ZO_GiftInventorySent_Keyboard:New(self)
end