Example #1
0
        private static void ShowBraveScorePanel(CUIFormScript form, COMDT_RANKDETAIL data, bool isShow)
        {
            GameObject widget = form.GetWidget(0);

            if (!isShow)
            {
                widget.CustomSetActive(false);
                return;
            }
            widget.CustomSetActive(true);
            if (data == null)
            {
                return;
            }
            Image      component             = form.GetWidget(1).GetComponent <Image>();
            Text       component2            = form.GetWidget(2).GetComponent <Text>();
            Text       component3            = form.GetWidget(3).GetComponent <Text>();
            GameObject widget2               = form.GetWidget(15);
            uint       dwAddScoreOfConWinCnt = data.dwAddScoreOfConWinCnt;
            uint       selfBraveScoreMax     = Singleton <CLadderSystem> .GetInstance().GetSelfBraveScoreMax();

            component.fillAmount = CLadderView.GetProcessCircleFillAmount((int)dwAddScoreOfConWinCnt, (int)selfBraveScoreMax);
            component2.text      = dwAddScoreOfConWinCnt + "/" + selfBraveScoreMax;
            component3.text      = Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_Exchange_Tip", new string[]
            {
                selfBraveScoreMax.ToString()
            });

            if (data.dwContinuousWin > 0u)
            {
                widget2.CustomSetActive(true);
                Text component4 = widget2.GetComponent <Text>();
                component4.text = data.dwContinuousWin + Singleton <CTextManager> .GetInstance().GetText("Common_Continues_Win");
            }
            else
            {
                widget2.CustomSetActive(false);
            }
        }
Example #2
0
        private static void ShowBraveScorePanel(CUIFormScript form, COMDT_RANKDETAIL data, bool isShow)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(0);

            if (!isShow)
            {
                widget.CustomSetActive(false);
                return;
            }
            widget.CustomSetActive(true);
            if (data == null)
            {
                return;
            }
            ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade);
            Image            component            = form.GetWidget(1).GetComponent <Image>();
            Text             component2           = form.GetWidget(2).GetComponent <Text>();
            Text             component3           = form.GetWidget(3).GetComponent <Text>();
            Transform        transform            = form.transform.FindChild("BottomPanel/BravePanel/imgKeDu");
            GameObject       widget2 = form.GetWidget(15);
            uint             dwAddScoreOfConWinCnt = data.dwAddScoreOfConWinCnt;
            uint             selfBraveScoreMax     = Singleton <CLadderSystem> .GetInstance().GetSelfBraveScoreMax();

            component.set_fillAmount(CLadderView.GetProcessCircleFillAmount((int)dwAddScoreOfConWinCnt, (int)selfBraveScoreMax));
            component2.set_text(dwAddScoreOfConWinCnt + "/" + selfBraveScoreMax);
            component3.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_Exchange_Tip", new string[]
            {
                selfBraveScoreMax.ToString()
            }));
            transform.rotation = CLadderView.GetImgKeDuRotation(gradeDataByShowGrade.dwProtectGradeScore, selfBraveScoreMax);
            Text component4 = form.transform.FindChild("BottomPanel/BravePanel/txtBaoJi").GetComponent <Text>();

            if (dwAddScoreOfConWinCnt >= gradeDataByShowGrade.dwProtectGradeScore)
            {
                component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_KeepGrade_Txt2"));
                component.set_color(CUIUtility.s_Color_BraveScore_BaojiKedu_On);
            }
            else
            {
                component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_KeepGrade_Txt1", new string[]
                {
                    (gradeDataByShowGrade.dwProtectGradeScore - dwAddScoreOfConWinCnt).ToString()
                }));
                component.set_color(CUIUtility.s_Color_BraveScore_BaojiKedu_Off);
            }
            if (data.dwContinuousWin > 0u)
            {
                widget2.CustomSetActive(true);
                Text component5 = widget2.GetComponent <Text>();
                component5.set_text(data.dwContinuousWin + Singleton <CTextManager> .GetInstance().GetText("Common_Continues_Win"));
            }
            else
            {
                widget2.CustomSetActive(false);
            }
        }