ESO Lua File v100012

ingame/contacts/gamepad/ignorelist_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
78
79
80
81
82
-----------------
-- Ignore List
-----------------
ZO_GamepadIgnoreListPanel = ZO_GamepadSocialListPanel:Subclass()
function ZO_GamepadIgnoreListPanel:New(control, movementContoller)
    local panel = ZO_GamepadSocialListPanel.New(self, control, movementContoller)
    return panel
end
function ZO_GamepadIgnoreListPanel:Initialize(control)
        ZO_GamepadSocialListPanel.Initialize(self, control)
        IGNORE_LIST_MANAGER:AddList(self)
        
        self:SetupSort(IGNORE_LIST_ENTRY_SORT_KEYS, "displayName", ZO_SORT_ORDER_DOWN)
        self:AddDataTemplate("ZO_GamepadIgnoreListRow", 64, function (control, data, selected) self:SetupRow(control, data, selected) end)
        self.sortHeaderGroup:SelectHeaderByKey("displayName")
        self:InitializeKeybind()
        self:RefreshData()
        local ALWAYS_ANIMATE = true
        GAMEPAD_FRIENDS_LIST_IGNORE_LIST_FRAGMENT = ZO_ConveyorSceneFragment:New(ZO_GamepadContactsMainIgnoreContainer, ALWAYS_ANIMATE)
        GAMEPAD_FRIENDS_LIST_IGNORE_LIST_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
                                                            if newState == SCENE_FRAGMENT_SHOWN then  
                                                                self:ActivatePanel()
                                                            elseif newState == SCENE_FRAGMENT_HIDING then  
                                                                self:DeactivateAll()
                                                            end
                                                        end)
end
function ZO_GamepadIgnoreListPanel:GetAddKeybind()
    local keybind  =  {
        name = GetString(SI_GAMEPAD_CONTACTS_ADD_IGNORE_BUTTON_LABEL),
        keybind = "UI_SHORTCUT_SECONDARY",
        callback = function()
            ZO_Dialogs_ShowGamepadDialog("GAMEPAD_SOCIAL_ADD_IGNORE_DIALOG", nil)
        end,
    }
    return keybind
end
function ZO_GamepadIgnoreListPanel:SetupRow(control, data, selected)
   self:ColorRow(control, data, selected)
end
function ZO_GamepadIgnoreListPanel:BuildOptionsList(list)
    if self.socialData then
        self:AddHeader(list, ZO_FormatUserFacingDisplayName(self.socialData.displayName))
    end
end
-----------------
-- Overrides from ZO_PagedList
function ZO_GamepadIgnoreListPanel:BuildMasterList()
    -- The master list lives in the IGNORE_LIST_MANAGER and is built there
end
function ZO_GamepadIgnoreListPanel:FilterList()
  
    self:Clear()
    local searchTerm = self:GetSearchTerm()
    
    local masterList = IGNORE_LIST_MANAGER:GetMasterList()
    for i = 1, #masterList do
        local data = masterList[i]
        if(searchTerm == "" or IGNORE_LIST_MANAGER:IsMatch(searchTerm, data)) then
            self:AddEntry("ZO_GamepadIgnoreListRow", data)
        end
    end    
end