ESO Lua File v100011

ingame/group/searchingforgroup.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
--TODO: Kill this file when new PC LFG is added
local SearchingForGroupManager = ZO_Object:Subclass()
function SearchingForGroupManager:New(control)
    local manager = ZO_Object.New(self)
    manager.control = control
    manager.spinner = GetControl(control, "Spinner")
    manager.searching = IsCurrentlySearchingForGroup()
    manager:Update()
    local function OnSearchUpdate(event, searching)
        if manager.searching ~= searching then
            manager.searching = searching
            manager:Update()
            if searching then
                PlaySound(SOUNDS.LFG_SEARCH_STARTED)
            else
                PlaySound(SOUNDS.LFG_SEARCH_FINISHED)
            end
        end
    end
    control:RegisterForEvent(EVENT_GROUPING_TOOLS_STATUS_UPDATE, OnSearchUpdate)
    return manager
end
function SearchingForGroupManager:Update()
    if self.searching then
        self.spinner:Show()
    else
        self.spinner:Hide()
    end
end
    SEARCHING_FOR_GROUP = SearchingForGroupManager:New(self)
end