Beispiel #1
0
 private void DealContent()
 {
     RankItemView.RankType = RankTypes;
     if (_curTabData != null)
     {
         RankItemView.ItemNotice = _curTabData.Notice;
     }
     RankItemView.TotalCount = _data.RankCount;
     if (ShowPanel)
     {
         SpringPanel.Begin(ShowPanel.gameObject, Vector3.zero, int.MaxValue);
     }
     YxWindowUtils.CreateItemGrid(GridPrefab, ref _itemGrid);
     foreach (var rankItemData in _data.RankDatas)
     {
         RankItemView item = YxWindowUtils.CreateItem(PrefabItem, _itemGrid.transform);
         item.UpdateView(rankItemData);
     }
     _itemGrid.repositionNow = true;
     if (SelfRankItem == null)
     {
         return;
     }
     SelfRankItem.UpdateView(_data.SelfRankDatas);
 }
Beispiel #2
0
        protected void UpdateTabs(IList <TabData> tabDatas)
        {
            YxWindowUtils.CreateItemGrid(TabelGridPerfab, ref _tabGrid);
            var count  = tabDatas.Count;
            var gridTs = _tabGrid.transform;

            _tabItems.Clear();
            for (var i = 0; i < count; i++)
            {
                if ((TabSatate & (1 << i)) == 0)
                {
                    continue;
                }
                var data = tabDatas[i];
                var item = YxWindowUtils.CreateItem(PerfabTableItem, gridTs);
                item.UpdateView(data);
                item.name    = i.ToString(CultureInfo.InvariantCulture);
                _tabItems[i] = item;
            }
            if (TabsView != null)
            {
                TabsView.localScale = _tabItems.Count < 2 ? new Vector3(0, 1, 1) : Vector3.one;
            }
            StartCoroutine(SelectFirst());
            _tabGrid.repositionNow = true;
            _tabGrid.Reposition();
        }
Beispiel #3
0
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateItemGrid(ItemGridPrefab, ref _itemGrid);
            var info = msg as Dictionary <string, object>;

            if (info == null)
            {
                return;
            }
            var data = info.ContainsKey("data") ? info["data"] : null;
            var list = data as List <object>;

            if (list == null || list.Count < 1)
            {
                if (NoDataSign != null)
                {
                    NoDataSign.SetActive(true);
                }
                return;
            }
            if (NoDataSign != null)
            {
                NoDataSign.SetActive(false);
            }
            OnSetItems(list, _itemGrid);
        }
Beispiel #4
0
        protected override void OnFreshView()
        {
            UpUserInfo();
            base.OnFreshView();
            var back = UserInfoModel.Instance.BackPack;
            var keys = back.GetKeys();

            YxWindowUtils.CreateItemGrid(ItemGridPerfab, ref _itemGrid);
            var ts = _itemGrid.transform;

            foreach (var key in keys)
            {
                var count = back.GetItem(key);
                if (count < 1)
                {
                    continue;
                }
                var item = YxWindowUtils.CreateItem(ItemPerfab, ts);
                item.UpdateView();
            }
            if (_itemGrid is YxNguiGrid)
            {
                var iGrid = _itemGrid as YxNguiGrid;
                iGrid.Makeup();
            }
            _itemGrid.repositionNow = true;
            _itemGrid.Reposition();
        }
Beispiel #5
0
        protected override void OnFreshView()
        {
            List <object> list;

            if (Data is Dictionary <string, object> )
            {
                Dictionary <string, object> dic = (Dictionary <string, object>)Data;
                if (dic.ContainsKey("data"))
                {
                    list = dic["data"] as List <object>;
                }
                else
                {
                    list = null;
                }
            }
            else
            {
                list = Data as List <object>;
            }
            if (list == null)
            {
                return;
            }
            SpringPanel.Begin(ScrollView.gameObject, Vector3.zero, int.MaxValue);
            var count = list.Count;

            YxWindowUtils.CreateItemGrid(ItemsGridPrefab, ref _itemGrid);
            _itemGrid.onCustomSort = OnCustomSort;
            var tsParent = _itemGrid.transform;

            for (var i = 0; i < count; i++)
            {
                var obj = list[i];
                if (obj == null)
                {
                    continue;
                }
                var dict = obj as Dictionary <string, object>;
                if (dict == null)
                {
                    continue;
                }
                var item = YxWindowUtils.CreateItem(RewardItemPrefab, tsParent);
                var data = new RewardItemData(dict);
                item.UpdateViewWithCallBack(data, UpdateGrid);
            }
            UpdateGrid();
            if (ScrollView != null)
            {
                ScrollView.ResetPosition();
            }
        }
Beispiel #6
0
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateItemGrid(ItemGridPrefab, ref _itemGrid);
            if (msg == null)
            {
                return;
            }
            var dict = msg as Dictionary <string, object>;

            if (dict == null)
            {
                return;
            }
            if (dict.ContainsKey("detail"))
            {
                var list   = dict["detail"] as List <object>;
                var weburl = "";
                if (dict.ContainsKey("web_host"))
                {
                    var temp = dict["web_host"];
                    weburl = temp.ToString();
                }
                if (list != null)
                {
                    var count = list.Count;
                    for (var i = 0; i < count; i++)
                    {
                        var obj = list[i];
                        if (obj == null)
                        {
                            continue;
                        }
                        if (!(obj is Dictionary <string, object>))
                        {
                            continue;
                        }
                        var cgdDict = obj as Dictionary <string, object>;
                        var item    = YxWindowUtils.CreateItem(ItemPrefab, _itemGrid.transform);
                        var cgdData = new CombatGainsDetailItemData(cgdDict)
                        {
                            Index   = (i + 1).ToString(),
                            WebHost = weburl
                        };
                        item.UpdateView(cgdData);
                    }
                }
            }
            if (dict.ContainsKey("room_id"))
            {
            }
            _itemGrid.repositionNow = true;
            _itemGrid.Reposition();
        }
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateItemGrid(ItemGridPrefab, ref _itemGrid);
            var list = msg as List <object>;

            if (list == null || list.Count < 1)
            {
                if (NoDataSign != null)
                {
                    NoDataSign.SetActive(true);
                }
                return;
            }
            if (NoDataSign != null)
            {
                NoDataSign.SetActive(false);
            }
            OnSetItems(list, _itemGrid);
        }
        protected override void OnFreshView()
        {
            YxWindowUtils.CreateItemGrid(ItemGridPrefab, ref _itemGrid);
            if (Data == null)
            {
                return;
            }
            var dict = Data as IDictionary;

            if (dict == null)
            {
                return;
            }
            _roomId = dict.Contains("room_id") ? dict["room_id"].ToString() : "";
            if (RoomId != null)
            {
                RoomId.text = _roomId;
            }
            if (Round != null)
            {
                Round.text = dict.Contains("round") ? dict["round"].ToString() : "";
            }
            if (BetAnte != null)
            {
                BetAnte.text = dict.Contains("betAnte") ? dict["betAnte"].ToString() : "";
            }
            if (GameType != null)
            {
                GameType.text = dict.Contains("gameType") ? dict["gameType"].ToString() : "";
            }
            _gameKey  = dict.Contains("game_key_c") ? dict["game_key_c"].ToString() : "";
            _function = dict.Contains("function") ? dict["function"].ToString() : "";
            if (CreateDt != null)
            {
                CreateDt.text = dict.Contains("create_dt") ? dict["create_dt"].ToString() : "----/--/-- --:--:--";
            }
            if (DetialBtn.GetComponent <UIButton>().onClick.Count == 0)
            {
                DetialBtn.GetComponent <UIButton>().onClick.Add(new EventDelegate(OnDetialBtn));
            }
            if (!dict.Contains("overinfo"))
            {
                return;
            }
            if (!(dict["overinfo"] is List <object>))
            {
                return;
            }
            var infoLists = dict["overinfo"] as List <object>;

            foreach (var infoList in infoLists)
            {
                if (!(infoList is Dictionary <string, object>))
                {
                    continue;
                }
                var infoData = infoList as Dictionary <string, object>;
                var item     = YxWindowUtils.CreateItem(NnRecordItem, _itemGrid.transform);
                item.UpdateView(infoData);
            }
            _itemGrid.repositionNow = true;
        }