⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 peoplemessage.luac.lua

📁 htc manila 2 sourcecode
💻 LUA
📖 第 1 页 / 共 2 页
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;;;;8,17,29;;10;0,11,37;0,0,0,0,3,23;;7,7,20,25;6;0,1,37;0,71,74,132,135;;;;;;;;;;;;0,2,10;0,10;;;;0,7;0,0,0,0,0,28;;;;0,10,31;;0,0,0,0,0,0,0,3,10,14,20;0,0,0,0,1,4,7,10,13,14,53,55,59;0,0,0,6,10,14,17,20,23,26,29,47;0,0,4,7,10,13,16,19;;;0,0,0,11;;; 2e74e665_manila.luac 

require("contacts_database_svc")
require("messaging_svc")
require("machine_status_svc")
require("transitions")
require("ScrollPhysics")
require("MyFaves_manager_v1_5_svc")
MessagesObject = class()
LvMessages = class()
objMessages = nil
MyFavesUtilityObj = nil
g_IsMyFavesContact = false
machinestatus = nil
main = function()
   objs3D = {}
   objs3D[1] = Camera3D
   objs2D = {}
   _application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_BACK"), LSKFunction_Callback))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MENU"), OpenMessageMenu))
   _request.NavigateOutTo:connect(OnNavigateOut)
   _request.NavigateInFrom:connect(OnNavigateIn)
   machinestatus = MachineStatus()
   MyFavesUtilityObj = MyFavesUtility()
   objMessages = MessagesObject()
   if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
      trace("[peopleMessage] : EnableLandscape")
      require("people\\peopleMessage_Landscape")
      PeopleMessage_Landscape = PeopleMessage_ScreenRotation(Camera2D, Camera3D, MessageListView, Group3D, ContactInfoGroup)
   end
   machinestatus.ContactPictureFilePath.OnValueChanged:connect(Handle_MyPhotoChanged)
   machinestatus.TwentyFourHourTime.OnValueChanged:connect(HandleTimeChange)
end

OnNavigateOut = function(l_2_0)
   machinestatus.ContactPictureFilePath.OnValueChanged:disconnect(Handle_MyPhotoChanged)
   machinestatus.TwentyFourHourTime.OnValueChanged:disconnect(HandleTimeChange)
   _request.NavigateOutTo:disconnect(OnNavigateOut)
   Transition(l_2_0, "Out")
   _application:EnableVelocityEngine(true)
   _application:HideInputPanel()
   objMessages:DisableInput()
   objMessages:DisconnectInputBoxEvent()
   objMessages:Destroy()
   machinestatus = nil
   InputBox:SetWindowSize(0, 0)
end

OnNavigateIn = function(l_3_0)
   _request.NavigateInFrom:disconnect(OnNavigateIn)
   Transition(l_3_0, "In")
   _application:EnableVelocityEngine(false)
end

HandleOnSipPanelChanged = function(l_4_0, l_4_1)
   trace("HandleOnSipPanelChanged" .. tostring(l_4_0))
   objMessages.InputBoxHeight = l_4_1
   objMessages.ShowSIP = l_4_0
   objMessages.SIPTimer:Start()
end

OpenMessageMenu = function()
   _application:HideInputPanel()
   objMessages:DisableInput()
   local l_5_0 = InputBox.WindowText
   l_5_0 = l_5_0 ~= ""
   local l_5_1 = objMessages.objLvMessages.Messages:GetCount()
   local l_5_2 = URL("Manila://PeopleMessage" .. (l_5_0 and "_drafts" or "") .. ".dialog?TYPE=MESSAGE&MesCount=" .. l_5_1)
   dialogThing = _application.DialogManager:GetDialog(l_5_2)
   dialogThing.OnExit:connect(DialogMenu_Callback)
   dialogThing:Show()
end

LSKFunction_Callback = function()
   BackToPreviousPage()
end

BackToPreviousPage = function()
   _application.Navigation:NavigateBack()
   local l_7_0 = _application.Store:GetIntValue(Lifetime_Application, "People.PeopleDetail.LaunchVia")
   if l_7_0 ~= nil and l_7_0 ~= 0 then
      Shell_GoBackToLaunchingApplication()
   end
end

DialogMenu_Callback = function(l_8_0)
   l_8_0.OnExit:disconnect(DialogMenu_Callback)
   if l_8_0.Result.ExitType ~= DialogExitType_Cancel then
      local l_8_1 = l_8_0.Result.UserValue
      if l_8_1 == "Reply With MMS" then
         trace("InputBox text : " .. InputBox.WindowText)
         Shell_SendAMMS(objMessages.PI:GetMobilePhoneNum(), InputBox.WindowText)
      elseif l_8_1 == "Save To Drafts" then
         local l_8_2 = MailDatabase("SMS", _application:GetScopedLog("Messaging"))
         l_8_2:SendSMSMessage("", objMessages.PI:GetMobilePhoneNum(), InputBox.WindowText, 1)
      elseif l_8_1 == "Forward" then
         _application.Navigation:Navigate(URL("Manila://MessageSelector/MessageSelector.page?MODE=FORWARD"), true)
      elseif l_8_1 == "Delete" then
         _application.Navigation:Navigate(URL("Manila://MessageSelector/MessageSelector.page?MODE=DELETE"), true)
      elseif l_8_1 == "Message Option" then
         _application.Navigation:Navigate(URL("Manila://MessageOption/MessageOption.page"), true)
      end
   end
end

ShowDialog = function(l_9_0, l_9_1, l_9_2, l_9_3)
   local l_9_4 = URL("Manila://Confirmation.dialog")
   l_9_4.Parameters:AddParameter("Title", l_9_0)
   l_9_4.Parameters:AddParameter("ContentString", l_9_1)
   l_9_4.Parameters:AddParameter("Type", l_9_2)
   local l_9_5 = _application.DialogManager:GetDialog(l_9_4)
   l_9_5.OnExit:connect(l_9_3)
   l_9_5:Show()
end

FunctionDialogReturned = function(l_10_0)
   l_10_0.OnExit:disconnect(FunctionDialogReturned)
end

Handle_MyPhotoChanged = function()
   trace("@@@###\t[MessagesObject:Handle_MyPhotoChanged]")
   if objMessages ~= nil then
      local l_11_0, l_11_1 = nil, nil
      objMessages.objLvMessages:SetMyPic(objMessages.PE:GetMyPicture())
      local l_11_2 = objMessages.Messages:GetCount() - 1
      local l_11_3 = objMessages.objLvMessages.listview:GetGenerator()
      for i = 0, l_11_2 do
         l_11_0 = objMessages.objLvMessages.PIDB:GetMailMessagingInstance(objMessages.objLvMessages.Messages:GetItem(i))
         if l_11_0:IsMine() then
            l_11_1 = l_11_3:GetItem(i).Namespace:FindName("HeadIcon")
            SetUserPic(objMessages.objLvMessages.MyPic, l_11_1)
         end
      end
   end
end

HandleTimeChange = function()
   if objMessages ~= nil then
      local l_12_0 = machinestatus.CurrentTime.Value
      if objMessages.ShowAMPM == l_12_0.IsTwentyFourHour then
         objMessages.ShowAMPM = not l_12_0.IsTwentyFourHour
         objMessages:ResetDateTimeFormate()
      end
   end
   trace("HandleTimeChange end")
end

GetFormatTime = function(l_13_0)
   local l_13_1 = ""
   if l_13_0:IsToday() then
      if machinestatus.CurrentTime.Value.IsTwentyFourHour then
         l_13_1 = Locale:GetString("IDS_PEOPLEMESSAGE_TODAY") .. " " .. l_13_0:GetTimeString(TimeFormatOptions_Default)
      else
         l_13_1 = Locale:GetString("IDS_PEOPLEMESSAGE_TODAY") .. " " .. l_13_0:GetTimeString(TimeFormatOptions_ExcludeTimeMarker) .. l_13_0:GetTimeString("tt")
      end
   else
      local l_13_2 = l_13_0:GetDateString(DateFormatOptions_Default)
      l_13_1 = l_13_2
   end
   return l_13_1
end

MessagesObject.__init = function(l_14_0)
   l_14_0.objBox = InputBox
   l_14_0.BGSend = BackgroundSend
   l_14_0.BtnSend = ButtonSend
   l_14_0.inputBG = InputBoxBackground
   l_14_0.InputBoxHeight = 160
   l_14_0.ShowSIP = false
   l_14_0.SIPTimer = timer(0.0099945068359375)
   l_14_0.SIPTimer:Stop()
   l_14_0.SIPTimer.OnElapsed:connect(l_14_0.DelayInputEvent, l_14_0)
   l_14_0.TayBarH = 78
   l_14_0.InputBoxDX = 120
   l_14_0.InputBoxDX_Landscape = 200
   l_14_0.InputBoxEnableH = 150
   l_14_0.InputBoxDisableH = 56
   l_14_0.InputBoxDY = 11
   l_14_0.InputBoxDY_Landscape = 11
   l_14_0.InputBoxPosPortraitX = 20
   l_14_0.InputBoxPosLandscapeX = 32
   l_14_0.SendButtonPortraitH = 154
   l_14_0.SendButtonLandscapeH = 60
   l_14_0.SendButtonW = 75
   l_14_0.InputBoxBackgroundPortraitH = 170
   l_14_0.InputBoxBackgroundLandscapeH = 80
   l_14_0.ShowAMPM = not machinestatus.CurrentTime.Value.IsTwentyFourHour
   l_14_0.PE = PeopleEngine_Instance()
   l_14_0.PI = PersonInfo()
   l_14_0.PE:GetPersonInfo(l_14_0.PI)
   if MyFavesUtilityObj:IsMyFavesTurnOn() then
      g_IsMyFavesContact = MyFavesUtilityObj:IsMyFavesContactyIDForLua(l_14_0.PI:GetIDForLua())
      trace("MyFaves on")
   end
   local l_14_1 = l_14_0.PI:GetPersonPicture()
   local l_14_2 = l_14_0.PI:GetContactType()
   if l_14_2 == -1 then
      ContactDisplayName.String = l_14_0.PI:GetUnknownPhoneNumber()
   else
      ContactDisplayName.String = l_14_0.PI:GetName()
   end
   if g_IsMyFavesContact == true and MyFavesUtilityObj:IsCircleStyle() and l_14_1 ~= nil and l_14_1:HasValue() then
      ContactPhoto._visible = false
      MyFavesContactPhoto._visible = true
      MyFavesBaseImage:SetTexture(l_14_1:GetValue().Texture)
      MyFavesBaseImage.TextureCoords.value = l_14_1:GetValue().UV
   else
      ContactPhoto._visible = true
      MyFavesContactPhoto._visible = false
      SetContactPicture(l_14_1, ContactPhoto, true, l_14_2)
   end
   local l_14_3 = PersonInfoDatabase(l_14_0.PI, PersonInfo_MESSAGE)
   local l_14_4 = l_14_3:Select(nil, nil)
   l_14_0.objLvMessages = LvMessages(l_14_3, l_14_4, MessageListView, l_14_2)
   l_14_0.objLvMessages:SetMyPic(l_14_0.PE:GetMyPicture())
   l_14_0.objLvMessages:SetContactPic(l_14_1)
   l_14_0.objLvMessages:PrepareData()
   l_14_0:InitialInputBox()
end

MessagesObject.DelayInputEvent = function(l_15_0)
   l_15_0.SIPTimer:Stop()
   if objMessages.ShowSIP then
      l_15_0:EnableInput()
   else
      l_15_0:DisableInput()
   end
end

MessagesObject.InitialInputBox = function(l_16_0)
   l_16_0.BGSend.onPress:connect(l_16_0.HandleSendOnPress, l_16_0)
   l_16_0.BGSend.onRelease:connect(l_16_0.HandleSendOnRelease, l_16_0)
   l_16_0.BGSend.onReleaseOutside:connect(l_16_0.HandleSendOnReleaseOutside, l_16_0)
   l_16_0:DisableInput()
   l_16_0:ConnectInputBoxEvent()
end

MessagesObject.DisconnectInputBoxEvent = function(l_17_0)
   _application.OnSipPanelChanged:disconnect(HandleOnSipPanelChanged)
   l_17_0.inputBG.onPress:disconnect(l_17_0.InputBox_onPress, l_17_0)
   l_17_0.objBox.onFocusOut:disconnect(l_17_0.InputBox_onFocusOut, l_17_0)
end

MessagesObject.ConnectInputBoxEvent = function(l_18_0)
   _application.OnSipPanelChanged:connect(HandleOnSipPanelChanged)
   l_18_0.inputBG.onPress:connect(l_18_0.InputBox_onPress, l_18_0)
   l_18_0.objBox.onFocusOut:connect(l_18_0.InputBox_onFocusOut, l_18_0)
end

MessagesObject.InputBox_onPress = function(l_19_0, l_19_1, l_19_2)
   trace("%%%%%%% InputBox_onPress")
   if not l_19_0.ShowSIP then
      _application:ShowInputPanel(0)
      l_19_0:EnableInput()
      trace("%%%%%%% InputBox_EnableInput")
   end
   l_19_2.value = true
end

MessagesObject.InputBox_onFocusOut = function(l_20_0)
   _application:HideInputPanel()
end

MessagesObject.DisableInput = function(l_21_0)
   trace("++++++++++++++++DisableInput")
   MessageListView:Focus()
   if _application.Orientation == ScreenOrientation_Portrait then
      l_21_0.objBox.Position.x = l_21_0.InputBoxPosPortraitX
      l_21_0.inputBG.Position.y = -(l_21_0.objLvMessages.WindowH - l_21_0.InputBoxBackgroundLandscapeH - l_21_0.TayBarH)
      l_21_0.objBox:SetWindowSize(l_21_0.objLvMessages.WindowW - l_21_0.InputBoxDX, l_21_0.InputBoxEnableH)
   else
      if _application.Orientation == ScreenOrientation_Landscape then
         l_21_0.objBox.Position.x = l_21_0.InputBoxPosLandscapeX
         l_21_0.inputBG.Position.y = -(l_21_0.objLvMessages.WindowH - l_21_0.InputBoxBackgroundLandscapeH)
         l_21_0.objBox:SetWindowSize(l_21_0.objLvMessages.WindowW - l_21_0.InputBoxDX_Landscape, l_21_0.InputBoxDisableH)
      end
   end
   l_21_0.inputBG.Size.height = l_21_0.InputBoxBackgroundLandscapeH
   l_21_0.inputBG:SetTextureRef("browse_messages_small_bg")
   l_21_0.inputBG.TextureCoords:set(0, 0, 0.9375, 0.625)
   l_21_0.objBox:SetShowWindowFlag(false)
   l_21_0.objBox.Position.y = l_21_0.inputBG.Position.y - l_21_0.InputBoxDY
   l_21_0.objBox:UpdateCoordinate()
   l_21_0.BGSend.Position.y = l_21_0.objBox.Position.y
   l_21_0.BGSend.Size.height = l_21_0.SendButtonLandscapeH
   l_21_0.BGSend.Size.width = l_21_0.SendButtonW
   l_21_0.BGSend:SetTextureRef("browse_bt2_send_up")
   l_21_0.BGSend.TextureCoords:set(0, 0, 0.5859375, 1)
   l_21_0.BtnSend.Position.y = -(l_21_0.BGSend.Size.height - l_21_0.BtnSend.Size.height) / 2
   l_21_0.ShowSIP = false
end

MessagesObject.EnableInput = function(l_22_0)
   l_22_0.objBox:SetShowWindowFlag(true)
   l_22_0.objBox:EnableAutoPopupSIP(true)
   l_22_0.objBox:Focus()
   if _application.Orientation == ScreenOrientation_Portrait then
      trace("+++++++[MessagesObject:EnableInput] :  ScreenOrientation_Portrait")
      l_22_0.inputBG.Size.height = l_22_0.InputBoxBackgroundPortraitH
      l_22_0.inputBG.Position.y = -(l_22_0.objLvMessages.WindowH - l_22_0.InputBoxHeight - l_22_0.InputBoxBackgroundPortraitH)
      l_22_0.inputBG.TextureCoords:set(0, 0, 0.9375, 0.67578125)
      l_22_0.inputBG:SetTextureRef("browse_messages_bg")
      l_22_0.objBox.Position.y = l_22_0.inputBG.Position.y - l_22_0.InputBoxDY
      l_22_0.objBox:SetWindowSize(l_22_0.objLvMessages.WindowW - l_22_0.InputBoxDX, l_22_0.InputBoxEnableH)
      l_22_0.objBox.Position.x = l_22_0.InputBoxPosPortraitX
      l_22_0.BGSend.Position.y = l_22_0.objBox.Position.y
      l_22_0.BGSend.Size.height = l_22_0.SendButtonPortraitH
      l_22_0.BGSend.Size.width = l_22_0.SendButtonW
      l_22_0.BGSend:SetTextureRef("browse_bt_send_up")
      l_22_0.BGSend.TextureCoords:set(0, 0, 0.6015625, 0.609375)
      l_22_0.BtnSend.Position.y = -(l_22_0.BGSend.Size.height - l_22_0.BtnSend.Size.height) / 2
   else
      if _application.Orientation == ScreenOrientation_Landscape then
         trace("+++++++[MessagesObject:EnableInput] :  ScreenOrientation_Landscape")
         l_22_0.inputBG.Size.height = l_22_0.InputBoxBackgroundLandscapeH
         l_22_0.inputBG.Position.y = -(l_22_0.objLvMessages.WindowH - l_22_0.InputBoxHeight - l_22_0.InputBoxBackgroundLandscapeH)
         l_22_0.objBox.Position.x = l_22_0.InputBoxPosLandscapeX
         l_22_0.objBox.Position.y = l_22_0.inputBG.Position.y - l_22_0.InputBoxDY
         l_22_0.objBox:SetWindowSize(l_22_0.objLvMessages.WindowW - l_22_0.InputBoxDX_Landscape, l_22_0.InputBoxDisableH)
         l_22_0.BGSend.Position.y = l_22_0.objBox.Position.y
         l_22_0.BGSend.Size.height = l_22_0.SendButtonLandscapeH
         l_22_0.BGSend.Size.width = l_22_0.SendButtonW
         l_22_0.BGSend:SetTextureRef("browse_bt2_send_up")
         l_22_0.BGSend.TextureCoords:set(0, 0, 0.5859375, 1)
      end
   end
   l_22_0.objBox:UpdateCoordinate()
   l_22_0.ShowSIP = true
end

⌨️ 快捷键说明

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