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

📄 stock_chart.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;0,7;0,4,8;;0,12;;0,0,0,0,0,0,2;0,0,0,0,0,0,2;;;;0,0,16;12;0,7;0,7;0,13;;0,0,0,10;8; 2b24430f_manila.luac 

trace("Load infornewslistview.lua")
require("class")
require("theme")
require("themecommon")
require("common")
HandleChartListItemSelection = function(l_1_0)
   trace("Album~~~HandleChartListItemSelection~~~~")
   local l_1_1 = l_1_0.Namespace:FindName("ChartGroup")
   l_1_1.Position:Interpolate(Vector3(l_1_1.Position.x, 331, l_1_1.Position.z), 10, 0, Interpolate_EaseOutQuad, nil)
   l_1_1.Opacity:Interpolate(100, 10, 0, Interpolate_EaseInQuad, nil)
   if OnSelectFunction ~= nil then
      l_1_1._visible = true
      OnSelectFunction(l_1_0)
   else
      l_1_1._visible = false
      trace("Album~~~OnShowChart is nil~~~~")
   end
end

HandleChartListItemDeselection = function(l_2_0)
   local l_2_1 = l_2_0.Namespace:FindName("ChartGroup")
   local l_2_2 = l_2_0.Namespace:FindName("Symbol")
   trace("Album~~~HandleChartListItemDeselection~~~" .. l_2_2.String)
   l_2_1.Position:Interpolate(Vector3(l_2_1.Position.x, 0, l_2_1.Position.z), 10, 0, Interpolate_EaseInQuad, nil)
   l_2_1.Opacity:Interpolate(0, 10, 0, Interpolate_EaseOutQuad, nil)
   if OnDeselectedFunction ~= nil then
      OnDeselectedFunction()
   end
end

OnAlbumItemCreated = function(l_3_0, l_3_1)
   l_3_1.Focusable = true
   l_3_1.OnSelected:connect(HandleChartListItemSelection)
   l_3_1.OnDeselected:connect(HandleChartListItemDeselection)
   local l_3_2 = l_3_1.Namespace:FindName("Symbol")
   l_3_2.String = l_3_0.Symbol
   l_3_2 = l_3_1.Namespace:FindName("Name")
   l_3_2.String = l_3_0.Name
   l_3_2 = l_3_1.Namespace:FindName("Price")
   l_3_2.String = l_3_0.Price
   if tonumber(l_3_0.Change) ~= nil then
      trace("change = " .. l_3_0.Change)
      if tonumber(l_3_0.Change) >= 0 then
         l_3_2 = l_3_1.Namespace:FindName("Updownsymbolright")        
         l_3_2._visible = true
         if RedIsUP then
            l_3_2:SetTextureRef("red_arrow")
         else
            l_3_2:SetTextureRef("green_arrow")
         end
         l_3_2.Rotation.z = 0
         l_3_2 = l_3_1.Namespace:FindName("UpdownsymbolLeft")
         l_3_2._visible = true
         if RedIsUP then
            l_3_2:SetTextureRef("red")
         else
            l_3_2:SetTextureRef("green")
         end
         l_3_2 = l_3_1.Namespace:FindName("Change")
         l_3_2._visible = true
         l_3_2.String = string.gsub(l_3_0.Change, "+", "")
         if RedIsUP then
            l_3_2.Color = Color(190, 0, 0, 255)
         else
            l_3_2.Color = Color(0, 150, 0, 255)
         end
      else
         l_3_2 = l_3_1.Namespace:FindName("Updownsymbolright")
         l_3_2._visible = true
         if RedIsUP then
            l_3_2:SetTextureRef("green_arrow")
         else
            l_3_2:SetTextureRef("red_arrow")
         end
         l_3_2.Rotation.z = 180
         l_3_2 = l_3_1.Namespace:FindName("UpdownsymbolLeft")
         l_3_2._visible = true
         if RedIsUP then
            l_3_2:SetTextureRef("green")
         else
            l_3_2:SetTextureRef("red")
         end
         l_3_2 = l_3_1.Namespace:FindName("Change")
         l_3_2._visible = true
         l_3_2.String = string.gsub(l_3_0.Change, "-", "")
         if RedIsUP then
            l_3_2.Color = Color(0, 150, 0, 255)
         else
            l_3_2.Color = Color(190, 0, 0, 255)
         end
      end
  else
     l_3_2 = l_3_1.Namespace:FindName("Updownsymbolright")
     l_3_2._visible = false
     l_3_2 = l_3_1.Namespace:FindName("UpdownsymbolLeft")
     l_3_2._visible = true
     if RedIsUP then
        l_3_2:SetTextureRef("red")
     else
        l_3_2:SetTextureRef("green")
     end
     l_3_2 = l_3_1.Namespace:FindName("Change")
     l_3_2._visible = false
  end
end

OnAlbumItemDestroyed = function(l_4_0)
   l_4_0.OnSelected:disconnect(HandleChartListItemSelection)
   l_4_0.OnDeselected:disconnect(HandleChartListItemDeselection)
   local l_4_1 = l_4_0.Namespace:FindName("ChartGroup")
   l_4_1._visible = false
   l_4_1.Position.y = 0
end

AlbumLayout = class()
AlbumLayout.__init = function(l_5_0, l_5_1)
   l_5_0.Base = l_5_1
   l_5_1.ExtendGetRealizedViewport:connect(AlbumLayout.GetRealizedViewport, l_5_0)
   l_5_1.ExtendGetPositionAtPoint:connect(AlbumLayout.GetPositionAtPoint, l_5_0)
   l_5_1.ExtendGetOpacityAtPoint:connect(AlbumLayout.GetOpacityAtPoint, l_5_0)
   l_5_1.UsePositionPath = true
   l_5_1.UseOpacityPath = true
   l_5_1.UseRotationPath = true
   l_5_1.UseScalePath = true
   l_5_1.SmoothPosition = true
   l_5_1.SmoothOpacity = true
   l_5_1.SmoothRotation = true
   l_5_1.SmoothScale = true
   l_5_1.PositionSmoothFactor = 5
   l_5_1.OpacitySmoothFactor = 3
   l_5_1.RotationSmoothFactor = 5
   l_5_1.ScaleSmoothFactor = 5
end

AlbumLayout.GetPositionAtPoint = function(l_6_0, l_6_1, l_6_2, l_6_3, l_6_4, l_6_5)
   local l_6_6 = AlbumGenerator.SelectedIndex
   if l_6_6 <= l_6_1 and l_6_1 <= l_6_6 + 3 then
      l_6_4.value.x = l_6_3.y * -10
      l_6_4.value.y = l_6_3.y * 10
      l_6_4.value.z = 0
   else
      l_6_4.value.x = 0
      l_6_4.value.y = 0
      l_6_4.value.z = 0
   end
   l_6_5.value = true
end

AlbumLayout.GetOpacityAtPoint = function(l_7_0, l_7_1, l_7_2, l_7_3, l_7_4, l_7_5)
   local l_7_6 = AlbumGenerator.SelectedIndex
   if l_7_6 <= l_7_1 and l_7_1 <= l_7_6 + 3 then
      l_7_4.value = 100
   else
      l_7_4.value = 0
   end
   l_7_5.value = true
end

AlbumLayout.GetRotationAtPoint = function(l_8_0, l_8_1, l_8_2, l_8_3, l_8_4, l_8_5)
   l_8_5.value = true
end

AlbumLayout.GetRealizedViewport = function(l_9_0, l_9_1, l_9_2, l_9_3)
   l_9_1.value.x = l_9_1.value.x - 512
   l_9_1.value.y = l_9_1.value.y - 512
   l_9_1.value.z = l_9_1.value.z - 512
   l_9_2.value.z = l_9_2.value.z + 1000
   l_9_2.value.x = l_9_2.value.x + 1000
   l_9_2.value.y = l_9_2.value.y + 1000
   l_9_3.value = true
end

AlbumLayout.OnItemArranged = function(l_10_0, l_10_1, l_10_2, l_10_3, l_10_4)
end

HandleSelectedIndexChanged = function(l_11_0, l_11_1)
   trace("[stock][chart list] HandleSelectedIndexChanged()  oldindex=" .. l_11_0 .. " newIndex=" .. l_11_1)
   if StockChartListView:HasGenerator() then
      local l_11_2 = StockChartListView:GetGenerator().SelectedIndex
      if l_11_2 >= 0 then
         trace("Album JumpToIndex~~~")
         StockChartListView:GetLayout():JumpToIndex(l_11_2, ListAlignment_Top, ListAlignmentOptions_Snap)
      end
   end
end

OnAlbumHandleItemsReplaced = function()
   trace("[stock][chart list] OnAlbumHandleItemsReplaced()")
   if StockChartListView:HasGenerator() then
      local l_12_0 = StockChartListView:GetGenerator().SelectedIndex
      if l_12_0 >= 0 then
         trace("[stock][chart list] JumpToIndex")
         StockChartListView:GetLayout():JumpToIndex(l_12_0, ListAlignment_Top, ListAlignmentOptions_Snap)
      end
   end
end

HandleChartListHeadItemSelection = function(l_13_0)
   trace("[stock][chart list] HandleChartListHeadItemSelection()")
   local l_13_1 = l_13_0.Namespace:FindName("AddIcon")
   if l_13_1 ~= nil then
      l_13_1.Position:Interpolate(Vector3(l_13_1.Position.x, 331, l_13_1.Position.z), 10, 0, Interpolate_EaseOutQuad, nil)
      l_13_1.Opacity:Interpolate(100, 10, 0, Interpolate_EaseInQuad, nil)
   end
end

HandleChartListHeadItemDeselection = function(l_14_0)
   trace("[stock][chart list] HandleChartListHeadItemDeselection()")
   local l_14_1 = l_14_0.Namespace:FindName("AddIcon")
   if l_14_1 ~= nil then
      l_14_1.Position:Interpolate(Vector3(l_14_1.Position.x, 0, l_14_1.Position.z), 10, 0, Interpolate_EaseInQuad, nil)
      l_14_1.Opacity:Interpolate(0, 10, 0, Interpolate_EaseOutQuad, nil)
   end
end

HandleHeadItemCreated = function(l_15_0)
   l_15_0.Focusable = true
   l_15_0.OnSelected:connect(HandleChartListHeadItemSelection)
   l_15_0.OnDeselected:connect(HandleChartListHeadItemDeselection)
   local l_15_1 = l_15_0.Namespace:FindName("updown")
   if RedIsUP then
      l_15_1:SetTextureRef("red")
   else
      l_15_1:SetTextureRef("green")
   end
end

HandleHeadItemDestroyed = function(l_16_0)
   l_16_0.OnSelected:disconnect(HandleChartListHeadItemSelection)
   l_16_0.OnDeselected:disconnect(HandleChartListHeadItemDeselection)
end

BuildChartListview = function(l_17_0, l_17_1, l_17_2)
   if l_17_1 ~= nil then
      OnSelectFunction = l_17_1
   end
   if l_17_2 ~= nil then
      OnDeselectedFunction = l_17_2
   end
   local l_17_3 = AlbumLayout(PathLayout())
   l_17_3.Base:SetItemSize(256, 256, 0)
   StockChartListView:SetLayout(l_17_3.Base)
   StockChartListView.AllowScrollToEnd = true
   AlbumGenerator = LibraryGeneratorStock(l_17_0, StockChartListView:GetMovie(), StockChartListView.ComponentLibraryName, StockChartListView.ComponentLibraryID)
   AlbumGenerator.ForceImmediateCleanup = true
   AlbumGenerator.ItemCreated:connect(OnAlbumItemCreated)
   AlbumGenerator.ItemDestroyed:connect(OnAlbumItemDestroyed)
   AlbumGenerator.ItemsReplaced:connect(OnAlbumHandleItemsReplaced)
   AlbumGenerator.SelectedIndexChanged:connect(HandleSelectedIndexChanged)
   AlbumGenerator.RecycleItems = true
   if AlbumGenerator:GetCount() > 0 then
      AlbumGenerator.SelectedIndex = 0
   end
   if AlbumGenerator.Collection:GetCount() < 21 then
      AlbumGenerator.HeadItemCreated:connect(HandleHeadItemCreated)
      AlbumGenerator.HeadItemDestroyed:connect(HandleHeadItemDestroyed)
      AlbumGenerator:SetHeadItemComponent(StockChartListView:GetMovie(), StockChartListView.ComponentLibraryName, 48)
   end
   StockChartListView:SetGenerator(AlbumGenerator)
end

DisconnectAlbumGeneratorEvents = function()
   if StockChartListView:HasGenerator() then
      local l_18_0 = StockChartListView:GetGenerator()
      l_18_0.ItemCreated:disconnect(OnAlbumItemCreated)
      l_18_0.SelectedIndexChanged:disconnect(HandleSelectedIndexChanged)
      l_18_0.ItemDestroyed:connect(OnAlbumItemDestroyed)
      l_18_0.ItemsReplaced:connect(OnAlbumHandleItemsReplaced)
   end
end

trace("Loaded infornewslistview.lua")

⌨️ 快捷键说明

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