Exemplo n.º 1
0
    void PasswordDialog(bool isFirst)
    {
        uint uid = LocalSaveManager.Instance.LoadFuncUserID();
        LocalSaveTransferPassword TransferPassword = LocalSaveManager.Instance.LoadFuncTransferPassword();

        Dialog newDialog = Dialog.Create(DialogType.DialogOK);

        newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "he180q_title");
        string detail = "";

        if (isFirst == true)
        {
            detail = GameTextUtil.GetText("he180q_content1") + "\n";
        }
        int    dd     = TransferPassword.m_TimeLimit % 100;
        int    mm     = (TransferPassword.m_TimeLimit / 100) % 100;
        int    yy     = TransferPassword.m_TimeLimit / 10000;
        string yymmdd = yy.ToString("0000") + "/" + mm.ToString("00") + "/" + dd.ToString("00");

        detail = detail + string.Format(GameTextUtil.GetText("he180q_content2"), UnityUtil.CreateDrawUserID(uid), TransferPassword.m_Password, yymmdd);
        newDialog.SetDialogText(DialogTextType.MainText, detail);
        newDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1");
        newDialog.SetDialogEvent(DialogButtonEventType.OK, () =>
        {
            m_OthersUser.PasswordText = GameTextUtil.GetText("he173p_button2_1");
        });
        newDialog.EnableFadePanel();
        newDialog.DisableCancelButton();
        newDialog.Show();
    }
Exemplo n.º 2
0
    void OnPassword()
    {
        SoundUtil.PlaySE(SEID.SE_MENU_OK);

        if (LocalSaveManager.Instance.LoadFuncTransferPasswordChk() == true)
        {
            PasswordDialog(false);
        }
        else
        {
            ServerDataUtilSend.SendPacketAPI_TransferOrder()
            .setSuccessAction(_data =>
            {
                LocalSaveTransferPassword TransferPassword = new LocalSaveTransferPassword();
                RecvTransferOrderValue TransferOrder       = _data.GetResult <RecvTransferOrder>().result;

                TransferPassword.m_Password  = TransferOrder.password;
                TransferPassword.m_TimeLimit = TransferOrder.remaining_time;
                LocalSaveManager.Instance.SaveFuncTransferPassword(TransferPassword);

                PasswordDialog(true);
            })
            .setErrorAction(data =>
            {
                if (data.m_PacketCode == API_CODE.API_CODE_MAKEPASSWORD_INVALID_RANK_ERROR)
                {
                    //--------------
                    //不正ランクの場合
                    //--------------
                    DialogManager.Open1B("OTHERS_TRANSFER_ERR_RANK_TITLE",
                                         "OTHERS_TRANSFER_ERR_RANK",
                                         "common_button1", true, true).
                    SetOkEvent(() =>
                    {
                    });
                    SoundUtil.PlaySE(SEID.SE_MENU_NG);
                }
                else
                {
                    DialogManager.Open1B("ERROR_MSG_WIDEUSE_TITLE",
                                         "ERROR_MSG_WIDEUSE",
                                         "common_button1", true, true).
                    SetOkEvent(() =>
                    {
                    });
                    SoundUtil.PlaySE(SEID.SE_MENU_NG);
                }
            })
            .SendStart();
        }
    }