Back to Home

ESO Lua File v101042

ingame/targetmarker/gamepad/targetmarkerwheel_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
ZO_TargetMarkerWheel_Gamepad = ZO_TargetMarkerWheel_Shared:Subclass()
function ZO_TargetMarkerWheel_Gamepad:Initialize(...)
    ZO_TargetMarkerWheel_Shared.Initialize(self, ...)
end
function ZO_TargetMarkerWheel_Gamepad:InitializeNarrationInfo()
    local narrationInfo =
    {
        canNarrate = function()
            return self:IsInteracting()
        end,
        selectedNarrationFunction = function()
            local narrations = {}
            local selectedEntry = self.menu.selectedEntry
            if selectedEntry then
                local targetMarkerType = selectedEntry.data
                ZO_AppendNarration(narrations, SCREEN_NARRATION_MANAGER:CreateNarratableObject(GetString("SI_TARGETMARKERTYPE", targetMarkerType)))
            end
            return narrations
        end,
        headerNarrationFunction = function()
            return SCREEN_NARRATION_MANAGER:CreateNarratableObject(GetString(SI_TARGET_MARKER_WHEEL_NARRATION))
        end,
        additionalInputNarrationFunction = function()
            local narrationData = {}
            if self.menu:ShouldShowKeybinds() then
                self.menu:ForEachOrdinalEntry(function(ordinalIndex, entry)
                    local actionName = ZO_GetRadialMenuActionNameForOrdinalIndex(ordinalIndex)
                    local targetMarkerType = entry.data
                    local entryNarrationData =
                    {
                        name = GetString("SI_TARGETMARKERTYPE", targetMarkerType),
                        keybindName = ZO_Keybindings_GetHighestPriorityNarrationStringFromAction(actionName) or GetString(SI_ACTION_IS_NOT_BOUND),
                        enabled = true,
                    }
                    table.insert(narrationData, entryNarrationData)
                end)
            end
            return narrationData
        end,
        narrationType = NARRATION_TYPE_HUD,
    }
    SCREEN_NARRATION_MANAGER:RegisterCustomObject("TargetMarkerWheelHUD", narrationInfo)
end
function ZO_TargetMarkerWheel_Gamepad:OnSelectionChangedCallback(selectedEntry)
    ZO_TargetMarkerWheel_Shared.OnSelectionChangedCallback(self, selectedEntry)
    --Re-narrate on selection changed
    if selectedEntry then
        SCREEN_NARRATION_MANAGER:QueueCustomEntry("TargetMarkerWheelHUD")
    end
end
function ZO_TargetMarkerWheel_Gamepad:ShowMenu()
    ZO_TargetMarkerWheel_Shared.ShowMenu(self)
    --Narrate the header when first showing
    local NARRATE_HEADER = true
    SCREEN_NARRATION_MANAGER:QueueCustomEntry("TargetMarkerWheelHUD", NARRATE_HEADER)
end
function ZO_TargetMarkerWheel_Gamepad:StopInteraction(...)
    local wasShowing = ZO_TargetMarkerWheel_Shared.StopInteraction(self, ...)
    if wasShowing then
        --Clear out any in progress HUD narration when exiting the wheel
        ClearNarrationQueue(NARRATION_TYPE_HUD)
    end
    return wasShowing
end
    TARGET_MARKER_WHEEL_GAMEPAD = ZO_TargetMarkerWheel_Gamepad:New(control, "ZO_TargetMarkerWheelMenuEntryTemplate_Gamepad", "DefaultRadialMenuAnimation", "SelectableItemRadialMenuEntryAnimation")
end