Back to Home

ESO Lua File v101044

ingame/giftinventory/keyboard/giftinventoryreceived_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
ZO_GiftInventoryReceived_Keyboard = ZO_GiftInventoryCategory_Keyboard:Subclass()
function ZO_GiftInventoryReceived_Keyboard:New(...)
    return ZO_GiftInventoryCategory_Keyboard.New(self, ...)
end
function ZO_GiftInventoryReceived_Keyboard:Initialize(control)
    ZO_GiftInventoryCategory_Keyboard.Initialize(self, control, "received")
    
    local RECEIVED_TYPE = 1
    self:AddSupportedGiftState(GIFT_STATE_RECEIVED, RECEIVED_TYPE, "ZO_GiftInventoryReceived_Keyboard_Row", 52, function(control, data) self:SetupReceived(control, data) end)
    self.sortHeaderGroup:SelectHeaderByKey("seen")
    self:SetSortFunction(function(leftEntry, rightEntry) return ZO_GiftInventory_Manager.CompareReceived(leftEntry.data, rightEntry.data, self.currentSortKey, self.currentSortOrder) end)
    self:SetEmptyText(GetString(SI_GIFT_INVENTORY_NO_RECEIVED_GIFTS))
        alignment = KEYBIND_STRIP_ALIGN_RIGHT,
        -- Open Gift Claim
        {
            name = GetString(SI_GIFT_INVENTORY_OPEN_KEYBIND),
            keybind = "UI_SHORTCUT_PRIMARY",
            visible = function()
                return self.mouseOverRow ~= nil
            end,
            callback = function()
                self:OpenGift()
            end,
        }
    })
end
function ZO_GiftInventoryReceived_Keyboard:SetupReceived(control, gift)
    self:SetupRow(control, gift)
    local newTexture = control:GetNamedChild("New")
    newTexture:SetHidden(gift:HasBeenSeen())
    local iconTexture = control:GetNamedChild("Icon")
    iconTexture:SetTexture(gift:GetGiftBoxIcon())
    local senderNameLabel = control:GetNamedChild("SenderName")
    senderNameLabel:SetText(gift:GetUserFacingPlayerName())
    local expiresLabel = control:GetNamedChild("Expires")
end
function ZO_GiftInventoryReceived_Keyboard:OpenGift()
    if self.mouseOverRow then
        local gift = ZO_ScrollList_GetData(self.mouseOverRow)
        GIFT_INVENTORY_VIEW_KEYBOARD:SetupAndShowGift(gift)
    end
end
-- Begin Global XML Functions --
    GIFT_INVENTORY_RECEIVED_KEYBOARD:Row_OnMouseEnter(control)
end
    GIFT_INVENTORY_RECEIVED_KEYBOARD:Row_OnMouseExit(control)
end
    GIFT_INVENTORY_RECEIVED_KEYBOARD:Row_OnMouseUp(control, button, upInside)
end
    if button == MOUSE_BUTTON_INDEX_LEFT then
        GIFT_INVENTORY_RECEIVED_KEYBOARD:OpenGift()
    end
end
    GIFT_INVENTORY_RECEIVED_KEYBOARD = ZO_GiftInventoryReceived_Keyboard:New(control)
end
-- End Global XML Functions --