ESO Lua File v100010

ingame/fishing/fishing.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
ZO_Fishing = ZO_InteractiveRadialMenuController:Subclass()
function ZO_Fishing:New(...)
    return ZO_InteractiveRadialMenuController.New(self, ...)
end
-- Overridden from base
function ZO_Fishing:PrepareForInteraction()
    if not SCENE_MANAGER:IsInUIMode() then
        local additionalInfo = select(5, GetGameCameraInteractableActionInfo())
        if additionalInfo == ADDITIONAL_INTERACT_INFO_FISHING_NODE then
            if GetFishingLure() == 0 then
                self:ShowMenu()
            end
            return true
        end
    end
    return false
end
function ZO_Fishing:SetupEntryControl(entryControl, lureIndex)
    local selected = lureIndex == GetFishingLure()
    local _, _, stackCount = GetFishingLureInfo(lureIndex)
    ZO_SetupSelectableItemRadialMenuEntryTemplate(entryControl, selected, stackCount > 0 and stackCount or nil)
end
function ZO_Fishing:InteractionCanceled()
end
function ZO_Fishing:PopulateMenu()
    for i=1, GetNumFishingLures() do
        local name, icon, stack = GetFishingLureInfo(i)
        if stack > 0 then
            self.menu:AddEntry(zo_strformat(SI_TOOLTIP_ITEM_NAME, name), icon, icon, function() SetFishingLure(i) end, i)
        else
            self.menu:AddEntry(GetString(SI_NO_BAIT_IN_SLOT), "EsoUI/Art/Fishing/bait_emptySlot.dds", "EsoUI/Art/Fishing/bait_emptySlot.dds", nil, i)
        end
    end
end
    FISHING = ZO_Fishing:New(control, "ZO_SelectableItemRadialMenuEntryTemplate", "DefaultRadialMenuAnimation", "SelectableItemRadialMenuEntryAnimation")
end