stock_landscape.luac.lua

来自「htc manila 2 sourcecode」· LUA 代码 · 共 162 行

LUA
162
字号
-- Decompiled using luadec 1.0 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l2 ;;4;1,8;6,7,; 1f782e68_manila.luac 

trace("Load Stock_Landscape.lua begin")
require("stock_svc")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Stock_ScreenRotation = class(RotationTemplate)
Stock_ScreenRotation.__init = function(l_1_0, l_1_1, l_1_2, l_1_3, l_1_4, l_1_5, l_1_6, l_1_7, l_1_8, l_1_9)
   trace("+++++++[Stock_ScreenRotation] : __init")
   l_1_0._Camera2D = l_1_8
   l_1_0._Camera3D = l_1_7
   l_1_0._UpdateComp = l_1_5
   l_1_0._NoStockItemComp = l_1_6
   l_1_0._Mask = l_1_3
   l_1_0._Select = l_1_9
   l_1_0._SListView = l_1_1
   l_1_0._YahooGroup = l_1_4
   l_1_0._Selector = l_1_9
   l_1_0._status = _application.Orientation
   RotationTemplate.__init(l_1_0)
   trace("+++++++[Stock_ScreenRotation] : __init end")
end

Stock_ScreenRotation.OnScreenRotation = function(l_2_0)
   trace("+++++++[Stock_ScreenRotation] : OnScreenRotation")
   local l_2_1 = screenHeight
   l_2_1 = l_2_1 - 2 * SystemTitlebarHeight
   l_2_0._status = _application.Orientation
   if l_2_0._Camera2D then
      l_2_0._Camera2D.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
      l_2_0._Camera2D.ViewLeft.value = 0
      l_2_0._Camera2D.ViewRight.value = screenWidth
      l_2_0._Camera2D.ViewTop.value = 0
      l_2_0._Camera2D.ViewButtom.value = -(screenHeight - 2 * SystemTitlebarHeight)
   else
      trace("[StockSublayer error] : _Camera2D nil")
   end
   if l_2_0._Camera3D then
      l_2_0._Camera3D.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
      l_2_0._Camera3D.ViewLeft.value = 0
      l_2_0._Camera3D.ViewRight.value = screenWidth
      l_2_0._Camera3D.ViewTop.value = 0
      l_2_0._Camera3D.ViewButtom.value = screenHeight - 2 * SystemTitlebarHeight
      l_2_0._Camera3D.CameraPosition.value = Vector3(0, 0, (l_2_1) / 2)
      l_2_0._Camera3D.Position.value = Vector3(-(screenWidth / 2), (l_2_1) / 2, 0)
   else
      trace("[StockSublayer error] : _Camera3D nil")
   end
   l_2_0._Selector.Scale.x = screenWidth / 480
   if _application.Orientation == ScreenOrientation_Portrait then
      trace("+++++++[Stock_ScreenRotation] : ScreenOrientation_Portrait")
      ItemSizeWidth = screenWidth
      ItemSizeHeight = 80
      LVWidth = 480
      LVHeight = 406
      LVPositionX = 0
      LVPositionY = 100
      l_2_0._Mask.Rectangle = RectFProperty(RectF(240, 445, LVWidth, LVHeight))
      TitleUpdateGp.Position.value = Vector3(0, -60, 0)
      UpdateHitArea.Position.x = screenWidth - UpdateHitArea.Size.width
      UpdateHitArea.Position.y = -60
      NoStockItemComponent.Position.y = 0
      NoStockItemComponent.Position.x = 0
      if NoStockItemComponent._visible == false then
         l_2_0._YahooGroup._visible = true
      end
    elseif _application.Orientation == ScreenOrientation_Landscape then
       trace("+++++++[Stock_ScreenRotation] : ScreenOrientation_Landscape")
       ItemSizeWidth = screenWidth
       ItemSizeHeight = 80
       LVWidth = 800
       LVHeight = screenHeight - SystemTitlebarHeight * 2 - 55
       LVPositionX = 0
       LVPositionY = 30
       l_2_0._Mask.Rectangle = RectFProperty(RectF(400, 218, LVWidth, LVHeight))
       TitleUpdateGp.Position.value = Vector3(300, 0, 0)
       UpdateHitArea.Position.x = screenWidth - UpdateHitArea.Size.width
       UpdateHitArea.Position.y = 0
       NoStockItemComponent.Position.y = 100
       NoStockItemComponent.Position.x = 180
       l_2_0._YahooGroup._visible = false
   end
   l_2_0._SListView.Position.x = LVPositionX
   l_2_0._SListView.Position.y = -LVPositionY
   l_2_0._SListView.Viewport.x = LVWidth
   l_2_0._SListView.Viewport.y = LVHeight
   if l_2_0._SListView:HasLayout() then
      local vect = Vector3F()
      vect.x = ItemSizeWidth
      vect.y = ItemSizeHeight
      vect.z = 0
      l_2_0._SListView:GetLayout().ItemSize = vect
   end
   trace("[StockSublayer] : StockListView position(" .. l_2_0._SListView.Position.x .. "," .. l_2_0._SListView.Position.y .. ")")
   stock_type = StockType_MyPortfolio
   if l_2_0._SListView:GetGenerator() ~= nil then
      l_2_0:ResetListViewContent(_application.Orientation)
   end
   trace("+++++++[Stock_ScreenRotation] : OnScreenRotation end")
end

Stock_ScreenRotation.ResetListViewContent = function(l_3_0, l_3_1)
   trace("+++++++[Stock_ScreenRotation] : ResetListViewContent")
   local l_3_2 = nil
   if l_3_0._SListView:TypeOf("SequentialListView") then
      l_3_2 = true
   else
      l_3_2 = false
   end
   trace("+++++++[Stock_ScreenRotation] : 1")
   local l_3_3 = 0
   if l_3_2 == true then
      l_3_3 = l_3_0._SListView:GetGenerator():GetRealizedItemCount()
   else
      l_3_3 = l_3_0._SListView:GetGenerator():GetCount()
   end
   trace("+++++++[Stock_ScreenRotation] : 2")
   local l_3_4 = l_3_0._SListView:GetGenerator()
   for i = 0, l_3_3 - 1 do
      local item = l_3_4:GetItem(i)
      l_3_0:AdjustListviewItemLayout(nil, item)
   end
end

Stock_ScreenRotation.AdjustListviewItemLayout = function(l_4_0, l_4_1, l_4_2)
   trace("+++++++[Stock_ScreenRotation] : ResetListViewContent Beginning")
   if l_4_2 then
      local l_4_3 = l_4_2.Namespace
      local l_4_4 = nil
      l_4_4 = l_4_3:FindName("Pricing")
      if l_4_4 then
         if l_4_0._status == ScreenOrientation_Portrait then
            l_4_4.Position.x = 140
         else
            if l_4_0._status == ScreenOrientation_Landscape then
               l_4_4.Position.x = 460
            end
         end
      end
      l_4_4 = l_4_3:FindName("StockInfoGroup")
      if l_4_4 then
         if l_4_0._status == ScreenOrientation_Portrait then
            l_4_4.Position.x = 0
         else
            if l_4_0._status == ScreenOrientation_Landscape then
               l_4_4.Position.x = 320
            end
         end
      end
      l_4_4 = l_4_3:FindName("dot_line")
      if l_4_4 then
         l_4_4.Size.width = ItemSizeWidth
         l_4_4.TextureCoords:set(0, 0, ItemSizeWidth / 2, 1)
      end
   end
   trace("+++++++[Stock_ScreenRotation] : ResetListViewContent Finished")
end

trace("Load Stock_Landscape.lua end")

⌨️ 快捷键说明

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