public void ShowBetLabel() { BetLabel.gameObject.SetActive(true); BetLabel.text = YxUtiles.ReduceNumber(BetMoney); }
/// <summary> /// 刷新上庄限制信息 /// </summary> /// <param name="bankLimit">上庄限制</param> private void OnFreshBankLimit(int bankLimit) { BankerLimit.TrySetComponentValue(string.Format(BankerLaberlFormat, YxUtiles.ReduceNumber(bankLimit))); }
void SetTotalScoreLabel(UILabel label, int score) { SetScoreLabel(label, score); label.text = YxUtiles.ReduceNumber(score); }
public void SetWinText(int win) { var wistr = YxUtiles.ReduceNumber(win); WinLabel.text = win > 0 ? string.Format("+{0}", wistr) : wistr; }
protected void OnStatus(object data) { ISFSObject eData = (SFSObject)(data); int singleBeat = eData.GetInt("SingleBet"); if (SingleBeat != null) { SingleBeat.text = YxUtiles.ReduceNumber(singleBeat); } TotalBeat.text = "¥" + Convert.ToString(0); if (eData.ContainsKey("ShowReady")) { ReadyBtn.SetActive(true); } else { ReadyBtn.SetActive(false); } if (eData.ContainsKey("ShowWx")) { if (WxShareBtn != null) { WxShareBtn.SetActive(true); } } else { if (WxShareBtn != null) { WxShareBtn.SetActive(false); } } if (eData.ContainsKey("TotalBeat")) { int allBeat = eData.GetInt("TotalBeat"); TotalBeat.text = "¥" + YxUtiles.ReduceNumber(allBeat); } if (eData.ContainsKey("ShowStart")) { bool show = eData.GetBool("ShowStart"); StartBtn.SetActive(show); } bool isKaiFang = eData.GetBool("IsFangKa"); if (isKaiFang) { KaiFang.SetActive(true); YuLe.SetActive(false); if (TableInfo == null) { TableInfo = KaiFang.GetComponent <JhTableInfo>(); } int maxju = eData.GetInt("MaxJu"); int roomId = eData.GetInt("RoomId"); int curju = eData.GetInt("CurJu"); int ante = eData.GetInt("Ante"); TableInfo.SetRoomId(roomId); TableInfo.SetJuShu(curju, maxju); TableInfo.SetDiFen(ante); } else { KaiFang.SetActive(false); YuLe.SetActive(true); if (TableInfo == null) { TableInfo = YuLe.GetComponent <JhTableInfo>(); } } int curlun = eData.GetInt("CurLun"); int maxlun = eData.GetInt("MaxLun"); TableInfo.SetLunShu(curlun, maxlun); if (eData.ContainsKey("HideReadyTip")) { if (ReadyTip != null) { ReadyTip.Hide(); } } }
protected void OnEnable() { int lastBet = App.GetGameData <FillpitGameData>().LastBetValue; FollowLabel.text = string.Format(Format, YxUtiles.ReduceNumber(lastBet)); }
///// <summary> ///// 进入游戏时,显示已下注数值 ///// </summary> ///// <param name="glist"></param> //public void SetNum(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(UILabel label, int gold) { label.text = YxUtiles.ReduceNumber(gold); label.gameObject.SetActive(gold > 0); }
public void SetRoundBetShow() { OneRoundBet.text = YxUtiles.ReduceNumber(OnceBet); AllRoundBet.text = YxUtiles.ReduceNumber(AllBet); }
public void InitOnce() { OnceBet = 0; OneRoundBet.text = YxUtiles.ReduceNumber(OnceBet); }
private void SetTurnBetLabel(int gold) { string goldVal = YxUtiles.ReduceNumber(gold); TurnBetLabel.text = string.Format(TurnBetFormat, goldVal); }
/// <summary> /// 设置消耗显示 /// </summary> /// <param name="consume"></param> private void SetConsumeNum(int consume) { ShowCost.TrySetComponentValue(YxUtiles.ReduceNumber(consume)); }
public void RefreshNum(int gold) { _num -= gold; Num.text = YxUtiles.ReduceNumber(_num); App.GetGameData <BtwGameData>().CurrentCanInGold = _num; }
public void InitData(string userName, int userGold) { gameObject.SetActive(true); UserName.text = userName; UserGold.text = YxUtiles.ReduceNumber(userGold); }
void SetTotalScoreLabel(UILabel label, int score) { SetScoreLabel(label, score); label.text = string.Format("{0}{1}", score >= 0 ? "+" : string.Empty, YxUtiles.ReduceNumber(score)); }
protected virtual void OnBindDate(UserInfo userInfo) { var loginName = userInfo.LoginName; if (UserId != null) { UserId.text = string.Format("{0}{1}", IdForm, userInfo.UserId); } if (UserName != null) { UserName.text = string.IsNullOrEmpty(loginName) ? "游客" : loginName; } if (Sex != null) { switch (userInfo.SexI) { case 0: Sex.text = "女"; break; case 1: Sex.text = "男"; break; default: Sex.text = "保密"; break; } } if (UserCoin != null) { UserCoin.text = YxUtiles.ReduceNumber(userInfo.CoinA); } if (UserGold != null) { UserGold.text = userInfo.CashA.ToString(); } UserCoinAdapter.TrySetComponentValue(userInfo.CoinA, "1"); if (ClienIp != null) { ClienIp.text = userInfo.ClientIP; } if (NikeName != null) { NikeName.text = userInfo.NickM; } if (PhoneNumber != null) { PhoneNumber.text = userInfo.PhoneNumber; } if (Sign != null) { var uiinput = Sign.GetComponent <UIInput>(); if (uiinput != null) { uiinput.value = userInfo.Signature; } else { Sign.text = userInfo.Signature; } } if (SpreadBtn != null) { var needShow = userInfo.Promoter != null && userInfo.Promoter == false; SpreadBtn.SetActive(needShow); } if (SpreadStateBtn != null) { if (string.IsNullOrEmpty(loginName)) { SpreadStateBtn.transform.parent.gameObject.SetActive(false); } Spread.text = userInfo.PromoterId ?? PromoterMsg; SpreadStateBtn.gameObject.SetActive(string.IsNullOrEmpty(userInfo.PromoterId)); } PortraitDb.SetPortrait(userInfo.AvatarX, Portrait, userInfo.SexI); }
public void SetBankerLimitLabel(int gold) { BankerLimit.Text(YxUtiles.ReduceNumber(gold)); }
public virtual void SetInfo(YxBaseUserInfo user, bool isBanker, int rank = 0) { NameLabel.text = isBanker ? "[FF0000]" + user.NickM : user.NickM; CoinLabel.text = (isBanker ? "[FF0000]" : "") + YxUtiles.ReduceNumber(user.CoinA); UserId = user.Id; }
public void SetBet(int bet) { BetValue = bet; Bet.text = YxUtiles.ReduceNumber(bet); Bet.gameObject.SetActive(bet > 0); }
public override void GameResponseStatus(int type, ISFSObject response) { YxDebug.Log("Request == " + (RequestType)type); if (response.ContainsKey("playerlist")) { BankerMgr.RefreshPlayerList(response.GetUtfStringArray("playerlist")); } switch ((RequestType)type) { case RequestType.Bet: if (response.ContainsKey("golds")) // -- 统一走else逻辑 { YxDebug.Log("收到重复上轮"); var golds = response.GetIntArray("golds"); var seat = response.GetInt("seat"); if (seat == App.GameData.SelfSeat) { RightBottomMgr.LastTime.isEnabled = true; } for (int i = 0; i < golds.Length; i++) { AddBet(golds[i], i, seat, true); } } else { int p = response.GetInt("p"); int gold = response.GetInt("gold"); int seat = response.GetInt("seat"); AddBet(gold, p, seat); } break; case RequestType.Reward: break; case RequestType.ApplyBanker: break; case RequestType.ApplyQuit: break; case RequestType.BeginBet: CanQuit = true; Loading.SetActive(false); RightBottomMgr.CurNum++; ResultManager.GetInstance().CloseResult(); ClearAllBet(); BetManager.GetInstance().IsBeginBet = true; StartCountNum(); Wheel.GetInstance().Selected.GetComponent <TweenAlpha>().enabled = false; Wheel.GetInstance().Selected.GetComponent <TweenAlpha>().value = Wheel.GetInstance().Selected.GetComponent <TweenAlpha>().from; break; case RequestType.EndBet: Loading.SetActive(false); BetManager.GetInstance().IsBeginBet = false; //开始摇奖 Wheel.GetInstance().StartTrun(); RefreshRepeatData(RightBottomMgr.UpBetValue.ToArray()); break; case RequestType.GiveCards: int carIndex = response.GetInt("carInx"); //针对超过20的服务器反馈进行处理 if (carIndex >= 20 && Wheel.GetInstance().Items.Length <= 20) //=>条件2考虑兼容问题 { carIndex = carIndex % 8; } LuckIndex = carIndex; Wheel.GetInstance().StopTrun(carIndex, OnDrawFinish); break; case RequestType.Result: CanQuit = true; Loading.SetActive(false); RightBottomMgr.RefreshLastTimeBtn(); if (!BankerMgr.IsBanker(-1)) { BankerMgr.Banker.WinTotalCoin += response.GetInt("bankWin"); var bankerCoin = "¥" + YxUtiles.ReduceNumber(BankerMgr.Banker.WinTotalCoin); BankerMgr.Banker.WinTotalCoinLabel.Text(bankerCoin); } var self = App.GameData.GetPlayer(); self.Coin = response.GetLong("total"); self.WinTotalCoin += response.GetInt("win"); YxDebug.Log("---------结算-----------"); ResultManager.GetInstance().OpenResult(response); HistoryRecord.GetInstance().RefreshData(response.GetInt("carInx"), 1); //YxDebug.Log("result"); break; case RequestType.BankerList: //UserManager.GetInstance().BankerSeat = response.GetInt("banker"); if (response.GetInt("banker") == -1) { BankerMgr.SetBankerInfo(null); } BankerMgr.RefreshBankerList(response.GetSFSArray("bankers"), response.GetInt("banker")); break; default: YxDebug.Log("不存在的服务器交互!"); break; } }
protected void OnEnable() { //显示当前局此按钮添加筹码的值 GetComponentInChildren <UILabel>(true).text = YxUtiles.ReduceNumber(AddValue, 2, true);//App.GetGameData<GlobalData>().GetShowGold(AddValue,true); }
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 OnFreshView() { CountLabel.text = Countdown; var responseData = GetData <ISFSObject>(); if (responseData == null) { return; } var gdata = App.GetGameData <BtwGameData>(); CancelInvoke("Dountdown"); var win = responseData.GetInt("win"); var self = gdata.GetPlayerInfo(); self.CoinA = responseData.GetLong("total"); var bwin = responseData.GetLong("bwin"); var pg = responseData.GetIntArray("pg"); var bpg = responseData.GetIntArray("bpg"); for (var i = 0; i < pg.Length; i++) { var p = -pg[i]; var pstr = YxUtiles.ReduceNumber(p); var ourLabel = OurLabels[i]; if (p >= 0) { ourLabel.text = pstr; // ourLabel.color = Color.green; SetLabelColorEffect(ourLabel, WinLabelStyle); } else { ourLabel.text = pstr; // ourLabel.color = Color.red; SetLabelColorEffect(ourLabel, LoseLabelStyle); } var bp = bpg[i]; var bpstr = YxUtiles.ReduceNumber(bp); var bankLabel = BnakerLabels[i]; if (bp >= 0) { bankLabel.text = bpstr; // bankLabel.color = Color.green; SetLabelColorEffect(bankLabel, WinLabelStyle); } else { bankLabel.text = bpstr; // bankLabel.color = Color.red; SetLabelColorEffect(bankLabel, LoseLabelStyle); } } var our3Label = OurLabels[3]; var winStr = YxUtiles.ReduceNumber(win); if (win >= 0) { our3Label.text = winStr; // our3Label.color = Color.green; SetLabelColorEffect(our3Label, WinLabelStyle); Facade.Instance <MusicManager>().Play("Win"); ShowWinMark(); } else { our3Label.text = winStr; // our3Label.color = Color.red; SetLabelColorEffect(our3Label, LoseLabelStyle); Facade.Instance <MusicManager>().Play("Lost"); ShowWinMark(false); } var bank3Label = BnakerLabels[3]; var bwinStr = YxUtiles.ReduceNumber(bwin); if (bwin >= 0) { bank3Label.text = bwinStr; // bank3Label.color = Color.green; SetLabelColorEffect(bank3Label, WinLabelStyle); } else { bank3Label.text = bwinStr; // bank3Label.color = Color.red; SetLabelColorEffect(bank3Label, LoseLabelStyle); } WinSprite.spriteName = win >= 0 ? "46" : "48"; InvokeRepeating("Dountdown", 0, 1); }
public void ChangeAnte() { ChangeAnteText.text = YxUtiles.ReduceNumber(App.GetGameData <LswcGameData>().GetNowAnte()); ChangeAnteBtnImage.overrideSprite = App.GetGameData <LswcGameData>().GetNowAnteSprite(); }
// ReSharper disable once ArrangeTypeMemberModifiers // ReSharper disable once UnusedMember.Local void OnEnable() { //显示当前局此按钮添加筹码的值 GetComponentInChildren <UILabel>().text = YxUtiles.ReduceNumber(BetValue); }
public virtual void SetInfo(YxBaseUserInfo brnnUser, bool isBanker = false, int rank = 0) { NameLabel.text = isBanker ? "[FF0000]" + brnnUser.NickM : brnnUser.NickM; CoinLabel.text = (isBanker ? "[FF0000]" : "") + YxUtiles.ReduceNumber((int)brnnUser.CoinA); }
public void ShowBetLabel() { BetLabel.gameObject.SetActive(true); BetLabel.text = YxUtiles.ReduceNumber(BetMoney);//App.GetGameData<GlobalData>().GetShowGold(BetMoney); }
/// <summary> /// 设置分数Label /// </summary> /// <param name="label"></param> /// <param name="score"></param> void SetScoreLabel(UILabel label, int score) { label.text = YxUtiles.ReduceNumber(score); }
/// <summary> /// 分筹码堆 /// </summary> /// <returns></returns> public void AssignedStack() { var gdata = App.GameData; var playerList = gdata.PlayerList; var playerCount = playerList.Length; while (true) { var minMoney = 0L; var playerIndex = -1; var allMoney = 0L; //获取最小allin的值和位置 for (var i = 0; i < playerCount; i++) { var player = gdata.GetPlayer <PlayerPanel>(i); if (player.CurGameType == PlayerGameType.AllIn && player.BetMoney > 0 && (minMoney == 0 || minMoney > player.BetMoney)) { minMoney = player.BetMoney; playerIndex = i; } allMoney += player.BetMoney; } //如果没有allin则直接加到大筹码堆上 if (playerIndex < 0) { if (allMoney == 0) { return; } if (!BigBetStack.IsAdd) { MoveDataToSmall(); } for (int i = 0; i < playerCount; i++) { var player = gdata.GetPlayer <PlayerPanel>(i); if (player.Info == null) { BigBetStack.Belong[i] = false; continue; } BigBetStack.BetValue += player.BetMoney; player.BetMoney = 0; player.BetLabel.gameObject.SetActive(false); if (BigBetStack.Belong[player.Info.Seat]) { BigBetStack.Belong[player.Info.Seat] = player.CurGameType != PlayerGameType.Fold; } } BigBetStack.Bet.text = YxUtiles.ReduceNumber(BigBetStack.BetValue); } else { //如果有allin判断大筹码堆是否可以添加 if (!BigBetStack.IsAdd) { MoveDataToSmall(); } AddToBigStack(minMoney); continue; } break; } }
public virtual void OnAddBetBtnShow() { //显示当前局此按钮添加筹码的值 GetComponentInChildren <UILabel>().text = YxUtiles.ReduceNumber(AddBetValue); }
// Use this for initialization protected void Start() { var gdata = App.GetGameData <MdxGameData>(); FristLine.text = string.Format(Format, YxUtiles.ReduceNumber(gdata.MinApplyBanker), YxUtiles.ReduceNumber(gdata.MaxApplyBanker)); }