albumlistview.luac.lua
来自「htc manila 2 sourcecode」· LUA 代码 · 共 584 行 · 第 1/2 页
LUA
584 行
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;;0,2;;0,0,0,0,0,0,2,3,4,5,6,7;0,0,0,0,0,0,2;0,0,0,0,0,0,2;;0,0,0,0,0,4;0,0,4,72,76,80,84,94,94,102,103,104,142,280,281,282,283,284;;0,10,11,63;;;0,11,12;7;;;;;;; 3e9c69af_manila.luac
-- With minor Q16.16 conversion error
trace("-- AlbumListview")
AlbumGenerator = nil
InitPortraitConstant = function()
RightBound = 367
PanoramaWidth = 184
PanoramaHeight = 64
PanoramaVWidth = 164
PanoramaVHeight = 272
PortraitWidth = 180
PortraitHeight = 240
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 200
WideLandscapeHeight = 120
ParaOff = 0
LOff = 0
WLOff = 0
POff = -5
VParaOff = -15
PhotoHitTarget.Position.x = 100
PhotoHitTarget.Position.y = -90
PhotoHitTarget.Size.width = 280
PhotoHitTarget.Size.height = 310
end
gbEnableScalado = false
if gbMobileDevice and gDataModule:EnableScaladoCodec() == 1 then
gbEnableScalado = true
end
DBUpdate = function()
if gExitingGizmo ~= true then
gMyTrace("DBUpdate start\n")
resetAlbumQuery()
resetList(true)
gCheckImageCount()
updateInfo(true)
gMyTrace("DBUpdate end\n")
end
end
OnUIRotation = function()
if gExitingGizmo ~= true then
trace("OnUIRotation")
if _application.Orientation == ScreenOrientation_Portrait then
ConnectPortraitLaunchCamera(false)
ConnectLandscapeLaunchCamera(false)
ConnectPortraitLaunchCamera(true)
NoPhotoLandscape._visible = false
NoPhotoPortrait._visible = true
else
ConnectPortraitLaunchCamera(false)
ConnectLandscapeLaunchCamera(false)
ConnectLandscapeLaunchCamera(true)
NoPhotoPortrait._visible = false
NoPhotoLandscape._visible = true
end
if AlbumGenerator ~= nil then
resetAlbumQuery()
resetList(false)
gCheckImageCount()
updateInfo(true)
end
end
end
if gDataModule ~= nil then
gDataModule.OnDBUpdate:connect(DBUpdate)
end
AlbumLVOnRelease = function(l_4_0, l_4_1)
gMyTrace("Listview click\n")
l_4_1 = true
end
AlbumQuery = VectorNotifyint()
jItemLists = {}
resetAlbumQuery = function()
jItemLists = nil
jItemLists = {}
AlbumQuery = VectorNotifyint()
local l_5_0 = gDataModule:GetImageCount()
gUpdateIndexStringForTotal(l_5_0)
for i = 0, l_5_0 - 1 do
AlbumQuery:push_back(i)
jItemLists[i] = {}
jItemLists[i].type = "portrait"
jItemLists[i].init = false
jItemLists[i].top_rotation_y = 90
jItemLists[i].rotation = 30
jItemLists[i].bottom_rotation = Vector3F(0, 0, 0)
jItemLists[i].landscape = false
end
end
if gbMobileDevice then
resetAlbumQuery()
else
for i = 0, 10 do
gUpdateIndexStringForTotal(11)
AlbumQuery:push_back(i)
jItemLists[i] = {}
jItemLists[i].type = "portrait"
jItemLists[i].init = false
jItemLists[i].top_rotation_y = 90
jItemLists[i].rotation = 30
jItemLists[i].bottom_rotation = Vector3F(0, 0, 0)
jItemLists[i].landscape = false
end
end
resetList = function(l_6_0)
local l_6_1 = AlbumGenerator.SelectedIndex
AlbumGenerator.Collection = AlbumQuery
if l_6_0 == true then
if AlbumGenerator:GetCount() > 0 then
AlbumGenerator.SelectedIndex = 0
end
elseif AlbumGenerator:GetCount() <= l_6_1 and AlbumGenerator:GetCount() > 0 then
AlbumGenerator.SelectedIndex = 0
else
AlbumGenerator.SelectedIndex = l_6_1
end
end
AlbumLayout = class()
AlbumLayout.__init = function(l_7_0, l_7_1)
l_7_0.Base = l_7_1
l_7_1.ExtendGetRealizedViewport:connect(AlbumLayout.GetRealizedViewport, l_7_0)
l_7_1.ExtendGetPositionAtPoint:connect(AlbumLayout.GetPositionAtPoint, l_7_0)
l_7_1.ExtendGetOpacityAtPoint:connect(AlbumLayout.GetOpacityAtPoint, l_7_0)
l_7_1.ExtendGetRotationAtPoint:connect(AlbumLayout.GetRotationAtPoint, l_7_0)
l_7_1.OnItemArranged:connect(AlbumLayout.OnItemArranged, l_7_0)
l_7_1.UsePositionPath = true
l_7_1.UseOpacityPath = true
l_7_1.UseScalePath = true
l_7_1.UseRotationPath = true
l_7_1.SmoothPosition = true
l_7_1.SmoothOpacity = true
l_7_0.SmoothScale = true
l_7_1.SmoothRotation = true
l_7_1.PositionSmoothFactor = 12
l_7_1.OpacitySmoothFactor = 6
l_7_1.ScaleSmoothFactor = 12
l_7_1.RotationSmoothFactor = 12
end
AlbumLayout.GetPositionAtPoint = function(l_8_0, l_8_1, l_8_2, l_8_3, l_8_4, l_8_5)
local l_8_6 = AlbumGenerator.SelectedIndex
local l_8_7 = 80
local l_8_8 = -80
local l_8_9 = -90
local l_8_10 = -100
local l_8_11 = -110
if _application.Orientation == ScreenOrientation_Landscape then
l_8_7 = 55
l_8_8 = -60
l_8_9 = -70
l_8_10 = -80
l_8_11 = -90
end
if l_8_1 == l_8_6 then
l_8_4.value.x = 0
l_8_4.value.y = l_8_7
l_8_4.value.z = 100
elseif l_8_1 == l_8_6 + 1 then
l_8_4.value.x = 0
l_8_4.value.y = l_8_8
l_8_4.value.z = 100
elseif l_8_1 == l_8_6 + 2 then
l_8_4.value.x = 0
l_8_4.value.y = l_8_9
l_8_4.value.z = 100
elseif l_8_1 == l_8_6 + 3 then
l_8_4.value.x = 0
l_8_4.value.y = l_8_10
l_8_4.value.z = 100
elseif l_8_1 == l_8_6 + 4 then
l_8_4.value.x = 0
l_8_4.value.y = l_8_11
l_8_4.value.z = 100
else
l_8_4.value.x = 0
l_8_4.value.y = 500
l_8_4.value.z = 100
end
l_8_5.value = true
end
AlbumLayout.GetOpacityAtPoint = function(l_9_0, l_9_1, l_9_2, l_9_3, l_9_4, l_9_5)
local l_9_6 = AlbumGenerator.SelectedIndex
if l_9_1 == l_9_6 then
l_9_4.value = 100
elseif l_9_1 == l_9_6 + 1 then
l_9_4.value = 100
elseif l_9_1 == l_9_6 + 2 then
l_9_4.value = 100
elseif l_9_1 == l_9_6 + 3 then
l_9_4.value = 100
elseif l_9_1 == l_9_6 + 4 then
l_9_4.value = 100
else
l_9_4.value = 0
end
l_9_5.value = true
end
AlbumLayout.GetRotationAtPoint = function(l_10_0, l_10_1, l_10_2, l_10_3, l_10_4, l_10_5)
local l_10_6 = AlbumGenerator.SelectedIndex
if l_10_1 == l_10_6 then
l_10_4.value.x = 0
l_10_4.value.y = 0
l_10_4.value.z = jItemLists[l_10_1].rotation
elseif l_10_1 == l_10_6 + 1 then
l_10_4.value = jItemLists[l_10_1].bottom_rotation
elseif l_10_1 == l_10_6 + 2 then
l_10_4.value = jItemLists[l_10_1].bottom_rotation
elseif l_10_1 == l_10_6 + 3 then
l_10_4.value = jItemLists[l_10_1].bottom_rotation
elseif l_10_1 == l_10_6 + 4 then
l_10_4.value = jItemLists[l_10_1].bottom_rotation
else
l_10_4.value.x = 0
if bFlyOutRotateFlag == true then
l_10_4.value.y = 90
else
l_10_4.value.y = -90
end
l_10_4.value.z = 0
end
l_10_5.value = true
end
AlbumLayout.GetRealizedViewport = function(l_11_0, l_11_1, l_11_2, l_11_3)
l_11_1.value.y = l_11_1.value.y - 200
l_11_2.value.y = l_11_2.value.y + 200
l_11_3.value = true
end
AlbumLayout.OnItemArranged = function(l_12_0, l_12_1, l_12_2, l_12_3, l_12_4)
local l_12_5 = l_12_2.Namespace:FindName("edgeShadowSprit")
if l_12_2.Position.y >= 0 then
l_12_5.Opacity.value = 20
else
if l_12_2.Position.y >= -180 then
l_12_5.Opacity.value = 20 + 80 * (l_12_2.Position.y / -180)
else
l_12_5.Opacity.value = 100
end
end
end
gFirstCount = 0
HandleAlbumCreated = function(l_13_0, l_13_1)
gMyTrace("HandleAlbumCreated\n")
local l_13_2 = nil
if l_13_0 < 5 then
thumbnailFilePath = gDataModule:GetItemPropertyAsString(2, l_13_0)
l_13_2 = Image()
if l_13_2:LoadFile(thumbnailFilePath) == false then
trace("[AG] Failed to load" .. thumbnailFilePath .. " !\n")
if l_13_2:LoadFile(thumbnailFilePath) == false then
l_13_2:LoadFile(thumbnailFilePath)
end
end
else
l_13_2 = gDataModule:GetThumbnailImage(l_13_0)
end
if gCountTotal ~= gDataModule:GetImageCount() then
gUpdateIndexStringForTotal(gDataModule:GetImageCount())
end
if l_13_0 < gCountTotal then
l_13_1.Opacity.value = 100
else
l_13_1.Opacity.value = 0
return
end
if gFirstLaunch == true then
l_13_1.Opacity.value = 0
else
l_13_1.Opacity.value = 100
end
local l_13_3 = l_13_1.Namespace:FindName("TmpPic")
local l_13_4 = l_13_1.Namespace:FindName("videoBKSprit")
local l_13_5 = l_13_1.Namespace:FindName("WhiteBoard")
local l_13_6 = l_13_1.Namespace:FindName("edgeShadowSprit")
l_13_3.Position.y = 0
l_13_5.Position.y = 0
l_13_6.Position.y = 0
local l_13_7 = gDataModule:GetImageFileType(l_13_0)
local l_13_8 = l_13_7 == 1
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?