Beispiel #1
0
    public async void OnContentLoaded(Content content)
    {
        scrollRect.ClearCells();

        scrollRect.totalCount = content.Season.tiers.Count + 1;
        var tiers = new List <TierData>(content.Season.tiers)
        {
            new TierData {
                isScrollRectFix = true
            }
        };

        for (var i = 0; i < tiers.Count - 1; i++)
        {
            var tier = tiers[i];
            tier.index = i;
            if (tier.Meta.parsedCriteria == default)
            {
                tier.Meta.parsedCriteria = tier.Meta.criteria.Select(Criterion.Parse).ToList();
            }
            if (tier.Meta.parsedStages == default)
            {
                tier.Meta.parsedStages = new List <Level>();
                tier.Meta.validStages  = new List <bool>();
                for (var stage = 0; stage < Math.Min(tier.Meta.stages.Count, 3); stage++)
                {
                    var level = tier.Meta.stages[stage].ToLevel(LevelType.Tier);
                    tier.Meta.parsedStages.Add(level);
                    tier.Meta.validStages.Add(level.IsLocal && level.Type == LevelType.Tier &&
                                              level.Meta.version == tier.Meta.stages[stage].Version);
                }
            }
        }

        scrollRect.objectsToFill = tiers.Cast <object>().ToArray();
        scrollRect.RefillCells();
        scrollRect.GetComponent <TransitionElement>().Apply(it =>
        {
            it.Leave(false, true);
            it.Enter();
        });
        LayoutFixer.Fix(scrollRect.content, count: 6);

        if (lastScrollPosition > -1)
        {
            await UniTask.DelayFrame(5);

            LayoutFixer.Fix(scrollRect.content, count: 6);
            scrollRect.SetVerticalNormalizedPositionFix(lastScrollPosition);
        }
        StartCoroutine(SnapCoroutine());
    }
Beispiel #2
0
 /// <summary>
 /// 生成玩家搜索列表UI
 /// </summary>
 private void GenerateSearchListUI(int playerCount)
 {
     isRecommendUI = false;
     lsRecommendList.ClearCells();
     lsRecommendList.totalCount = playerCount;
     if (lsRecommendList.totalCount > 0)
     {
         _QCharacter.gameObject.SetActive(false);
     }
     else
     {
         ShowEmptyTip(FriendTabTags.TabRecommend);
     }
     lsRecommendList.RefillCells();
 }
Beispiel #3
0
 //public Image game_name;
 //public void setGameName() {
 //    //string name = "CHỌN GAME";
 //    int nameIndex = -1;
 //    switch (gameControl.gameID) {
 //        case GameID.PHOM:
 //            // name = "PHỎM";
 //            nameIndex = 0;
 //            break;
 //        case GameID.TLMN:
 //            //  name = "TIẾN LÊN MN";
 //            nameIndex = 1;
 //            break;
 //        case GameID.XITO:
 //            // name = "XÌ TỐ";
 //            nameIndex = 2;
 //            break;
 //        case GameID.MAUBINH:
 //            // name = "MẬU BINH";
 //            nameIndex = 3;
 //            break;
 //        case GameID.BACAY:
 //            // name = "BA CÂY";
 //            nameIndex = 4;
 //            break;
 //        case GameID.LIENG:
 //            // name = "LIÊNG";
 //            nameIndex = 5;
 //            break;
 //        case GameID.XAM:
 //            // name = "SÂM";
 //            nameIndex = 6;
 //            break;
 //        case GameID.XOCDIA:
 //            // name = "XÓC ĐĨA";
 //            nameIndex = 7;
 //            break;
 //        case GameID.POKER:
 //            // name = "POKER";
 //            nameIndex = 8;
 //            break;
 //        case GameID.TAIXIU:
 //            //name = "TÀI XỈU";
 //            nameIndex = 9;
 //            break;
 //        case GameID.TLMNsolo:
 //            // name = "TIẾN LÊN MN Solo";
 //            nameIndex = 10;
 //            break;
 //        case GameID.XENG:
 //            // name = "XÈNG";
 //            nameIndex = 11;
 //            break;
 //    }
 //    game_name.sprite = gameControl.gameNames[nameIndex];
 //}
 public void createScollPane()
 {
     // List<TableItem> listTable = gameControl.listTable;
     gameControl.panelWaiting.onShow();
     //if (parent.childCount > 0) {
     //loopVerticalScrollRect.RefillCells();
     loopVerticalScrollRect.ClearCells();
     loopVerticalScrollRect.RefillCells();
     // }
     loopVerticalScrollRect.totalCount = gameControl.listTable.Count;
     //loopVerticalScrollRect.enabled = true;
     //for (int i = 0; i < listRoom.Count; i++) {
     //    Destroy(listRoom[i]);
     //}
     //listRoom.Clear();
     //for (int i = 0; i < listTable.Count; i++) {
     //    GameObject obj = Instantiate(prefabsTable) as GameObject;
     //    obj.transform.SetParent(parent);
     //    obj.transform.localScale = Vector3.one;
     //    obj.GetComponent<TableBehavior>().index = i;
     //    obj.GetComponent<TableBehavior>().ScrollCellIndex(listTable[i]);
     //    listRoom.Add(obj);
     //}
     gameControl.panelWaiting.onHide();
 }
Beispiel #4
0
 public void SetData(List <FriendCircleVo> data)
 {
     _data = data;
     //_data 需要按时间排序
     _data.Sort();
     _showData = _data.FindAll(item => {
         return((item.FriendCircleRuleInfo.friendCircleSceneInfo.NpcId == 0 && item.PublishState) ||
                item.FriendCircleRuleInfo.friendCircleSceneInfo.NpcId != 0);
     });
     _loopRect.ClearCells();
     ShowList();
     _loopRect.RefillCells();
 }
Beispiel #5
0
 /// <summary>
 /// 生成好友列表UI
 /// </summary>
 private void GenerateFriendListUI()
 {
     lsFriendList.ClearCells();
     lsFriendList.totalCount = StaticData.playerInfoData.listFriendInfo.Count;
     if (lsFriendList.totalCount > 0)
     {
         _QCharacter.gameObject.SetActive(false);
     }
     else
     {
         ShowEmptyTip(FriendTabTags.TabFriendList);
     }
     lsFriendList.RefillCells();
     GenerateFriendAmountUI(true);
 }
Beispiel #6
0
    private void GetManorLogInfo()
    {
        lsManorLog.ClearCells();
        //请求服务器,庄园日志,todo
        CSEmptyManorLogs csEmptyManorLogs = new CSEmptyManorLogs();

        ProtocalManager.Instance().SendCSEmptyManorLogs(csEmptyManorLogs, (scManorLogs) =>
        {
            if (scManorLogs != null)
            {
                listLogs = scManorLogs.StealInfo;
            }
            RefreshLogList();
            //
            UniversalTool.StartUIAnimTwo(_canvasGroup, _tra);
        }, (error) =>
        {
            StaticData.DebugGreen($"{error}");
        }, false);
    }
Beispiel #7
0
    public override void OnScreenInitialized()
    {
        base.OnScreenInitialized();

        searchInputField.onEndEdit.AddListener(value =>
        {
            actionTabs.Close();
            if (LoadedPayload.Query.search.IsNullOrEmptyTrimmed() && !value.IsNullOrEmptyTrimmed())
            {
                LoadedPayload.Query.sort = "relevance"; // Reset to relevance
            }
            LoadedPayload.Query.search = value.Trim();
            LoadLevels(true);
        });
        ownerInputField.onEndEdit.AddListener(value =>
        {
            actionTabs.Close();
            LoadedPayload.Query.owner = value.Trim().ToLower();
            LoadLevels(true);
        });

        Context.LevelManager.OnLevelDeleted.AddListener(_ =>
        {
            if (State != ScreenState.Active)
            {
                return;
            }
            // Reload active content
            if (LoadedPayload.Levels.Count > 0)
            {
                LoadedPayload.ScrollPosition = scrollRect.verticalNormalizedPosition;
                scrollRect.ClearCells();
                RenderLevels();
                scrollRect.SetVerticalNormalizedPositionFix(LoadedPayload.ScrollPosition);
            }
        });
        SetupOptions();
        Context.OnLanguageChanged.AddListener(SetupOptions);
    }
Beispiel #8
0
 internal override void Close()
 {
     _Rect.ClearCells();
     base.Close();
 }
Beispiel #9
0
 public void GenerateOrnamentListUI()
 {
     lsOrnamentList.ClearCells();
     lsOrnamentList.totalCount = listShopOrnamentList.Count;
     lsOrnamentList.RefillCells();
 }
Beispiel #10
0
 public void GenerateItemListUI()
 {
     lsItemList.ClearCells();
     lsItemList.totalCount = listShopItemList.Count;
     lsItemList.RefillCells();
 }
Beispiel #11
0
 public void GenerateSeedListUI()
 {
     lsSeedList.ClearCells();
     lsSeedList.totalCount = listShopSeedList.Count;
     lsSeedList.RefillCells();
 }
Beispiel #12
0
 /// <summary>
 /// 更改列表
 /// </summary>
 /// <param name="coutn"></param>
 public void ChangeList(int count)
 {
     m_OADList.ClearCells();
     m_OADList.totalCount = count;
     m_OADList.RefillCells();
 }