Ejemplo n.º 1
0
 private void OnRevengeButtonClicked(UXButton button)
 {
     this.ToggleRevengeButtons(false);
     if (Service.CurrentPlayer.Inventory.Troop.GetTotalStorageAmount() <= 0 && Service.CurrentPlayer.Inventory.SpecialAttack.GetTotalStorageAmount() <= 0 && Service.CurrentPlayer.Inventory.Hero.GetTotalStorageAmount() <= 0 && Service.CurrentPlayer.Inventory.Champion.GetTotalStorageAmount() <= 0)
     {
         AlertScreen.ShowModal(false, this.lang.Get("NOT_ENOUGH_TROOPS_TITLE", new object[0]), this.lang.Get("NOT_ENOUGH_TROOPS_FOR_ATTACK", new object[0]), null, null);
         Service.EventManager.SendEvent(EventId.UIAttackScreenSelection, new ActionMessageBIData("PvP", "no_troops"));
         return;
     }
     if (Service.CurrentPlayer.ProtectedUntil > ServerTime.Time)
     {
         DisableProtectionAlertScreen.ShowModal(new OnScreenModalResult(this.OnConfirmInvalidation), button.Tag);
     }
     else
     {
         GameUtils.ExitEditState();
         this.StartRevenge(button.Tag as BattleEntry);
     }
 }
Ejemplo n.º 2
0
        public static AlertScreen ShowModal(bool fatal, string title, string message, string spriteName, OnScreenModalResult onModalResult, object modalResultCookie, bool disableCloseBtn, bool isAlwaysOnTop, string biMessage, bool turnOffTicker)
        {
            AlertScreen alertScreen = new AlertScreen(fatal, title, message, spriteName, disableCloseBtn);

            alertScreen.OnModalResult     = onModalResult;
            alertScreen.ModalResultCookie = modalResultCookie;
            alertScreen.IsAlwaysOnTop     = isAlwaysOnTop;
            if (fatal && !string.IsNullOrEmpty(biMessage))
            {
                Service.Logger.ErrorFormat("Force Reload Popup: {0}", new object[]
                {
                    biMessage
                });
            }
            if (Service.ScreenController != null)
            {
                Service.ScreenController.AddScreen(alertScreen, turnOffTicker);
            }
            return(alertScreen);
        }
Ejemplo n.º 3
0
        protected override void OnUpgradeButtonClicked(UXButton button)
        {
            int    upgradeCredits          = this.nextBuildingInfo.UpgradeCredits;
            int    upgradeMaterials        = this.nextBuildingInfo.UpgradeMaterials;
            int    upgradeContraband       = this.nextBuildingInfo.UpgradeContraband;
            string buildingPurchaseContext = GameUtils.GetBuildingPurchaseContext(this.nextBuildingInfo, this.buildingInfo, true, false, this.selectedPlanet);

            if (PayMeScreen.ShowIfNotEnoughCurrency(upgradeCredits, upgradeMaterials, upgradeContraband, buildingPurchaseContext, new OnScreenModalResult(this.OnPayMeForCurrencyResult)))
            {
                return;
            }
            if (PayMeScreen.ShowIfNoFreeDroids(new OnScreenModalResult(this.OnPayMeForDroidResult), null))
            {
                return;
            }
            string      planetDisplayName = LangUtils.GetPlanetDisplayName(this.selectedPlanet);
            AlertScreen alertScreen       = AlertScreen.ShowModal(false, this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_TITLE", new object[0]), this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_DESC", new object[]
            {
                planetDisplayName
            }), new OnScreenModalResult(this.OnConfirmation), this.selectedPlanet);

            alertScreen.SetPrimaryLabelText(this.lang.Get("s_Confirm", new object[0]));
            alertScreen.SetTextureInset("PlanetEnvIcon-" + this.selectedPlanet.Abbreviation);
        }
Ejemplo n.º 4
0
        public void OnPurchaseShardsClicked(UXButton button)
        {
            int  num  = 1;
            bool flag = button == this.purchaseAllBtn;

            if (flag)
            {
                num = this.vto.RemainingShardsForSale;
            }
            CostVO costVO   = (!flag) ? this.vto.CostOfNextShard : this.vto.CostOfAllShards;
            int    crystals = costVO.Crystals;

            if (!ShardShopViewModule.warned && crystals >= GameConstants.CRYSTAL_SPEND_WARNING_MINIMUM)
            {
                ShardShopViewModule.warned = true;
                string currencyItemAssetName = UXUtils.GetCurrencyItemAssetName(CurrencyType.Crystals.ToString());
                AlertScreen.ShowModalWithImage(false, this.lang.Get("shard_shop_crystal_warning_title", new object[0]), this.lang.Get("shard_shop_crystal_warning_body", new object[]
                {
                    crystals
                }), currencyItemAssetName, new OnScreenModalResult(this.PurchaseShards), num);
                return;
            }
            this.PurchaseShards(button, num);
        }
Ejemplo n.º 5
0
 public static AlertScreen ShowModal(bool fatal, string title, string message, string spriteName, OnScreenModalResult onModalResult, object modalResultCookie, bool disableCloseBtn, bool isAlwaysOnTop)
 {
     return(AlertScreen.ShowModal(fatal, title, message, null, onModalResult, modalResultCookie, false, isAlwaysOnTop, null, true));
 }
Ejemplo n.º 6
0
 public static AlertScreen ShowModal(bool fatal, string title, string message, OnScreenModalResult onModalResult, object modalResultCookie)
 {
     return(AlertScreen.ShowModal(fatal, title, message, null, onModalResult, modalResultCookie, false, false, null, true));
 }
Ejemplo n.º 7
0
 public static AlertScreen ShowModalWithBI(bool fatal, string title, string message, string biMessage)
 {
     return(AlertScreen.ShowModal(fatal, title, message, null, null, null, false, false, biMessage, true));
 }
Ejemplo n.º 8
0
 public unsafe static long $Invoke21(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(AlertScreen.ShowModalWithImage(*(sbyte *)args != 0, Marshal.PtrToStringUni(*(IntPtr *)(args + 1)), Marshal.PtrToStringUni(*(IntPtr *)(args + 2)), Marshal.PtrToStringUni(*(IntPtr *)(args + 3)), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[4]), GCHandledObjects.GCHandleToObject(args[5]))));
 }
Ejemplo n.º 9
0
 public unsafe static long $Invoke20(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(AlertScreen.ShowModalWithBI(*(sbyte *)args != 0, Marshal.PtrToStringUni(*(IntPtr *)(args + 1)), Marshal.PtrToStringUni(*(IntPtr *)(args + 2)), Marshal.PtrToStringUni(*(IntPtr *)(args + 3)))));
 }