Back to Home

ESO Lua File v101042

common/scenes/commonfragments.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
----------------------------------------
--Gamepad Menu Sound Fragment
----------------------------------------
ZO_GamepadMenuSoundFragment = ZO_SceneFragment:Subclass()
function ZO_GamepadMenuSoundFragment:New()
    local fragment = ZO_SceneFragment.New(self)
    fragment:SetForceRefresh(true)
    return fragment
end
local OPEN_SOUND_SCENES = {
    ["hudui"] = true,
    ["hud"] = true,
    ["gamepadInteract"] = true,
}
function ZO_GamepadMenuSoundFragment:Show()
    local previousSceneName = SCENE_MANAGER:GetPreviousSceneName()
    
    if OPEN_SOUND_SCENES[previousSceneName] then
        PlaySound(SOUNDS.GAMEPAD_OPEN_WINDOW)
    elseif SCENE_MANAGER:IsSceneOnStack(previousSceneName) then
        PlaySound(SOUNDS.GAMEPAD_MENU_FORWARD)
    end
    self:OnShown()
end
function ZO_GamepadMenuSoundFragment:Hide()
    local currentSceneName = SCENE_MANAGER:GetCurrentSceneName()
    if SCENE_MANAGER:IsShowingBaseSceneNext() then
        PlaySound(SOUNDS.GAMEPAD_CLOSE_WINDOW)
    elseif not SCENE_MANAGER:IsSceneOnStack(currentSceneName) then
        PlaySound(SOUNDS.GAMEPAD_MENU_BACK)
    end
    self:OnHidden()
end
GAMEPAD_MENU_SOUND_FRAGMENT = ZO_GamepadMenuSoundFragment:New()
--Gamepad fragments
function ZO_CreateQuadrantConveyorFragment(control, alwaysAnimate)
   return ZO_ConveyorSceneFragment:New(control, alwaysAnimate)
end