Example #1
0
        private void OnCrateInfoPayButtonClicked(UXButton button)
        {
            CurrentPlayer player = Service.Get <CurrentPlayer>();
            bool          flag;

            if (this.targetLEIVO != null)
            {
                flag = GameUtils.BuyLEI(player, this.targetLEIVO);
            }
            else
            {
                flag = GameUtils.BuyCrate(player, this.targetCrateVO);
            }
            if (flag)
            {
                Service.Get <EventManager>().RegisterObserver(this, EventId.OpeningPurchasedCrate);
                ProcessingScreen.Show();
            }
            else
            {
                this.OnCloseCrateInfoButtonClicked(null);
            }
            button.Enabled = false;
        }