Ejemplo n.º 1
0
 private void RefreshShareForm(CUIFormScript shareForm, uint achievementId)
 {
     if (shareForm == null)
     {
         shareForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_ShareNewAchievement.prefab");
     }
     if (shareForm != null)
     {
         CAchieveItem achieveItemById = CAchieveInfo.GetAchieveInfo().GetAchieveItemById(achievementId);
         if (achieveItemById != null)
         {
             shareForm.GetWidget(0).GetComponent <Text>().text = achieveItemById.GetAchievementName();
             shareForm.GetWidget(5).GetComponent <Text>().text = achieveItemById.GetAchievementDesc();
             shareForm.GetWidget(7).GetComponent <Text>().text = achieveItemById.GetAchievementTips();
             shareForm.GetWidget(9).GetComponent <Image>().SetSprite(achieveItemById.GetAchievementBgIconPath(), shareForm, true, false, false);
             GameObject widget = shareForm.GetWidget(6);
             if (achieveItemById.IsHideForegroundIcon())
             {
                 widget.CustomSetActive(false);
             }
             else
             {
                 widget.CustomSetActive(true);
                 widget.GetComponent <Image>().SetSprite(achieveItemById.GetAchievementIconPath(), shareForm, true, false, false);
             }
             this.RefreshAwardPanel(shareForm, achievementId);
             ShareSys.SetSharePlatfText(shareForm.GetWidget(10).GetComponent <Text>());
             if (CSysDynamicBlock.bSocialBlocked)
             {
                 Transform transform = shareForm.transform.Find("Panel_ShareAchievement_Btn");
                 if (transform != null)
                 {
                     transform.gameObject.CustomSetActive(false);
                 }
                 Transform transform2 = shareForm.transform.Find("Panel_NewAchievement_Btn/Btn_Share");
                 if (transform2 != null)
                 {
                     transform2.gameObject.CustomSetActive(false);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
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);
                }
            }
        }