示例#1
0
        private void OnTrophyEnable(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

            if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_CurTrophies.Count)
            {
                return;
            }
            CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript;

            if (cUIListElementScript == null)
            {
                DebugHelper.Assert(false, "achievement selector sery enable elementscript is null");
                return;
            }
            CAchieveItem2 cAchieveItem = this.m_CurTrophies[srcWidgetIndexInBelongedList];
            GameObject    widget       = cUIListElementScript.GetWidget(0);
            GameObject    widget2      = cUIListElementScript.GetWidget(1);
            GameObject    widget3      = cUIListElementScript.GetWidget(2);
            GameObject    widget4      = cUIListElementScript.GetWidget(3);
            GameObject    widget5      = cUIListElementScript.GetWidget(4);

            if (Array.IndexOf <CAchieveItem2>(this.SelectedTrophies, cAchieveItem) >= 0)
            {
                widget2.CustomSetActive(true);
            }
            else
            {
                widget2.CustomSetActive(false);
            }
            Image component  = widget.GetComponent <Image>();
            Image component2 = widget5.GetComponent <Image>();
            Text  component3 = widget3.GetComponent <Text>();
            Text  component4 = widget4.GetComponent <Text>();

            if (component == null || component2 == null || component3 == null || component4 == null)
            {
                return;
            }
            CAchieveItem2 cAchieveItem2 = cAchieveItem.TryToGetMostRecentlyDoneItem();

            if (cAchieveItem2 == null)
            {
                component.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem, null);
                component3.set_text(cAchieveItem.Cfg.szName);
                component4.set_text(cAchieveItem.GetGotTimeText(false, false));
            }
            else
            {
                component.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem2.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem2, null);
                component3.set_text(cAchieveItem2.Cfg.szName);
                component4.set_text(cAchieveItem2.GetGotTimeText(false, false));
            }
        }
示例#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);
                }
            }
        }