ESO Lua File v100010

ingame/quickslot/quickslotradial.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
ZO_QuickslotRadialManager = ZO_InteractiveRadialMenuController:Subclass()
function ZO_QuickslotRadialManager:New(...)
    return ZO_InteractiveRadialMenuController.New(self, ...)
end
-- functions overridden from base
function ZO_QuickslotRadialManager:PrepareForInteraction()
    if SCENE_MANAGER:IsShowing("treasureMapQuickSlot") then
        SYSTEMS:HideScene("treasureMapQuickSlot")
        return false
    elseif not SCENE_MANAGER:IsShowing("hud") then
        return false
    end
    return true
end
function ZO_QuickslotRadialManager:InteractionCanceled()
    ActionButtonUp(ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 1)
end
function ZO_QuickslotRadialManager:SetupEntryControl(entryControl, slotNum)
    local selected = (slotNum == self.selectedSlotNum)
    local itemCount = GetSlotItemCount(slotNum)
    local slotType = GetSlotType(slotNum)
    ZO_SetupSelectableItemRadialMenuEntryTemplate(entryControl, selected, slotType ~= ACTION_TYPE_NOTHING and itemCount or nil)
end
local EMPTY_QUICKSLOT_TEXTURE = "EsoUI/Art/Quickslots/quickslot_emptySlot.dds"
local EMPTY_QUICKSLOT_STRING = GetString(SI_QUICKSLOTS_EMPTY)
function ZO_QuickslotRadialManager:PopulateMenu()
    self.selectedSlotNum = GetCurrentQuickslot()
    for i = ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 1, ACTION_BAR_FIRST_UTILITY_BAR_SLOT + ACTION_BAR_UTILITY_BAR_SIZE do
        local slotIcon = GetSlotTexture(i)
        local slotType = GetSlotType(i)
        local slotName = GetSlotName(i)
        slotName = zo_strformat(SI_TOOLTIP_ITEM_NAME, slotName)
        local slotItemQuality = GetSlotItemQuality(i)
        local slotNameData
        if slotItemQuality
        then
            local r, g, b = GetInterfaceColor(INTERFACE_COLOR_TYPE_ITEM_QUALITY_COLORS, slotItemQuality)
            local colorTable = { r = r, g = g, b = b }
            slotNameData = {slotName, colorTable}
        else
            slotNameData = slotName
        end
        if(slotType == ACTION_TYPE_NOTHING) then
            self.menu:AddEntry(EMPTY_QUICKSLOT_STRING, EMPTY_QUICKSLOT_TEXTURE, EMPTY_QUICKSLOT_TEXTURE, function() SetCurrentQuickslot(i) end, i)
        else
            self.menu:AddEntry(slotNameData, slotIcon, slotIcon, function() SetCurrentQuickslot(i) end, i)
        end
    end
end
    QUICKSLOT_RADIAL = ZO_QuickslotRadialManager:New(control, "ZO_SelectableItemRadialMenuEntryTemplate", "DefaultRadialMenuAnimation", "SelectableItemRadialMenuEntryAnimation")
end