Back to Home

ESO Lua File v101041

ingame/rewards/ingame_rewards_manager.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
---------------------
-- Rewards Manager
---------------------
local IngameRewardsManager = ZO_RewardsManager:Subclass()
function IngameRewardsManager:New(...)
     return ZO_RewardsManager.New(self)
end
function IngameRewardsManager:GetCollectibleEntryInfo(rewardId, parentChoice)
    local collectibleId = GetCollectibleRewardCollectibleId(rewardId)
    local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
    if collectibleData then
        local rewardData = ZO_RewardData:New(rewardId, parentChoice)
        rewardData:SetRawName(collectibleData:GetName())
        rewardData:SetFormattedName(collectibleData:GetFormattedName())
        rewardData:SetIcon(collectibleData:GetIcon())
        return rewardData
    end
    return nil
end
function IngameRewardsManager:GetRewardContextualTypeString(rewardId, parentChoice)
    local entryType = GetRewardType(rewardId)
    if entryType == REWARD_ENTRY_TYPE_COLLECTIBLE then
        local collectibleId = GetCollectibleRewardCollectibleId(rewardId)
        local collectibleData = ZO_COLLECTIBLE_DATA_MANAGER:GetCollectibleDataById(collectibleId)
        if collectibleData then
            return collectibleData:GetCategoryTypeDisplayName()
        end
    end
    return ZO_RewardsManager.GetRewardContextualTypeString(self, rewardId, parentChoice)
end
REWARDS_MANAGER = IngameRewardsManager:New()