コード例 #1
0
ファイル: MahRecordItem.cs プロジェクト: narakai/chessgame
        protected override void OnFreshView()
        {
            base.OnFreshView();
            var infoData = Data as Dictionary <string, object>;

            if (infoData != null)
            {
                var gameName = infoData["game_name"].ToString();
                var str      = string.Format("({0})", gameName);
                YxTools.TrySetComponentValue(GameName, str);
                var roomId = infoData["room_id"].ToString().Substring(3, 6);
                YxTools.TrySetComponentValue(RoomId, roomId);
                var gameCreatTime = infoData["create_dt"].ToString();
                YxTools.TrySetComponentValue(GameCreatTime, gameCreatTime);
                var infos     = infoData["overinfo"];
                var infoLists = infos as List <object>;
                if (infoLists != null)
                {
                    foreach (var infoList in infoLists)
                    {
                        var infoDic = infoList as Dictionary <string, object>;
                        if (infoDic != null)
                        {
                            var item = YxWindowUtils.CreateItem(MahPlayerHeadItem, MahPlayerHeadGrid.transform);
                            item.UpdateView(infoDic);
                        }
                    }
                    MahPlayerHeadGrid.repositionNow = true;
                }
            }
        }
コード例 #2
0
        private void GetUserData()
        {
            if (Data is string)
            {
                var manager = App.GetGameManager <Lyzz2DGameManager>();
                if (manager)
                {
                    var USeat = int.Parse(Data.ToString());
                    var sit   = (manager.CurrentSeat + USeat) % manager.PlayerNumber;
                    if (manager.Players != null && (manager.Players.Length > sit))
                    {
                        var info = manager.Players[sit].UserInfo;
                        UserName.text = name;

                        YxTools.TrySetComponentValue(UserName, info.name);
                        YxTools.TrySetComponentValue(UserID, info.id.ToString());
                        YxTools.TrySetComponentValue(UserIP, info.ip);
                        if (_userHead)
                        {
                            var texture = manager.Players[sit].CurrentInfoPanel.UserIcon;
                            if (texture)
                            {
                                _userHead.SetTexture(texture.mainTexture);
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: ShopWindow.cs プロジェクト: xinrui5577/roomgame
        protected void OnBindDate()
        {
            var userInfoModel = UserInfoModel.Instance;
            var userinfo      = userInfoModel.UserInfo;

            if (Coin != null)
            {
                Coin.text = userinfo.CoinA.ToString(CultureInfo.InvariantCulture);
            }
            YxTools.TrySetComponentValue(CoinAdapter, userinfo.CoinA, "1");
            if (Gold != null)
            {
                Gold.text = userinfo.CashA.ToString(CultureInfo.InvariantCulture);
            }
            if (Coupon != null)
            {
                Coupon.text = userinfo.CouponA.ToString(CultureInfo.InvariantCulture);
            }
            var backPack = userInfoModel.BackPack;

            if (RoomCard != null)
            {
                RoomCard.text = backPack.GetItem("item2_q").ToString(CultureInfo.InvariantCulture);
            }
        }
コード例 #4
0
 protected override void ParseData(Dictionary <string, object> dic)
 {
     YxTools.TryGetValueWitheKey(dic, out _replayId, KeyReplayId);
     YxTools.TryGetValueWitheKey(dic, out _userInfoHeads, KeyHeads);
     YxTools.TryGetValueWitheKey(dic, out _createTime, KeyTime);
     YxTools.TryGetValueWitheKey(dic, out _url, KeyUrl);
 }
コード例 #5
0
 protected override void ParseData(Dictionary <string, object> dic)
 {
     YxTools.TryGetValueWitheKey(dic, out _title, KeyTitle);
     YxTools.TryGetValueWitheKey(dic, out _time, KeyTime);
     YxTools.TryGetValueWitheKey(dic, out _mailId, KeyId);
     YxTools.TryGetValueWitheKey(dic, out _status, KeyStatus);
 }
コード例 #6
0
        protected virtual void TryGetDic(Dictionary <string, object> dic)
        {
            Dictionary <string, object> dataDic;

            YxTools.TryGetValueWitheKey(dic, out dataDic, KeyData);
            Dic = GetDatas(dataDic);
        }
コード例 #7
0
ファイル: PludoGameManager.cs プロジェクト: narakai/chessgame
 private void ShootScreen(SharePlat sharePlat)
 {
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(YxTools.ShareSceenImage(sharePlat, waitForScreen));
     }
 }
コード例 #8
0
        protected virtual void TryGetList(Dictionary <string, object> dic)
        {
            List <object> list;

            YxTools.TryGetValueWitheKey(dic, out list, KeyData);
            Items = GetDatas(list);
        }
コード例 #9
0
 protected override void OnHide()
 {
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(YxTools.WaitExcuteCalls(OnHideAction));
     }
 }
コード例 #10
0
ファイル: SpinningWindow.cs プロジェクト: xinrui5577/roomgame
 private void SetResidueDegree(int count, int costType = 0, int costNum = 0)
 {
     _residueDegree = count;
     if (ResidueDegreeLabel == null)
     {
         return;
     }
     if (count == 0 && RotateBySome)
     {
         CostContainer.SetActive(true);
         ResidueDegreeLabel.gameObject.SetActive(false);
         if (CostContainer)
         {
             YxTools.TrySetComponentValue(CostLabel, string.Format(CostLabelFormat, costNum));
             YxTools.TrySetComponentValue(CostLabelAdapter, costNum, costType.ToString(), CostLabelFormat);
             YxTools.TrySetComponentValue(CostTypeSprite, string.Format(CostSpriteFormat, costType));
         }
         return;
     }
     if (CostContainer)
     {
         CostContainer.SetActive(false);
     }
     ResidueDegreeLabel.text = string.Format(ResidueDegreeFormat, count);
 }
コード例 #11
0
        /// <summary>
        /// 查找茶馆房间
        /// </summary>
        /// <param name="teaId">茶馆ID</param>
        /// <param name="msgBoxName">提示框名称</param>
        /// <param name="successCall">成功回调</param>
        /// <param name="openTeapanel"></param>
        /// <param name="defTeaHouseName">默认茶馆窗口名称</param>
        public static void FindTeaHouse(string teaId, string msgBoxName = null, TwCallBack successCall = null, bool openTeapanel = true, string defTeaHouseName = KeyDefTeaHouseName)
        {
            var dic = new Dictionary <string, object>();

            dic[KeyTeaId] = teaId;
            Facade.Instance <TwManager>().SendAction(KeyFindTeaHouseAction, dic, message =>
            {
                if (successCall != null)
                {
                    successCall(message);
                }
                if (openTeapanel)
                {
                    Dictionary <string, object> successDic = (Dictionary <string, object>)message;
                    YxWindow window = YxWindowManager.GetWindowInstance <TeaPanel>(defTeaHouseName);
                    if (window == null)
                    {
                        window = YxTools.OpenWindowWithData(null, defTeaHouseName, successDic);
                    }
                    else
                    {
                        window.UpdateView(successDic);
                    }
                    if (window)
                    {
                        TeaPanel panel = window.GetComponent <TeaPanel>();
                        panel.SetTeaCode(int.Parse(teaId));
                        Util.SetString(KeySaveTeaKey, teaId);
                    }
                }
            });
        }
コード例 #12
0
 protected override void ParseData(Dictionary <string, object> dic)
 {
     base.ParseData(dic);
     YxTools.TryGetValueWitheKey(dic, out _dataCount, KeyCount);
     YxTools.TryGetValueWitheKey(dic, out _pageCount, KeyPageCount);
     YxTools.TryGetValueWitheKey(dic, out _pageNum, KeyPageNumber);
     YxTools.TryGetValueWitheKey(dic, out _totalCount, KeyTotalCount);
 }
コード例 #13
0
ファイル: UserInfoPanel.cs プロジェクト: narakai/chessgame
 public void SetGold(int num)
 {
     if (_userInfo != null)
     {
         _userInfo.Gold = num;
     }
     YxTools.TrySetComponentValue(Gold, YxUtiles.GetShowNumber(num).ToString());
 }
コード例 #14
0
ファイル: PludoGameManager.cs プロジェクト: narakai/chessgame
 /// <summary>
 /// 点击邀请好友按钮
 /// </summary>
 public void OnClickInviteBtn()
 {
     YxTools.ShareFriend
     (
         GameData.RoomInfo.CreateRoomInfo.RoomId.ToString(),
         GameData.RoomInfo.Rule
     );
 }
コード例 #15
0
        void AddOnClick()
        {
            ////添加返回大厅按钮的OnClick事件
            _bcakButton.onClick.Add(new EventDelegate(() =>
            {
                YxMessageBox.Show(new YxMessageBoxData
                {
                    Msg       = "确定要返回大厅吗?",
                    IsTopShow = true,
                    BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                    Listener  = (box, btnName) =>
                    {
                        if (btnName == YxMessageBox.BtnLeft)
                        {
                            App.QuitGame();
                        }
                    },
                });
            }
                                                      ));



            //微信邀请
            _invitButton.onClick.Add(new EventDelegate(() =>
            {
                YxTools.ShareFriend(_roomId.ToString(), _ruleInfo);
            }));
            //分享战绩
            _shareButton.onClick.Add(new EventDelegate(() =>
            {
                YxWindowManager.ShowWaitFor();

                Facade.Instance <WeChatApi>().InitWechat();

                UserController.Instance.GetShareInfo(info =>
                {
                    YxWindowManager.HideWaitFor();

                    _img.DoScreenShot(new Rect(0, 0, Screen.width, Screen.height), imageUrl =>
                    {
                        if (Application.platform == RuntimePlatform.Android)
                        {
                            imageUrl = "file://" + imageUrl;
                        }
                        info.ImageUrl  = imageUrl;
                        info.ShareType = ShareType.Image;
                        Facade.Instance <WeChatApi>().ShareContent(info);
                    });
                });
            }));

            _agreeBtn.onClick.Add(new EventDelegate(() => { App.GetRServer <TexasGameServer>().DismissRoom(3); SetMannerBtn(false); }));

            _disagreeBtn.onClick.Add(new EventDelegate(() => { App.GetRServer <TexasGameServer>().DismissRoom(-1); SetMannerBtn(false); }));

            _closeBtn.onClick.Add(new EventDelegate(() => { DismissRoom.transform.GetChild(0).gameObject.SetActive(false); }));
        }
コード例 #16
0
ファイル: MatchItem.cs プロジェクト: narakai/chessgame
 protected override void ParseData(Dictionary <string, object> dic)
 {
     base.ParseData(dic);
     YxTools.TryGetValueWitheKey(dic, out _selfInfo, _keySelf);
     if (dic.ContainsKey(_keyStatus))
     {
         _status = (EnumMatchState)Enum.Parse(typeof(EnumMatchState), dic[_keyStatus].ToString());
     }
 }
コード例 #17
0
ファイル: RoomListItem.cs プロジェクト: narakai/chessgame
        public void OnRoomClick(string index)
        {
            var room = RoomListModel.Instance.RoomUnitModel[int.Parse(index)];

            YxTools.GoldJoinRoom(room.GameKey, room.TypeId, delegate
            {
                RoomListController.Instance.OnDirectGame(room);
            });
        }
コード例 #18
0
ファイル: TopMenu.cs プロジェクト: xinrui5577/roomgame
        private void RefreshInfo()
        {
            var userInfo = UserInfoModel.Instance.UserInfo;

            YxTools.TrySetComponentValue(UserGold, userInfo.CoinA.ToString());
            YxTools.TrySetComponentValue(UserGoldAdapter, userInfo.CoinA, "1");
            YxTools.TrySetComponentValue(UserCash, userInfo.CashA.ToString());
            YxTools.TrySetComponentValue(RoomCard, UserInfoModel.Instance.BackPack.GetItem("item2_q").ToString());
        }
コード例 #19
0
        public void OnClickWeiChatBtn()
        {
            var CurrentGame = Manager.Data.CurrentGame;

            if (CurrentGame != null)
            {
                YxTools.ShareFriend(CurrentGame.ShowRoomId.ToString(), CurrentGame.RuleInfo);
            }
        }
コード例 #20
0
 protected override void OnShow()
 {
     if (_cacheInfo != null)
     {
         YxTools.TrySetComponentValue(Author, _cacheInfo.Sender);
         YxTools.TrySetComponentValue(Content, _cacheInfo.Content);
         YxTools.TrySetComponentValue(Time, _cacheInfo.Time);
     }
 }
コード例 #21
0
 /// <summary>
 /// 设置头像相关信息
 /// </summary>
 /// <param name="heads"></param>
 private void SetHeads(List <object> heads)
 {
     for (int i = 0, lenth = heads.Count; i < lenth; i++)
     {
         var view = YxTools.GetChildView(i, HeadItemPrefab, HeadGrid.transform);
         view.UpdateView(heads[i]);
     }
     HeadGrid.repositionNow = true;
 }
コード例 #22
0
        protected void OnUpCoin(object msg = null)
        {
            var userinfo = UserInfoModel.Instance.UserInfo;

            YxTools.TrySetComponentValue(BankCoin, userinfo.BankCoin.ToString());
            YxTools.TrySetComponentValue(UserCoin, userinfo.CoinA.ToString());
            YxTools.TrySetComponentValue(BankCoinAdapter, userinfo.BankCoin, "1");
            YxTools.TrySetComponentValue(UserCoinAdapter, userinfo.CoinA, "1");
        }
コード例 #23
0
 protected override void ParseData(Dictionary <string, object> dic)
 {
     YxTools.TryGetValueWitheKey(dic, out _status, KeyStatus);
     YxTools.TryGetValueWitheKey(dic, out _content, KeyContent);
     YxTools.TryGetValueWitheKey(dic, out _mid, KeyMid);
     YxTools.TryGetValueWitheKey(dic, out _title, KeyTitle);
     YxTools.TryGetValueWitheKey(dic, out _sender, KeySender);
     YxTools.TryGetValueWitheKey(dic, out _time, KeyCreateTime);
 }
コード例 #24
0
 protected override void TryGetList(Dictionary <string, object> dic)
 {
     base.TryGetList(dic);
     if (dic.ContainsKey(_keyDetail))
     {
         List <object> list;
         YxTools.TryGetValueWitheKey(dic, out list, _keyDetail);
         Items = GetDatas(list);
     }
 }
コード例 #25
0
 public void Init(string iconName, int showNum)
 {
     if (ShowIcon)
     {
         ShowIcon.spriteName = iconName;
         ShowIcon.MakePixelPerfect();
     }
     YxTools.TrySetComponentValue(ShowNum, string.Format("x{0}", showNum));
     YxTools.TrySetComponentValue(ShowNumAdapter, showNum, iconName, "x{0}");
 }
コード例 #26
0
        public void ShowDetailInfo(string id, MailItem Item)
        {
            selectItem = Item;
            var dic = new Dictionary <string, object>()
            {
                { KeyParamId, id }
            };

            YxTools.SendActionWithCacheKey(ActionName, dic, SuccessCall, YxTools.GetCacahKey(ActionName, dic));
        }
コード例 #27
0
ファイル: MatchItem.cs プロジェクト: narakai/chessgame
        private void OnOpenQuickGame()
        {
            RoomUnitModel model = new RoomUnitModel(null);

            model.TypeId  = _curData.GameType.ToString();
            model.GameKey = _curData.GameKey;
            YxTools.GoldJoinRoom(model.GameKey, model.TypeId, delegate {
                RoomListController.Instance.OnDirectGame(model);
            });
        }
コード例 #28
0
 protected virtual void RefreshView(List <YxData> data, int startIndex = 0)
 {
     for (int i = startIndex, endIndex = data.Count + startIndex; i < endIndex; i++)
     {
         var view     = YxTools.GetChildView(i, ListItem, Table.transform);
         var itemData = data[i - startIndex];
         view.Id = (IdAntitone? _totalCount - i :i + 1).ToString();
         view.UpdateView(itemData);
     }
     Table.repositionNow = true;
 }
コード例 #29
0
        protected override void OnEnable()
        {
            var CreateRoom = data.CurrentGame.GameRoomType == -1;

            DessolveButton.gameObject.SetActive(CreateRoom);
            YxTools.TrySetComponentValue(ReturnButton, !CreateRoom);
            if (manager.IsInit())
            {
                DessolveButton.GetComponent <BoxCollider>().enabled = manager.SelfPlayer.UserInfo.id == data.CurrentGame.OwnerId;
            }
        }
コード例 #30
0
ファイル: YxPageListView.cs プロジェクト: narakai/chessgame
        protected virtual void SendActionWithPage()
        {
            string cacaheKey = "";

            SetActionDic();
            if (ActionWithCacheKey)
            {
                cacaheKey = YxTools.GetCacahKey(ActionName, ActionParam);
            }
            YxTools.SendActionWithCacheKey(ActionName, ActionParam, UpdateView, cacaheKey);
        }