Ejemplo n.º 1
0
 public void Refresh()
 {
     if (this.mSpPanel == null)
     {
         this.mSpPanel = this.mClip.GetComponent<SpringPanel>();
     }
     if (this.mSpPanel != null && this.mSpPanel.enabled)
     {
         Vector3 target = this.mSpPanel.target;
         target.y = -32f;
         this.mSpPanel.target = target;
     }
     else
     {
         Vector3 localPosition = this.mClip.transform.localPosition;
         localPosition.y = -34f;
         this.mClip.transform.localPosition = localPosition;
         this.mClip.clipOffset = Vector2.zero;
     }
     GameUIVip.lastLookVIPDesc = this.vipLevel;
     this.vipLevelInfo = Globals.Instance.AttDB.VipLevelDict.GetInfo(this.vipLevel);
     this.groupPageDesc.Refresh(this.vipLevelInfo);
     this.groupGiftPacks.Refresh(this.vipLevelInfo);
     NGUITools.SetActive(this.btnPageLeft.gameObject, this.vipLevel > 1);
     NGUITools.SetActive(this.btnPageRight.gameObject, this.vipLevel < 15);
 }
Ejemplo n.º 2
0
 public static void RequestBuyVipWeekReward(VipLevelInfo vipInfo)
 {
     if (vipInfo == null)
     {
         return;
     }
     LocalPlayer player = Globals.Instance.Player;
     int vipLevel = Tools.GetVipLevel(vipInfo);
     if ((ulong)player.Data.VipLevel < (ulong)((long)vipLevel))
     {
         GameMessageBox.ShowRechargeMessageBox(string.Format(Singleton<StringManager>.Instance.GetString("VIPTip2"), vipLevel), null);
         return;
     }
     if (Globals.Instance.Player.IsVipWeekRewardBuy(vipInfo))
     {
         return;
     }
     if (player.Data.Diamond < vipInfo.WeekOffPrice)
     {
         Tools.MoneyNotEnough(ECurrencyType.ECurrencyT_Diamond, vipInfo.WeekOffPrice, 0);
         return;
     }
     GameMessageBox gameMessageBox = GameMessageBox.ShowMessageBox(Singleton<StringManager>.Instance.GetString("VIPTitle4", new object[]
     {
         vipInfo.WeekOffPrice,
         Tools.GetVIPWeekRewardTitle(vipInfo)
     }), MessageBox.Type.OKCancel, vipInfo);
     GameMessageBox expr_BE = gameMessageBox;
     expr_BE.OkClick = (MessageBox.MessageDelegate)Delegate.Combine(expr_BE.OkClick, new MessageBox.MessageDelegate(UIVIPGiftPacks.OnPayVIPWeekRewardChecked));
 }
Ejemplo n.º 3
0
 private void RefreshCurLevelInfo()
 {
     GUIVIPWeekRewardInfo.CurViewVIPLevel = Mathf.Clamp(GUIVIPWeekRewardInfo.CurViewVIPLevel, 0, 15);
     this.curVipLevelInfo = Tools.GetVipLevelInfo(GUIVIPWeekRewardInfo.CurViewVIPLevel);
     if (this.curVipLevelInfo == null)
     {
         global::Debug.LogErrorFormat("Error Vip level {0}", new object[]
         {
             GUIVIPWeekRewardInfo.CurViewVIPLevel
         });
         return;
     }
     this.Title.text = Tools.GetVIPWeekRewardTitle(this.curVipLevelInfo);
     for (int i = 0; i < this.RewardItem.Length; i++)
     {
         if (this.RewardItem[i] != null)
         {
             UnityEngine.Object.Destroy(this.RewardItem[i]);
             this.RewardItem[i] = null;
         }
     }
     int num = 0;
     for (int j = 0; j < this.curVipLevelInfo.WeekRewardType.Count; j++)
     {
         if (this.curVipLevelInfo.WeekRewardType[j] != 0 && this.curVipLevelInfo.WeekRewardType[j] != 20)
         {
             this.RewardItem[num] = GameUITools.CreateReward(this.curVipLevelInfo.WeekRewardType[j], this.curVipLevelInfo.WeekRewardValue1[j], this.curVipLevelInfo.WeekRewardValue2[j], this.Reward, true, true, 36f, -7f, -2000f, 20f, 13f, 7f, 0);
             if (this.RewardItem[num] != null)
             {
                 this.RewardItem[num].gameObject.AddComponent<UIDragScrollView>();
                 this.RewardItem[num].transform.localPosition = new Vector3((float)(num * 106), 0f, 0f);
                 num++;
             }
             if (num >= this.RewardItem.Length)
             {
                 break;
             }
         }
     }
     this.Price.text = this.curVipLevelInfo.WeekPrice.ToString();
     this.OffPrice.text = this.curVipLevelInfo.WeekOffPrice.ToString();
     this.BuyVIPLevel.text = Singleton<StringManager>.Instance.GetString("VIPTip3", new object[]
     {
         GUIVIPWeekRewardInfo.CurViewVIPLevel
     });
     this.CurVipLevel.text = Singleton<StringManager>.Instance.GetString("VIPTip4", new object[]
     {
         Globals.Instance.Player.Data.VipLevel
     });
     if (Globals.Instance.Player.IsVipWeekRewardBuy(this.curVipLevelInfo))
     {
         this.ToBuy.gameObject.SetActive(false);
         this.Buyed.gameObject.SetActive(true);
     }
     else
     {
         this.ToBuy.gameObject.SetActive(true);
         this.Buyed.gameObject.SetActive(false);
     }
 }
Ejemplo n.º 4
0
 public VIPRewardData(VipLevelInfo info)
 {
     this.VipInfo = info;
 }
Ejemplo n.º 5
0
 public void Refresh(VipLevelInfo viplevel)
 {
     if (this.desc2 == null)
     {
         this.desc2 = ((GameUIVip)GameUIManager.mInstance.CurUISession).mDesc2;
         this.InitDesc2();
     }
     this.vipLevelInfo = viplevel;
     this.desc0.text = string.Empty;
     this.desc1.text = string.Empty;
     if (this.vipLevelInfo == null)
     {
         return;
     }
     VipLevelInfo info = Globals.Instance.AttDB.VipLevelDict.GetInfo(viplevel.ID - 1);
     this.title.text = Singleton<StringManager>.Instance.GetString("VIPDes1", new object[]
     {
         this.vipLevelInfo.TotalPay,
         viplevel.ID
     });
     if (this.vipLevelInfo.SceneResetCount > 0 && (info == null || this.vipLevelInfo.SceneResetCount != info.SceneResetCount))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes7", new object[]
         {
             this.vipLevelInfo.SceneResetCount
         }), false);
     }
     if (this.vipLevelInfo.ShopCommon2Count > 0 && (info == null || this.vipLevelInfo.ShopCommon2Count != info.ShopCommon2Count))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes8", new object[]
         {
             this.vipLevelInfo.ShopCommon2Count
         }), false);
         if (Tools.CanPlay(GameConst.GetInt32(24), true))
         {
             this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes3", new object[]
             {
                 this.vipLevelInfo.ShopCommon2Count
             }), false);
         }
         if (Tools.CanPlay(GameConst.GetInt32(201), true))
         {
             this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes17", new object[]
             {
                 this.vipLevelInfo.ShopLopetCount
             }), false);
         }
     }
     if (this.vipLevelInfo.BuyCount[1] > 0 && (info == null || this.vipLevelInfo.BuyCount[1] != info.BuyCount[1]))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes5", new object[]
         {
             this.vipLevelInfo.BuyCount[1]
         }), false);
     }
     if (this.vipLevelInfo.BuyCount[0] > 0 && (info == null || this.vipLevelInfo.BuyCount[0] != info.BuyCount[0]))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes4", new object[]
         {
             this.vipLevelInfo.BuyCount[0]
         }), false);
     }
     if (this.vipLevelInfo.BuyCount[2] > 0 && (info == null || this.vipLevelInfo.BuyCount[2] != info.BuyCount[2]))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes11", new object[]
         {
             this.vipLevelInfo.BuyCount[2]
         }), false);
     }
     if (this.vipLevelInfo.D2MCount > 0 && (info == null || this.vipLevelInfo.D2MCount != info.D2MCount))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes6", new object[]
         {
             this.vipLevelInfo.D2MCount
         }), false);
     }
     if (this.vipLevelInfo.BuyCount[3] > 0 && (info == null || this.vipLevelInfo.BuyCount[3] != info.BuyCount[3]))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes9", new object[]
         {
             this.vipLevelInfo.BuyCount[3]
         }), false);
     }
     if (this.vipLevelInfo.BuyCount[4] > 0 && (info == null || this.vipLevelInfo.BuyCount[4] != info.BuyCount[4]))
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes10", new object[]
         {
             this.vipLevelInfo.BuyCount[4]
         }), false);
     }
     if (this.vipLevelInfo.ScratchOff > 0)
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes12", new object[]
         {
             this.vipLevelInfo.ScratchOff - Globals.Instance.AttDB.VipLevelDict.GetInfo(16).ScratchOff
         }), false);
     }
     if (this.vipLevelInfo.BuyPillageCount > 0)
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes15", new object[]
         {
             viplevel.BuyPillageCount
         }), false);
     }
     if (viplevel.BuyRevengeCount > 0)
     {
         this.AddDesc(Singleton<StringManager>.Instance.GetString("VIPDes16", new object[]
         {
             viplevel.BuyRevengeCount
         }), false);
     }
     this.AddDescEnd();
     this.RefreshDesc2();
     if (this.desc0.height < this.desc1.height)
     {
         this.mBG.bottomAnchor.target = this.desc1.transform;
         this.mBG.topAnchor.target = this.desc1.transform;
         this.mBG.bottomAnchor.absolute = 26;
         this.mBG.topAnchor.absolute = 10;
     }
 }
Ejemplo n.º 6
0
 public bool IsVipWeekRewardBuy(VipLevelInfo info)
 {
     if (info == null)
     {
         return false;
     }
     if (info.ID > 16)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("VipReward overflow, vipLevel = {0}", info.ID)
         });
         return false;
     }
     return (this.Data.VipWeekReward & 1 << info.ID) != 0;
 }
Ejemplo n.º 7
0
 public void Refresh(VipLevelInfo viplevel)
 {
     this.vipLevelInfo = viplevel;
     if (this.vipLevelInfo == null)
     {
         this.desc.text = string.Empty;
         return;
     }
     VipLevelInfo info = Globals.Instance.AttDB.VipLevelDict.GetInfo(viplevel.ID - 1);
     this.title.text = string.Format(Singleton<StringManager>.Instance.GetString("VIPDes13"), new object[0]);
     StringBuilder stringBuilder = new StringBuilder();
     if (this.vipLevelInfo.SceneResetCount > 0 && (info == null || this.vipLevelInfo.SceneResetCount != info.SceneResetCount))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes7"), this.vipLevelInfo.SceneResetCount);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.ShopCommon2Count > 0 && (info == null || this.vipLevelInfo.ShopCommon2Count != info.ShopCommon2Count))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes8"), this.vipLevelInfo.ShopCommon2Count);
         stringBuilder.AppendLine();
         if (Tools.CanPlay(GameConst.GetInt32(24), true))
         {
             stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPDes3", new object[]
             {
                 this.vipLevelInfo.ShopCommon2Count
             }));
         }
         if (Tools.CanPlay(GameConst.GetInt32(201), true))
         {
             stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPDes17", new object[]
             {
                 this.vipLevelInfo.ShopLopetCount
             }));
         }
     }
     if (this.vipLevelInfo.BuyCount[1] > 0 && (info == null || this.vipLevelInfo.BuyCount[1] != info.BuyCount[1]))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes5"), this.vipLevelInfo.BuyCount[1]);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.BuyCount[0] > 0 && (info == null || this.vipLevelInfo.BuyCount[0] != info.BuyCount[0]))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes4"), this.vipLevelInfo.BuyCount[0]);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.BuyCount[2] > 0 && (info == null || this.vipLevelInfo.BuyCount[2] != info.BuyCount[2]))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes11"), this.vipLevelInfo.BuyCount[2]);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.D2MCount > 0 && (info == null || this.vipLevelInfo.D2MCount != info.D2MCount))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes6"), this.vipLevelInfo.D2MCount);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.BuyCount[3] > 0 && (info == null || this.vipLevelInfo.BuyCount[3] != info.BuyCount[3]))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes9"), this.vipLevelInfo.BuyCount[3]);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.BuyCount[4] > 0 && (info == null || this.vipLevelInfo.BuyCount[4] != info.BuyCount[4]))
     {
         stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes10"), this.vipLevelInfo.BuyCount[4]);
         stringBuilder.AppendLine();
     }
     if (this.vipLevelInfo.ScratchOff > 0 && (info == null || this.vipLevelInfo.ScratchOff != info.ScratchOff))
     {
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPDes12", new object[]
         {
             this.vipLevelInfo.ScratchOff
         }));
     }
     if (this.vipLevelInfo.BuyPillageCount > 0 && (info == null || this.vipLevelInfo.BuyPillageCount != info.BuyPillageCount))
     {
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPDes15", new object[]
         {
             this.vipLevelInfo.BuyPillageCount
         }));
     }
     if (this.vipLevelInfo.BuyRevengeCount > 0 && (info == null || this.vipLevelInfo.BuyRevengeCount != info.BuyRevengeCount))
     {
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPDes16", new object[]
         {
             this.vipLevelInfo.BuyRevengeCount
         }));
     }
     switch (this.vipLevelInfo.ID)
     {
     case 1:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes0"));
         break;
     case 2:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes1"));
         break;
     case 3:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes2"));
         break;
     case 4:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes3"));
         break;
     case 5:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes4"));
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes11"));
         break;
     case 6:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes5"));
         break;
     case 7:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes6"));
         break;
     case 9:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes8"));
         break;
     case 10:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes9"));
         break;
     case 12:
         stringBuilder.AppendLine(Singleton<StringManager>.Instance.GetString("VIPLevelDes10"));
         break;
     }
     stringBuilder.AppendFormat(Singleton<StringManager>.Instance.GetString("VIPDes19"), this.vipLevelInfo.ID);
     this.desc.text = stringBuilder.ToString();
 }
Ejemplo n.º 8
0
 public void Refresh(VipLevelInfo vipInfo)
 {
     this.vipLevelInfo = vipInfo;
     if (this.vipLevelInfo == null)
     {
         return;
     }
     this.title.text = Singleton<StringManager>.Instance.GetString("VIPTitle3", new object[]
     {
         this.vipLevelInfo.ID
     });
     this.RefreshRewards();
     this.mPrice.text = this.vipLevelInfo.Price.ToString();
     this.mOffPrice.text = this.vipLevelInfo.OffPrice.ToString();
     this.mOffPrice.color = ((Globals.Instance.Player.Data.Diamond >= this.vipLevelInfo.OffPrice) ? Color.white : Color.red);
     if ((ulong)Globals.Instance.Player.Data.VipLevel < (ulong)((long)this.vipLevelInfo.ID))
     {
         this.mCondition.text = Singleton<StringManager>.Instance.GetString("VIPDes14", new object[]
         {
             this.vipLevelInfo.ID
         });
         NGUITools.SetActive(this.mCondition.gameObject, true);
         NGUITools.SetActive(this.mReceiveBtn.gameObject, false);
     }
     else
     {
         NGUITools.SetActive(this.mReceiveBtn.gameObject, true);
         NGUITools.SetActive(this.mCondition.gameObject, false);
     }
     bool flag = Globals.Instance.Player.IsPayVipRewardTaken(this.vipLevelInfo);
     if (flag)
     {
         this.mReceiveBtn.isEnabled = false;
         for (int i = 0; i < this.mReceiveBtns.Length; i++)
         {
             this.mReceiveBtns[i].SetState(UIButtonColor.State.Disabled, true);
         }
         this.mReceiveBtnLabel.text = Singleton<StringManager>.Instance.GetString("VIPDes21");
     }
     else
     {
         this.mReceiveBtn.isEnabled = true;
         for (int j = 0; j < this.mReceiveBtns.Length; j++)
         {
             this.mReceiveBtns[j].SetState(UIButtonColor.State.Normal, true);
         }
         this.mReceiveBtnLabel.text = Singleton<StringManager>.Instance.GetString("VIPDes20");
     }
 }