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

📄 slidercontrol.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,0,4;0,0,0,13,17,21,28,31,37,48,61,68;0;; 3a19a69e_manila.luac 

trace("Loaded Slider Control Script\n")
local l_0_0 = 5
local l_0_1 = 5
local l_0_2 = 300
SliderControl_ButtonHitTest = function(l_1_0, l_1_1)
   local l_1_2 = l_1_0.Namespace:FindName("Button")
   return l_1_2.Position.x < l_1_1 and l_1_1 < l_1_2.Position.x + l_1_2.Size.width
end

SliderControl_GetValueForXPos = function(l_2_0, l_2_1)
   local l_2_2 = 0
   local l_2_3 = l_2_0.Namespace:FindName("Button")
   local l_2_4 = l_2_0.Namespace:FindName("SliderOffBar")
   local l_2_5 = l_2_4.Position.x + l_2_4.Size.width
   local l_2_6 = l_2_5 - l_2_3.Size.width / 2
   local l_2_7 = l_2_3.Size.width / 2   
   if l_2_1 < l_2_7 then
      l_2_2 = 0
   elseif l_2_6 < l_2_1 then
      l_2_2 = 100
   else
      l_2_2 = (l_2_1 - l_2_7) / (l_2_6 - l_2_7) * 100
   end
   return l_2_2
end

SliderControl_SetValue = function(l_3_0, l_3_1, l_3_2)
   if l_3_1 < 0 then
      l_3_1 = 0
   elseif l_3_1 > 100 then
      l_3_1 = 100
   end
   l_3_0.Tag.Value = l_3_1
   local l_3_3 = l_3_0.Namespace:FindName("Button")
   local l_3_4 = l_3_0.Namespace:FindName("SliderOnBar")
   local l_3_5 = l_3_0.Namespace:FindName("SliderOffBar")
   local l_3_6 = l_3_1 - SliderControl_GetValueForXPos(l_3_0, l_3_3.Size.width / 2)
   local l_3_7 = l_3_6 / 100 * l_0_2
   local l_3_8 = Vector3(l_3_7, l_3_3.Position.y, 0)
   local l_3_9 = Vector3((l_3_7 + l_3_3.Size.width / 2) / l_3_5.Size.width, 1, 1)
   local l_3_10 = RectF(l_3_4.TextureCoords.x, l_3_4.TextureCoords.y, l_3_5.Size.width * l_3_9.x / 512, l_3_4.TextureCoords.height)
   if l_3_2 then
      local l_3_11 = (l_3_7 - l_3_3.Position.x) / l_0_1
      if l_3_11 < 0 then
         l_3_11 = -l_3_11
      end
      l_3_3.Position:Interpolate(l_3_8, l_3_11, 0, Interpolate_Linear)
      l_3_4.Scale:Interpolate(l_3_9, l_3_11, 0, Interpolate_Linear)
      l_3_4.TextureCoords:Interpolate(l_3_10, l_3_11, 0, Interpolate_Linear)
   else
      l_3_3.Position.x = l_3_8.x
      l_3_4.Scale.x = l_3_9.x
      l_3_4.TextureCoords:set(l_3_10.x, l_3_10.y, l_3_10.width, l_3_10.height)
   end
end

SliderControl_Initialize = function(l_4_0, l_4_1)
   l_4_0.Tag = {}
   SliderControl_SetValue(l_4_0, l_4_1, false)
end

⌨️ 快捷键说明

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