public static bool CanBuyRewardMark(ActivityPayShopData data)
 {
     if (data == null)
     {
         return false;
     }
     for (int i = 0; i < data.Data.Count; i++)
     {
         APItemData aPItemData = data.Data[i];
         if (aPItemData.BuyCount < aPItemData.MaxCount && data.PayDay >= aPItemData.Value)
         {
             return true;
         }
     }
     return false;
 }
 public void OnActivityPayShopUpdateEvent(ActivityPayShopData data)
 {
     if (data == null)
     {
         return;
     }
     if (this.APSData == null)
     {
         return;
     }
     if (this.APSData.Base.ID != data.Base.ID)
     {
         return;
     }
     this.APSData = data;
     this.mAPItemDataGrid.ClearData();
     this.mAPItemDataGrid.repositionNow = true;
     for (int i = 0; i < data.Data.Count; i++)
     {
         APItemData data2 = data.Data[i];
         this.mAPItemDataGrid.AddData(new APItemDataEx(this.APSData, data2));
     }
 }
 public void Refresh(ActivityPayShopData data)
 {
     if (this.APSData == data)
     {
         this.time1Flag = 0.1f;
         this.time2Flag = 0.1f;
         this.mAPItemDataGrid.repositionNow = true;
     }
     else
     {
         this.time1Flag = 0.1f;
         this.time2Flag = 0.1f;
         this.mAPItemDataGrid.SetDragAmount(0f, 0f);
         this.mAPItemDataGrid.ClearData();
         if (data != null)
         {
             for (int i = 0; i < data.Data.Count; i++)
             {
                 APItemData aPItemData = data.Data[i];
                 if (aPItemData != null)
                 {
                     this.mAPItemDataGrid.AddData(new APItemDataEx(data, aPItemData));
                 }
             }
         }
         this.mAPItemDataGrid.repositionNow = true;
     }
     this.APSData = data;
 }
Example #4
0
 public void InitWithBaseScene(ActivityPayShopData data)
 {
     this.APSData = data;
     this.mIsChecked = false;
     this.CreateObjects();
     this.Text = data.Base.Name;
     this.Icon = "FlashSale";
     base.gameObject.name = string.Format("cc{0}", data.Base.ID);
 }
Example #5
0
 private GUIRewardCheckBtn InitActivityCheckBtn(ActivityPayShopData data)
 {
     if (Tools.GetRemainAARewardTime(data.Base.CloseTimeStamp) <= 0)
     {
         return null;
     }
     if (this.RewardCheckBtnPrefab == null)
     {
         this.RewardCheckBtnPrefab = Res.LoadGUI("GUI/GUIRewardCheckBtn");
     }
     if (this.RewardCheckBtnPrefab == null)
     {
         global::Debug.LogError(new object[]
         {
             "Res.Load GUI/GUIRewardCheckBtn error"
         });
         return null;
     }
     GameObject gameObject = Tools.AddChild(this.mTabBtnsTable.gameObject, this.RewardCheckBtnPrefab);
     GUIRewardCheckBtn gUIRewardCheckBtn = gameObject.AddComponent<GUIRewardCheckBtn>();
     gUIRewardCheckBtn.InitWithBaseScene(data);
     gUIRewardCheckBtn.IsShowMark = GUIActivityPayShopInfo.CanBuyRewardMark(data);
     GUIRewardCheckBtn expr_91 = gUIRewardCheckBtn;
     expr_91.CheckChangeCallbackEvent = (GUIRewardCheckBtn.CheckChangeCallback)Delegate.Combine(expr_91.CheckChangeCallbackEvent, new GUIRewardCheckBtn.CheckChangeCallback(this.OnActivityPayShopBtnsChanged));
     return gUIRewardCheckBtn;
 }
Example #6
0
 private void OnActivityPayShopUpdateEvent(ActivityPayShopData data)
 {
     if (data == null)
     {
         return;
     }
     if (this.mAPSInfo != null)
     {
         this.mAPSInfo.OnActivityPayShopUpdateEvent(data);
     }
     for (int i = 0; i < this.mTabs.Count; i++)
     {
         GUIRewardCheckBtn gUIRewardCheckBtn = this.mTabs[i];
         if (gUIRewardCheckBtn.APSData != null && gUIRewardCheckBtn.APSData == data)
         {
             gUIRewardCheckBtn.IsShowMark = GUIActivityPayShopInfo.CanBuyRewardMark(gUIRewardCheckBtn.APSData);
         }
     }
 }
Example #7
0
 public APItemDataEx(ActivityPayShopData aa, APItemData data)
 {
     this.APSD = aa;
     this.APData = data;
 }