email_animation.luac.lua

来自「htc manila 2 sourcecode」· LUA 代码 · 共 110 行

LUA
110
字号
-- Decompiled using luadec 0.7 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;19,21,24,27,44;;;;;;;; 77399225_manila.luac 

trace("load email animation")
TargetFlapState = 1
envelopeanimationtime = 20
FlapCompletionFunction = nil
EnvelopeStartXRotation = 0
EnvelopeStartYRotation = 14
EnvelopeStartZRotation = 8
EnvelopeTargetXRotation = -360
EnvelopeTargetYRotation = 14
EnvelopeTargetZRotation = 8
TargetEnvelopeState = 1
EnvelopeCompletionFunction = nil
EnvelopeFlap.Rotation.x = 170
OnFlapUpdate = function()
   EmailLayoutExtender:OpenEnvelope()
end

OpenEnvelope = function(l_2_0)
   if l_2_0 then
      FirstRun = true
      EnvelopeFlap.Rotation:Interpolate(Vector3(EnvelopeFlap.Rotation.x, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), Vector3(0, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), 0, 0, Interpolate_Linear, OnFlapUpdate)
      return 
   end
   if EmailList:GetGenerator():GetCount() > 0 then
      EnvelopeFlap.Rotation:Interpolate(Vector3(EnvelopeFlap.Rotation.x, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), Vector3(0, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), envelopeanimationtime / 5, 0, Interpolate_Linear, OnFlapUpdate)
   end
end

CloseEnvelope = function()
   EmailLayoutExtender:CloseEnvelope()
   EnvelopeFlap.Rotation:Interpolate(Vector3(EnvelopeFlap.Rotation.x, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), Vector3(170, EnvelopeFlap.Rotation.y, EnvelopeFlap.Rotation.z), envelopeanimationtime / 5, 0, Interpolate_Linear, nil)
   SpinEnvelope()
   EmailListGroup.Position:Interpolate(Vector3(EmailListGroup.Position.x, EmailListGroup.Position.y, EmailListGroup.Position.z), 0, envelopeanimationtime / 1.5, Interpolate_Linear, HandleAccountNameUpdate)
end

HandleEnvelopeUpdate = function()
   trace("ENVELOPE UPDATE")
end

HandleAccountNameUpdate = function()
   trace("~~~~~HandleAccountNameUpdate")
   if AccountGenerator and AccountGenerator.SelectedIndex >= 0 then
      if EmailGenerator == nil then
         return 
      end
      local l_5_0 = AccountGenerator:GetData(AccountGenerator.SelectedIndex)
      local l_5_1 = l_5_0:GetAccountName()
      local l_5_2 = EmailGenerator:GetCount()
      local l_5_3 = EmailGenerator.SelectedIndex + 1
      if l_5_1 == "ActiveSync" then
         l_5_1 = "Outlook"
      end
      MailCount.Size.width = 480
      MailCount.String = l_5_3 .. "/" .. l_5_2
      local l_5_4 = TextHelper_GetStringWidth(MailCount, MailCount.String)
      MailCount.Size.width = l_5_4
      local l_5_5 = 360 - l_5_4 - 8      
      trace("AccountName=" .. l_5_1 .. " Account maxW=" .. l_5_5)
      AccountNameText.Size.width = 480
      local x = TextHelper_GetStringWidth(AccountNameText, l_5_1)
      trace("accountW=" .. x )
      AccountNameText.String = l_5_1
      if l_5_5 < x then
         AccountNameText.Size.width = l_5_5
      else
         AccountNameText.Size.width = x
      end
      MailCount.Position.x = AccountNameText.Position.x + AccountNameText.Size.width + 8
   end
end

SpinEnvelope = function()
   if not FirstRun then
      EmailListGroup.Rotation:Interpolate(Vector3(EnvelopeStartXRotation, EnvelopeStartYRotation, EnvelopeStartZRotation), Vector3(EnvelopeTargetXRotation, EnvelopeTargetYRotation, EnvelopeTargetZRotation), 0, 0, Interpolate_Linear, OpenEnvelope)
   else
      EmailListGroup.Rotation:Interpolate(Vector3(EnvelopeStartXRotation, EnvelopeStartYRotation, EnvelopeStartZRotation), Vector3(EnvelopeTargetXRotation, EnvelopeTargetYRotation, EnvelopeTargetZRotation), envelopeanimationtime, 0, Interpolate_Linear, OpenEnvelope)
   end
end

FadeOutEnvelope = function()
   EmailListGroup.Opacity:Interpolate(0, 10, 0, Interpolate_Linear)
end

FadeInEnvelope = function()
   EmailListGroup.Opacity:Interpolate(100, 20, 0, Interpolate_Linear)
   EmailListGroup._visible = true
   EmailListGroup:Focus()
end

FadeOutNoAccounts = function()
   NoAccounts.Opacity:Interpolate(0, 10, 0, Interpolate_Linear)
end

FadeInNoAccounts = function()
   NoAccounts.Opacity:Interpolate(100, 20, 0, Interpolate_Linear)
end

FadeOutNoMessages = function()
   NoMessages.Opacity:Interpolate(0, 10, 0, Interpolate_Linear)
end

FadeInNoMessages = function()
   NoMessages.Opacity:Interpolate(100, 20, 0, Interpolate_Linear)
end


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?