Back to Home

ESO Lua File v101036

common/gamepad/zo_gamepadloading.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
ZO_GAMEPAD_LOADING_ICON_DEFAULT_SIZE = 90
ZO_GAMEPAD_LOADING_ICON_FOOTER_SIZE = 64
-- Loading Icon
local TARGET_FRAMERATE = 60
local MAX_FRAMES_PER_UPDATE = 5
local MAX_ROTATION = ZO_TWO_PI
local ROTATION_PER_FRAME = -MAX_ROTATION * 0.01
    self.animation = self:GetNamedChild("Animation")
    self.currentRotation = 0
    self.lastAnimationUpdate = 0
end
    local now = GetFrameTimeMilliseconds()
    local delta = now - self.lastAnimationUpdate
    
    local numFramesToIncrease = delta / TARGET_FRAMERATE
    if numFramesToIncrease == 0 then
        return
    elseif numFramesToIncrease > MAX_FRAMES_PER_UPDATE then
        numFramesToIncrease = MAX_FRAMES_PER_UPDATE
    end
    self.lastAnimationUpdate = now
    self.currentRotation = (self.currentRotation + numFramesToIncrease * ROTATION_PER_FRAME) % MAX_ROTATION
    self.animation:SetTextureRotation(self.currentRotation)
end