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

📄 onoffbuttoncontrol.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 4,5,6;;0,1,9,13,17,21,28,88,101;0;0,0,8,12,16,20,57,70; 201d712f_manila.luac 

trace("Loading OnOffButton Script\n")
local l_0_0 = 18
local l_0_1 = Interpolate_Linear
local l_0_2 = 54
OnOffButton_SetValue = function(l_1_0, l_1_1)
   if l_1_0.Tag.Value ~= l_1_1 then
      OnOffButton_ToggleValue(l_1_0)
   end
end

OnOffButton_ToggleValue = function(l_2_0)
   local l_2_1 = l_2_0.Tag
   l_2_1 = l_2_1.Value
   l_2_1 = not l_2_1
   l_2_0.Tag.Value = l_2_1
   local l_2_2 = l_2_0.Namespace:FindName("OnBar")
   local l_2_3 = l_2_0.Namespace:FindName("OffBar")
   local l_2_4 = l_2_0.Namespace:FindName("OnButton")
   local l_2_5 = l_2_0.Namespace:FindName("OffButton")
   local l_2_6 = Vector3(0, l_2_4.Position.y, l_2_4.Position.z)
   if l_2_1 == true then
      l_2_2._visible = true
      l_2_6.x = l_0_2
      l_2_4.Opacity:Interpolate(100, l_0_0, 0, l_0_1)
      l_2_5.Opacity:Interpolate(0, l_0_0, 0, l_0_1)
   else
      l_2_4.Opacity:Interpolate(0, l_0_0, 0, l_0_1)
      l_2_5.Opacity:Interpolate(100, l_0_0, 0, l_0_1)
   end
   l_2_4.Position:Interpolate(l_2_6, l_0_0, 0, l_0_1)
   l_2_5.Position:Interpolate(l_2_6, l_0_0, 0, l_0_1)
   local l_2_7 = Vector3((l_2_6.x + l_2_5.Size.width / 2) / l_2_3.Size.width, 1, 1)
   local l_2_8 = RectF(l_2_2.TextureCoords.x, l_2_2.TextureCoords.y, l_2_3.Size.width * l_2_7.x / 128, l_2_2.TextureCoords.height)
   l_2_2.Scale:Interpolate(l_2_7, l_0_0, 0, l_0_1, OnOffButton_AnimateDone, l_2_0)
   l_2_2.TextureCoords:Interpolate(l_2_8, l_0_0, 0, l_0_1)
end

OnOffButton_AnimateDone = function(l_3_0)
   if not l_3_0.Tag.Value then
      l_3_0.Namespace:FindName("OnBar")._visible = false
   end
end

OnOffButton_Initialize = function(l_4_0, l_4_1)
   l_4_0.Tag = {}
   l_4_0.Tag.Value = l_4_1
   local l_4_2 = l_4_0.Namespace:FindName("OnBar")
   local l_4_3 = l_4_0.Namespace:FindName("OffBar")
   local l_4_4 = l_4_0.Namespace:FindName("OnButton")
   local l_4_5 = l_4_0.Namespace:FindName("OffButton")
   if l_4_0.Tag.Value then
      l_4_4.Position.x = l_0_2
      l_4_4.Opacity.value = 100
      l_4_5.Opacity.value = 0
      l_4_2._visible = true
   else
      l_4_4.Position.x = 0
      l_4_4.Opacity.value = 0
      l_4_5.Opacity.value = 100
      l_4_2._visible = false
   end
   l_4_5.Position.x = l_4_4.Position.x
   local l_4_6 = Vector3((l_4_5.Position.x + l_4_5.Size.width / 2) / l_4_3.Size.width, 1, 1)
   local l_4_7 = RectF(l_4_2.TextureCoords.x, l_4_2.TextureCoords.y, l_4_3.Size.width * l_4_6.x / 128, l_4_2.TextureCoords.height)
   l_4_2.Scale.x = l_4_6.x
   l_4_2.TextureCoords:set(l_4_7.x, l_4_7.y, l_4_7.width, l_4_7.height)
end


⌨️ 快捷键说明

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