📄 peopledialogbase.luac.lua
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;0,4;0,12,18;0,19;;;;0,0,6,31,49,53,56,88;;;;;0,0,0,13,17,21,25,29,30,38,48,144;0,12;0,0,16,26;;0,0,22;;;;; 3d1d852b_manila.luac
trace("Loaded people email dialog Script\n")
require("theme")
ItemSizeWidth = 480
ItemSizeHeight = 80
Modal_CurrentStackIndex = 0
Modal_SelectedStack = {}
Modal_PressedItem = nil
Modal_IgnoreInputEvent = true
ConnectEvents = function()
_application.DialogManager.OnDialogIn:connect(AnimateIn)
_application.DialogManager.OnDialogOut:connect(AnimateOut)
end
DisconnectEvents = function()
_application.DialogManager.OnDialogIn:disconnect(AnimateIn)
_application.DialogManager.OnDialogOut:disconnect(AnimateOut)
end
HandleModalListItemSelected = function(l_3_0)
local l_3_1 = l_3_0.Namespace:FindName("Arrow")
if l_3_1._visible then
Modal_CurrentStackIndex = Modal_CurrentStackIndex + 1
Modal_SelectedStack[Modal_CurrentStackIndex] = l_3_0.Tag
AnimateOut(nil, Rebind)
elseif _config_os == "windowsmobile" then
trace("DialogItemPressed: " .. l_3_0.Tag.Data.Name .. "\n")
_dialog.Result.UserValue = l_3_0.Tag.Data.Name
_dialog:Exit(DialogExitType_OK)
else
trace("DialogItemPressed: " .. l_3_0.Tag.Data .. "\n")
AnimateOut()
end
end
OnModalMouseDown = function(l_4_0)
if Modal_IgnoreInputEvent == true then
return
end
trace("OnModalMouseDown\n")
local l_4_1 = ModalListView:GetIndexAtMousePoint(l_4_0._xmouse, l_4_0._ymouse)
if l_4_1 ~= -1 then
local l_4_2 = ModalGenerator:GetItem(l_4_1)
trace("hit item: " .. tostring(l_4_1) .. "\n")
if l_4_2.Tag.Enable then
UpdateFocusUI(l_4_2, true)
l_4_2:Focus()
end
end
end
OnModalMouseUp = function(l_5_0)
if Modal_IgnoreInputEvent == true then
return
end
trace("OnModalMouseUp\n")
if Modal_PressedItem ~= nil then
UpdateFocusUI(Modal_PressedItem, false)
end
local l_5_1 = ModalListView:GetIndexAtMousePoint(l_5_0._xmouse, l_5_0._ymouse)
if l_5_1 ~= -1 and l_5_1 == ModalGenerator.SelectedIndex then
Modal_IgnoreInputEvent = true
local item = ModalGenerator:GetItem(l_5_1)
if item.Tag.Enable then
HandleModalListItemSelected(item)
return
end
end
CancelDialog()
end
OnModalKeyUp = function(l_6_0, l_6_1, l_6_2)
if Modal_IgnoreInputEvent == true then
return
end
if l_6_1.Code == KeyCode_Back then
if Modal_CurrentStackIndex > 0 then
BackDialog()
else
CancelDialog()
end
l_6_2.value = true
end
end
OnModalListItemKeyDown = function(l_7_0, l_7_1, l_7_2)
if Modal_IgnoreInputEvent == true then
return
end
if l_7_0.Tag.Enable and (l_7_1.Code == KeyCode_Return or l_7_1.Code == KeyCode_Space) then
HandleModalListItemSelected(l_7_0)
UpdateFocusUI(l_7_0, true)
l_7_2.value = true
end
end
OnModalListItemKeyUp = function(l_8_0, l_8_1, l_8_2)
if Modal_IgnoreInputEvent == true then
return
end
if l_8_0.Tag.Enable then
UpdateFocusUI(l_8_0, false)
end
end
UpdateFocusUI = function(l_9_0, l_9_1)
local l_9_2 = ModalListView:GetGenerator():GetIndexForItem(l_9_0)
trace("ListIndex - " .. tostring(l_9_2))
trace("Selected Index - " .. tostring(ModalListView:GetGenerator().SelectedIndex))
local l_9_3 = l_9_2 == ModalListView:GetGenerator().SelectedIndex
trace("Selected - " .. tostring(l_9_3))
trace("Pressed - " .. tostring(l_9_1))
local l_9_4 = l_9_0.Namespace:FindName("TopSelected")
local l_9_5 = l_9_0.Namespace:FindName("TopPressed")
if l_9_3 ~= nil then
local l_9_6 = 0
if l_9_3 then
l_9_6 = 100
end
l_9_4.Opacity:Interpolate(l_9_6, 2, 0, Interpolate_Linear)
l_9_4 = l_9_0.Namespace:FindName("Selected")
l_9_4.Opacity:Interpolate(l_9_6, 2, 0, Interpolate_Linear)
end
if l_9_1 ~= nil then
local l_9_6 = 0
if l_9_1 then
l_9_6 = 100
if Modal_PressedItem ~= nil then
local l_9_7 = Modal_PressedItem
UpdateFocusUI(Modal_PressedItem, false, nil)
end
Modal_PressedItem = l_9_0
else
if Modal_PressedItem ~= nil then
if Modal_PressedItem.Tag.Index == l_9_0.Tag.Index then
Modal_PressedItem = nil
end
end
end
local tp = l_9_0.Namespace:FindName("TopPressed")
tp.Opacity:Interpolate(l_9_6, 2, 0, Interpolate_Linear)
tp = l_9_0.Namespace:FindName("Pressed")
tp.Opacity:Interpolate(l_9_6, 2, 0, Interpolate_Linear)
end
local l_9_6 = l_9_0.Namespace:FindName("Text")
if l_9_3 == true or l_9_1 == true then
l_9_6.Color = GetMenuSelectedColor()
else
l_9_6.Color = GetMenuUnselectedColor()
end
end
Rebind = function()
BuildModalDialog(Modal_SelectedStack[Modal_CurrentStackIndex].Data, Modal_SelectedStack[Modal_CurrentStackIndex].Dynamic)
if Modal_CurrentStackIndex == 0 then
_application:SetLeftSoftkey(Softkey("", nil))
else
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_BACK"), BackDialog))
end
AnimateIn(nil, function()
end)
Modal_IgnoreInputEvent = false
end
GetIdealListviewY = function(l_11_0)
local l_11_1 = l_11_0:GetLayout().ItemSize.y * l_11_0:GetGenerator().Collection:GetCount()
if l_11_1 > 684 then
l_11_1 = 684
end
return l_11_1
end
HandleItemSelected = function(l_12_0)
if Modal_IgnoreInputEvent == true then
return
end
UpdateFocusUI(l_12_0, nil)
end
HandleItemDeselected = function(l_13_0)
if Modal_IgnoreInputEvent == true then
return
end
UpdateFocusUI(l_13_0, false)
end
HandleModalListItemCreation = function(l_14_0, l_14_1)
local l_14_2 = nil
if tonumber(l_14_0) == nil then
l_14_2 = l_14_0
else
l_14_2 = DynamicData[l_14_0]
end
local l_14_3 = l_14_1.Namespace:FindName("Text")
local l_14_4 = l_14_1.Namespace:FindName("TopItem")
local l_14_5 = l_14_1.Namespace:FindName("MiddleItem")
local l_14_6 = l_14_1.Namespace:FindName("Arrow")
local l_14_7 = l_14_1.Namespace:FindName("Contents")
local l_14_8 = true
if IsDialogItemEnable ~= nil then
l_14_8 = IsDialogItemEnable(l_14_2)
end
local l_14_9 = false
if IsDynamicItem ~= nil then
l_14_9 = IsDynamicItem(l_14_2)
end
local l_14_10 = ModalListView:GetGenerator():GetIndexForItem(l_14_1)
if l_14_10 == 0 then
l_14_4._visible = true
l_14_5._visible = false
end
if l_14_9 then
l_14_3.String = l_14_2.Title
l_14_6._visible = l_14_9
else
l_14_3.String = l_14_2.Title
l_14_6._visible = l_14_2.HasChildren
end
if SetRadioBox ~= nil then
SetRadioBox(l_14_2, l_14_1)
end
l_14_3.Tag = {}
l_14_3.Tag.Data = l_14_2
l_14_3.onKeyDown:connect(OnModalListItemKeyDown)
l_14_3.onKeyUp:connect(OnModalListItemKeyUp)
l_14_1.Tag = {}
l_14_1.Tag.Data = l_14_2
l_14_1.Tag.Index = l_14_10
l_14_1.Tag.Enable = l_14_8
l_14_1.Tag.Dynamic = l_14_9
l_14_1.OnSelected:connect(HandleItemSelected)
l_14_1.OnDeselected:connect(HandleItemDeselected)
if l_14_8 then
l_14_3.Color = Color(0, 0, 0, 255)
else
l_14_3.Color = Color(155, 155, 155, 255)
end
if ModalListView.Tag.InitialAnimation then
l_14_7.Opacity:Interpolate(0, 100, 10, l_14_10 * 2 + 1, Interpolate_Linear, nil)
local l_14_11 = (GetIdealListviewY(ModalListView) - 52) / ModalListView:GetLayout().ItemSize.y
if l_14_11 <= l_14_10 then
ModalListView.Tag.InitialAnimation = false
end
end
end
HandleModalListItemDestruction = function(l_15_0)
l_15_0.OnSelected:disconnect(HandleItemSelected)
l_15_0.OnDeselected:disconnect(HandleItemDeselected)
local l_15_1 = l_15_0.Namespace:FindName("Text")
l_15_1.onKeyDown:disconnect(OnModalListItemKeyDown)
l_15_1.onKeyUp:disconnect(OnModalListItemKeyUp)
end
dialogRequest = nil
AnimateIn = function(l_16_0, l_16_1)
if l_16_0 ~= nil then
if dialogRequest ~= nil then
return
end
dialogRequest = l_16_0
end
trace("Animating in\n")
if l_16_1 == nil then
l_16_1 = AnimateInDone
end
local l_16_2 = GetIdealListviewY(ModalListView)
local l_16_3 = (GetIdealListviewY(ModalListView) - 52) / ModalListView:GetLayout().ItemSize.y
DialogGroup.Position:Interpolate(Vector3(0, 0, 0), Vector3(0, l_16_2, 0), 2 + 4 * (l_16_3 / 8), 0, Interpolate_EaseInOutQuad, l_16_1)
end
AnimateInDone = function()
_application.DialogManager:DialogInComplete(dialogRequest)
end
AnimateOut = function(l_18_0, l_18_1)
trace("Animating out\n")
if l_18_0 ~= nil and dialogRequest ~= l_18_0 then
return
end
if l_18_1 == nil then
l_18_1 = AnimateOutDone
end
local l_18_2 = (GetIdealListviewY(ModalListView) - 52) / ModalListView:GetLayout().ItemSize.y
DialogGroup.Position:Interpolate(Vector3(0, DialogGroup.Position.y, 0), Vector3(0, 0, 0), 2 + 6 * (l_18_2 / 8), 0, Interpolate_EaseInOutQuad, l_18_1)
end
AnimateOutDone = function()
trace("AnimateOutDone\n")
if _config_os == "windowsmobile" then
DisconnectEvents()
_application.DialogManager:DialogOutComplete(dialogRequest)
end
dialogRequest = nil
end
BuildModalDialog = function(l_20_0, l_20_1)
ModalListView.Tag = {}
ModalListView.Tag.InitialAnimation = true
ModalItemListLayout = TileLayout()
ModalItemListLayout:SetItemSize(ItemSizeWidth, ItemSizeHeight, 0)
ModalListView.Viewport.x = ItemSizeWidth
ModalListView:SetLayout(ModalItemListLayout)
if l_20_1 then
ModalGenerator = LibraryGeneratorint(GetDynamicCollection(), ModalListView:GetMovie(), ModalListView.ComponentLibraryName, ModalListView.ComponentLibraryID)
else
ModalGenerator = LibraryGeneratorDialogItem(l_20_0:GetChildren(), ModalListView:GetMovie(), ModalListView.ComponentLibraryName, ModalListView.ComponentLibraryID)
end
ModalGenerator.ItemCreated:connect(HandleModalListItemCreation)
ModalGenerator.ItemDestroyed:connect(HandleModalListItemDestruction)
ModalGenerator.RecycleItems = true
ModalListView:SetGenerator(ModalGenerator)
ModalListView:ForceLayout()
ModalListView:Focus()
Modal_PressedItem = nil
Modal_IgnoreInputEvent = false
end
CancelDialog = function()
_dialog:Exit(DialogExitType_Cancel)
end
BackDialog = function()
trace("[BackDialog]")
Modal_CurrentStackIndex = Modal_CurrentStackIndex - 1
AnimateOut(nil, Rebind)
end
if _config_os == "windowsmobile" then
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_CLOSE"), CancelDialog))
_application:SetLeftSoftkey(Softkey("", nil))
Collection = _application.DialogManager:GetDialogTree(_dialog:GetDialog()):GetChildren()
local l_0_0 = {}
l_0_0.Data = _application.DialogManager:GetDialogTree(_dialog:GetDialog())
Modal_SelectedStack[Modal_CurrentStackIndex] = l_0_0
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
trace("[SimpleDialogScript] : EnableLandscape")
require("SimpleDialog\\SimpleDialog_Landscape")
_SimpleDialog_ScreenRotation = SimpleDialogRotation(SoundsSettingsItemListView, Camera_2D, Camera_3D, Mask)
end
BuildModalDialog(Modal_SelectedStack[Modal_CurrentStackIndex].Data, false)
ConnectEvents()
end
ModalListView.onMouseUp:connect(OnModalMouseUp)
ModalListView.onMouseDown:connect(OnModalMouseDown)
ModalListView.onKeyUp:connect(OnModalKeyUp)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -