ESO Lua File v100012

internalingame/market/gamepad/marketclasses_gamepad.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
ZO_GAMEPAD_MARKET_BUNDLE_PRODUCT_WIDTH = 620
ZO_GAMEPAD_MARKET_BUNDLE_PRODUCT_HEIGHT = 270
ZO_GAMEPAD_MARKET_INDIVIDUAL_PRODUCT_WIDTH = 407
ZO_GAMEPAD_MARKET_INDIVIDUAL_PRODUCT_HEIGHT = 270
ZO_GAMEPAD_MARKET_PRODUCT_TEMPLATE = "ZO_Gamepad_MarketProductTemplate"
ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_ATTACHMENT_TEMPLATE = "ZO_Gamepad_MarketProductBundleAttachmentTemplate"
ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_ITEM_ATTACHMENT_TEMPLATE = "ZO_Gamepad_MarketProductBundleItemAttachmentTemplate"
ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_COLLECTIBLE_ATTACHMENT_TEMPLATE = "ZO_Gamepad_MarketProductBundleCollectibleAttachmentTemplate"
ZO_GAMEPAD_MARKET_BLANK_TILE_TEMPLATE = "ZO_Gamepad_MarketBlankTileTemplate"
ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_STANDARD = 0
ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_WIDE = 1
ZO_GAMEPAD_MARKET_PRODUCT_CONTENT_TOP_INSET_Y = 11
ZO_GAMEPAD_MARKET_PRODUCT_CONTENT_X_INSET = 25
ZO_GAMEPAD_MARKET_PRODUCT_CONTENT_BOTTOM_INSET_Y = -20
--account for the fade that we add to the sides of the callout
ZO_GAMEPAD_MARKET_PRODUCT_CALLOUT_X_OFFSET = 5
local SINGLE_ITEM_COUNT = 1
--
--[[ Gamepad Market Product ]]--
--
ZO_GamepadMarketProduct = ZO_MarketProductBase:Subclass()
function ZO_GamepadMarketProduct:New(...)
    return ZO_MarketProductBase.New(self, ...)
end
function ZO_GamepadMarketProduct:Initialize(controlId, parent, owner, controlName)
    ZO_MarketProductBase.Initialize(self, controlId, self:GetTemplate(), parent, owner, controlName)
    self.currencyIcon = self.cost:GetNamedChild("CurrencyIcon")
    self.normalBorder = self.control:GetNamedChild("HighlightNormal")
    self.focusData =
    {
        control = self.control,
        highlight = self.control:GetNamedChild("Highlight"),
        marketProduct = self,
        isBlank = self:IsBlank()
    }
    self.renderSize = ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_STANDARD
end
function ZO_GamepadMarketProduct:GetTemplate()
    return ZO_GAMEPAD_MARKET_PRODUCT_TEMPLATE
end
do
    local BUNDLE_PRODUCT_WIDTH_POWER_OF_TWO = 1024
    local BUNDLE_PRODUCT_HEIGHT_POWER_OF_TWO = 512
    local BUNDLE_TEXTURE_WIDTH_COORD = ZO_GAMEPAD_MARKET_BUNDLE_PRODUCT_WIDTH / BUNDLE_PRODUCT_WIDTH_POWER_OF_TWO
    local BUNDLE_TEXTURE_HEIGHT_COORD = ZO_GAMEPAD_MARKET_BUNDLE_PRODUCT_HEIGHT / BUNDLE_PRODUCT_HEIGHT_POWER_OF_TWO
    
    local INDIVIDUAL_PRODUCT_WIDTH_POWER_OF_TWO = 512
    local INDIVIDUAL_PRODUCT_HEIGHT_POWER_OF_TWO = 512
    local INDIVIDUAL_TEXTURE_WIDTH_COORD = ZO_GAMEPAD_MARKET_INDIVIDUAL_PRODUCT_WIDTH / INDIVIDUAL_PRODUCT_WIDTH_POWER_OF_TWO
    local INDIVIDUAL_TEXTURE_HEIGHT_COORD = ZO_GAMEPAD_MARKET_INDIVIDUAL_PRODUCT_HEIGHT / INDIVIDUAL_PRODUCT_HEIGHT_POWER_OF_TWO
    function ZO_GamepadMarketProduct:LayoutBackground(background)
        self.background:SetTexture(background)
        
        local coordRight, coordBottom
        if self.renderSize == ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_STANDARD then
            coordRight = INDIVIDUAL_TEXTURE_WIDTH_COORD
            coordBottom = INDIVIDUAL_TEXTURE_HEIGHT_COORD
        elseif self.renderSize == ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_WIDE then
            coordRight = BUNDLE_TEXTURE_WIDTH_COORD
            coordBottom = BUNDLE_TEXTURE_HEIGHT_COORD
        end
        
        self.background:SetTextureCoords(0, coordRight, 0, coordBottom)
        self.background:SetHidden(background == ZO_NO_TEXTURE_FILE)
    end
end
function ZO_GamepadMarketProduct:PerformLayout(description, cost, discountedCost, discountPercent, icon, background, isNew, isFeatured)
    self.costAmount = cost
end
function ZO_GamepadMarketProduct:LayoutCostAndText(description, cost, discountPercent, discountedCost, isNew)
    ZO_MarketProductBase.LayoutCostAndText(self, description, cost, discountPercent, discountedCost, isNew)
    self.cost:ClearAnchors()
    self.textCallout:ClearAnchors()
    
    if cost > discountedCost then
        self.cost:SetAnchor(BOTTOMLEFT, self.previousCost, BOTTOMRIGHT, 10)
        self.textCallout:SetAnchor(BOTTOMLEFT, self.previousCost, TOPLEFT, ZO_GAMEPAD_MARKET_PRODUCT_CALLOUT_X_OFFSET - 2, 4) -- x offset to account for strikethrough
    else
        self.cost:SetAnchor(BOTTOMLEFT, self.control, BOTTOMLEFT, ZO_GAMEPAD_MARKET_PRODUCT_CONTENT_X_INSET, ZO_GAMEPAD_MARKET_PRODUCT_CONTENT_BOTTOM_INSET_Y)
        self.textCallout:SetAnchor(BOTTOMLEFT, self.cost, TOPLEFT, ZO_GAMEPAD_MARKET_PRODUCT_CALLOUT_X_OFFSET, 4)
    end
end
function ZO_GamepadMarketProduct:GetFocusData()
    return self.focusData
end
function ZO_GamepadMarketProduct:HasPreview()
    if not self:IsBundle() then -- Can't preview bundles from top level in gamepad version
        return self:GetNumAttachedCollectibles() == 1 and self:CanPreviewCollectible(1)
    else
        return false
    end
end
function ZO_GamepadMarketProduct:Preview()
     if not self:IsBundle() then -- Can't preview bundles from top level in gamepad version
        self:PreviewCollectible(1)
    end
end
function ZO_GamepadMarketProduct:SetListIndex(listIndex)
    self.listIndex = listIndex
end
function ZO_GamepadMarketProduct:GetListIndex()
    return self.listIndex
end
-- Changing the render size switches the background being used for the tile
-- This allows us to change backgrounds without re-calling Show()
function ZO_GamepadMarketProduct:SetRenderSize(renderSize)
    if renderSize ~= self.renderSize then
        self.renderSize = renderSize
    end
end
-- Used for explicity show/hide without re-laying out the data via :Show
function ZO_GamepadMarketProduct:SetHidden(hidden)
    self.control:SetHidden(hidden)
end
-- Used for cycling through preview items in the preview screen
function ZO_GamepadMarketProduct:SetPreviewIndex(previewIndex)
    self.previewIndex = previewIndex
end
function ZO_GamepadMarketProduct:GetPreviewIndex()
    return self.previewIndex
end
function ZO_GamepadMarketProduct:GetProductForSell()
    return self
end
function ZO_GamepadMarketProduct:GetBackground()
    local productId = self:GetId()
    if self.renderSize == ZO_GAMEPAD_MARKET_PRODUCT_RENDER_SIZE_STANDARD then
        return GetMarketProductGamepadBackground(productId)
    else
        return GetMarketProductGamepadWideBackground(productId)
    end
end
function ZO_GamepadMarketProduct:GetStackCount()
    if not self:IsBundle() then
        return select(6, GetMarketProductItemInfo(self.marketProductId, 1))
    else
        return SINGLE_ITEM_COUNT
    end
end
function ZO_GamepadMarketProduct:SetTitle(title)
    local formattedTitle = zo_strformat(SI_MARKET_PRODUCT_NAME_FORMATTER, title)
    local stackCount = self:GetStackCount()
    if stackCount > SINGLE_ITEM_COUNT then
        formattedTitle = zo_strformat(SI_TOOLTIP_ITEM_NAME_WITH_QUANTITY, formattedTitle, stackCount)
    end
    self.title:SetText(formattedTitle)
end
do
    local BLANK_HINT = ""
    local IS_PURCHASEABLE = true
    local SINGLE_PRODUCT_INDEX = 1
    function ZO_GamepadMarketProduct:Show(...)
        ZO_MarketProductBase.Show(self, ...)
        self:UpdateProductStyle()
        self.isCollectible = (not self:IsBundle()) and GetMarketProductNumCollectibles(self.marketProductId) > 0
        if self.isCollectible then
            local collectibleId, _, name, type, description, owned, isPlaceholder = GetMarketProductCollectibleInfo(self:GetId(), SINGLE_PRODUCT_INDEX)
            local unlockState = GetCollectibleUnlockStateById(collectibleId)
            self.tooltipLayoutArgs = { categoryName, name, nil, unlockState, IS_PURCHASEABLE, description, BLANK_HINT, isPlaceholder }
        elseif not self:IsBundle() then
            self.itemLink = GetMarketProductItemLink(self:GetId(), SINGLE_PRODUCT_INDEX)
        end
    end
end
function ZO_GamepadMarketProduct:SetIsFocused(isFocused)
    if self.isFocused ~= isFocused then
        self.isFocused = isFocused
        self:UpdateProductStyle()
    end
end
function ZO_GamepadMarketProduct:Reset()
    ZO_MarketProductBase.Reset(self)
    self.itemLink = nil
    self.layoutArgs = nil
    self.isCollectible = false
end
function ZO_GamepadMarketProduct:LayoutTooltip(tooltip)
    if self:IsBundle() then
        GAMEPAD_TOOLTIPS:LayoutMarketProduct(tooltip, self)
    elseif self.isCollectible then
        GAMEPAD_TOOLTIPS:LayoutCollectible(tooltip, unpack(self.tooltipLayoutArgs))
    elseif GetMarketProductNumItems(self.marketProductId) > 0 then
        local stackCount = self:GetStackCount()
        GAMEPAD_TOOLTIPS:LayoutItemWithStackCountSimple(tooltip, self.itemLink, stackCount, ZO_ITEM_TOOLTIP_HIDE_INVENTORY_BODY_COUNT, ZO_ITEM_TOOLTIP_HIDE_BANK_BODY_COUNT)
    else
        GAMEPAD_TOOLTIPS:LayoutMarketProduct(tooltip, self)
    end
end
do
    local MARKET_PRODUCT_FOCUS_STATE_UNFOCUSED = 1
    local MARKET_PRODUCT_FOCUS_STATE_FOCUSED = 2
    
    local MARKET_PRODUCT_STORE_STATE_DEFAULT = 1 -- Not Purchased, Not On Sale, Not New
    local MARKET_PRODUCT_STORE_STATE_PURCHASED = 2
    local MARKET_PRODUCT_STORE_STATE_ON_SALE = 3
    local MARKET_PRODUCT_STORE_STATE_NEW = 4
    local MARKET_PRODUCT_COLOR_MAP = 
    {
        [MARKET_PRODUCT_FOCUS_STATE_UNFOCUSED] =
        {
            [MARKET_PRODUCT_STORE_STATE_DEFAULT] = ZO_MARKET_DIMMED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_PURCHASED] = ZO_MARKET_PRODUCT_PURCHASED_DIMMED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_ON_SALE] = ZO_MARKET_DIMMED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_NEW] = ZO_MARKET_DIMMED_COLOR,
        },
        [MARKET_PRODUCT_FOCUS_STATE_FOCUSED] = 
        {
            [MARKET_PRODUCT_STORE_STATE_DEFAULT] = ZO_MARKET_SELECTED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_PURCHASED] = ZO_MARKET_PRODUCT_PURCHASED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_ON_SALE] = ZO_MARKET_SELECTED_COLOR,
            [MARKET_PRODUCT_STORE_STATE_NEW] = ZO_MARKET_SELECTED_COLOR,
        },
    }
    local function SetMarketProductLabelColor(label, focusedState, storeState)
        label:SetColor(MARKET_PRODUCT_COLOR_MAP[focusedState][storeState]:UnpackRGB())
    end
    -- Update Product style is called during show, product refresh, and on selection changed.
    -- Effectively Dims, Brightens and Desaturates products according to focus and product state
    function ZO_GamepadMarketProduct:UpdateProductStyle()
        local isFocused = self.isFocused
        local isPurchased = self:IsPurchased()
        local isNew = self.isNew
        local onSale = self.onSale
        local focusedState = isFocused and MARKET_PRODUCT_FOCUS_STATE_FOCUSED or MARKET_PRODUCT_FOCUS_STATE_UNFOCUSED
        local productNameState = isPurchased and MARKET_PRODUCT_STORE_STATE_PURCHASED or MARKET_PRODUCT_STORE_STATE_DEFAULT
        
        SetMarketProductLabelColor(self.title, focusedState, productNameState)
        local costState = MARKET_PRODUCT_STORE_STATE_DEFAULT
        if isPurchased then
            SetMarketProductLabelColor(self.purchaseLabelControl, focusedState, productNameState)
            self.normalBorder:SetEdgeColor(ZO_MARKET_PRODUCT_PURCHASED_COLOR:UnpackRGB())
            costState = MARKET_PRODUCT_STORE_STATE_PURCHASED
        else
            self.normalBorder:SetEdgeColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGB())
        end
        self.normalBorder:SetHidden(false)
        SetMarketProductLabelColor(self.cost, focusedState, costState)
        local textCalloutBackgroundColor
        if onSale then
            textCalloutBackgroundColor = isFocused and ZO_MARKET_PRODUCT_ON_SALE_COLOR or ZO_MARKET_PRODUCT_ON_SALE_DIMMED_COLOR
        elseif isNew then
            textCalloutBackgroundColor = isFocused and ZO_MARKET_PRODUCT_NEW_COLOR or ZO_MARKET_PRODUCT_NEW_DIMMED_COLOR
        end
        if textCalloutBackgroundColor then
            self:SetCalloutColor(textCalloutBackgroundColor)
        end
        local backgroundColor = isFocused and ZO_MARKET_PRODUCT_BACKGROUND_BRIGHTNESS_COLOR or ZO_MARKET_DIMMED_COLOR
        self.background:SetColor(backgroundColor:UnpackRGB())
        self.background:SetDesaturation(self:GetBackgroundSaturation(isPurchased))
        local crownsColor = isFocused and ZO_MARKET_SELECTED_COLOR or ZO_MARKET_DIMMED_COLOR
        self.currencyIcon:SetColor(crownsColor:UnpackRGB())
        self.textCallout:SetColor(crownsColor:UnpackRGB())
        local previousCostColor = isFocused and ZO_DEFAULT_TEXT or ZO_DISABLED_TEXT
        self.previousCost:SetColor(previousCostColor:UnpackRGB())
        self.previousCostStrikethrough:SetColor(previousCostColor:UnpackRGB())
    end
end
--
--[[ Gamepad Market Product Bundle Attachment ]]--
--
ZO_GamepadMarketProductBundleAttachment = ZO_GamepadMarketProduct:Subclass()
function ZO_GamepadMarketProductBundleAttachment:New(...)
    return ZO_GamepadMarketProduct.New(self, ...)
end
function ZO_GamepadMarketProductBundleAttachment:GetTemplate()
    return ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_ATTACHMENT_TEMPLATE
end
function ZO_GamepadMarketProductBundleAttachment:Refresh()
end
function ZO_GamepadMarketProductBundleAttachment:HasPreview()
    return false
end
function ZO_GamepadMarketProductBundleAttachment:SetBundle(bundle)
    self.bundle = bundle
end
function ZO_GamepadMarketProductBundleAttachment:IsPurchased()
     return self.bundle:IsPurchased()
end
function ZO_GamepadMarketProductBundleAttachment:GetProductForSell()
    return self.bundle
end
function ZO_GamepadMarketProductBundleAttachment:IsBundle()
    return false
end
function ZO_GamepadMarketProductBundleAttachment:IsBundleAttachment()
    return true
end
function ZO_GamepadMarketProductBundleAttachment:Reset()
    ZO_MarketProductBase.Reset(self)
    self.bundle = nil
end
function ZO_GamepadMarketProductBundleAttachment:LayoutTooltip(tooltip)
    assert(false) -- must be overridden
end
--
--[[ Gamepad Market Product Bundle Item Atachment ]]--
--
ZO_GamepadMarketProductBundleItemAttachment = ZO_GamepadMarketProductBundleAttachment:Subclass()
function ZO_GamepadMarketProductBundleItemAttachment:New(...)
    return ZO_GamepadMarketProductBundleAttachment.New(self, ...)
end
function ZO_GamepadMarketProductBundleItemAttachment:GetTemplate()
    return ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_ITEM_ATTACHMENT_TEMPLATE
end
function ZO_GamepadMarketProductBundleItemAttachment:ShowAsBundleItem(marketProductId, iconFile, name, itemQuality, requiredLevel, itemCount, itemLink, attachmentIndex, background)
    self.marketProductId = marketProductId
    self.itemLink = itemLink
    self.attachmentIndex = attachmentIndex
    self.isCollectible = false
    self.name = name
    self:SetTitle(name)
    self.purchaseLabelControl:SetHidden(true)
    self.previousCostStrikethrough:SetHidden(true)
    self.textCallout:SetHidden(true)
    self:LayoutBackground(background)
    self.control:SetHidden(false)
end
function ZO_GamepadMarketProductBundleItemAttachment:GetAttachmentIndex()
    return self.attachmentIndex
end
function ZO_GamepadMarketProductBundleItemAttachment:Reset()
    ZO_GamepadMarketProductBundleAttachment.Reset(self)
    self.itemLink = nil
end
function ZO_GamepadMarketProductBundleItemAttachment:GetBackground()
    return GetMarketProductItemGamepadBackground(self.bundle:GetId(), self.attachmentIndex)
end
function ZO_GamepadMarketProductBundleItemAttachment:LayoutTooltip(tooltip)
    local stackCount = self:GetStackCount()
    GAMEPAD_TOOLTIPS:LayoutItemWithStackCount(tooltip, self.itemLink, stackCount, ZO_ITEM_TOOLTIP_HIDE_INVENTORY_BODY_COUNT, ZO_ITEM_TOOLTIP_HIDE_BANK_BODY_COUNT)
end
function ZO_GamepadMarketProductBundleItemAttachment:GetStackCount()
    return select(6, GetMarketProductItemInfo(self.bundle:GetId(), self.attachmentIndex))
end
--
--[[ Gamepad Market Product Bundle Collectible Attachment ]]--
--
ZO_GamepadMarketProductBundleCollectibleAttachment = ZO_GamepadMarketProductBundleAttachment:Subclass()
function ZO_GamepadMarketProductBundleCollectibleAttachment:New(...)
    return ZO_GamepadMarketProductBundleAttachment.New(self, ...)
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:GetTemplate()
    return ZO_GAMEPAD_MARKET_PRODUCT_BUNDLE_COLLECTIBLE_ATTACHMENT_TEMPLATE
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:ShowAsBundleCollectible(marketProductId, iconFile, name, unlocked, tooltipLayoutArgs, collectibleIndex, background)
    self.isCollectible = true
    self.tooltipLayoutArgs = tooltipLayoutArgs
    self.marketProductId = marketProductId
    self.collectibleIndex = collectibleIndex
    self.name = name
    self:SetTitle(name)
    self.purchaseLabelControl:SetHidden(not unlocked)
    
    if unlocked then
        self.purchaseLabelControl:SetText(GetString("SI_COLLECTIBLEUNLOCKSTATE", COLLECTIBLE_UNLOCK_STATE_UNLOCKED_OWNED))
    end
    ZO_MarketClasses_Shared_ApplyTextColorToLabel(self.purchaseLabelControl, unlocked, ZO_DEFAULT_TEXT, ZO_SELECTED_TEXT)
    self.previousCostStrikethrough:SetHidden(true)
    self.textCallout:SetHidden(true)
    self:LayoutBackground(background)
    self.control:SetHidden(false)
end
do
    LAYOUT_UNLOCKED_ARG_INDEX = 4
    function ZO_GamepadMarketProductBundleCollectibleAttachment:Refresh()
        ZO_GamepadMarketProductBundleAttachment.Refresh(self)
        local collectibleId, _, _, _, _, owned = GetMarketProductCollectibleInfo(self.bundle:GetId(), self.collectibleIndex)
        local unlockState = GetCollectibleUnlockStateById(collectibleId)
        self.purchaseLabelControl:SetHidden(not owned)
        self.tooltipLayoutArgs[LAYOUT_UNLOCKED_ARG_INDEX] = unlockState
        if owned then
            self.purchaseLabelControl:SetText(GetString("SI_COLLECTIBLEUNLOCKSTATE", COLLECTIBLE_UNLOCK_STATE_UNLOCKED_OWNED))
        end
    end
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:GetCollectibleIndex()
    return self.collectibleIndex
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:HasPreview()
    return self.bundle:CanPreviewCollectible(self.collectibleIndex)
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:Preview()
    self.bundle:PreviewCollectible(self.collectibleIndex)
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:Reset()
    ZO_GamepadMarketProductBundleAttachment.Reset(self)
    self.tooltipLayoutArgs = nil
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:GetBackground()
    return GetMarketProductCollectibleGamepadBackground(self.bundle:GetId(), self.collectibleIndex)
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:LayoutTooltip(tooltip)
    GAMEPAD_TOOLTIPS:LayoutCollectible(tooltip, unpack(self.tooltipLayoutArgs))
end
function ZO_GamepadMarketProductBundleCollectibleAttachment:GetStackCount()
    return SINGLE_ITEM_COUNT
end
--
--[[ Gamepad Market Blank Product ]]--
--
ZO_GamepadMarketBlankProduct = ZO_Object.MultiSubclass(ZO_MarketBlankProductBase, ZO_GamepadMarketProduct)
function ZO_GamepadMarketBlankProduct:New(...)
    return ZO_GamepadMarketProduct.New(self, ...)
end
function ZO_GamepadMarketBlankProduct:Initialize(...)
    ZO_GamepadMarketProduct.Initialize(self, ...)
end
function ZO_MarketBlankProductBase:LayoutBackground()
end
function ZO_MarketBlankProductBase:UpdateProductStyle()
end
function ZO_GamepadMarketBlankProduct:GetTemplate()
    return ZO_GAMEPAD_MARKET_BLANK_TILE_TEMPLATE
end