Exemplo n.º 1
0
 private void InitHeroItemData(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
 {
     if (((null != elementScript) && (actor != 0)) && (actor.handle.ValueComponent != null))
     {
         bool bActive = actor.handle.IsHostCamp();
         elementScript.gameObject.CustomSetActive(bActive || actor.handle.ActorControl.IsDeadState);
         this.RefreshHeroIconImage(elementScript, actor);
         this.RefreshHeroIconImageColor(elementScript, actor);
         GameObject widget = elementScript.GetWidget(3);
         GameObject obj3   = elementScript.GetWidget(4);
         if ((widget != null) && (obj3 != null))
         {
             widget.CustomSetActive(bActive);
             obj3.CustomSetActive(bActive);
             if (bActive)
             {
                 widget.GetComponent <Image>().fillAmount = actor.handle.ValueComponent.GetHpRate().single;
             }
         }
         GameObject obj4 = elementScript.GetWidget(5);
         if (obj4 != null)
         {
             if (actor.handle.ActorControl.IsDeadState)
             {
                 obj4.CustomSetActive(true);
                 obj4.GetComponent <Text>().text = string.Format("{0}", Mathf.RoundToInt(actor.handle.ActorControl.ReviveCooldown * 0.001f));
             }
             else
             {
                 obj4.CustomSetActive(false);
             }
         }
     }
 }
Exemplo n.º 2
0
        private void InitTextImageCacheList()
        {
            this.m_reviveTextCacheList.Clear();
            this.m_hpImageCacheList.Clear();
            if (null == this.heroInfoList)
            {
                return;
            }
            int elementAmount = this.heroInfoList.GetElementAmount();

            for (int i = 0; i < elementAmount; i++)
            {
                CUIListElementScript elemenet = this.heroInfoList.GetElemenet(i);
                if (elemenet != null)
                {
                    GameObject widget = elemenet.GetWidget(3);
                    if (widget != null)
                    {
                        this.m_hpImageCacheList.Add(widget.GetComponent <Image>());
                    }
                    GameObject widget2 = elemenet.GetWidget(5);
                    if (widget2 != null)
                    {
                        this.m_reviveTextCacheList.Add(widget2.GetComponent <Text>());
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void Update()
        {
            if (null == this.heroInfoList)
            {
                return;
            }
            int count = this.m_teamHeroList.get_Count();

            for (int i = 0; i < count; i++)
            {
                PoolObjHandle <ActorRoot> ptr      = this.m_teamHeroList.get_Item(i);
                CUIListElementScript      elemenet = this.heroInfoList.GetElemenet(i);
                if (ptr && ptr.handle.SkillControl != null && !(null == elemenet))
                {
                    SkillSlot skillSlot = null;
                    if (ptr.handle.SkillControl.TryGetSkillSlot(SkillSlotType.SLOT_SKILL_3, out skillSlot) && skillSlot.IsUnLock() && skillSlot.IsCDReady)
                    {
                        elemenet.GetWidget(6).CustomSetActive(true);
                    }
                    else
                    {
                        elemenet.GetWidget(6).CustomSetActive(false);
                    }
                    int num = this.m_heroInfoChangeBitsList[i];
                    if (num != 0)
                    {
                        if ((num & 1) != 0)
                        {
                            Image hpImage = this.GetHpImage(i);
                            if (hpImage != null)
                            {
                                hpImage.set_fillAmount(ptr.handle.ValueComponent.GetHpRate().single);
                            }
                            num &= -2;
                        }
                        Text reviveText = this.GetReviveText(i);
                        if (reviveText != null && (num & 2) != 0)
                        {
                            reviveText.set_text(SimpleNumericString.GetNumeric(Mathf.RoundToInt((float)ptr.handle.ActorControl.ReviveCooldown * 0.001f)));
                        }
                        this.m_heroInfoChangeBitsList[i] = num;
                    }
                }
            }
            int count2 = this.m_enemyHeroList.get_Count();

            for (int j = 0; j < count2; j++)
            {
                CUIListElementScript elemenet2 = this.heroInfoList.GetElemenet(j + 5);
                if (elemenet2 != null && this.m_enemyHeroList.get_Item(j))
                {
                    Text reviveText2 = this.GetReviveText(j + 5);
                    if (reviveText2 != null)
                    {
                        reviveText2.set_text(SimpleNumericString.GetNumeric(Mathf.RoundToInt((float)this.m_enemyHeroList.get_Item(j).handle.ActorControl.ReviveCooldown * 0.001f)));
                    }
                }
            }
        }
Exemplo n.º 4
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));
            }
        }
Exemplo n.º 5
0
    private void OnHonorItemEnable(CUIEvent uiEvent)
    {
        int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

        if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_honorInfoList.get_Count())
        {
            return;
        }
        COMDT_HONORINFO cOMDT_HONORINFO = this.m_honorInfoList.get_Item(srcWidgetIndexInBelongedList);

        if (cOMDT_HONORINFO == null)
        {
            return;
        }
        ResHonor dataByKey = GameDataMgr.resHonor.GetDataByKey((long)cOMDT_HONORINFO.iHonorID);

        if (dataByKey == null)
        {
            return;
        }
        if (cOMDT_HONORINFO.iHonorLevel < 0 || cOMDT_HONORINFO.iHonorLevel > dataByKey.astHonorLevel.Length)
        {
            return;
        }
        CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript;

        if (cUIListElementScript == null)
        {
            return;
        }
        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 (widget != null)
        {
            this.SetHonorImage(widget.transform, cOMDT_HONORINFO);
        }
        if (widget2 != null)
        {
            this.SetHonorAssitImage(widget2.transform, cOMDT_HONORINFO, uiEvent.m_srcFormScript);
        }
        if (widget3 != null)
        {
            this.SetHonorPoint(widget3.transform, cOMDT_HONORINFO);
        }
        this.SetHonorStatus(widget5, cOMDT_HONORINFO);
        widget4.CustomSetActive(false);
    }
Exemplo n.º 6
0
 private void OnActorDead(ref GameDeadEventParam eventParam)
 {
     if ((eventParam.src != 0) && (eventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
     {
         bool flag = eventParam.src.handle.IsHostCamp();
         int  num  = 0;
         CUIListElementScript elementScript = null;
         if (!flag)
         {
             this.m_enemyHeroList.Add(eventParam.src);
             num           = this.m_enemyHeroList.Count - 1;
             elementScript = this.GetHeroListElement(num + 5);
         }
         if (this.m_HeroToIndexDic.TryGetValue(eventParam.src.handle.ObjID, out num))
         {
             elementScript = this.GetHeroListElement(num);
         }
         if (elementScript != null)
         {
             if (!flag)
             {
                 elementScript.gameObject.CustomSetActive(true);
                 this.InitHeroItemData(elementScript, eventParam.src);
             }
             else
             {
                 this.RefreshHeroIconImageColor(elementScript, eventParam.src);
                 elementScript.GetWidget(5).CustomSetActive(true);
                 this.SetHeroChangeFlag(eventParam.src, enHeroInfoChangeType.ReviveCntDown, true);
             }
         }
     }
 }
Exemplo n.º 7
0
 private void OnActorRevive(ref DefaultGameEventParam eventParam)
 {
     if ((eventParam.src != 0) && (eventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
     {
         bool flag = eventParam.src.handle.IsHostCamp();
         int  num  = 0;
         if (flag)
         {
             if (this.m_HeroToIndexDic.TryGetValue(eventParam.src.handle.ObjID, out num))
             {
                 CUIListElementScript heroListElement = this.GetHeroListElement(num);
                 if (heroListElement != null)
                 {
                     this.RefreshHeroIconImageColor(heroListElement, eventParam.src);
                     heroListElement.GetWidget(5).CustomSetActive(false);
                 }
                 this.SetHeroChangeFlag(eventParam.src, enHeroInfoChangeType.ReviveCntDown, false);
             }
         }
         else
         {
             this.m_enemyHeroList.Remove(eventParam.src);
             this.RefreshEnemyHeroListUI();
         }
     }
 }
Exemplo n.º 8
0
 private void RefreshHeroReviveCntDown(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
 {
     if ((null != elementScript) && (actor != 0))
     {
         GameObject widget = elementScript.GetWidget(5);
         if ((widget != null) && actor.handle.ActorControl.IsDeadState)
         {
             widget.GetComponent <Text>().text = SimpleNumericString.GetNumeric(Mathf.RoundToInt(actor.handle.ActorControl.ReviveCooldown * 0.001f));
         }
     }
 }
Exemplo n.º 9
0
        private void RefreshHeroReviveCntDown(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor)
            {
                return;
            }
            GameObject widget = elementScript.GetWidget(5);

            if (widget != null && actor.handle.ActorControl.IsDeadState)
            {
                widget.GetComponent <Text>().set_text(SimpleNumericString.GetNumeric(Mathf.RoundToInt((float)actor.handle.ActorControl.ReviveCooldown * 0.001f)));
            }
        }
Exemplo n.º 10
0
        private void InitHeroItemData(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor || actor.handle.ValueComponent == null)
            {
                return;
            }
            bool flag = actor.handle.IsHostCamp();

            elementScript.gameObject.CustomSetActive(flag || actor.handle.ActorControl.IsDeadState);
            this.RefreshHeroIconImage(elementScript, actor);
            this.RefreshHeroIconImageColor(elementScript, actor);
            GameObject widget  = elementScript.GetWidget(3);
            GameObject widget2 = elementScript.GetWidget(4);

            if (widget != null && widget2 != null)
            {
                widget.CustomSetActive(flag);
                widget2.CustomSetActive(flag);
                if (flag)
                {
                    widget.GetComponent <Image>().set_fillAmount(actor.handle.ValueComponent.GetHpRate().single);
                }
            }
            GameObject widget3 = elementScript.GetWidget(5);

            if (widget3 != null)
            {
                if (actor.handle.ActorControl.IsDeadState)
                {
                    widget3.CustomSetActive(true);
                    widget3.GetComponent <Text>().set_text(string.Format("{0}", Mathf.RoundToInt((float)actor.handle.ActorControl.ReviveCooldown * 0.001f)));
                }
                else
                {
                    widget3.CustomSetActive(false);
                }
            }
        }
Exemplo n.º 11
0
 private void RefreshHeroIconImage(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
 {
     if ((null != elementScript) && (actor != 0))
     {
         GameObject widget = elementScript.GetWidget(0);
         if (widget != null)
         {
             ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)actor.handle.TheActorMeta.ConfigId);
             Image          component = widget.GetComponent <Image>();
             if ((component != null) && (dataByKey != null))
             {
                 component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustCircleSmall_Dir, dataByKey.szImagePath), Singleton <CBattleSystem> .instance.FightFormScript, true, false, false);
             }
         }
     }
 }
Exemplo n.º 12
0
 private void RefreshHeroIconImageColor(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
 {
     if ((null != elementScript) && (actor != 0))
     {
         GameObject widget = elementScript.GetWidget(0);
         if (widget != null)
         {
             Image component = widget.GetComponent <Image>();
             if (actor.handle.IsHostCamp())
             {
                 component.color = !actor.handle.ActorControl.IsDeadState ? CUIUtility.s_Color_White : CUIUtility.s_Color_GrayShader;
             }
             else
             {
                 component.color = CUIUtility.s_Color_GrayShader;
             }
         }
     }
 }
Exemplo n.º 13
0
        private void InitTypeMenu(CUIFormScript form)
        {
            int           num       = 2;
            CUIListScript component = form.GetWidget(0).GetComponent <CUIListScript>();

            component.SetElementAmount(2);
            for (int i = 0; i < num; i++)
            {
                CUIListElementScript elemenet = component.GetElemenet(i);
                GameObject           widget   = elemenet.GetWidget(0);
                if (widget != null)
                {
                    Text component2 = widget.GetComponent <Text>();
                    if (component2 != null)
                    {
                        component2.set_text(Singleton <CTextManager> .GetInstance().GetText(this.m_TypeMenuNameKeys[i]));
                    }
                }
            }
            component.SelectElement(0, true);
        }
Exemplo n.º 14
0
        private void RefreshHeroIconImageColor(CUIListElementScript elementScript, PoolObjHandle <ActorRoot> actor)
        {
            if (null == elementScript || !actor)
            {
                return;
            }
            GameObject widget = elementScript.GetWidget(0);

            if (widget != null)
            {
                Image component = widget.GetComponent <Image>();
                if (actor.get_handle().IsHostCamp())
                {
                    component.color = ((!actor.get_handle().ActorControl.IsDeadState) ? CUIUtility.s_Color_White : CUIUtility.s_Color_GrayShader);
                }
                else
                {
                    component.color = CUIUtility.s_Color_GrayShader;
                }
            }
        }
Exemplo n.º 15
0
        private void RefreshOverviewForm(CUIFormScript overviewForm = null)
        {
            if (overviewForm == null)
            {
                overviewForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Trophy_Overview.prefab");
            }
            if (overviewForm == null)
            {
                return;
            }
            CUIListScript component = overviewForm.GetWidget(1).GetComponent <CUIListScript>();

            if (component != null)
            {
                component.SetElementAmount(this.m_CurAchieveSeries.Count);
            }
            GameObject widget  = overviewForm.GetWidget(2);
            GameObject widget2 = overviewForm.GetWidget(3);
            GameObject widget3 = overviewForm.GetWidget(7);
            GameObject widget4 = overviewForm.GetWidget(8);
            GameObject widget5 = overviewForm.GetWidget(9);
            GameObject widget6 = overviewForm.GetWidget(10);
            GameObject widget7 = overviewForm.GetWidget(4);
            GameObject widget8 = overviewForm.GetWidget(5);
            GameObject widget9 = overviewForm.GetWidget(6);

            if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget7 == null || widget8 == null || widget9 == null || widget5 == null || widget6 == null)
            {
                DebugHelper.Assert(false, "Some of Trophy overview form widgets is null");
                return;
            }
            Text          component2        = widget.GetComponent <Text>();
            Text          component3        = widget2.GetComponent <Text>();
            Image         component4        = widget6.GetComponent <Image>();
            Image         component5        = widget3.GetComponent <Image>();
            Text          component6        = widget4.GetComponent <Text>();
            CAchieveInfo2 masterAchieveInfo = CAchieveInfo2.GetMasterAchieveInfo();

            if (masterAchieveInfo.LastDoneTrophyRewardInfo != null)
            {
                component4.SetSprite(masterAchieveInfo.LastDoneTrophyRewardInfo.GetTrophyImagePath(), overviewForm, true, false, false, false);
            }
            component2.set_text((masterAchieveInfo.LastDoneTrophyRewardInfo == null) ? "0" : string.Format("{0}", masterAchieveInfo.LastDoneTrophyRewardInfo.Cfg.dwTrophyLvl));
            if (masterAchieveInfo.GetWorldRank() == 0u)
            {
                widget5.CustomSetActive(true);
                widget2.CustomSetActive(false);
            }
            else
            {
                widget5.CustomSetActive(false);
                widget2.CustomSetActive(true);
                component3.set_text(masterAchieveInfo.GetWorldRank().ToString());
            }
            uint num  = 0u;
            uint num2 = 0u;

            masterAchieveInfo.GetTrophyProgress(ref num, ref num2);
            CTrophyRewardInfo trophyRewardInfoByPoint = masterAchieveInfo.GetTrophyRewardInfoByPoint(num);
            CTrophyRewardInfo trophyRewardInfoByIndex = masterAchieveInfo.GetTrophyRewardInfoByIndex(trophyRewardInfoByPoint.Index + 1);

            component5.set_fillAmount(Utility.Divide(num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint));
            component6.set_text(string.Format("{0}/{1}", num - trophyRewardInfoByIndex.MinPoint, trophyRewardInfoByIndex.MaxPoint - trophyRewardInfoByIndex.MinPoint));
            Text              component7 = widget7.GetComponent <Text>();
            CUIListScript     component8 = widget8.GetComponent <CUIListScript>();
            CUIEventScript    component9 = widget9.GetComponent <CUIEventScript>();
            CTrophyRewardInfo firstTrophyRewardInfoAwardNotGot = masterAchieveInfo.GetFirstTrophyRewardInfoAwardNotGot();

            if (firstTrophyRewardInfoAwardNotGot == null)
            {
                widget7.CustomSetActive(false);
                widget9.CustomSetActive(false);
                component8.SetElementAmount(0);
            }
            else
            {
                bool       flag          = false;
                CUseable[] trophyRewards = firstTrophyRewardInfoAwardNotGot.GetTrophyRewards();
                if (!firstTrophyRewardInfoAwardNotGot.HasGotAward() && firstTrophyRewardInfoAwardNotGot.IsFinish())
                {
                    flag = true;
                }
                widget7.CustomSetActive(true);
                component7.set_text(string.Format("{0}级奖励:", firstTrophyRewardInfoAwardNotGot.Cfg.dwTrophyLvl));
                component8.SetElementAmount(trophyRewards.Length);
                for (int i = 0; i < trophyRewards.Length; i++)
                {
                    CUIListElementScript elemenet = component8.GetElemenet(i);
                    CUICommonSystem.SetItemCell(overviewForm, elemenet.GetWidget(0), trophyRewards[i], false, false, false, false);
                }
                widget9.CustomSetActive(true);
                if (flag)
                {
                    CUICommonSystem.SetButtonEnableWithShader(widget9.GetComponent <Button>(), true, true);
                    component9.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Get_Trophy_Reward, new stUIEventParams
                    {
                        tag = firstTrophyRewardInfoAwardNotGot.Index
                    });
                }
                else
                {
                    CUICommonSystem.SetButtonEnableWithShader(widget9.GetComponent <Button>(), false, true);
                }
            }
        }
Exemplo n.º 16
0
 public void Update()
 {
     if (null != this.heroInfoList)
     {
         int count = this.m_teamHeroList.Count;
         CUIListElementScript elemenet = null;
         int num2  = 0;
         int index = 0;
         index = 0;
         while (index < count)
         {
             PoolObjHandle <ActorRoot> handle = this.m_teamHeroList[index];
             elemenet = this.heroInfoList.GetElemenet(index);
             if (((handle != 0) && (handle.handle.SkillControl != null)) && (null != elemenet))
             {
                 SkillSlot slot = null;
                 if ((handle.handle.SkillControl.TryGetSkillSlot(SkillSlotType.SLOT_SKILL_3, out slot) && slot.IsUnLock()) && slot.IsCDReady)
                 {
                     elemenet.GetWidget(6).CustomSetActive(true);
                 }
                 else
                 {
                     elemenet.GetWidget(6).CustomSetActive(false);
                 }
                 num2 = this.m_heroInfoChangeBitsList[index];
                 if (num2 != 0)
                 {
                     if ((num2 & 1) != 0)
                     {
                         Image hpImage = this.GetHpImage(index);
                         if (hpImage != null)
                         {
                             hpImage.fillAmount = handle.handle.ValueComponent.GetHpRate().single;
                         }
                         num2 &= -2;
                     }
                     Text reviveText = this.GetReviveText(index);
                     if ((reviveText != null) && ((num2 & 2) != 0))
                     {
                         reviveText.text = SimpleNumericString.GetNumeric(Mathf.RoundToInt(handle.handle.ActorControl.ReviveCooldown * 0.001f));
                     }
                     this.m_heroInfoChangeBitsList[index] = num2;
                 }
             }
             index++;
         }
         int num4 = this.m_enemyHeroList.Count;
         for (index = 0; index < num4; index++)
         {
             if ((this.heroInfoList.GetElemenet(index + 5) != null) && (this.m_enemyHeroList[index] != 0))
             {
                 Text text2 = this.GetReviveText(index + 5);
                 if (text2 != null)
                 {
                     PoolObjHandle <ActorRoot> handle2 = this.m_enemyHeroList[index];
                     text2.text = SimpleNumericString.GetNumeric(Mathf.RoundToInt(handle2.handle.ActorControl.ReviveCooldown * 0.001f));
                 }
             }
         }
     }
 }
Exemplo n.º 17
0
        public void Init(GameObject heroInfoPanelObj)
        {
            if (null != heroInfoPanelObj)
            {
                this.heroInfoList = heroInfoPanelObj.GetComponent <CUIListScript>();
                if (null != this.heroInfoList)
                {
                    this.heroInfoList.SetElementAmount(10);
                    this.InitTextImageCacheList();
                    Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                    if (hostPlayer == null)
                    {
                        DebugHelper.Assert(false, "HeroInfoPanel Init hostPlayer is null");
                    }
                    else
                    {
                        this.m_HeroToIndexDic.Clear();
                        this.m_enemyHeroList.Clear();
                        this.m_teamHeroList.Clear();
                        int        index   = 0;
                        int        num2    = 10;
                        bool       bActive = false;
                        GameObject widget  = null;
                        GameObject obj3    = null;
                        GameObject obj4    = null;
                        GameObject obj5    = null;
                        index = 0;
                        while (index < num2)
                        {
                            bActive = index >= 5;
                            CUIListElementScript elemenet = this.heroInfoList.GetElemenet(index);
                            if (elemenet != null)
                            {
                                elemenet.gameObject.CustomSetActive(false);
                                widget = elemenet.GetWidget(1);
                                obj3   = elemenet.GetWidget(2);
                                widget.CustomSetActive(!bActive);
                                obj3.CustomSetActive(bActive);
                                obj4 = elemenet.GetWidget(6);
                                obj5 = elemenet.GetWidget(7);
                                obj4.CustomSetActive(false);
                                obj5.CustomSetActive(!bActive);
                            }
                            index++;
                        }
                        List <Player> allPlayers = Singleton <GamePlayerCenter> .instance.GetAllPlayers();

                        int num3      = 0;
                        int listIndex = 0;
                        for (index = 0; index < allPlayers.Count; index++)
                        {
                            CUIListElementScript elementScript = null;
                            if ((allPlayers[index].PlayerCamp == hostPlayer.PlayerCamp) && (allPlayers[index] != hostPlayer))
                            {
                                listIndex     = num3;
                                elementScript = this.heroInfoList.GetElemenet(num3);
                                if ((elementScript != null) && (allPlayers[index].Captain != 0))
                                {
                                    elementScript.gameObject.CustomSetActive(true);
                                    this.InitHeroItemData(elementScript, allPlayers[index].Captain);
                                    this.AddHeroToDic(allPlayers[index].Captain, listIndex);
                                    this.m_teamHeroList.Add(allPlayers[index].Captain);
                                }
                                num3++;
                            }
                        }
                        this.InitEventListener();
                    }
                }
            }
        }
Exemplo n.º 18
0
        public void Init(GameObject heroInfoPanelObj)
        {
            if (null == heroInfoPanelObj)
            {
                return;
            }
            this.heroInfoList = heroInfoPanelObj.GetComponent <CUIListScript>();
            if (null == this.heroInfoList)
            {
                return;
            }
            this.heroInfoList.SetElementAmount(10);
            this.InitTextImageCacheList();
            Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            if (hostPlayer == null)
            {
                DebugHelper.Assert(false, "HeroInfoPanel Init hostPlayer is null");
                return;
            }
            this.m_HeroToIndexDic.Clear();
            this.m_enemyHeroList.Clear();
            this.m_teamHeroList.Clear();
            int num = 10;

            for (int i = 0; i < num; i++)
            {
                bool flag = i >= 5;
                CUIListElementScript elemenet = this.heroInfoList.GetElemenet(i);
                if (elemenet != null)
                {
                    elemenet.gameObject.CustomSetActive(false);
                    GameObject widget  = elemenet.GetWidget(1);
                    GameObject widget2 = elemenet.GetWidget(2);
                    widget.CustomSetActive(!flag);
                    widget2.CustomSetActive(flag);
                    GameObject widget3 = elemenet.GetWidget(6);
                    GameObject widget4 = elemenet.GetWidget(7);
                    widget3.CustomSetActive(false);
                    widget4.CustomSetActive(!flag);
                }
            }
            List <Player> allPlayers = Singleton <GamePlayerCenter> .instance.GetAllPlayers();

            int num2 = 0;

            for (int j = 0; j < allPlayers.get_Count(); j++)
            {
                if (allPlayers.get_Item(j).PlayerCamp == hostPlayer.PlayerCamp && allPlayers.get_Item(j) != hostPlayer)
                {
                    int listIndex = num2;
                    CUIListElementScript elemenet2 = this.heroInfoList.GetElemenet(num2);
                    if (elemenet2 != null && allPlayers.get_Item(j).Captain)
                    {
                        elemenet2.gameObject.CustomSetActive(true);
                        this.InitHeroItemData(elemenet2, allPlayers.get_Item(j).Captain);
                        this.AddHeroToDic(allPlayers.get_Item(j).Captain, listIndex);
                        this.m_teamHeroList.Add(allPlayers.get_Item(j).Captain);
                    }
                    num2++;
                }
            }
            this.InitEventListener();
        }
        private void UpdateElement(CUIListElementScript elementScript, CUseable useable, bool isShowBigIcon)
        {
            CUIFormScript belongedFormScript = elementScript.m_belongedFormScript;
            GameObject    widget             = elementScript.GetWidget(0);
            GameObject    widget2            = elementScript.GetWidget(1);
            GameObject    widget3            = elementScript.GetWidget(2);

            if (useable.m_type != COM_ITEM_TYPE.COM_OBJTYPE_HERO && useable.m_type != COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
            {
                isShowBigIcon = false;
            }
            if (!isShowBigIcon)
            {
                widget.CustomSetActive(true);
                widget2.CustomSetActive(false);
                if (useable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HERO)
                {
                    CHeroItem cHeroItem = useable as CHeroItem;
                    if (cHeroItem == null)
                    {
                        return;
                    }
                    CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo != null && masterRoleInfo.IsOwnHero(cHeroItem.m_heroData.dwCfgID))
                    {
                        widget3.CustomSetActive(true);
                    }
                    else
                    {
                        widget3.CustomSetActive(false);
                    }
                }
                else if (useable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
                {
                    CHeroSkin cHeroSkin = useable as CHeroSkin;
                    if (cHeroSkin == null)
                    {
                        return;
                    }
                    CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo2 != null && masterRoleInfo2.IsHaveHeroSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, false))
                    {
                        widget3.CustomSetActive(true);
                    }
                    else
                    {
                        widget3.CustomSetActive(false);
                    }
                }
                else
                {
                    widget3.CustomSetActive(false);
                }
                CUICommonSystem.SetItemCell(elementScript.m_belongedFormScript, elementScript.GetWidget(0), useable, true, false, false, false);
            }
            else
            {
                widget.CustomSetActive(false);
                widget2.CustomSetActive(true);
                Image      componetInChild = Utility.GetComponetInChild <Image>(widget2, "imageIcon");
                GameObject gameObject      = Utility.FindChild(widget2, "skinLabelImage");
                GameObject gameObject2     = Utility.FindChild(widget2, "nameContainer/heroNameText");
                Text       component       = gameObject2.GetComponent <Text>();
                GameObject gameObject3     = Utility.FindChild(widget2, "nameContainer/heroSkinText");
                Text       component2      = gameObject3.GetComponent <Text>();
                if (useable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HERO)
                {
                    CHeroItem cHeroItem2 = useable as CHeroItem;
                    if (cHeroItem2 == null)
                    {
                        return;
                    }
                    CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo3 != null && masterRoleInfo3.IsOwnHero(cHeroItem2.m_heroData.dwCfgID))
                    {
                        widget3.CustomSetActive(true);
                    }
                    else
                    {
                        widget3.CustomSetActive(false);
                    }
                    string prefabPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + cHeroItem2.m_iconID;
                    componetInChild.SetSprite(prefabPath, belongedFormScript, false, true, true, true);
                    gameObject2.CustomSetActive(true);
                    component.set_text(useable.m_name);
                    gameObject.CustomSetActive(false);
                    gameObject3.CustomSetActive(false);
                }
                else if (useable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
                {
                    CHeroSkin cHeroSkin2 = useable as CHeroSkin;
                    if (cHeroSkin2 == null)
                    {
                        return;
                    }
                    IHeroData heroData        = CHeroDataFactory.CreateHeroData(cHeroSkin2.m_heroId);
                    CRoleInfo masterRoleInfo4 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo4 != null && masterRoleInfo4.IsHaveHeroSkin(cHeroSkin2.m_heroId, cHeroSkin2.m_skinId, false))
                    {
                        widget3.CustomSetActive(true);
                    }
                    else
                    {
                        widget3.CustomSetActive(false);
                    }
                    string prefabPath2 = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + cHeroSkin2.m_iconID;
                    componetInChild.SetSprite(prefabPath2, belongedFormScript, false, true, true, true);
                    gameObject2.CustomSetActive(true);
                    component.set_text(heroData.heroName);
                    gameObject.CustomSetActive(true);
                    CUICommonSystem.SetHeroSkinLabelPic(belongedFormScript, gameObject, cHeroSkin2.m_heroId, cHeroSkin2.m_skinId);
                    gameObject3.CustomSetActive(true);
                    component2.set_text(useable.m_name);
                }
            }
        }
Exemplo n.º 20
0
        private void OnTrophyEnable(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

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

            if (cUIListElementScript == null)
            {
                DebugHelper.Assert(false, "achievement sery enable elementscript is null");
                return;
            }
            CAchieveItem2  cAchieveItem = this.m_CurAchieveSeries[srcWidgetIndexInBelongedList];
            CUIEventScript component    = cUIListElementScript.GetComponent <CUIEventScript>();

            component.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Trophy_Click, new stUIEventParams
            {
                commonUInt32Param1 = cAchieveItem.Cfg.dwID
            });
            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);
            GameObject widget6 = cUIListElementScript.GetWidget(5);

            widget2.CustomSetActive(false);
            Image component2 = widget.GetComponent <Image>();
            Image component3 = widget5.GetComponent <Image>();
            Text  component4 = widget3.GetComponent <Text>();
            Text  component5 = widget4.GetComponent <Text>();

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

            if (cAchieveItem2 == null)
            {
                component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem, null);
                component4.set_text(cAchieveItem.Cfg.szName);
                component5.set_text(cAchieveItem.GetGotTimeText(false, false));
                widget6.CustomSetActive(true);
            }
            else
            {
                component2.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem2.GetAchieveImagePath(), false, false), false);
                CAchievementSystem.SetAchieveBaseIcon(widget5.transform, cAchieveItem2, null);
                component4.set_text(cAchieveItem2.Cfg.szName);
                if (cAchieveItem == cAchieveItem2)
                {
                    component5.set_text(cAchieveItem.GetGotTimeText(false, false));
                }
                else
                {
                    component5.set_text(cAchieveItem2.GetGotTimeText(false, true));
                }
                widget6.CustomSetActive(false);
            }
        }
Exemplo n.º 21
0
        private void OnAchievementEnable(CUIEvent uiEvent)
        {
            if (this.m_CurAchieveItem == null)
            {
                Singleton <CUIManager> .GetInstance().CloseForm("UGUI/Form/System/Achieve/Form_Trophy_Detail.prefab");

                return;
            }
            int           srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            int           achievementCnt = this.m_CurAchieveItem.GetAchievementCnt();
            CAchieveItem2 cAchieveItem   = this.m_CurAchieveItem;
            bool          bActive        = srcWidgetIndexInBelongedList != achievementCnt - 1;

            for (int i = 0; i < srcWidgetIndexInBelongedList; i++)
            {
                cAchieveItem = cAchieveItem.Next;
            }
            CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript;
            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);
            GameObject           widget6  = cUIListElementScript.GetWidget(5);
            GameObject           widget7  = cUIListElementScript.GetWidget(6);
            GameObject           widget8  = cUIListElementScript.GetWidget(7);
            GameObject           widget9  = cUIListElementScript.GetWidget(8);
            GameObject           widget10 = cUIListElementScript.GetWidget(9);

            widget4.CustomSetActive(bActive);
            Image component  = widget.GetComponent <Image>();
            Image component2 = widget9.GetComponent <Image>();
            Text  component3 = widget2.GetComponent <Text>();
            Text  component4 = widget3.GetComponent <Text>();
            Text  component5 = widget10.GetComponent <Text>();
            Text  component6 = widget5.GetComponent <Text>();
            Text  component7 = widget6.GetComponent <Text>();

            if (component == null || component3 == null || component4 == null || component6 == null || component7 == null || component2 == null || component5 == null)
            {
                return;
            }
            component.SetSprite(CUIUtility.GetSpritePrefeb(cAchieveItem.GetAchieveImagePath(), false, false), false);
            CAchievementSystem.SetAchieveBaseIcon(widget9.transform, cAchieveItem, null);
            component3.set_text(cAchieveItem.Cfg.szName);
            component4.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Achievement_Score"), cAchieveItem.Cfg.dwPoint));
            if (cAchieveItem.IsFinish())
            {
                if (cAchieveItem.DoneTime == 0u)
                {
                    widget10.CustomSetActive(false);
                }
                else
                {
                    widget10.CustomSetActive(true);
                    component5.set_text(string.Format("{0:yyyy.M.d}", Utility.ToUtcTime2Local((long)((ulong)cAchieveItem.DoneTime))));
                }
                component6.set_text(cAchieveItem.GetAchievementDesc());
                component7.set_text(Singleton <CTextManager> .GetInstance().GetText("Achievement_Status_Done"));
                widget7.CustomSetActive(true);
                widget8.CustomSetActive(false);
            }
            else
            {
                widget10.CustomSetActive(false);
                component6.set_text(cAchieveItem.GetAchievementDesc());
                widget6.CustomSetActive(false);
                widget7.CustomSetActive(false);
                widget8.CustomSetActive(true);
            }
        }
Exemplo n.º 22
0
        private void OnTrophyRewardInfoEnable(CUIEvent uiEvent)
        {
            int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            int num = (this.m_TrophyRewardInfoWithRewardList == null) ? 0 : this.m_TrophyRewardInfoWithRewardList.Count;

            if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= num)
            {
                return;
            }
            CTrophyRewardInfo    cTrophyRewardInfo    = this.m_TrophyRewardInfoWithRewardList[srcWidgetIndexInBelongedList];
            CUIListElementScript cUIListElementScript = uiEvent.m_srcWidgetScript as CUIListElementScript;

            if (cUIListElementScript == null)
            {
                DebugHelper.Assert(false, "achievement reward enable elementscript is null");
                return;
            }
            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);
            GameObject widget6  = cUIListElementScript.GetWidget(5);
            GameObject widget7  = cUIListElementScript.GetWidget(6);
            GameObject widget8  = cUIListElementScript.GetWidget(7);
            GameObject widget9  = cUIListElementScript.GetWidget(8);
            GameObject widget10 = cUIListElementScript.GetWidget(9);
            GameObject widget11 = cUIListElementScript.GetWidget(10);

            if (cTrophyRewardInfo.HasGotAward())
            {
                widget.CustomSetActive(false);
                widget2.CustomSetActive(true);
                widget5.CustomSetActive(false);
                widget8.CustomSetActive(false);
                widget6.CustomSetActive(true);
                Text component = widget6.GetComponent <Text>();
                component.set_text(Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Got"));
                widget9.CustomSetActive(false);
            }
            else if (cTrophyRewardInfo.IsFinish())
            {
                uint num2 = 0u;
                for (int i = 0; i < 3; i++)
                {
                    if (cTrophyRewardInfo.Cfg.astReqReward[i].dwRewardNum != 0u)
                    {
                        num2 += 1u;
                    }
                }
                if (num2 == 0u)
                {
                    widget.CustomSetActive(false);
                    widget2.CustomSetActive(true);
                    widget5.CustomSetActive(false);
                    widget8.CustomSetActive(false);
                    widget6.CustomSetActive(true);
                    Text component2 = widget6.GetComponent <Text>();
                    component2.set_text(Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Done"));
                }
                else
                {
                    widget.CustomSetActive(true);
                    widget2.CustomSetActive(false);
                    widget5.CustomSetActive(false);
                    widget8.CustomSetActive(true);
                    widget6.CustomSetActive(false);
                    CUIEventScript component3 = widget8.GetComponent <CUIEventScript>();
                    if (component3 != null)
                    {
                        component3.SetUIEvent(enUIEventType.Click, enUIEventID.Achievement_Get_Trophy_Reward, new stUIEventParams
                        {
                            tag = cTrophyRewardInfo.Index
                        });
                    }
                }
                widget9.CustomSetActive(false);
            }
            else
            {
                widget.CustomSetActive(true);
                widget2.CustomSetActive(false);
                widget5.CustomSetActive(false);
                widget8.CustomSetActive(false);
                widget6.CustomSetActive(true);
                Text component4 = widget6.GetComponent <Text>();
                if (component4 != null)
                {
                    component4.set_text((cTrophyRewardInfo.State == TrophyState.OnGoing) ? Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_OnGoing") : Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Reward_Status_Not_Done"));
                }
                widget9.CustomSetActive(false);
            }
            Image component5 = widget3.GetComponent <Image>();

            component5.SetSprite(cTrophyRewardInfo.GetTrophyImagePath(), cUIListElementScript.m_belongedFormScript, true, false, false, false);
            Text component6 = widget4.GetComponent <Text>();

            if (component6 != null)
            {
                component6.set_text(cTrophyRewardInfo.Cfg.szTrophyDesc);
            }
            CUIListScript component7 = widget7.GetComponent <CUIListScript>();

            if (component7 != null)
            {
                CUseable[] trophyRewards = cTrophyRewardInfo.GetTrophyRewards();
                component7.SetElementAmount(trophyRewards.Length);
                for (int j = 0; j < trophyRewards.Length; j++)
                {
                    CUIListElementScript elemenet = component7.GetElemenet(j);
                    GameObject           widget12 = elemenet.GetWidget(0);
                    if (widget12 != null)
                    {
                        CUseable cUseable = trophyRewards[j];
                        if (cUseable == null)
                        {
                            component7.SetElementAmount(0);
                            return;
                        }
                        if (trophyRewards.Length >= 5)
                        {
                            CUICommonSystem.SetItemCell(component7.m_belongedFormScript, widget12, cUseable, false, false, false, false);
                        }
                        else
                        {
                            CUICommonSystem.SetItemCell(component7.m_belongedFormScript, widget12, cUseable, true, false, false, false);
                        }
                        if (cUseable.m_stackCount == 1)
                        {
                            Utility.FindChild(widget12, "cntBg").CustomSetActive(false);
                            Utility.FindChild(widget12, "lblIconCount").CustomSetActive(false);
                        }
                        else
                        {
                            Utility.FindChild(widget12, "cntBg").CustomSetActive(true);
                            Utility.FindChild(widget12, "lblIconCount").CustomSetActive(true);
                        }
                    }
                }
            }
        }
Exemplo n.º 23
0
        public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet)
        {
            uint payValue = 0;

            if (itemWidget.m_priceContainer != null)
            {
                itemWidget.m_priceContainer.SetActive(true);
                CMallItem.OldPriceType oldPriceType = this.GetOldPriceType();
                CUIListScript          component    = itemWidget.m_priceContainer.GetComponent <CUIListScript>();
                component.SetElementAmount(1);
                itemWidget.m_orTextContainer.CustomSetActive(false);
                CUIListElementScript elemenet = component.GetElemenet(0);
                if (elemenet == null)
                {
                    return(payValue);
                }
                GameObject widget = elemenet.GetWidget(0);
                GameObject obj3   = elemenet.GetWidget(1);
                GameObject obj4   = elemenet.GetWidget(2);
                GameObject obj5   = elemenet.GetWidget(4);
                GameObject obj6   = elemenet.GetWidget(3);
                GameObject obj7   = elemenet.GetWidget(5);
                if ((((widget == null) || (obj3 == null)) || ((obj4 == null) || (obj5 == null))) || ((obj6 == null) || (obj7 == null)))
                {
                    return(payValue);
                }
                for (int i = 0; i < payInfoSet.m_payInfoCount; i++)
                {
                    if ((payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan))
                    {
                        payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan;
                    }
                }
                for (int j = 0; j < payInfoSet.m_payInfoCount; j++)
                {
                    if (((payInfoSet.m_payInfos[j].m_payType != enPayType.DianQuan) && (payInfoSet.m_payInfos[j].m_payType != enPayType.Diamond)) && (payInfoSet.m_payInfos[j].m_payType != enPayType.DiamondAndDianQuan))
                    {
                        continue;
                    }
                    payValue = payInfoSet.m_payInfos[j].m_payValue;
                    switch (oldPriceType)
                    {
                    case CMallItem.OldPriceType.None:
                        itemWidget.m_middleOrText.CustomSetActive(true);
                        itemWidget.m_bottomOrText.CustomSetActive(false);
                        widget.SetActive(false);
                        obj3.SetActive(false);
                        obj4.SetActive(false);
                        obj6.SetActive(true);
                        obj6.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString();
                        obj7.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                        return(payValue);

                    case CMallItem.OldPriceType.FirstOne:
                        itemWidget.m_middleOrText.CustomSetActive(false);
                        itemWidget.m_bottomOrText.CustomSetActive(true);
                        if (j != 0)
                        {
                            break;
                        }
                        obj3.SetActive(false);
                        obj6.SetActive(false);
                        widget.SetActive(true);
                        obj4.SetActive(true);
                        widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString();
                        obj4.GetComponent <Text>().text   = payInfoSet.m_payInfos[j].m_payValue.ToString();
                        obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                        return(payValue);

                    case CMallItem.OldPriceType.SecondOne:
                        itemWidget.m_middleOrText.CustomSetActive(false);
                        itemWidget.m_bottomOrText.CustomSetActive(true);
                        if (j != 1)
                        {
                            goto Label_045D;
                        }
                        obj3.SetActive(false);
                        obj6.SetActive(false);
                        widget.SetActive(true);
                        obj4.SetActive(true);
                        widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString();
                        obj4.GetComponent <Text>().text   = payInfoSet.m_payInfos[j].m_payValue.ToString();
                        obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                        return(payValue);

                    case CMallItem.OldPriceType.Both:
                        itemWidget.m_middleOrText.CustomSetActive(true);
                        itemWidget.m_bottomOrText.CustomSetActive(false);
                        obj3.SetActive(false);
                        obj6.SetActive(false);
                        widget.SetActive(true);
                        obj4.SetActive(true);
                        widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString();
                        obj4.GetComponent <Text>().text   = payInfoSet.m_payInfos[j].m_payValue.ToString();
                        obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                        return(payValue);

                    default:
                        return(payValue);
                    }
                    obj3.SetActive(false);
                    widget.SetActive(false);
                    obj6.SetActive(false);
                    obj4.SetActive(true);
                    obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString();
                    obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                    return(payValue);

Label_045D:
                    obj3.SetActive(false);
                    widget.SetActive(false);
                    obj6.SetActive(false);
                    obj4.SetActive(true);
                    obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString();
                    obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false);
                    return(payValue);
                }
            }
            return(payValue);
        }
Exemplo n.º 24
0
        public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet)
        {
            uint result = 0u;

            if (itemWidget.m_priceContainer == null)
            {
                return(result);
            }
            itemWidget.m_priceContainer.SetActive(true);
            CMallItem.OldPriceType oldPriceType = this.GetOldPriceType();
            CUIListScript          component    = itemWidget.m_priceContainer.GetComponent <CUIListScript>();

            component.SetElementAmount(1);
            itemWidget.m_orTextContainer.CustomSetActive(false);
            CUIListElementScript elemenet = component.GetElemenet(0);

            if (elemenet == null)
            {
                return(result);
            }
            GameObject widget  = elemenet.GetWidget(0);
            GameObject widget2 = elemenet.GetWidget(1);
            GameObject widget3 = elemenet.GetWidget(2);
            GameObject widget4 = elemenet.GetWidget(4);
            GameObject widget5 = elemenet.GetWidget(3);
            GameObject widget6 = elemenet.GetWidget(5);

            if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget5 == null || widget6 == null)
            {
                return(result);
            }
            for (int i = 0; i < payInfoSet.m_payInfoCount; i++)
            {
                if (payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)
                {
                    payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan;
                }
            }
            for (int j = 0; j < payInfoSet.m_payInfoCount; j++)
            {
                if (payInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)
                {
                    result = payInfoSet.m_payInfos[j].m_payValue;
                    switch (oldPriceType)
                    {
                    case CMallItem.OldPriceType.None:
                    {
                        itemWidget.m_middleOrText.CustomSetActive(true);
                        itemWidget.m_bottomOrText.CustomSetActive(false);
                        widget.SetActive(false);
                        widget2.SetActive(false);
                        widget3.SetActive(false);
                        widget5.SetActive(true);
                        Text component2 = widget5.GetComponent <Text>();
                        component2.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                        Image component3 = widget6.GetComponent <Image>();
                        component3.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        break;
                    }

                    case CMallItem.OldPriceType.FirstOne:
                        itemWidget.m_middleOrText.CustomSetActive(false);
                        itemWidget.m_bottomOrText.CustomSetActive(true);
                        if (j == 0)
                        {
                            widget2.SetActive(false);
                            widget5.SetActive(false);
                            widget.SetActive(true);
                            widget3.SetActive(true);
                            Text component4 = widget.GetComponent <Text>();
                            component4.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString());
                            Text component5 = widget3.GetComponent <Text>();
                            component5.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                            Image component6 = widget4.GetComponent <Image>();
                            component6.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        }
                        else
                        {
                            widget2.SetActive(false);
                            widget.SetActive(false);
                            widget5.SetActive(false);
                            widget3.SetActive(true);
                            Text component7 = widget3.GetComponent <Text>();
                            component7.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                            Image component8 = widget4.GetComponent <Image>();
                            component8.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        }
                        break;

                    case CMallItem.OldPriceType.SecondOne:
                        itemWidget.m_middleOrText.CustomSetActive(false);
                        itemWidget.m_bottomOrText.CustomSetActive(true);
                        if (j == 1)
                        {
                            widget2.SetActive(false);
                            widget5.SetActive(false);
                            widget.SetActive(true);
                            widget3.SetActive(true);
                            Text component9 = widget.GetComponent <Text>();
                            component9.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString());
                            Text component10 = widget3.GetComponent <Text>();
                            component10.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                            Image component11 = widget4.GetComponent <Image>();
                            component11.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        }
                        else
                        {
                            widget2.SetActive(false);
                            widget.SetActive(false);
                            widget5.SetActive(false);
                            widget3.SetActive(true);
                            Text component12 = widget3.GetComponent <Text>();
                            component12.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                            Image component13 = widget4.GetComponent <Image>();
                            component13.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        }
                        break;

                    case CMallItem.OldPriceType.Both:
                    {
                        itemWidget.m_middleOrText.CustomSetActive(true);
                        itemWidget.m_bottomOrText.CustomSetActive(false);
                        widget2.SetActive(false);
                        widget5.SetActive(false);
                        widget.SetActive(true);
                        widget3.SetActive(true);
                        Text component14 = widget.GetComponent <Text>();
                        component14.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString());
                        Text component15 = widget3.GetComponent <Text>();
                        component15.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString());
                        Image component16 = widget4.GetComponent <Image>();
                        component16.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false);
                        break;
                    }
                    }
                    break;
                }
            }
            return(result);
        }