Exemplo n.º 1
0
        //  private void SettingsChooseIndex(int index, TitleItemDataModel clickMenu)
        // {
        //DataModel.PermitLevel = clickMenu.PermitLevel;
        ////if (DataModel.PermitLevel != -1)
        ////{
        ////    DataModel.PermitLevel ++;
        ////}
        //DataModel.SelectIndex = index;
        //if (index == -1)
        //{
        //    return;
        //}
        //var _tbCompose = Table.GetItemCompose(DataModel.SelectIndex);
        //var _count = 0;
        //for (var i = 0; i < _tbCompose.NeedId.Count; i++)
        //{
        //    if (_tbCompose.NeedId[i] != -1)
        //    {
        //        _count++;
        //    }
        //}
        //DataModel.ConsumeCount = _count;
        // }



        private void UpgradeSelect(int selectIndex, TitleItemDataModel clickMenu)
        {
            // SettingsChooseIndex(selectIndex, clickMenu);
            {
                // foreach(var menuData in DataModel.MenuDatas)
                var _enumerator4 = (DataModel.MenuDatas).GetEnumerator();
                while (_enumerator4.MoveNext())
                {
                    var _menuData = _enumerator4.Current;
                    {
                        if (_menuData.Type == 1)
                        {
                            if (_menuData.TableId == selectIndex)
                            {
                                _menuData.IsOpen = 1;
                            }
                            else
                            {
                                _menuData.IsOpen = 0;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private TitleItemDataModel GetSetItem(int titleId)
        {
            var item = new TitleItemDataModel();

            item.Id = titleId;
            if (titleId == SelectedTitleId)
            {
                item.State = SelectedState;
            }
            else
            {
                item.State = (int)TitleState.NoActive;
            }
            GameUtils.TitleAddAttr(item, Table.GetNameTitle(titleId));
            return(item);
        }
Exemplo n.º 3
0
        private void RefleshTitle()
        {
            var list = new List <TitleItemDataModel>();

            foreach (var g in Group)
            {
                var i = g.Value.Count - 1;
                for (; i >= 0; i--)
                {
                    var  id = g.Value[i];
                    bool active;
                    if ((IdList.TryGetValue(id, out active) && active) || i == 0)
                    {
                        var item = new TitleItemDataModel();

                        item.Id    = id;
                        item.State = active ? (int)TitleState.ActiveNoPutOn : (int)TitleState.NoActive;
                        GameUtils.TitleAddAttr(item, Table.GetNameTitle(id));
                        list.Add(item);
                        break;
                    }
                }
            }

            var titleList = PlayerDataManager.Instance.TitleList;

            for (var i = 0; i < list.Count; i++)
            {
                var ii = list[i];
                if (titleList.ContainsValue(ii.Id))
                {
                    ii.State = (int)TitleState.PutOn;
                }
                else
                {
                    if (ii.State != (int)TitleState.NoActive)
                    {
                        ii.State = (int)TitleState.ActiveNoPutOn;
                    }
                }
            }
            // ListSort(list);
            DataModel.Lists = new ObservableCollection <TitleItemDataModel>(list);
        }
Exemplo n.º 4
0
 private void GetGroupId(TitleItemDataModel item)
 {
     foreach (var ii in Group)
     {
         var count = ii.Value.Count;
         for (var i = 0; i < count; i++)
         {
             if (item.Id == ii.Value[i])
             {
                 SelectedState = item.State;
                 SelectGroupId = ii.Key;
                 SelectListId  = i;
                 return;
             }
         }
     }
     SelectGroupId = -1;
     SelectListId  = -1;
 }
Exemplo n.º 5
0
        private IEnumerator  UpgradeSelectToCleanCortoutine()
        {
            yield return(new WaitForSeconds(0.2f));

            var GetedTitle = 0;

            DataModel.MenuDatas.Clear();
            string a = GameUtils.GetDictionaryText(100002157);
            string b = GameUtils.GetDictionaryText(540);

            var _list = new List <TitleItemDataModel>();

            {
                var _enumerator3 = (DataModel.MenuState).GetEnumerator();
                while (_enumerator3.MoveNext())
                {
                    var _b = _enumerator3.Current;
                    {
                        var _menu = new TitleItemDataModel();
                        _menu.Type    = 0;
                        _menu.TableId = _b.Key;
                        var _type = (eTitleType)_b.Key;


                        switch (_type)
                        {
                        case eTitleType.Rank:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002157);
                        }
                        break;

                        case eTitleType.Level:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002158);
                        }
                        break;

                        case eTitleType.Strength:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002159);
                        }
                        break;

                        case eTitleType.Wings:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(1059);
                        }
                        break;

                        case eTitleType.Beast:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002161);
                        }
                        break;

                        case eTitleType.Skill:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002162);
                        }
                        break;

                        case eTitleType.Collect:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002163);
                        }
                        break;

                        case eTitleType.WingCulture:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(1060);
                        }
                        break;

                        case eTitleType.EquipFashion:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002306);
                        }
                        break;

                        case eTitleType.WeaponFashion:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002307);
                        }
                        break;

                        case eTitleType.WingFashion:
                        {
                            _menu.TypeName = GameUtils.GetDictionaryText(100002308);
                        }
                        break;
                        }
                        _list.Add(_menu);
                        if (_type == eTitleType.Rank)
                        {
                            GetedTitle = Table.GetHonor(ReceiveMilitary).TitleId;
                        }
                        else
                        {
                            GetedTitle = ReceivedIndex;
                        }

                        if (_b.Value)
                        {
                            // var aaa = DataModel.ItemSelected.State;

                            //if (SelectGroupId == -1) SelectGroupId = 3019;
                            var GainedNum = GetedTitle - SelectGroupId;
                            _menu.IsOpen = 0;
                            foreach (var tt in Group[SelectGroupId])
                            {
                                var _subMenu = new TitleItemDataModel();
                                _subMenu.Type    = 1;
                                _subMenu.TableId = tt;
                                if (clickTitleListIndex >= DataModel.Lists.Count)
                                {
                                    yield break;
                                }
                                if (GainedNum >= 0 &&
                                    DataModel.Lists[clickTitleListIndex].State != (int)TitleState.NoActive)
                                {
                                    _subMenu.GainedTitle = true;
                                    GainedNum--;
                                }
                                unFoldTitleNum++;
                                if (_subMenu.TableId == GetedTitle)
                                {
                                    _subMenu.IsOpen = 1;
                                }
                                else
                                {
                                    _subMenu.IsOpen = 0;
                                }
                                _list.Add(_subMenu);
                            }
                        }
                        else
                        {
                            _menu.IsOpen = 1;
                        }
                    }
                }
            }
            DataModel.MenuDatas = new ObservableCollection <TitleItemDataModel>(_list);
            ShowPuton();
        }