예제 #1
0
 public bool IsNeedShow()
 {
     if ((this.m_cfgInfo.dwPreAchievementID > 0) && !CAchieveInfo.GetAchieveInfo().GetAchieveItemById(this.m_cfgInfo.dwPreAchievementID).IsFinish())
     {
         return(false);
     }
     return(true);
 }
예제 #2
0
        private void RefreshTypeForm(CUIFormScript typeForm = null)
        {
            if (typeForm == null)
            {
                typeForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_Type.prefab");
            }
            if (typeForm != null)
            {
                CAchieveInfo achieveInfo           = CAchieveInfo.GetAchieveInfo();
                int          gotRewardAchievePoint = achieveInfo.GetGotRewardAchievePoint(0);
                int          totalAchievePoint     = achieveInfo.GetTotalAchievePoint(0);
                string[]     args = new string[] { gotRewardAchievePoint.ToString(), totalAchievePoint.ToString() };
                typeForm.GetWidget(0).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_My_Point", args);

                string[] textArray2 = new string[] { (this.m_worldRank != 0) ? this.m_worldRank.ToString() : Singleton <CTextManager> .GetInstance().GetText("Common_Not_In_Rank") };
                typeForm.GetWidget(1).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_World_Rank", textArray2);

                Transform transform = typeForm.GetWidget(2).transform;
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform child       = transform.GetChild(i);
                    int       achieveType = i + 1;
                    int       finish      = achieveInfo.GetGotRewardAchievePoint(achieveType);
                    int       total       = achieveInfo.GetTotalAchievePoint(achieveType);
                    string[]  textArray3  = new string[] { finish.ToString(), total.ToString() };
                    child.Find("txtProcess").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Type_Process_Format", textArray3);

                    if ((finish < total) || (total == 0))
                    {
                        child.Find("imgProcessCircle").GetComponent <Image>().fillAmount = this.GetProcessCircleFillAmount(finish, total);
                        if (total == 0)
                        {
                            child.Find("imgNotFinishBg").GetComponent <Image>().color      = Color.grey;
                            child.Find("imgIcon").GetComponent <Image>().color             = Color.grey;
                            child.GetComponent <CUIEventScript>().m_onClickEventParams.tag = 1;
                            if (CSysDynamicBlock.bUnfinishBlock)
                            {
                                child.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                    else
                    {
                        child.Find("imgNotFinishBg").gameObject.CustomSetActive(false);
                        child.Find("imgProcessCircle").gameObject.CustomSetActive(false);
                        child.Find("imgFinishBg").gameObject.CustomSetActive(true);
                        child.Find("imgAllComplishMark").gameObject.CustomSetActive(true);
                    }
                    child.Find("imgRedPoint").gameObject.CustomSetActive(achieveInfo.IsHaveFinishButNotGetRewardAchievement(achieveType));
                }
            }
        }
예제 #3
0
 private void RefreshListForm(CUIFormScript listForm = null)
 {
     if (listForm == null)
     {
         listForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_List.prefab");
     }
     if (listForm != null)
     {
         listForm.GetWidget(1).GetComponent <Text>().text = CAchieveItem.GetAchievementTypeName(this.m_curAchievementType);
         this.m_oneTypeAchieveItems = CAchieveInfo.GetAchieveInfo().GetNeedShowAchieveItemsByType(this.m_curAchievementType);
         this.m_oneTypeAchieveItems.Sort();
         listForm.GetWidget(0).GetComponent <CUIListScript>().SetElementAmount(this.m_oneTypeAchieveItems.Count);
     }
 }
예제 #4
0
        private void OnAchieveStateUpdate()
        {
            CAchieveInfo achieveInfo = CAchieveInfo.GetAchieveInfo();

            if (achieveInfo != null)
            {
                if (achieveInfo.IsHaveFinishButNotGetRewardAchievement(0))
                {
                    Singleton <LobbyUISys> .GetInstance().AddRedDot(enSysEntryID.AchievementBtn, enRedDotPos.enTopRight);
                }
                else
                {
                    Singleton <LobbyUISys> .GetInstance().DelRedDot(enSysEntryID.AchievementBtn);
                }
            }
        }
예제 #5
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);
                 }
             }
         }
     }
 }
 public bool IsNeedShow()
 {
     return(this.m_cfgInfo.dwPreAchievementID <= 0u || CAchieveInfo.GetAchieveInfo().GetAchieveItemById(this.m_cfgInfo.dwPreAchievementID).IsFinish());
 }