ESO Lua File v100011

ingame/group/gamepad/zo_groupheader_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
local ZO_GroupHeaderManager_Gamepad = ZO_Object.MultiSubclass(GroupMembersManager_Shared, ZO_GroupingToolsQueueStatusManager_Shared)
function ZO_GroupHeaderManager_Gamepad:New(control)
    local manager = ZO_Object.New(self)
    manager:Initialize(control)
    return manager
end
function ZO_GroupHeaderManager_Gamepad:Initialize(control)
    ZO_GroupingToolsQueueStatusManager_Shared.Initialize(self, control)
    
    GAMEPAD_GROUP_HEADER_DATA_FRAGMENT = ZO_FadeSceneFragment:New(ZO_GroupHeader_Gamepad)
    GAMEPAD_GROUP_HEADER_DATA_FRAGMENT:RegisterCallback("StateChange",
        function(oldState, newState)
             if newState == SCENE_FRAGMENT_SHOWING then
                self:Refresh(IsCurrentlySearchingForGroup())
             end
        end
    )
end
function ZO_GroupHeaderManager_Gamepad:InitializeHeader(control)
    self.headerData = {
        titleText = GetString(SI_MAIN_MENU_GROUP),
        data1HeaderText = GetString(SI_LFG_QUEUE_STATUS),
        data2HeaderText = GetString(SI_GAMEPAD_GROUP_LIST_PANEL_GROUP_MEMBERS_LABEL),
    }
end
function ZO_GroupHeaderManager_Gamepad:Refresh(isSearching)
    if not self:IsShowing() then return end
    local icon = self.control:GetNamedChild("Icon")
    icon:SetHidden(not isSearching)
    self.headerData.data1Text = isSearching and GetString(SI_LFG_QUEUE_STATUS_QUEUED) or GetString(SI_LFG_QUEUE_STATUS_NOT_QUEUED)
    CALLBACK_MANAGER:FireCallbacks("OnGroupStatusChange")
end
function ZO_GroupHeaderManager_Gamepad:IsShowing()
    return GAMEPAD_GROUP_HEADER_DATA_FRAGMENT:IsShowing()
end
function ZO_GroupHeaderManager_Gamepad:Update(groupSize)
    local maxGroupSize = (groupSize > SMALL_GROUP_SIZE_THRESHOLD) and GROUP_SIZE_MAX or SMALL_GROUP_SIZE_THRESHOLD
    self.headerData.data2Text = zo_strformat(SI_GROUP_LIST_PANEL_GROUP_MEMBERS_COUNT, groupSize, maxGroupSize)
    CALLBACK_MANAGER:FireCallbacks("OnGroupStatusChange")
end
    GAMEPAD_GROUP_HEADER_DATA = ZO_GroupHeaderManager_Gamepad:New(self)
end