public void Init(MS2C_LuckyRoll reply, UnityEngine.Object basescene)
 {
     this.mRewardItems = new List<GUIRollRewardsWindow.RewardItem>();
     foreach (OpenLootData current in reply.Data)
     {
         if (current.InfoID != 0)
         {
             this.mRewardItems.Add(new GUIRollRewardsWindow.RewardItem
             {
                 infoID = current.InfoID,
                 count = current.Count
             });
         }
     }
     foreach (ulong current2 in reply.PetIDs)
     {
         if (current2 != 0uL)
         {
             this.mRewardItems.Add(new GUIRollRewardsWindow.RewardItem
             {
                 rewardType = GUIRollRewardsWindow.ERollRewardType.ERT_Pet,
                 GUID = current2,
                 count = 1u
             });
         }
     }
     if (basescene is GUISoulReliquaryInfo)
     {
         if (this.baseSoulReliquaryLayer != null)
         {
             this.Refresh();
             return;
         }
         this.baseSoulReliquaryLayer = (GUISoulReliquaryInfo)basescene;
     }
     else if (basescene is GUIRewardLuckyDrawInfo)
     {
         if (this.baseRewardLuckyDrawInfo != null)
         {
             this.Refresh();
             return;
         }
         this.baseRewardLuckyDrawInfo = (GUIRewardLuckyDrawInfo)basescene;
     }
     this.rewardsList = new List<GameObject>();
     this.rewards = GameUITools.FindGameObject("Rewards", base.gameObject);
     this.mBG = GameUITools.FindUISprite("BG", base.gameObject);
     this.window = GameUITools.FindGameObject("Window", base.gameObject);
     this.buttonGroup = GameUITools.FindGameObject("ButtonGroup", this.window);
     this.OKBtn = GameUITools.FindGameObject("OK", this.buttonGroup);
     this.AgainBtn = GameUITools.FindGameObject("Again", this.buttonGroup);
     UIEventListener expr_1E1 = UIEventListener.Get(this.OKBtn);
     expr_1E1.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1E1.onClick, new UIEventListener.VoidDelegate(this.OnOKClick));
     UIEventListener expr_20D = UIEventListener.Get(this.AgainBtn);
     expr_20D.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_20D.onClick, new UIEventListener.VoidDelegate(this.OnAgainClick));
     if (this.baseRewardLuckyDrawInfo != null)
     {
         this.InitRollWindow();
     }
     else if (this.baseSoulReliquaryLayer != null)
     {
         this.InitSoulReliquaryWindow();
     }
 }
Exemple #2
0
 public static void LuckyRollEvent(MS2C_LuckyRoll data)
 {
     if (!GameAnalytics.IsValide())
     {
         return;
     }
     int num = data.Data.Count + data.PetIDs.Count;
     if (data.Type == 2)
     {
         GameAnalytics.OnPurchase(GameAnalytics.PurchaseType.DiamondRoll, (double)((num <= 1) ? GameConst.GetInt32(41) : GameConst.GetInt32(42)));
     }
     else if (data.Type == 3)
     {
         GameAnalytics.OnPurchase(GameAnalytics.PurchaseType.SoulRoll, (double)GUISoulReliquaryInfo.GetPrice());
     }
 }