public void SetLog(PvPLog log, UIArenaManager arena)
    {
        _log   = log;
        _arena = arena;

        lblDate.text = log.LogTime.ToString(GameManager.localization.GetText("Arena_LastMatchFormatDate"));

        string s = "";

        if (log.Result < 0)
        {
            s = string.Format(GameManager.localization.GetText("Arena_LastMatchWin"), log.Opponent.Base.NickName);
        }
        else if (log.Result == 0)
        {
            s = string.Format(GameManager.localization.GetText("Arena_LastMatchDraw"), log.Opponent.Base.NickName);
        }
        else
        {
            s = string.Format(GameManager.localization.GetText("Arena_LastMatchLose"), log.Opponent.Base.NickName);
        }

        lblName.text = s;

        lblReplay.text = GameManager.localization.GetText("Arena_btnReplay");
    }
    public void onButtonRevenge_Click()
    {
        if (_selectedReportSlot == null)
        {
            MessageBox.ShowDialog(GameManager.localization.GetText("ErrorCode_Social_Revenge_NotSelectMail"), UINoticeManager.NoticeType.Message);
            return;
        }
        Debug.Log("onButtonRevenge_Click");


        int    mailID = _selectedReportSlot._report.id;
        PvALog log    = GameManager.GameUser.PvALogs.FirstOrDefault(p => p.LogId == mailID);

        if (log != null)
        {
            _controller.SendRevenge(log.Opponent.Id);
        }
        else
        {
            PvPLog pvpLog = GameManager.GameUser.PvPLogs.FirstOrDefault(p => p.LogId == mailID);
            if (pvpLog != null)
            {
                _controller.SendRevenge(pvpLog.Opponent.Id);
            }
        }
    }
Example #3
0
    public void OnResponseReport()
    {
        for (int i = 0; i < GameManager.GameUser.PvPLogs.Count; i++)
        {
            GameObject go = NGUITools.AddChild(lastMatchRoot, lastMatchPrefab);

            PvPLog log = GameManager.GameUser.PvPLogs[i];

            go.GetComponent <UILastMatchManager>().SetLog(log, this);

            go.SetActive(true);
        }
        lastMatchRoot.GetComponent <UIGrid>().Reposition();
    }
Example #4
0
    public void SetDetail(UIReport report)
    {
        btnTakeAll.gameObject.SetActive(false);
        if (report.type == 0)
        {
            PvALog log = GameManager.pvaLogs.FirstOrDefault(p => p.LogId == report.id);
            if (log != null)
            {
                lblFrom.text    = log.Opponent.Base.NickName;
                lblSubject.text = "";
                text            = "";

                string time       = log.LogTime.Hour + ":" + log.LogTime.Minute;
                string day        = log.LogTime.ToString(GameManager.localization.GetText("Global_ShortDay"));
                string enemy      = string.Format("[FF0000]{0}[-]", log.Opponent.Base.NickName);
                string SilverEarn = string.Format("[00FF00]{0}[-]", Mathf.Abs(log.Silver));
                string SilverDrop = string.Format("[00FF00]{0}[-]", Mathf.Abs(log.Silver / 10));

                string s;
                if (log.Mode == 0)
                {
                    if (log.Result < 0)
                    {
                        s    = GameManager.localization.GetText("Social_MailDetail_Pillage_WinAttack");
                        text = string.Format(s, time, day, enemy, SilverEarn, SilverDrop);
                    }
                    else
                    {
                        s    = GameManager.localization.GetText("Social_MailDetail_Pillage_LoseAttack");
                        text = string.Format(s, time, day, enemy);
                    }
                }
                else
                {
                    if (log.Result < 0)
                    {
                        s = GameManager.localization.GetText("Social_MailDetail_Pillage_WinDefence");
                    }
                    else
                    {
                        s = GameManager.localization.GetText("Social_MailDetail_Pillage_LoseDefence");
                    }
                    text = string.Format(s, time, day, enemy, SilverEarn);
                }


                Invoke("SetTexreport", 0.5f);
            }
        }
        else
        {
            PvPLog log = GameManager.pvpLogs.FirstOrDefault(p => p.LogId == report.id);
            if (log != null)
            {
                lblFrom.text    = log.Opponent.Base.NickName;
                lblSubject.text = "";
                text            = "";


                string s;
                if (log.Result < 0)
                {
                    s = GameManager.localization.GetText("Social_MailDetail_WinPVP");
                }
                else
                {
                    s = GameManager.localization.GetText("Social_MailDetail_LosePVP");
                }

                string time      = log.LogTime.Hour + ":" + log.LogTime.Minute;
                string day       = log.LogTime.ToString(GameManager.localization.GetText("Global_ShortDay"));
                string enemy     = string.Format("[FF0000]{0}[-]", log.Opponent.Base.NickName);
                string HonorEarn = string.Format("[FFFF00]{0}[-]", Mathf.Abs(log.HonorAdd));
                string curHonor  = string.Format("[FFFF00]{0}[-]", Mathf.Abs(log.HonorTotal));
                string curRank   = string.Format("[00FF00]{0}[-]", GameManager.GameUser.Base.HonorRank);

                text = string.Format(s, time, day, enemy, HonorEarn, curHonor, curRank);

                Invoke("SetTexreport", 0.5f);
            }
        }
    }
Example #5
0
 public void OnButtonReplay_Click(PvPLog log)
 {
     controller.SendReplay(log.Opponent.Id);
     type = Type.PVA;
 }