ESO Lua File v100010

ingame/tooltip/collectionstooltips.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
function ZO_Tooltip:LayoutCollectibleFromLink(collectibleLink)
    local collectibleId = GetCollectibleIdFromLink(collectibleLink)
    if collectibleId then
        local name, description, _, _, unlocked, purchasable, _, _, hint = GetCollectibleInfo(collectibleId)
        local nickname = GetCollectibleNickname(collectibleId)
        self:LayoutCollectible(nil, name, nickname, unlocked, purchaseable, description, hint)
    end
end
function ZO_Tooltip:LayoutCollectible(collectionName, collectibleName, collectibleNickname, isUnlocked, isPurchasable, description, hint)
    local headerSection = self:AcquireSection(self:GetStyle("bodyHeader"))
    if collectionName then
        headerSection:AddLine(zo_strformat(SI_COLLECTIBLE_NAME_FORMATTER, collectionName))
    end
    headerSection:AddLine(zo_strformat(SI_COLLECTIBLE_NAME_FORMATTER, collectibleName), qualityNormal, self:GetStyle("title"))
    
    if collectibleNickname and collectibleNickname ~= "" then
        headerSection:AddLine(zo_strformat(SI_GAMEPAD_COLLECTIONS_NICKNAME_FORMAT, collectibleNickname), qualityNormal, self:GetStyle("bodyHeader"))
    end
    
    if isUnlocked then
        headerSection:AddLine(GetString(SI_GAMEPAD_COLLECTIONS_COLLECTED_HEADER), qualityNormal, self:GetStyle("bodySection"))
    else
        headerSection:AddLine(GetString(SI_GAMEPAD_COLLECTIONS_NOT_COLLECTED_HEADER), qualityNormal, self:GetStyle("bodySection"))
    end
    self:AddSection(headerSection)
    local bodySection = self:AcquireSection(self:GetStyle("collectionsInfoSection"))
    if description then
        bodySection:AddLine(zo_strformat(SI_GAMEPAD_COLLECTIONS_DESCRIPTION_FORMATTER, description), self:GetStyle("bodyDescription"))
    end
    if isPurchasable then 
        bodySection:AddLine(GetString(SI_COLLECTIBLE_TOOLTIP_PURCHASABLE), self:GetStyle("bodyDescription"))
    end
    if hint then
        bodySection:AddLine(zo_strformat(SI_GAMEPAD_COLLECTIONS_DESCRIPTION_FORMATTER, hint), self:GetStyle("bodyDescription"))
    end
    self:AddSection(bodySection)
end