📄 email_letterlist.luac.lua
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;;;;;;;;;;;;;;4;;;;;0,0,25;;;;0,0,14,18;0,12;;;9,13;;3,24;;;;5; 0e064871_manila.luac
trace("Loaded Letter List Script\n")
require("hitfeedback")
Objects3DHitFeedback = HitFeedback(Objects3D)
EmailDatabase = nil
EmailQuery = nil
EmailLayoutExtender = nil
MaxEmailAccount = 7
LetterLayout = class()
LetterLayout.__init = function(l_1_0, l_1_1)
l_1_0.Base = l_1_1
l_1_1.ExtendGetRealizedViewport:connect(LetterLayout.GetRealizedViewport, l_1_0)
l_1_1.ExtendGetPositionAtPoint:connect(LetterLayout.GetPositionAtPoint, l_1_0)
l_1_1.ExtendGetOpacityAtPoint:connect(LetterLayout.GetOpacityAtPoint, l_1_0)
l_1_1.ExtendGetScaleAtPoint:connect(LetterLayout.GetScaleAtPoint, l_1_0)
l_1_0.Opened = false
l_1_0.Base.UsePositionPath = true
l_1_0.Base.UseOpacityPath = true
l_1_0.Base.UseScalePath = true
l_1_0.Base.SmoothPosition = true
l_1_0.Base.SmoothOpacity = true
l_1_0.Base.SmoothScale = true
l_1_0.Base.PositionSmoothFactor = 3
l_1_0.Base.OpacitySmoothFactor = 1
l_1_0.Base.ScaleSmoothFactor = 1
end
LetterLayout.OpenEnvelope = function(l_2_0)
l_2_0.Base.PositionSmoothFactor = 3
l_2_0.Base.OpacitySmoothFactor = 1
l_2_0.Base.ScaleSmoothFactor = 1
l_2_0.Opened = true
l_2_0.Base:NotifyPathChanged()
end
LetterLayout.CloseEnvelope = function(l_3_0)
l_3_0.PositionSmoothFactor = 3
l_3_0.OpacitySmoothFactor = 1
l_3_0.ScaleSmoothFactor = 1
l_3_0.Opened = false
l_3_0.Base:NotifyPathChanged()
end
LetterLayout.IsOpened = function(l_4_0)
return l_4_0.Opened
end
LetterLayout.GetRealizedViewport = function(l_5_0, l_5_1, l_5_2, l_5_3)
l_5_3.value = true
end
LetterLayout.GetPositionAtPoint = function(l_6_0, l_6_1, l_6_2, l_6_3, l_6_4, l_6_5)
if l_6_0.Opened == true then
l_6_4.value.x = l_6_3.y * -20
l_6_4.value.y = l_6_3.y * 40 + 125
l_6_4.value.z = l_6_3.y * -20
else
l_6_4.value.x = 0
l_6_4.value.y = 50
l_6_4.value.z = l_6_3.y * -5
end
l_6_5.value = true
end
LetterLayout.GetOpacityAtPoint = function(l_7_0, l_7_1, l_7_2, l_7_3, l_7_4, l_7_5)
if l_7_0.Opened == true then
l_7_4.value = 100
else
l_7_4.value = 0
end
l_7_5.value = true
end
LetterLayout.GetScaleAtPoint = function(l_8_0, l_8_1, l_8_2, l_8_3, l_8_4, l_8_5)
if l_8_0.Opened == true then
if l_8_3.y < 0 then
l_8_4.value.x = 1
l_8_4.value.y = 1 + l_8_3.y * 3
if l_8_4.value.y < 0 then
l_8_4.value.y = 0
end
l_8_4.value.z = 1
else
l_8_4.value.x = 1
l_8_4.value.y = 1
l_8_4.value.z = 1
end
else
l_8_4.value.x = 1
l_8_4.value.y = 1
l_8_4.value.z = 1
end
l_8_5.value = true
end
OnUnreadEmailNumberChanged = function()
for i = 0, AccountGenerator:GetCount() - 1 do
UpdateAccountUnread(i)
end
end
SetEmptyStateVisibilities = function()
trace("SetEmptyStateVisibilities")
if AccountGenerator:GetCount() > 0 then
if EmailGenerator:GetCount() > 0 then
FadeInEnvelope()
FadeOutNoAccounts()
FadeOutNoMessages()
trace("[Email]-SetEmptyStateVisibilities 1\n")
else
FadeOutEnvelope()
FadeOutNoAccounts()
FadeInNoMessages()
trace("[Email]-SetEmptyStateVisibilities 2\n")
end
else
FadeOutEnvelope()
FadeInNoAccounts()
FadeOutNoMessages()
trace("[Email]-SetEmptyStateVisibilities 3\n")
end
trace("SetEmptyStateVisibilities end")
end
UpdateAccountUnread = function(l_11_0)
trace("UpdateAccountUnread")
if l_11_0 >= 0 and l_11_0 < AccountGenerator:GetCount() then
local l1 = AccountGenerator:GetItem(l_11_0)
local l2 = AccountGenerator:GetData(l_11_0)
if l1 ~= nil then
if l2 ~= nil then
SetUnreadMessages(l1,l2)
if l_11_0 == AccountGenerator.SelectedIndex then
BindCurrentAccount()
end
end
end
end
trace("UpdateAccountUnread end")
end
SetUnreadMessages = function(l_12_0, l_12_1)
local l_12_2 = l_12_0.Namespace:FindName("UnreadItemGroup")
local l_12_3 = l_12_0.Namespace:FindName("UnreadItemMoreIcon")
local l_12_4 = l_12_0.Namespace:FindName("UnreadItemCountText")
if l_12_2 ~= nil then
if _config_os == "windowsmobile" then
local md = MailDatabase(l_12_1:GetAccountName(), _application:GetScopedLog("Email"))
local l6 = md:GetUnreadMessageCount()
if l6 > 0 then
l_12_2._visible = true
if l_12_4 ~= nil then
if l6 > 99 then
l_12_4.String = "99"
l_12_3._visible = true
else
l_12_4.String = tostring(l6)
l_12_3._visible = false
end
end
else
l_12_2._visible = false
end
else
l_12_2._visible = false
end
end
end
HandleItemsAdded = function(l_13_0, l_13_1)
if EmailList:GetGenerator().SelectedIndex == -1 then
EmailList:GetGenerator().SelectedIndex = 0
OpenEnvelope()
else
AlignVerticalScroll()
end
SetEmptyStateVisibilities()
end
HandleItemsRemoved = function(l_14_0, l_14_1)
AlignVerticalScroll()
SetEmptyStateVisibilities()
end
HandleItemsMoved = function(l_15_0, l_15_1, l_15_2)
AlignVerticalScroll()
SetEmptyStateVisibilities()
end
HandleItemsReplaced = function(l_16_0, l_16_1)
AlignVerticalScroll()
SetEmptyStateVisibilities()
end
HandleSelectedIndexChanged = function(l_17_0, l_17_1)
AlignVerticalScroll()
if l_17_1 >= 0 then
HandleAccountNameUpdate()
end
end
AlignVerticalScroll = function()
local l_18_0 = EmailList:GetGenerator().SelectedIndex
if l_18_0 >= 0 then
EmailList:GetLayout():JumpToIndex(l_18_0, ListAlignment_Top, ListAlignmentOptions_Snap)
end
end
ConnectEmailEvents = function()
if EmailGenerator ~= nil then
EmailGenerator.SelectedIndexChanged:connect(HandleSelectedIndexChanged)
end
if EmailQuery ~= nil then
EmailQuery.ItemsAdded:connect(HandleItemsAdded)
EmailQuery.ItemsRemoved:connect(HandleItemsRemoved)
EmailQuery.ItemsMoved:connect(HandleItemsMoved)
EmailQuery.ItemsReplaced:connect(HandleItemsReplaced)
end
EmailListGroup.onKeyDown:connect(HandleKeyDown)
EmailListGroup:Focus()
end
DisconnectEmailEvents = function()
if EmailGenerator ~= nil then
EmailGenerator.SelectedIndexChanged:disconnect(HandleSelectedIndexChanged)
end
if EmailQuery ~= nil then
EmailQuery.ItemsAdded:disconnect(HandleItemsAdded)
EmailQuery.ItemsRemoved:disconnect(HandleItemsRemoved)
EmailQuery.ItemsMoved:disconnect(HandleItemsMoved)
EmailQuery.ItemsReplaced:disconnect(HandleItemsReplaced)
end
EmailListGroup.onKeyDown:disconnect(HandleKeyDown)
end
BindCurrentAccount = function(l_21_0)
trace("BindCurrentAccount++++")
DisconnectEmailEvents()
if l_21_0 then
local item = AccountQuery:GetItem(l_21_0)
if item ~= nil then
local name = item:GetAccountName()
if name ~= nil then
EmailDatabase = MailDatabase(name, _application:GetScopedLog("Email"))
if EmailDatabase ~= nil then
local msb = MailSortBy()
msb:SORTBY("DeliveryTime", SortDirection_Descending)
EmailQuery = EmailDatabase:Select(nil, msb)
EmailGenerator.Collection = EmailQuery
if EmailGenerator:GetCount() > 0 then
EmailGenerator.SelectedIndex = 0
EmailListGroup._visible = true
end
end
end
end
ConnectEmailEvents()
return
end
if AccountGenerator.SelectedIndex >= 0 then
local data = AccountGenerator:GetData(AccountGenerator.SelectedIndex)
if data ~= nil then
local name = data:GetAccountName();
if name ~= nil then
EmailDatabase = MailDatabase(name, _application:GetScopedLog("Email"))
if EmailDatabase ~= nil then
local msb = MailSortBy()
msb:SORTBY("DeliveryTime", SortDirection_Descending)
EmailQuery = EmailDatabase:Select(nil, msb)
EmailGenerator.Collection = EmailQuery
if EmailGenerator:GetCount() > 0 then
EmailGenerator.SelectedIndex = 0
HandleAccountNameUpdate()
end
end
end
end
else
EmailGenerator.Collection = nil
end
ConnectEmailEvents()
end
HandleLetterBackgroundPress = function(l_22_0, l_22_1)
Objects3DHitFeedback:Press()
l_22_1.value = true
end
HandleLetterBackgroundRelease = function(l_23_0, l_23_1)
Objects3DHitFeedback:Release()
EmailList:GetLayout().SmoothPosition = false
EmailGenerator:SelectObject(l_23_0)
EmailList:ForceLayout()
EmailList:GetLayout().SmoothPosition = true
if _config_os == "windowsmobile" then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -