Example #1
0
        private void SetAchievementListItem(CUIListElementScript listElement, CAchieveItem achieveItem)
        {
            Transform  transform  = listElement.transform;
            GameObject gameObject = transform.Find("Panel_NotGotAward").gameObject;
            GameObject obj3       = transform.Find("Panel_GotAward").gameObject;
            GameObject obj4       = transform.Find("imgIconBg/imgIcon").gameObject;
            Image      component  = transform.Find("imgIconBg").GetComponent <Image>();
            Image      image      = transform.Find("imgIconBg/imgIcon").GetComponent <Image>();
            Text       text       = transform.Find("txtName").GetComponent <Text>();
            Text       text2      = transform.Find("txtDesc").GetComponent <Text>();
            Text       text3      = transform.Find("txtProcess").GetComponent <Text>();

            if (achieveItem.GetAchieveState() == COM_ACHIEVEMENT_STATE.COM_ACHIEVEMENT_STATE_REWARD)
            {
                obj3.CustomSetActive(true);
                gameObject.CustomSetActive(false);
            }
            else
            {
                gameObject.CustomSetActive(true);
                obj3.CustomSetActive(false);
            }
            component.SetSprite(achieveItem.GetAchievementBgIconPath(), listElement.m_belongedFormScript, true, false, false);
            if (achieveItem.IsHideForegroundIcon())
            {
                obj4.CustomSetActive(false);
            }
            else
            {
                obj4.CustomSetActive(true);
                image.SetSprite(achieveItem.GetAchievementIconPath(), listElement.m_belongedFormScript, true, false, false);
            }
            text.text  = achieveItem.GetAchievementName();
            text2.text = achieveItem.GetAchievementDesc();
            if (achieveItem.m_cfgInfo.dwClassification == 2)
            {
                text3.gameObject.CustomSetActive(true);
                if (achieveItem.IsFinish())
                {
                    string[] args = new string[] { achieveItem.m_cfgInfo.dwDoneCondi.ToString(), achieveItem.m_cfgInfo.dwDoneCondi.ToString() };
                    text3.text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Type_Process_Format", args);
                }
                else
                {
                    string[] textArray2 = new string[] { achieveItem.GetAchieveDoneCnt().ToString(), achieveItem.m_cfgInfo.dwDoneCondi.ToString() };
                    text3.text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Type_Process_Format", textArray2);
                }
            }
            else
            {
                text3.gameObject.CustomSetActive(false);
            }
            this.SetAchievementListItemState(listElement, achieveItem);
            this.SetAchievementListItemAward(listElement, achieveItem);
        }
Example #2
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);
                 }
             }
         }
     }
 }