Exemple #1
0
        private void RefreshShareForm()
        {
            if (this.m_curTrophyRewardInfo == null)
            {
                return;
            }
            if (this.m_shareForm == null)
            {
                this.m_shareForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_Share.prefab");
            }
            if (this.m_shareForm == null)
            {
                return;
            }
            CAchieveInfo2     masterAchieveInfo       = CAchieveInfo2.GetMasterAchieveInfo();
            CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(this.m_curTrophyRewardInfo.Index + 1);

            if (this.m_isNewTrophy)
            {
            }
            Text component = this.m_shareForm.GetWidget(0).GetComponent <Text>();

            component.set_text(this.m_curAchieveItem.Cfg.szName);
            Text component2 = this.m_shareForm.GetWidget(5).GetComponent <Text>();

            component2.set_text(this.m_curAchieveItem.GetAchievementDesc());
            Text component3 = this.m_shareForm.GetWidget(7).GetComponent <Text>();

            component3.set_text(this.m_curAchieveItem.GetAchievementTips());
            GameObject widget     = this.m_shareForm.GetWidget(6);
            Image      component4 = widget.GetComponent <Image>();

            component4.SetSprite(this.m_curAchieveItem.GetAchieveImagePath(), this.m_shareForm, true, false, false, false);
            GameObject widget2 = this.m_shareForm.GetWidget(18);

            CAchievementSystem.SetAchieveBaseIcon(widget2.transform, this.m_curAchieveItem, this.m_shareForm);
            Image      component5 = this.m_shareForm.GetWidget(20).GetComponent <Image>();
            GameObject widget3    = this.m_shareForm.GetWidget(12);
            GameObject widget4    = this.m_shareForm.GetWidget(19);
            Text       component6 = this.m_shareForm.GetWidget(11).GetComponent <Text>();
            Text       component7 = widget3.GetComponent <Text>();
            Text       component8 = this.m_shareForm.GetWidget(16).GetComponent <Text>();

            component5.SetSprite(this.m_curTrophyRewardInfo.GetTrophyImagePath(), this.m_shareForm, true, false, false, false);
            component8.set_text(string.Format("{0}/{1}", this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep()));
            component6.set_text(this.m_curTrophyRewardInfo.Cfg.dwTrophyLvl.ToString());
            if (masterAchieveInfo.GetWorldRank() == 0u)
            {
                widget4.CustomSetActive(true);
                widget3.CustomSetActive(false);
            }
            else
            {
                widget3.CustomSetActive(true);
                component7.set_text(masterAchieveInfo.GetWorldRank().ToString());
                widget4.CustomSetActive(false);
            }
            this.DoTrophyTween();
            Text component9 = this.m_shareForm.GetWidget(10).GetComponent <Text>();

            ShareSys.SetSharePlatfText(component9);
            if (CSysDynamicBlock.bSocialBlocked)
            {
                Transform transform = this.m_shareForm.transform.Find("Panel_ShareAchievement_Btn");
                if (transform != null)
                {
                    transform.gameObject.CustomSetActive(false);
                }
                Transform transform2 = this.m_shareForm.transform.Find("Panel_NewAchievement_Btn/Btn_Share");
                if (transform2 != null)
                {
                    transform2.gameObject.CustomSetActive(false);
                }
            }
        }
Exemple #2
0
        private void RefreshData(uint achievementId)
        {
            this.ResetData();
            CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo();

            this.m_curAchieveItem = masterAchieveInfo.m_AchiveItemDic[achievementId];
            CAchieveItem2 head = this.m_curAchieveItem.GetHead();

            if (head == this.m_curAchieveItem)
            {
                this.m_isNewTrophy = true;
            }
            else
            {
                this.m_isNewTrophy = false;
            }
            uint num = 0u;

            masterAchieveInfo.GetTrophyProgress(ref num, ref this.m_nextPoint);
            uint num2 = 0u;

            for (int i = 0; i < masterAchieveInfo.MostLatelyDoneAchievements.get_Count(); i++)
            {
                CAchieveItem2 cAchieveItem = masterAchieveInfo.m_AchiveItemDic[masterAchieveInfo.MostLatelyDoneAchievements.get_Item(i)];
                num2 += cAchieveItem.Cfg.dwPoint;
            }
            this.m_startPoint = num - num2;
            this.m_endPoint   = this.m_startPoint + this.m_curAchieveItem.Cfg.dwPoint;
            CTrophyRewardInfo trophyRewardInfoByPoint = masterAchieveInfo.GetTrophyRewardInfoByPoint(this.m_startPoint);
            CTrophyRewardInfo cTrophyRewardInfo       = this.m_curTrophyRewardInfo = masterAchieveInfo.GetTrophyRewardInfoByPoint(this.m_endPoint);
            CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(cTrophyRewardInfo.Index + 1);

            if (trophyRewardInfoByPoint.Cfg.dwTrophyLvl == cTrophyRewardInfo.Cfg.dwTrophyLvl)
            {
                this.m_achievePointsFrom = Utility.Divide(this.m_startPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep());
                this.m_achievePointsTo   = Utility.Divide(this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep());
            }
            else
            {
                this.m_achievePointsFrom = 0f;
                this.m_achievePointsTo   = Utility.Divide(this.m_endPoint - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.GetPointStep());
            }
        }