facebooklogin.luac.lua

来自「htc manila 2 sourcecode」· LUA 代码 · 共 93 行

LUA
93
字号
-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;0;;0,15,27;0;0;0;;0;;; 1529ccce_manila.luac 

require("facebook_svc")
PeopleLoginComponent = class()
PeopleLoginComponent.__init = function(l_1_0)
   l_1_0._request = _request
   l_1_0._request.NavigateOutTo:connect(l_1_0.Destroy, l_1_0)
   l_1_0._application = _application
   l_1_0._application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_OK"), l_1_0.OnLeftSoftKeyPress, l_1_0))
   l_1_0._application:SetRightSoftkey(Softkey(Locale:GetString("IDS_CANCEL"), l_1_0.OnRightSoftKeyPress, l_1_0))
   FBmgr = FacebookManager_Instance()
   UserNameEmptyBg.onPress:connect(l_1_0.OnUserNameFocus, l_1_0)
   PasswordEmptyBg.onPress:connect(l_1_0.OnPasswordFocus, l_1_0)
   UserNameInputBox.onKeyDown:connect(l_1_0.onUserNameKeyDown, l_1_0)
   PasswordInputBox.onKeyDown:connect(l_1_0.onPasswordKeyDown, l_1_0)
end

PeopleLoginComponent.Destroy = function(l_2_0)
   UserNameInputBox:SetShowWindowFlag(false)
   PasswordInputBox:SetShowWindowFlag(false)
   UserNameEmptyBg.onPress:disconnect(l_2_0.OnUserNameFocus, l_2_0)
   PasswordEmptyBg.onPress:disconnect(l_2_0.OnPasswordFocus, l_2_0)
   UserNameInputBox.onKeyDown:disconnect(l_2_0.onUserNameKeyDown, l_2_0)
   PasswordInputBox.onKeyDown:disconnect(l_2_0.onPasswordKeyDown, l_2_0)
   l_2_0._request.NavigateOutTo:disconnect(l_2_0.Destroy, l_2_0)
end

PeopleLoginComponent.OnLeftSoftKeyPress = function(l_3_0)
   UserNameInputBox:SetShowWindowFlag(false)
   PasswordInputBox:SetShowWindowFlag(false)
   local l_3_1 = FBmgr:Login(UserNameInputBox.WindowText, PasswordInputBox.WindowText)
   if l_3_1 == FBError_SUCCESS_ then
      l_3_0:loginSuccessPath()
   elseif l_3_1 == FBError_BAD_AUTHENTICATION_ then
      local l_3_2 = URL("Manila://Confirmation.dialog")
      l_3_2.Parameters:AddParameter("Title", Locale:GetString("IDS_LOGINFAILED"))
      l_3_2.Parameters:AddParameter("ContentString", Locale:GetString("IDS_LOGINFAILED_MESSAGE"))
      l_3_2.Parameters:AddParameter("Type", "OK")
      local dialog = l_3_0._application.DialogManager:GetDialog(l_3_2)
      dialog.OnExit:connect(l_3_0.OnDialogShow, dialog)
      dialog:Show()
   else
      local l_3_2 = URL("Manila://Confirmation.dialog")
      l_3_2.Parameters:AddParameter("Title", Locale:GetString("IDS_LOGINFAILED"))
      l_3_2.Parameters:AddParameter("ContentString", Locale:GetString("IDS_LOGINFAILED_CONNECTIONERROR"))
      l_3_2.Parameters:AddParameter("Type", "OK")
      local dialog = l_3_0._application.DialogManager:GetDialog(l_3_2)
      dialog.OnExit:connect(l_3_0.OnDialogShow, dialog)
      dialog:Show()
   end
end

PeopleLoginComponent.OnRightSoftKeyPress = function(l_4_0)
   l_4_0._application.Navigation:NavigateBack()
end

PeopleLoginComponent.loginSuccessPath = function(l_5_0)
   l_5_0._application.Navigation:NavigateBack()
end

PeopleLoginComponent.OnUserNameFocus = function(l_6_0)
   UserNameInputBox:SetShowWindowFlag(true)
end

PeopleLoginComponent.OnPasswordFocus = function(l_7_0)
   PasswordInputBox:SetShowWindowFlag(true)
end

PeopleLoginComponent.onUserNameKeyDown = function(l_8_0, l_8_1, l_8_2, l_8_3)
   if l_8_2.Code == KeyCode_Return then
     if UserNameInputBox.WindowText ~= "" then
       UserNameInputBox:SetShowWindowFlag(false)
       PasswordInputBox:SetShowWindowFlag(true)
     end
   end
end

PeopleLoginComponent.onPasswordKeyDown = function(l_9_0, l_9_1, l_9_2, l_9_3)
   if l_9_2.Code == KeyCode_Return and UserNameInputBox.WindowText ~= "" and PasswordInputBox.WindowText ~= "" then
      l_9_0:OnLeftSoftKeyPress()
   end
end

PeopleLoginComponent.OnDialogShow = function(l_10_0, l_10_1)
   l_10_1.OnExit:disconnect(OnDialogShow, l_10_1)
   if l_10_1.Result.ExitType == DialogExitType_OK then
     UserNameInputBox:SetShowWindowFlag(true)
   end
end


⌨️ 快捷键说明

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