Esempio n. 1
0
    // Token: 0x06001561 RID: 5473 RVA: 0x0024BA08 File Offset: 0x00249C08
    public ushort GetItemCount(eMissionClickType Tag = eMissionClickType.None)
    {
        if (Tag == eMissionClickType.None)
        {
            Tag = this.CurrentTag;
        }
        this.MissionList.Clear();
        switch (Tag)
        {
        case eMissionClickType.Tag1:
            for (byte b = 0; b < 8; b += 1)
            {
                this.MissionList.Add(b);
            }
            return((ushort)this.MissionList.Count);

        case eMissionClickType.Tag2:
        case eMissionClickType.Tag3:
        {
            _eMissionType type;
            if (Tag == eMissionClickType.Tag2)
            {
                type = _eMissionType.Affair;
            }
            else
            {
                type = _eMissionType.Alliance;
            }
            ushort           num = 0;
            TimerTypeMission timerMissionData = DataManager.MissionDataManager.GetTimerMissionData(type);
            for (byte b2 = 0; b2 < timerMissionData.MissionCount; b2 += 1)
            {
                if (timerMissionData.TimeMission[(int)b2].State != _eTimerMissionState.Complete)
                {
                    this.MissionList.Add(timerMissionData.TimeMission[(int)b2].Index);
                    if (num > 0 && (timerMissionData.TimeMission[(int)b2].State == _eTimerMissionState.Reward || timerMissionData.TimeMission[(int)b2].State == _eTimerMissionState.Countdown))
                    {
                        for (int i = (int)num; i > 0; i--)
                        {
                            this.MissionList[i - 1] = (this.MissionList[i - 1] ^ this.MissionList[i]);
                            this.MissionList[i]     = (this.MissionList[i] ^ this.MissionList[i - 1]);
                            this.MissionList[i - 1] = (this.MissionList[i - 1] ^ this.MissionList[i]);
                        }
                    }
                    num += 1;
                }
            }
            return(num);
        }

        default:
            return(0);
        }
    }
Esempio n. 2
0
    // Token: 0x0600155F RID: 5471 RVA: 0x0024B1E0 File Offset: 0x002493E0
    public bool ChangeTag(eMissionClickType Tag, bool ForceUpdate = false)
    {
        if (!ForceUpdate && this.CurrentTag == Tag)
        {
            return(false);
        }
        if (DataManager.Instance.RoleAlliance.Id == 0u && Tag == eMissionClickType.Tag3)
        {
            Door door = GUIManager.Instance.FindMenu(EGUIWindow.Door) as Door;
            DataManager.Instance.SetSelectRequest = 0;
            door.OpenMenu(EGUIWindow.UI_AllianceHint, 0, 0, false);
            return(false);
        }
        if (this.Select != null)
        {
            this.Select.SetSelect(false, this.SelectIndex, null, null, null);
        }
        if (this.CurrentTag != eMissionClickType.Tag4)
        {
            this.Oldid = (int)this.CurrentTag;
        }
        this.CurrentTag = Tag;
        int currentTag = (int)this.CurrentTag;

        if (this.NoMission.gameObject.activeSelf)
        {
            this.NoMission.gameObject.SetActive(false);
        }
        if (!this.scrollPanel.gameObject.activeSelf)
        {
            this.scrollPanel.gameObject.SetActive(true);
        }
        if (this.CurrentTag != eMissionClickType.Tag1)
        {
            this.SetScrollViewRange(1);
        }
        else
        {
            this.SetScrollViewRange(2);
        }
        if (this.MissionListItem[currentTag] == null)
        {
            this.MissionListItem[currentTag] = new UIMissionItem[(int)this.MaxItemCount];
            for (int i = 0; i < (int)this.MaxItemCount; i++)
            {
                switch (this.CurrentTag)
                {
                case eMissionClickType.Tag1:
                    if (i == 0)
                    {
                        this.MissionListItem[currentTag][i] = new ReCommandMission(UnityEngine.Object.Instantiate(this.ItemSample[2]) as Transform, this.ReCommandSpriteArray);
                    }
                    else if (i == 1)
                    {
                        this.MissionListItem[currentTag][i] = new AchieveTarget(UnityEngine.Object.Instantiate(this.ItemSample[0]) as Transform, this.ManorKindSpriteArray.GetSprite(0));
                    }
                    else
                    {
                        this.MissionListItem[currentTag][i] = new ManorMissionKind(UnityEngine.Object.Instantiate(this.ItemSample[0]) as Transform, (eUIMissionKind)(i - 2), this.ManorKindSpriteArray);
                    }
                    this.MissionListItem[currentTag][i].TimeHandle = this;
                    break;

                case eMissionClickType.Tag2:
                    this.MissionListItem[currentTag][i] = new AffairMission(UnityEngine.Object.Instantiate(this.ItemSample[1]) as Transform, this.AffairSpriteArray, this.TimebarData);
                    if (this.MissionListItem[currentTag + 1] == null)
                    {
                        this.MissionListItem[currentTag + 1] = new UIMissionItem[(int)this.MaxItemCount];
                    }
                    this.MissionListItem[currentTag + 1][i]            = this.MissionListItem[currentTag][i];
                    this.MissionListItem[currentTag + 1][i].TimeHandle = this;
                    break;

                case eMissionClickType.Tag3:
                    this.MissionListItem[currentTag][i] = new AffairMission(UnityEngine.Object.Instantiate(this.ItemSample[1]) as Transform, this.AffairSpriteArray, this.TimebarData);
                    if (this.MissionListItem[currentTag - 1] == null)
                    {
                        this.MissionListItem[currentTag - 1] = new UIMissionItem[(int)this.MaxItemCount];
                    }
                    this.MissionListItem[currentTag - 1][i]            = this.MissionListItem[currentTag][i];
                    this.MissionListItem[currentTag - 1][i].TimeHandle = this;
                    break;

                case eMissionClickType.Tag4:
                    if (this.vipMission == null)
                    {
                        this.vipMission = new VIPMission(this.ItemSample[3], this.VIPTimebar);
                    }
                    this.vipMission.TimdHandle = this;
                    break;
                }
                if (this.CurrentTag == eMissionClickType.Tag4)
                {
                    break;
                }
            }
        }
        if (this.CurrentTag == eMissionClickType.Tag4)
        {
            this.ControllerTrans.gameObject.SetActive(false);
            this.vipMission.SetAchieve(true);
            return(true);
        }
        if (!this.ControllerTrans.gameObject.activeSelf)
        {
            this.vipMission.SetAchieve(false);
            this.ControllerTrans.gameObject.SetActive(true);
        }
        bool flag = true;

        if ((this.Oldid == 1 && this.CurrentTag == eMissionClickType.Tag3) || (this.Oldid == 2 && this.CurrentTag == eMissionClickType.Tag2))
        {
            flag = false;
        }
        if (this.CurrentTag == eMissionClickType.Tag2 || this.CurrentTag == eMissionClickType.Tag3)
        {
            for (int j = 0; j < (int)this.MaxItemCount; j++)
            {
                AffairMission affairMission = this.MissionListItem[currentTag][j] as AffairMission;
                if (this.CurrentTag == eMissionClickType.Tag2)
                {
                    affairMission.SetType(_eMissionType.Affair);
                }
                else
                {
                    affairMission.SetType(_eMissionType.Alliance);
                }
            }
        }
        if (flag)
        {
            for (byte b = 0; b < this.MaxItemCount; b += 1)
            {
                if (this.MissionListItem.Length > this.Oldid && this.MissionListItem[this.Oldid][(int)b] != null)
                {
                    this.MissionListItem[this.Oldid][(int)b].transform.gameObject.SetActive(false);
                }
                if (this.MissionListItem[currentTag][(int)b].transform.parent == null)
                {
                    this.MissionListItem[currentTag][(int)b].transform.SetParent(this.Content.GetChild((int)b));
                }
                this.MissionListItem[currentTag][(int)b].transform.localPosition = new Vector3(this.OffsetX[currentTag], 0f, 0f);
                this.MissionListItem[currentTag][(int)b].transform.localScale    = Vector3.one;
                this.MissionListItem[currentTag][(int)b].transform.gameObject.SetActive(true);
                for (int k = 0; k < this.MissionListItem[currentTag][(int)b].ItemBtn.Length; k++)
                {
                    if (this.MissionListItem[currentTag][(int)b].ItemBtn[k] != null)
                    {
                        this.MissionListItem[currentTag][(int)b].ItemBtn[k].m_Handler = this;
                    }
                }
            }
        }
        this.ItemsHeight.Clear();
        float  item      = 0f;
        ushort itemCount = this.GetItemCount(eMissionClickType.None);

        for (int l = 0; l < (int)itemCount; l++)
        {
            if (l < this.MissionListItem[currentTag].Length)
            {
                item = this.MissionListItem[currentTag][l].GetHeight();
            }
            this.ItemsHeight.Add(item);
        }
        Vector2 vector  = Vector2.zero;
        int     itemidx = 0;

        this.Select = null;
        if (itemCount > 0)
        {
            if (ForceUpdate)
            {
                vector  = this.Content.anchoredPosition;
                itemidx = this.scrollPanel.GetBeginIdx();
            }
            this.scrollPanel.AddNewDataHeight(this.ItemsHeight, this.RectSecroll.sizeDelta.y, true);
        }
        this.ResetBtn.m_BtnID2 = (int)this.CurrentTag;
        this.InfoBtn.m_BtnID2  = (int)this.CurrentTag;
        this.UpdateTime        = 0f;
        this.Update();
        if (itemCount > 0 && ForceUpdate)
        {
            this.scrollPanel.GoTo(itemidx, vector.y);
        }
        if (this.CurrentTag == eMissionClickType.Tag1 && DataManager.MissionDataManager.RewardList.Priority.Count > 0)
        {
            this.OnButtonClick(this.MissionListItem[currentTag][1].ItemBtn[0]);
        }
        else if (this.MissionListItem[currentTag][0] != null)
        {
            this.OnButtonClick(this.MissionListItem[currentTag][0].ItemBtn[0]);
        }
        return(true);
    }