Back to Home

ESO Lua File v100036

pregame/gamecredits/keyboard/gamecredits_keyboard.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
local CreditsScreen_Keyboard = CreditsScreen_Base:Subclass()
function CreditsScreen_Keyboard:New(...)
    return CreditsScreen_Base.New(self, ...)
end
function CreditsScreen_Keyboard:Initialize(control)
    CreditsScreen_Base.Initialize(self, control)
    
    GAME_CREDITS_FRAGMENT = ZO_FadeSceneFragment:New(control)
    GAME_CREDITS_FRAGMENT:RegisterCallback("StateChange",   function(oldState, newState)
                                                            if(newState == SCENE_FRAGMENT_SHOWING) then
                                                                ShowCredits()
                                                            elseif(newState == SCENE_FRAGMENT_HIDDEN) then
                                                                self:StopCredits()
                                                            end
                                                        end)
    -- NOTE: Templates must be unique due to how the object pools name controls as they're created.
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_DEPARTMENT_HEADER, "ZO_GameCreditsDepartment", function(textControl, text) return self:SetupTextControl(textControl, text) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_SECTION_HEADER, "ZO_GameCreditsSection", function(textControl, text) return self:SetupTextControl(textControl, text) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_SECTION_TEXT, "ZO_GameCreditsNames", function(textControl, text) return self:SetupTextControl(textControl, text) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_SECTION_TEXT_BLOCK, "ZO_GameCreditsTextBlock", function(textControl, text) return self:SetupTextControl(textControl, text) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_COMPANY_LOGO, "ZO_GameCreditsLogo", function(logoControl, texture, height) return self:SetupLogoControl(logoControl, texture, height) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_BACKGROUND_SWITCH, "ZO_GameCreditsBGSwitch", function(backgroundControl, texture) return self:SetupBackgroundSwitch(backgroundControl, texture) end)
    self:AddPool(GAME_CREDITS_ENTRY_TYPE_PADDING_SECTION, "ZO_GameCreditsPadding", function(paddingControl, unused, height) return self:SetupPaddingSection(paddingControl, unused, height) end)
    EVENT_MANAGER:RegisterForEvent("GameCreditsKeyboard", EVENT_GAME_CREDITS_READY, function() self:BeginCredits() end)
end
function CreditsScreen_Keyboard:SetOnExitCallback(onExitCallback)
end
function CreditsScreen_Keyboard:Exit()
    if self.onExitCallback then
        self.onExitCallback()
    end
end
function CreditsScreen_Keyboard:IsPreferredScreen()
    return not IsInGamepadPreferredMode()
end
    GAME_CREDITS_KEYBOARD = CreditsScreen_Keyboard:New(control)
end
    GAME_CREDITS_KEYBOARD:Exit()
end
    if(upInside) then
        GAME_CREDITS_KEYBOARD:Exit()
    end
end