⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 digitalclock.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
📖 第 1 页 / 共 2 页
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 12;;;;;;;;;;;0,0,0,64,65;;0,1;0,0,0,0,0,31,32,33;;;;;;; 2a0ac464_manila.luac 

trace("Loaded digital clock\n")
TabHalf = {Tab = nil, HighDigit = nil, LowDigit = nil}
TabHalf.new = function(l_1_0, l_1_1)
   if not l_1_1 then
      l_1_1 = {}
   end
   setmetatable(l_1_1, l_1_0)
   l_1_0.__index = l_1_0
   return l_1_1
end

TabFlip = {
  Time = 0,
  TimeDifference = 0,
  ShowingTime = 0,
  WrapAroundNumber = 0,
  StartValue = 0,
  ShouldHideLeadingZeros = true,
  TopTab = nil,
  TopTabFlip = nil,
  BottomTab = nil,
  BottomTabFlip = nil,
  LastDuration = -1,
  UseAltTiming = false,
  getDuration = function(l_2_0)
    if l_2_0.UseAltTiming then
      if l_2_0.LastDuration < 0 then
        if l_2_0.TimeDifference <= 1 then
          l_2_0.LastDuration = 10
        elseif l_2_0.TimeDifference <= 2 then
          l_2_0.LastDuration = 8
        elseif l_2_0.TimeDifference <= 3 then
          l_2_0.LastDuration = 6
        else
          l_2_0.LastDuration = 4
        end
      end
    elseif l_2_0.LastDuration < 0 then
      if l_2_0.TimeDifference < 1 then
        l_2_0.LastDuration = 20
      elseif l_2_0.TimeDifference < 2 then
        l_2_0.LastDuration = 15
      elseif l_2_0.TimeDifference < 5 then
        l_2_0.LastDuration = 10
      elseif l_2_0.TimeDifference < 10 then
        l_2_0.LastDuration = 3
      elseif l_2_0.TimeDifference < 30 then
        l_2_0.LastDuration = 2
      else
        l_2_0.LastDuration = 1
      end
    end
    return l_2_0.LastDuration
  end,

  ApplyDigitToTexture = function(l_3_0, l_3_1, l_3_2)
    if l_3_0 == 0 then
        l_3_1:SetTextureRef("012")
        if l_3_2 then
          l_3_1.TextureCoords:set(0, 0, 0.3125, 0.3515625)
        else
          l_3_1.TextureCoords:set(0, 0.35546875, 0.3125, 0.703125)
        end
    elseif l_3_0 == 1 then
        l_3_1:SetTextureRef("012")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.31640625, 0, 0.625, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.31640625, 0.35546875, 0.625, 0.703125)
        end
    elseif l_3_0 == 2 then
        l_3_1:SetTextureRef("012")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.62890625, 0, 0.9375, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.62890625, 0.35546875, 0.9375, 0.703125)
        end
    elseif l_3_0 == 3 then
        l_3_1:SetTextureRef("345")
        if l_3_2 then
          l_3_1.TextureCoords:set(0, 0, 0.3125, 0.3515625)
        else
          l_3_1.TextureCoords:set(0, 0.35546875, 0.3125, 0.703125)
        end
    elseif l_3_0 == 4 then
        l_3_1:SetTextureRef("345")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.31640625, 0, 0.625, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.31640625, 0.35546875, 0.625, 0.703125)
        end
    elseif l_3_0 == 5 then
        l_3_1:SetTextureRef("345")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.62890625, 0, 0.9375, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.62890625, 0.35546875, 0.9375, 0.703125)
        end
    elseif l_3_0 == 6 then
        l_3_1:SetTextureRef("678")
        if l_3_2 then
          l_3_1.TextureCoords:set(0, 0, 0.3125, 0.3515625)
        else
          l_3_1.TextureCoords:set(0, 0.35546875, 0.3125, 0.703125)
        end
    elseif l_3_0 == 7 then
        l_3_1:SetTextureRef("678")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.31640625, 0, 0.625, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.31640625, 0.35546875, 0.625, 0.703125)
        end
    elseif l_3_0 == 8 then
        l_3_1:SetTextureRef("678")
        if l_3_2 then
          l_3_1.TextureCoords:set(0.62890625, 0, 0.9375, 0.3515625)
        else
          l_3_1.TextureCoords:set(0.62890625, 0.35546875, 0.9375, 0.703125)
        end
    else
        l_3_1:SetTextureRef("9")
        if l_3_2 then
          l_3_1.TextureCoords:set(0, 0, 0.3125, 0.3515625)
        else
          l_3_1.TextureCoords:set(0, 0.35546875, 0.3125, 0.703125)
        end
    end
  end,

  UpdateTimeAndTextures = function(l_4_0, l_4_1)
    l_4_0.NextTime = l_4_0.ShowingTime + 1
    if l_4_0.NextTime > l_4_0.WrapAroundNumber then
        l_4_0.NextTime = l_4_0.StartValue
    end
    l_4_0:UpdateTextures(l_4_1, l_4_0.NextTime)
  end,

  UpdateTextures = function(l_5_0, l_5_1, l_5_2)
    l_5_0.iHighDigit = 0
    l_5_0.iLowDigit = 0
    if DataBindingEnabled then
        l_5_0.iHighDigit = NumberUtilities_GetDigit(l_5_2, 2)
        l_5_0.iLowDigit = NumberUtilities_GetDigit(l_5_2, 1)
    else
        for i = 0, 11 do
          Power = i * 10
          if l_5_2 < Power then
              l_5_0.iHighDigit = i - 1
              break;
          end
        end
        for i = 0, 10 do
          Number = l_5_0.iHighDigit * 10 + i
          if Number == l_5_2 then
              l_5_0.iLowDigit = i
              break;
          end
        end
    end
    if l_5_1 then
      l_5_0.ApplyDigitToTexture(l_5_0.iHighDigit, l_5_0.TopTab.HighDigit, true)
      l_5_0.ApplyDigitToTexture(l_5_0.iLowDigit, l_5_0.TopTab.LowDigit, true)
    else
      l_5_0.ApplyDigitToTexture(l_5_0.iHighDigit, l_5_0.BottomTabFlip.HighDigit, false)
      l_5_0.ApplyDigitToTexture(l_5_0.iLowDigit, l_5_0.BottomTabFlip.LowDigit, false)
    end
    if l_5_0.ShouldHideLeadingZeros then
        if l_5_2 < 10 then
          if l_5_1 then
              l_5_0.TopTab.HighDigit._visible = false
              l_5_0.TopTab.LowDigit.Position.x = 50
          else
              l_5_0.BottomTabFlip.HighDigit._visible = false
              l_5_0.BottomTabFlip.LowDigit.Position.x = 50
          end
        elseif l_5_1 then
          l_5_0.TopTab.HighDigit._visible = true
          l_5_0.TopTab.LowDigit.Position.x = 90
        else
          l_5_0.BottomTabFlip.HighDigit._visible = true
          l_5_0.BottomTabFlip.LowDigit.Position.x = 90
        end
    end
  end,

  StopAnimationAndSetTime = function(l_6_0, l_6_1)
    l_6_0.TimeDifference = 0
    l_6_0.ShowingTime = l_6_1
    l_6_0.LastDuration = -1
    l_6_0:UpdateTextures(true, l_6_0.ShowingTime)
    l_6_0:UpdateTextures(false, l_6_0.ShowingTime)
    l_6_0.TopTabFlip.Tab.Rotation:ClearInterpolate()
    l_6_0.TopTabFlip.Tab.Rotation.x = 0
    l_6_0.TopTabFlip.Tab._visible = true
    l_6_0.BottomTabFlip.Tab.Rotation:ClearInterpolate()
    l_6_0.BottomTabFlip.Tab.Rotation.x = 0
    l_6_0.BottomTabFlip.Tab._visible = true
    l_6_0.ApplyDigitToTexture(l_6_0.iHighDigit, l_6_0.BottomTab.HighDigit, false)
    l_6_0.ApplyDigitToTexture(l_6_0.iLowDigit, l_6_0.BottomTab.LowDigit, false)
    l_6_0.BottomTab.HighDigit._visible = l_6_0.BottomTabFlip.HighDigit._visible
    l_6_0.BottomTab.LowDigit.Position.x = l_6_0.BottomTabFlip.LowDigit.Position.x
    l_6_0.ApplyDigitToTexture(l_6_0.iHighDigit, l_6_0.TopTabFlip.HighDigit, true)
    l_6_0.ApplyDigitToTexture(l_6_0.iLowDigit, l_6_0.TopTabFlip.LowDigit, true)
    l_6_0.TopTabFlip.HighDigit._visible = l_6_0.TopTab.HighDigit._visible
    l_6_0.TopTabFlip.LowDigit.Position.x = l_6_0.TopTab.LowDigit.Position.x
    AMBottom._visible = AMFlip._visible
    PMBottom._visible = PMFlip._visible
  end,

  StartAnimation = function(l_7_0)
    l_7_0:UpdateTimeAndTextures(true)
    l_7_0.TopTabFlip.Tab.Rotation:Interpolate(Vector3(0, l_7_0.TopTabFlip.Tab.Rotation.y, l_7_0.TopTabFlip.Tab.Rotation.z), Vector3(90, l_7_0.TopTabFlip.Tab.Rotation.y, l_7_0.TopTabFlip.Tab.Rotation.z), l_7_0:getDuration(), 0, Interpolate_EaseInQuad, l_7_0.onTopFlipComplete, l_7_0)
  end,

  onTopFlipComplete = function(l_8_0)
    l_8_0:UpdateTimeAndTextures(false)
    l_8_0.LastDuration = -1
    l_8_0.BottomTabFlip.Tab.Rotation:Interpolate(Vector3(-90, l_8_0.BottomTabFlip.Tab.Rotation.y, l_8_0.BottomTabFlip.Tab.Rotation.z), Vector3(0, l_8_0.BottomTabFlip.Tab.Rotation.y, l_8_0.BottomTabFlip.Tab.Rotation.z), l_8_0:getDuration(), 0, Interpolate_EaseOutQuad, l_8_0.onBottomFlipComplete, l_8_0)
    l_8_0.TopTabFlip.Tab._visible = false
    l_8_0.BottomTabFlip.Tab._visible = true
  end,

  onBottomFlipComplete = function(l_9_0)
    l_9_0.ShowingTime = l_9_0.NextTime
    if l_9_0.UpdateShowingTime then
        l_9_0.UpdateShowingTime.Function(l_9_0.UpdateShowingTime.Param)
    end
    l_9_0.TimeDifference = l_9_0.TimeDifference - 1
    l_9_0.LastDuration = -1
    l_9_0.ApplyDigitToTexture(l_9_0.iHighDigit, l_9_0.BottomTab.HighDigit, false)
    l_9_0.ApplyDigitToTexture(l_9_0.iLowDigit, l_9_0.BottomTab.LowDigit, false)
    l_9_0.BottomTab.HighDigit._visible = l_9_0.BottomTabFlip.HighDigit._visible
    l_9_0.BottomTab.LowDigit.Position.x = l_9_0.BottomTabFlip.LowDigit.Position.x
    l_9_0.ApplyDigitToTexture(l_9_0.iHighDigit, l_9_0.TopTabFlip.HighDigit, true)
    l_9_0.ApplyDigitToTexture(l_9_0.iLowDigit, l_9_0.TopTabFlip.LowDigit, true)
    l_9_0.TopTabFlip.HighDigit._visible = l_9_0.TopTab.HighDigit._visible
    l_9_0.TopTabFlip.LowDigit.Position.x = l_9_0.TopTab.LowDigit.Position.x
    l_9_0.TopTabFlip.Tab.Rotation.x = 0
    l_9_0.TopTabFlip.Tab._visible = true
    AMBottom._visible = AMFlip._visible
    PMBottom._visible = PMFlip._visible
    if l_9_0.TimeDifference > 0 then
        if l_9_0:getDuration() > 1 then
          l_9_0.TopTabFlip.Tab.Rotation:Interpolate(Vector3(0, l_9_0.TopTabFlip.Tab.Rotation.y, l_9_0.TopTabFlip.Tab.Rotation.z), 1, 0, Interpolate_Linear, l_9_0.StartAnimation, l_9_0)
        else
          l_9_0:UpdateTimeAndTextures(true)
          l_9_0.TopTabFlip.Tab.Rotation:Interpolate(Vector3(0, l_9_0.TopTabFlip.Tab.Rotation.y, l_9_0.TopTabFlip.Tab.Rotation.z), Vector3(90, l_9_0.TopTabFlip.Tab.Rotation.y, l_9_0.TopTabFlip.Tab.Rotation.z), l_9_0:getDuration(), 0, Interpolate_EaseInQuad, l_9_0.onTopFlipComplete, l_9_0)
        end
    elseif l_9_0.AnimationComplete and l_9_0.AnimationComplete.Function(l_9_0.AnimationComplete.Param) then
        l_9_0.AnimationComplete = nil
    end
  end}

TabFlip.new = function(l_10_0, l_10_1)
   if not l_10_1 then
      l_10_1 = {}
   end

⌨️ 快捷键说明

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