📄 peopledetailselectnumber.luac.lua
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;0,3,28;;;5;5;;;;7;0,0,19,41;;0,0,0,0,5,12;0,4,44;0,0,0,7,11,15,29,38;0,9,13;; 3cbea8bc_manila.luac
trace("select number scripts")
require("contacts_database_svc")
require("ScrollPhysics")
require("transitions")
require("CheckboxControl")
objs3D = {}
objs3D[1] = Camera3D
setOffScreen()
OnNavigateOut = function(l_1_0)
_request.NavigateOutTo:disconnect(OnNavigateOut)
Transition(l_1_0, "Out")
end
OnNavigateIn = function(l_2_0)
Transition(l_2_0, "In")
end
DetailSelectNumberScreenRotation = nil
widthPeopleItem = 480
heightPeopleItem = 80
NUMBERTYPE = {MOBILE = 1, COMPANY = 2, WORK1 = 3, WORK2 = 4, HOME1 = 5, HOME2 = 6, CAR = 7, ASSISTANT = 8}
OnConfirmSaveReturned = function(l_3_0)
l_3_0.OnExit:disconnect(OnConfirmSaveReturned)
if l_3_0.Result.ExitType ~= DialogExitType_Cancel then
SelectNumberControl:SaveToSIM()
end
end
SavedSIMDialogReturned = function(l_4_0)
l_4_0.OnExit:disconnect(SavedSIMDialogReturned)
_application.Navigation:NavigateBack()
end
SavedSIMConfirmationDialog = function(l_5_0)
local l_5_1 = URL("Manila://Confirmation.dialog")
l_5_1.Parameters:AddParameter("Title", "Saved")
if l_5_0 == nil or l_5_0 == "" then
l_5_0 = "None is saved."
end
l_5_1.Parameters:AddParameter("ContentString", l_5_0)
l_5_1.Parameters:AddParameter("Type", "OK")
local l_5_2 = _application.DialogManager:GetDialog(l_5_1)
l_5_2.OnExit:connect(SavedSIMDialogReturned)
l_5_2:Show()
end
GetTypeAll = function(l_6_0)
if l_6_0 == NUMBERTYPE.MOBILE then
return "Moble"
else
if l_6_0 == NUMBERTYPE.COMPANY then
return "Company"
else
if l_6_0 == NUMBERTYPE.WORK1 then
return "Work1"
else
if l_6_0 == NUMBERTYPE.WORK2 then
return "Work2"
else
if l_6_0 == NUMBERTYPE.HOME1 then
return "Home1"
else
if l_6_0 == NUMBERTYPE.HOME2 then
return "Home2"
else
if l_6_0 == NUMBERTYPE.CAR then
return "Car"
else
if l_6_0 == NUMBERTYPE.ASSISTANT then
return "Assiatant"
end
end
end
end
end
end
end
end
end
GetType = function(l_7_0)
if l_7_0 == NUMBERTYPE.MOBILE then
return "M"
else
if l_7_0 == NUMBERTYPE.COMPANY then
return "COM"
else
if l_7_0 == NUMBERTYPE.WORK1 then
return "W1"
else
if l_7_0 == NUMBERTYPE.WORK2 then
return "W2"
else
if l_7_0 == NUMBERTYPE.HOME1 then
return "H1"
else
if l_7_0 == NUMBERTYPE.HOME2 then
return "H2"
else
if l_7_0 == NUMBERTYPE.CAR then
return "CAR"
else
if l_7_0 == NUMBERTYPE.ASSISTANT then
return "A"
end
end
end
end
end
end
end
end
end
UnselectAll = function()
local l_8_0 = SelectNumberControl.Collection:GetCount() - 1
for i = 0, l_8_0 do
if SelectNumberControl.NumberList[i].Select then
local gi = SelectNumberControl.listview:GetGenerator():GetItem(i)
if gi ~= nil then
local i = gi.Namespace:FindName("Select")
ToggleCheckbox(i)
end
SelectNumberControl.NumberList[i].Select = false
end
end
SelectNumberControl.SelectCount = 0
end
SelectAll = function()
local l_9_0 = SelectNumberControl.Collection:GetCount() - 1
for i = 0, l_9_0 do
if not SelectNumberControl.NumberList[i].Select then
local item = SelectNumberControl.listview:GetGenerator():GetItem(i)
if item ~= nil then
local s = item.Namespace:FindName("Select")
ToggleCheckbox(s)
end
SelectNumberControl.NumberList[i].Select = true
end
end
SelectNumberControl.SelectCount = SelectNumberControl.Collection:GetCount()
end
CancelSelection = function()
_application.Navigation:NavigateBack()
end
MainMenuExitCallback = function(l_11_0)
if l_11_0.Result.ExitType ~= DialogExitType_Cancel then
if l_11_0.Result.UserValue == "Select All" then
SelectAll()
else
if l_11_0.Result.UserValue == "Unselect All" then
UnselectAll()
else
if l_11_0.Result.UserValue == "Cancel" then
CancelSelection()
end
end
end
end
end
DoLSK = function()
if SelectNumberControl.SelectCount > 0 then
local url = URL("Manila://Confirmation.dialog")
url.Parameters:AddParameter("Title", Locale:GetString("IDS_SELNUMPEO_CONFIRMTITLE"))
url.Parameters:AddParameter("ContentString", Locale:GetString("IDS_SELNUMPEO_CONFIRMSUB"))
url.Parameters:AddParameter("Type", "OK")
local dlg = _application.DialogManager:GetDialog(url)
dlg.OnExit:connect(OnConfirmSaveReturned)
dlg:Show()
else
_application.Navigation:NavigateBack()
end
end
DoRSK = function()
local l_13_0 = _application.DialogManager:GetDialog(URL("Manila://people-select-menu.dialog"))
l_13_0.OnExit:connect(MainMenuExitCallback)
l_13_0:Show()
end
SelectNumberObject = class()
SelectNumberObject.__init = function(l_14_0, l_14_1)
l_14_0.listview = l_14_1
l_14_0.NumberList = nil
l_14_0.PeopleEngine = PeopleEngine_Instance()
l_14_0.ContactInfo = PersonInfo()
l_14_0.PeopleEngine:GetPersonInfo(l_14_0.ContactInfo)
l_14_0.Name = l_14_0.ContactInfo:GetName()
l_14_0.SelectCount = 0
local l_14_2 = TileLayout()
l_14_2:SetItemSize(widthPeopleItem, heightPeopleItem, 0)
l_14_0.listview:SetLayout(l_14_2)
l_14_0.Collection = VectorNotifyint()
local l_14_3 = LibraryGeneratorint(l_14_0.Collection, l_14_0.listview:GetMovie(), l_14_0.listview.ComponentLibraryName, l_14_0.listview.ComponentLibraryID)
l_14_3.ItemCreated:connect(l_14_0.HandleItemCreated, l_14_0)
l_14_3.RecycleItems = true
l_14_0.listview:SetGenerator(l_14_3)
l_14_0.ListPhysics = ScrollPhysics(l_14_0.listview, l_14_0.listview, HandleItemSelection, false)
l_14_0.ListPhysics:ConnectMouseEvents()
l_14_0.listview:Focus()
l_14_0:PrepareNumberList()
end
SelectNumberObject.PrepareNumberList = function(l_15_0)
l_15_0.NumberList = {}
l_15_0:SetPropertyValue(NUMBERTYPE.MOBILE, l_15_0.ContactInfo:GetMobilePhoneNum(), "CallMobile")
l_15_0:SetPropertyValue(NUMBERTYPE.COMPANY, l_15_0.ContactInfo:GetCompanyPhoneNum(), "Company")
l_15_0:SetPropertyValue(NUMBERTYPE.WORK1, l_15_0.ContactInfo:GetWork1PhoneNum(), "Callwork")
l_15_0:SetPropertyValue(NUMBERTYPE.WORK2, l_15_0.ContactInfo:GetWork2PhoneNum(), "Callwork")
l_15_0:SetPropertyValue(NUMBERTYPE.HOME1, l_15_0.ContactInfo:GetHome1PhoneNum(), "Callhome")
l_15_0:SetPropertyValue(NUMBERTYPE.HOME2, l_15_0.ContactInfo:GetHome2PhoneNum(), "Callhome")
l_15_0:SetPropertyValue(NUMBERTYPE.CAR, l_15_0.ContactInfo:GetCarPhoneNum(), "Car")
l_15_0:SetPropertyValue(NUMBERTYPE.ASSISTANT, l_15_0.ContactInfo:GetAssistantPhoneNum(), "Assistant")
end
SelectNumberObject.SetPropertyValue = function(l_16_0, l_16_1, l_16_2, l_16_3)
if l_16_2 ~= nil and l_16_2 ~= "" then
local l_16_4 = {}
l_16_4.Type = l_16_1
l_16_4.Value = l_16_2
l_16_4.Select = false
l_16_4.Icon = l_16_3
local l_16_5 = l_16_0.Collection:GetCount()
l_16_0.NumberList[l_16_5] = l_16_4
l_16_0.Collection:push_back(l_16_5)
end
end
SelectNumberObject.SaveToSIM = function(l_17_0)
local l_17_1 = l_17_0.Collection:GetCount() - 1
local l_17_2 = ""
for i = 0, l_17_1 do
if l_17_0.NumberList[i].Select then
local l_17_7 = l_17_0.Name .. "/" .. GetType(l_17_0.NumberList[i].Type)
local aspb = Shell_AddSimPhoneBook(l_17_7, l_17_0.NumberList[i].Value)
if aspb == true then
l_17_2 = tostring(l_17_2) .. tostring(l_17_7) .. ":" .. tostring(l_17_0.NumberList[i].Value) .. "\n"
end
end
end
SavedSIMConfirmationDialog(l_17_2)
end
SelectNumberObject.HandleItemCreated = function(l_18_0, l_18_1, l_18_2)
item = l_18_0.NumberList[l_18_1]
local l_18_3 = l_18_2.Namespace:FindName("Number")
local l_18_4 = l_18_2.Namespace:FindName("TelType")
local l_18_5 = l_18_2.Namespace:FindName("Select")
if SelectNumListView.Viewport.x == 800 then
l_18_5.Position.x = 730
else
l_18_5.Position.x = 420
end
local l_18_6 = l_18_2.Namespace:FindName("Line")
l_18_6.Size.width = SelectNumListView.Viewport.x
local l_18_7 = l_18_2.Namespace:FindName("ListIcon")
if item.Icon ~= nil then
l_18_3.Position.x = 80
local stuff = item.Icon .. "_Up"
l_18_7:SetTextureRef(stuff)
l_18_7._visible = true
else
l_18_3.Position.x = 10
l_18_7._visible = false
end
l_18_4.String = GetTypeAll(item.Type)
l_18_3.String = item.Value
InitializeCheckbox(l_18_5, item.Select)
end
HandleItemSelection = function(l_19_0)
if l_19_0 >= 0 then
local l_19_1 = SelectNumberControl.listview:GetGenerator():GetItem(l_19_0)
local l_19_2 = l_19_1.Namespace:FindName("Select")
ToggleCheckbox(l_19_2)
if l_19_2.Tag.Value then
SelectNumberControl.SelectCount = SelectNumberControl.SelectCount + 1
else
SelectNumberControl.SelectCount = SelectNumberControl.SelectCount - 1
end
SelectNumberControl.NumberList[l_19_0].Select = l_19_2.Tag.Value
end
end
_request.NavigateOutTo:connect(OnNavigateOut)
_request.NavigateInFrom:connect(OnNavigateIn)
main = function()
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
trace("[DetailSelectNumber] : EnableLandscape")
require("people\\PeopleDetailSelectNumber_Landscape")
DetailSelectNumberScreenRotation = DetailSelectNumber_ScreenRotation(SelectNumListView, Camera2D, Camera3D, Mask)
end
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_DONE"), DoLSK))
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MENU"), DoRSK))
SelectNumberControl = SelectNumberObject(SelectNumListView)
if DetailSelectNumberScreenRotation then
DetailSelectNumberScreenRotation:OnScreenRotation()
end
end
main()
trace("select number end")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -