Beispiel #1
0
 protected bool CheckForValidInput()
 {
     if (!Service.Get <ProfanityController>().IsValid(this.inputBox.Text, false))
     {
         AlertScreen.ShowModal(false, null, this.lang.Get("INVALID_TEXT", new object[0]), null, null);
         return(false);
     }
     return(true);
 }
        private void OnUpgradeAllWallsButton(UXButton button)
        {
            int    num     = GameUtils.CrystalCostToUpgradeAllWalls(this.nextBuildingInfo.UpgradeMaterials, this.allWallSameLevelCount);
            string title   = this.lang.Get("upgrade_all_walls_confirm_title", new object[0]);
            string message = this.lang.Get("upgrade_all_walls_conifrm_desc", new object[]
            {
                this.allWallSameLevelCount,
                this.currentWallLevel + 1,
                num
            });

            AlertScreen.ShowModal(false, title, message, new OnScreenModalResult(this.ConfirmUpgradeAllWalls), null);
        }
Beispiel #3
0
        private bool CheckForValidInput(bool checkName)
        {
            ProfanityController profanityController = Service.ProfanityController;

            if (checkName && (this.inputName.Text == this.lang.Get("INIT_SQUAD_NAME_INPUT", new object[0]) || !profanityController.IsValid(this.inputName.Text, true)))
            {
                AlertScreen.ShowModal(false, null, this.lang.Get("INVALID_SQUAD_NAME", new object[0]), null, null);
                return(false);
            }
            if (!profanityController.IsValid(this.inputDescription.Text, false))
            {
                AlertScreen.ShowModal(false, null, this.lang.Get("INVALID_SQUAD_DESC", new object[0]), null, null);
                return(false);
            }
            return(true);
        }
Beispiel #4
0
        private void OnTutorialConfirmClicked(UXButton button)
        {
            string planetDisplayName    = LangUtils.GetPlanetDisplayName(this.selectedPlanet);
            string planetDisplayNameKey = LangUtils.GetPlanetDisplayNameKey(this.selectedPlanet.Uid);

            Service.SharedPlayerPrefs.SetPref("1stPlaName", planetDisplayNameKey);
            Service.SharedPlayerPrefs.SetPref("1stPlaUid", this.selectedPlanet.Uid);
            AlertScreen alertScreen = AlertScreen.ShowModal(false, this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_TITLE", new object[0]), this.lang.Get("PLANETS_GNC_TUTORIAL_MESSAGE", new object[]
            {
                planetDisplayName
            }), new OnScreenModalResult(this.OnConfirmation), this.selectedPlanet);

            alertScreen.AllowFUEBackButton = true;
            alertScreen.Tag = "Tutorial";
            alertScreen.SetPrimaryLabelText(this.lang.Get("s_Confirm", new object[0]));
            alertScreen.SetTextureInset("PlanetEnvIcon-" + this.selectedPlanet.Abbreviation);
        }
 private void OnRevengeButtonClicked(UXButton button)
 {
     this.ToggleRevengeButtons(false);
     if (Service.Get <CurrentPlayer>().Inventory.Troop.GetTotalStorageAmount() <= 0 && Service.Get <CurrentPlayer>().Inventory.SpecialAttack.GetTotalStorageAmount() <= 0 && Service.Get <CurrentPlayer>().Inventory.Hero.GetTotalStorageAmount() <= 0 && Service.Get <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.Get <EventManager>().SendEvent(EventId.UIAttackScreenSelection, new ActionMessageBIData("PvP", "no_troops"));
         return;
     }
     if (Service.Get <CurrentPlayer>().ProtectedUntil > ServerTime.Time)
     {
         DisableProtectionAlertScreen.ShowModal(new OnScreenModalResult(this.OnConfirmInvalidation), button.Tag);
         return;
     }
     GameUtils.ExitEditState();
     this.StartRevenge(button.Tag as BattleEntry);
 }
Beispiel #6
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);
        }
Beispiel #7
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));
 }
Beispiel #8
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));
 }
Beispiel #9
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));
 }
Beispiel #10
0
 public unsafe static long $Invoke19(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(AlertScreen.ShowModal(*(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]), *(sbyte *)(args + 6) != 0, *(sbyte *)(args + 7) != 0, Marshal.PtrToStringUni(*(IntPtr *)(args + 8)), *(sbyte *)(args + 9) != 0)));
 }