public static void InitReport()
    {
        uiReport.Clear();
        foreach (PvALog log in pvaLogs)
        {
            UIReport report = new UIReport()
            {
                id       = log.LogId,
                type     = 0,
                nickName = log.Opponent.Base.NickName,
                time     = log.LogTime.ToString(localization.GetText("Arena_LastMatchFormatDate")),
                where    = localization.GetText("WorldMap_Pillage"),
            };

            if (log.Result < 0)
            {
                report.status = string.Format("[00FF00]{0}[-]", GameManager.localization.GetText("Dialog_Battle_Win"));
            }
            else if (log.Result == 0)
            {
                report.status = GameManager.localization.GetText("Dialog_Battle_Draw");
            }
            else
            {
                report.status = string.Format("[FF0000]{0}[-]", GameManager.localization.GetText("Dialog_Battle_Lose"));
            }
            uiReport.Add(report);
        }

        foreach (PvPLog log in pvpLogs)
        {
            UIReport report = new UIReport()
            {
                id       = log.LogId,
                type     = 1,
                nickName = log.Opponent.Base.NickName,
                time     = log.LogTime.ToString(localization.GetText("Arena_LastMatchFormatDate")),
                where    = localization.GetText("WorldMap_Arena"),
            };
            if (log.Result < 0)
            {
                report.status = string.Format("[00FF00]{0}[-]", GameManager.localization.GetText("Dialog_Battle_Win"));
            }
            else if (log.Result == 0)
            {
                report.status = GameManager.localization.GetText("Dialog_Battle_Draw");
            }
            else
            {
                report.status = string.Format("[FF0000]{0}[-]", GameManager.localization.GetText("Dialog_Battle_Lose"));
            }
            uiReport.Add(report);
        }
    }
Beispiel #2
0
    public void SetReport(UISocialManager manager, UIReport report)
    {
        _manager = manager;
        _report  = report;

        lblUserName.text = _report.nickName;
        lblStatus.text   = _report.status;
        lblTime.text     = _report.time;
        lblWhere.text    = _report.where;

        if (report.type == 0)
        {
            spriteWhere.spriteName = "bac";
        }
        else
        {
            spriteWhere.spriteName = "lobby_Batle";
        }
    }
Beispiel #3
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);
            }
        }
    }