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

📄 homebackground.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;0;5;0,0,3,20;0;;1,7; 7adfaca3_manila.luac 

require("asyncimageloader")
CachedImagePath = "\\Windows\\HomeBackground.img"
InterpolateOpacity = function(l_1_0, l_1_1)
   l_1_1.Opacity:Interpolate(l_1_0, 20, 0, Interpolate_EaseOutQuad)
end

BackgroundWidth = 480
BackgroundHeight = 696
LoadDefaultBackground = function()
   InterpolateOpacity(0, HomeBackground)
   local l_2_0 = HomeTitleBar
   if l_2_0 ~= nil then
      l_2_0 = HomeTitleBar
      l_2_0 = l_2_0.Opacity
      l_2_0.value = 0
      l_2_0 = _application
      l_2_0 = l_2_0.Navigation
      l_2_0.TabTrayOpacity = 100
   end
end

BackgroundImageLoaded = function(l_3_0, l_3_1)
   if l_3_1 == 1 then
      HomeBackground.TextureCoords.width = l_3_0.TextureCoords.width
      HomeBackground.TextureCoords.height = l_3_0.TextureCoords.height
      local widthp = l_3_0.TextureCoords.width * l_3_0.Image.Width
      local heightp = l_3_0.TextureCoords.height * l_3_0.Image.Height
      local widthsc = widthp / BackgroundWidth
      local heightsc = heightp / BackgroundHeight 
      if widthsc < heightsc then
         HomeBackground.Size.height = heightp / (widthp) * BackgroundWidth
         HomeBackground.Size.width = BackgroundWidth
      else
         HomeBackground.Size.width = widthp / (heightp) * BackgroundHeight
         HomeBackground.Size.height = BackgroundHeight
      end
      HomeBackground.Position.x = (BackgroundWidth - HomeBackground.Size.width) / 2
      HomeBackground.Position.y = -(BackgroundHeight - HomeBackground.Size.height) / 2
      HomeBackground:SetTexture(l_3_0.Image)
      InterpolateOpacity(100, HomeBackground)
      if HomeTitleBar ~= nil then
        local schp = _application.Store:GetIntValue(Lifetime_Application, "ShowCacheHomePage")
        if schp == 1 then
           HomeTitleBar.Opacity.value = 60
           _application.Navigation.TabTrayOpacity = 60
        end
      end
   else
      LoadDefaultBackground()
   end
   collectgarbage("collect")
   BackgroundAsyncImageLoader = nil   
end

BeginLoadBackgroundImage = function(l_4_0)
   if Shell_HaveDRMRightsToFile(machineStatus.HomeBackgroundPath.Value, false) then
      BackgroundAsyncImageLoader = AsyncImageLoader()
      BackgroundAsyncImageLoader.Priority = TaskPriority_Normal
      BackgroundAsyncImageLoader.OnComplete:connect(BackgroundImageLoaded)
      BackgroundAsyncImageLoader:BeginLoadFile(l_4_0, false, true)
   else
      machineStatus.HomeBackgroundPath.Value = ""
      machineStatus.CachedBackgroundPath.Value = ""
      LoadDefaultBackground()
   end
end

BackgroundImageResized = function(l_5_0, l_5_1)
   if l_5_1 == 1 and machineStatus.HomeBackgroundPath.Value ~= "" then
      machineStatus.CachedBackgroundPath.Value = machineStatus.HomeBackgroundPath.Value
      BeginLoadBackgroundImage(CachedImagePath)
   else
      LoadDefaultBackground()
      BackgroundAsyncImageLoader = nil
   end
   collectgarbage("collect")
end

machineStatus_OnCustomBackgroundUpdate = function()
   if _config_os == "windowsmobile" then
      local l_6_0 = machineStatus.HomeBackgroundPath.Value
      local l_6_1 = machineStatus.CachedBackgroundPath.Value
      if l_6_0 ~= l_6_1 then
         if BackgroundAsyncImageFactoryLoader ~= nil and BackgroundAsyncImageFactoryLoader:IsRunning() then
            BackgroundAsyncImageFactoryLoader = nil
            collectgarbage("collect")
         end
         if BackgroundAsyncImageLoader ~= nil and BackgroundAsyncImageLoader:IsRunning() then
            BackgroundAsyncImageLoader = nil
            collectgarbage("collect")
         end
         if l_6_0 == "" then
            machineStatus.CachedBackgroundPath.Value = machineStatus.HomeBackgroundPath.Value
            LoadDefaultBackground()
         else
            BackgroundAsyncImageFactoryLoader = AsyncImageFactoryLoader()
            BackgroundAsyncImageFactoryLoader.Priority = TaskPriority_BelowNormal
            BackgroundAsyncImageFactoryLoader.Quality = 100
            BackgroundAsyncImageFactoryLoader.OnComplete:connect(BackgroundImageResized)
            BackgroundAsyncImageFactoryLoader:ResizeImage(machineStatus.HomeBackgroundPath.Value, CachedImagePath, EncoderType_JPEG, 512, 512, true, false)
         end
      elseif l_6_1 ~= "" then
         BeginLoadBackgroundImage(CachedImagePath)
      else
         LoadDefaultBackground()
      end
   else
      LoadDefaultBackground()
   end
end

if _config_os == "windowsmobile" then
   machineStatus.HomeBackgroundPath.OnValueChanged:connect(machineStatus_OnCustomBackgroundUpdate)
   machineStatus_OnCustomBackgroundUpdate()
end

⌨️ 快捷键说明

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