public void OpenPanel(YxBaseGameUserInfo selfInfo = null) { Bg.SetActive(true); if (selfInfo == null) { return; } selfInfo.State = false; int ante = App.GetGameData <TexasGameData>().Ante; //MinGold = selfInfo.RoomGold >= App.GetGameData<GlobalData>().Ante * 10 ? App.GetGameData<GlobalData>().Ante * 10 : selfInfo.RoomGold; MinGold = selfInfo.RoomCoin >= ante * 10 ? 0 : ante * 10 - selfInfo.RoomCoin; MinGold = MinGold > selfInfo.CoinA ? selfInfo.CoinA : MinGold; MaxGold = (selfInfo.CoinA + selfInfo.RoomCoin) > ante * 100 ? ante * 100 : selfInfo.CoinA + selfInfo.RoomCoin; //App.GetGameData<GlobalData>().Ante * 100 ? App.GetGameData<GlobalData>().Ante * 100 : selfInfo.Gold; MaxGold = selfInfo.RoomCoin >= ante * 100 ? 0 : MaxGold - selfInfo.RoomCoin; //App.GetGameData<GlobalData>().Ante*100 - selfInfo.RoomGold; Debug.Log(" ==== Ante == " + ante + " , MinGold == " + MinGold + " , MaxGold == " + MaxGold + " ==== "); MinGoldLabel.text = string.Format("最小:{0}", YxUtiles.ReduceNumber(MinGold)); MaxGoldLabel.text = string.Format("最大:{0}", YxUtiles.ReduceNumber(MaxGold)); TotalGoldLabel.text = string.Format("现有金额:{0}", YxUtiles.ReduceNumber(selfInfo.CoinA)); ChooseSlider.value = 1f; ChooseGold = MaxGold; //显示要带入筹码金额 ChooseGoldLabelAdp.Text(YxUtiles.ReduceNumber(ChooseGold)); }
protected virtual void CyclePerformNum() { int time = Int32.Parse(CountdownNum.Value) - 1; CountdownNum.Text(time.ToString(CultureInfo.InvariantCulture)); CountDownSprite.fillAmount -= _cdStep; if (Int32.Parse(CountdownNum.Value) > 0) { return; } CountdownNum.Text("0"); CountDownSprite.fillAmount = 0; EndCountdown(); }
void SetLabel(long gold, NguiLabelAdapter adapter) { adapter.Text(gold); var labelStyle = gold >= 0 ? WinLabelStyle : LoseLabelStyle; SetLabelStyle(adapter, labelStyle); adapter.gameObject.SetActive(true); }
protected override void OnChangeData(IItemData itemData, string itemType) { _model = itemData as GameUnitModel; if (_model == null) { gameObject.SetActive(false); return; } gameObject.SetActive(true); if (GameNameLabel != null) { GameNameLabel.Text(_model.GameName); } if (Background != null) { var gm = GameListModel.Instance; var group = gm.GetGroup(gm.CurGroup); Background.spriteName = string.Format("{0}{1}", BackgroundNamePrefix, group.Type); } name = _model.GameKey; if (_itemView != null) { Destroy(_itemView.gameObject); } var assetname = string.Format("gamelist_{0}", name); if (!string.IsNullOrEmpty(itemType)) { assetname = string.Format("{0}_{1}", assetname, itemType); } var bundlePrefix = string.Format("{0}_{1}", App.Skin.GameInfo, name); var bundleName = string.Format("{0}/{1}", bundlePrefix, assetname); var go = ResourceManager.LoadAsset(App.Skin.GameInfo, bundleName, assetname);//App.HallName if (go == null) { return; } go = Instantiate(go); var ts = go.transform; var lcScale = ts.localScale; var lcPos = ts.localPosition; var lcRot = ts.localRotation; ts.parent = transform; ts.localPosition = lcPos; ts.localRotation = lcRot; ts.localScale = lcScale; _itemView = go.GetComponent <GameListItemView>(); if (_itemView != null) { _itemView.FreshBtnClickBound(_btn, DefaultBoxWidget, _model.GameState == GameState.Developing); } else { YxDebug.LogError("没有GameListItemView", "GameListItem"); } }
/// <summary> /// 初始化排名信息 /// </summary> /// <param name="playerName">玩家名字</param> /// <param name="gold">输赢</param> /// <param name="rank">排名(1--3)</param> public void InitItem(string playerName, int gold, int rank) { var labelStylt = gold >= 0 ? WinLabelStyle : LoseLabelStyle; SetLabelStyle(GoldLabel, labelStylt); PlayerName.Text(playerName); GoldLabel.Text(YxUtiles.ReduceNumber(gold)); SetRank(rank); }
private void SetWinValLabel(int win) { if (win == 0) { ResultLabel.text = "未下注"; WinValLabel.gameObject.SetActive(false); return; } ResultLabel.text = win > 0 ? "赢" : "输"; WinValLabel.Text(win); WinValLabel.gameObject.SetActive(true); }
protected override void OnFreshView() { Reset(); var win = 0; _timer = _closeTime; RefreshCountDown(); InvokeRepeating("RefreshCountDown", 0.1f, 1); var sfsdata = GetData <ISFSObject>(); if (sfsdata == null) { return; } if (sfsdata.ContainsKey("selfBet")) { var selfBet = YxUtiles.ReduceNumber(sfsdata.GetInt("selfBet")); SelfBet.Text(selfBet); } if (sfsdata.ContainsKey("allBet")) { var allBet = YxUtiles.ReduceNumber(sfsdata.GetInt("allBet")); TotalBet.Text(allBet); } if (sfsdata.ContainsKey("win") && ResultMe != null) { win = sfsdata.GetInt("win"); ResultMe.Text(YxUtiles.ReduceNumber(win)); } if (sfsdata.ContainsKey("bwin") && ResultBanker != null) { var bwin = YxUtiles.ReduceNumber(sfsdata.GetLong("bwin")); ResultBanker.Text(bwin); } //设置排行榜信息 if (sfsdata.ContainsKey("pwins")) { string[] rankArray = sfsdata.GetUtfStringArray("pwins"); for (int i = 0; i < MaxRankCount; i++) { CreateRankItem(rankArray, i); } WinParent.repositionNow = true; WinParent.Reposition(); LostParent.repositionNow = true; LostParent.Reposition(); } SetTitel(win); }
void SetLabel(NguiLabelAdapter adapter, int score) { adapter.Text(score); var label = adapter.Label; if (score < 0) { label.gradientTop = Tools.ChangeToColor(0x6FFBF1); label.gradientBottom = Tools.ChangeToColor(0x0090FF); label.effectColor = Tools.ChangeToColor(0x002EA3); } else { label.gradientTop = Tools.ChangeToColor(0xFFFF00); label.gradientBottom = Tools.ChangeToColor(0xFF9600); label.effectColor = Tools.ChangeToColor(0x831717); } label.gameObject.SetActive(true); }
protected override void OnFreshView() { Reset(); _timer = _closeTime; RefreshCountDown(); InvokeRepeating("RefreshCountDown", 0.1f, 1); base.OnFreshView(); var sfsdata = GetData <ISFSObject>(); if (sfsdata == null) { return; } if (sfsdata.ContainsKey("selfBet")) { SelfBet.Text(sfsdata.GetInt("selfBet")); } if (sfsdata.ContainsKey("allBet")) { TotalBet.Text(sfsdata.GetInt("allBet")); } //设置排行榜信息 if (sfsdata.ContainsKey("pwins")) { string[] rankArray = sfsdata.GetUtfStringArray("pwins"); for (int i = 0; i < MaxRankCount; i++) { CreateRankItem(rankArray, i); } WinParent.repositionNow = true; WinParent.Reposition(); LostParent.repositionNow = true; LostParent.Reposition(); } SetTitel(); }
public void ShowSelfWinLabel(int gold) { if (SelfWinLabel == null) { return; } if (gold == 0) { return; } SelfWinLabel.Text(gold); SelfWinLabel.Label.color = gold > 0 ? WinColor : LostColor; SelfWinLabel.gameObject.SetActive(true); var tweens = SelfWinLabel.GetComponents <UITweener>(); foreach (var tween in tweens) { tween.ResetToBeginning(); tween.PlayForward(); } }
protected override void OnBindDate(bool isChange = false) { if (!isChange) { return; } var userInfo = UserInfoModel.Instance.UserInfo; if (UserName != null) { UserName.text = userInfo.NickM; } if (IdLabel != null) { IdLabel.text = App.UserId; } if (UserGold != null) { UserGold.text = userInfo.CoinA.ToString(); } if (UserGoldAdapter) { UserGoldAdapter.Text(userInfo.CoinA); } if (UserCash != null) { UserCash.text = userInfo.CashA.ToString(); } if (CustomLabel != null) { CustomLabel.text = LoginInfo.Instance.G_MobileHallServerText; } if (Portrait != null) { PortraitRes.SetPortrait(userInfo.AvatarX, Portrait, userInfo.SexI); } OnBindBackDate(null); RefreshTopMenu(); ShowVersion(VerLabel); }
public void RefreshBankerList(ISFSObject responseData) { var gdata = App.GetGameData <BrttzGameData>(); while (gdata.CurrentBankerList.Count != 0) { Destroy(gdata.CurrentBankerList[0]); gdata.CurrentBankerList.RemoveAt(0); } gdata.CurrentBankerList.Clear(); if (!responseData.ContainsKey(Parameter.Bankers) || !responseData.ContainsKey(Parameter.Banker)) { return; } var bankers = responseData.GetSFSArray(Parameter.Bankers); var b = responseData.GetInt(Parameter.Banker); bool isHasMe = false; if (bankers == null || bankers.Size() == 0) { if (b == -1) { var info = new YxBaseGameUserInfo { NickM = "系统", CoinA = 1147483647, Seat = -1, TotalCount = 0, WinTotalCoin = 0 }; gdata.BankerPlayer.SetMaxCoin(1147483646); gdata.BankerPlayer.Info = info; gdata.BankerPlayer.HideBankerTime(); } ApplyCtrl.Instance.SetStutus(gdata.GetPlayerInfo().CoinA >= gdata.MiniApplyBanker ? 1 : 2); return; } var len = bankers.Size(); for (int i = 0; i < len; i++) { var banker = bankers.GetSFSObject(i); var user = new YxBaseGameUserInfo { Seat = banker.GetInt(Parameter.Seat), CoinA = banker.GetLong("ttgold"), NickM = banker.GetUtfString(Parameter.UserName) }; if (user.Seat == b) { var oldBanker = gdata.BankerPlayer.Info; var bankerInfo = gdata.GetPlayerInfo(b, true); if (oldBanker == null || oldBanker.NickM != user.NickM) { bankerInfo.CoinA = user.CoinA; bankerInfo.NickM = user.NickM; bankerInfo.Seat = user.Seat; bankerInfo.WinTotalCoin = 0; gdata.BankerPlayer.Info = bankerInfo; gdata.BankerPlayer.SetBankerTime(0); } else { gdata.BankerPlayer.Coin = user.CoinA; } var temp = CloneUser(BankerItem, GridBankers.gameObject); temp.name = "0"; temp.GetComponent <UserListModel>().SetInfo(user, true, i + 1); gdata.CurrentBankerList.Add(temp); } else { var bankerItem = CloneUser(BankerItem, GridBankers.gameObject); bankerItem.name = i + ""; bankerItem.GetComponent <UserListModel>().SetInfo(user, false, i + 1); gdata.CurrentBankerList.Add(bankerItem); } if (gdata.SelfSeat == user.Seat) { isHasMe = true; } } var applyCtrl = App.GetGameManager <BrttzGameManager>().ApplyCtrl; if (isHasMe) { applyCtrl.SetStutus(0); } else { applyCtrl.SetStutus(gdata.GetPlayerInfo().CoinA >= gdata.MiniApplyBanker ? 1 : 2); } GridBankers.enabled = true; GridBankers.Reposition(); if (BankLimitLabel != null) { BankLimitLabel.Text(YxUtiles.ReduceNumber(gdata.MiniApplyBanker)); } }
protected override void FreshData() { if (Data is string) { Model = GameListModel.Instance.GameUnitModels[Data.ToString()]; } else { Model = Data as GameUnitModel; } if (Model == null) { gameObject.SetActive(false); return; } gameObject.SetActive(true); if (Background != null) { var gm = GameListModel.Instance; var group = gm.GetGroup(gm.CurGroup); var index = group == null || KeepStyle ? Model.Index % BackgroundCount :group.Type % BackgroundCount; var normalSprite = string.Format("{0}{1}", BackgroundNamePrefix, index); Background.spriteName = normalSprite; _btn.normalSprite = normalSprite; } if (GameNameLabel != null) { GameNameLabel.SetActive(KeepStyle); GameNameLabel.Text(Model.GameName); } name = Model.GameKey; if (_itemView != null) { Destroy(_itemView.gameObject); } if (KeepStyle) { return; } var assetname = string.Format("gamelist_{0}", name); if (!string.IsNullOrEmpty(ViewType)) { assetname = string.Format("{0}_{1}", assetname, ViewType); } var bundlePrefix = string.Format("{0}_{1}", App.Skin.GameInfo, name); _bundleName = string.Format("{0}/{1}", bundlePrefix, assetname); var asInfo = new AssetBundleInfo { Name = _bundleName, Attach = App.Skin.GameInfo, AssetName = assetname }; if (KeepStyle) { } else { ResourceManager.LoadAssesAsync <GameObject>(asInfo, false, CreateItem); } #region 注释 同步加载 // var go = ResourceManager.LoadAsset(App.Skin.GameInfo, bundleName, assetname);//App.HallName // if (go == null) return; // go = Instantiate(go); // var ts = go.transform; // var lcScale = ts.localScale; // var lcPos = ts.localPosition; // var lcRot = ts.localRotation; // ts.parent = transform; // ts.localPosition = lcPos; // ts.localRotation = lcRot; // ts.localScale = lcScale; // _itemView = go.GetComponent<GameListItemView>(); // if (_itemView!=null) // { // _itemView.FreshBtnClickBound(_btn, DefaultBoxWidget, Model.GameState == GameState.Developing); // } // else // { // YxDebug.LogError("没有GameListItemView","GameListItem"); // } #endregion }
public void SetBankerLimitLabel(int gold) { BankerLimit.Text(gold); }
public void SetBankerLimitLabel(int gold) { BankerLimit.Text(YxUtiles.ReduceNumber(gold)); }
///// <summary> ///// 进入游戏时,显示已下注数值 ///// </summary> ///// <param name="glist"></param> //public void SetGroupBet(int[] glist) //{ // int len = glist.Length; // int labelLen = ZLabels.Length; // for (int i = 0; i < len; i++) // { // if (i >= labelLen) break; // var gold = glist[i]; // SetNumLabel(ZLabels[i], gold); // ZBet[i] = gold; // } //} /// <summary> /// 设置label内容 /// </summary> /// <param name="label"></param> /// <param name="gold"></param> void SetNumLabel(NguiLabelAdapter label, int gold) { label.Text(gold); }