Esempio n. 1
0
 public ApplePromoScreen(OnScreenModalResult onModalResult, object result) : base(true, null, null, null, false)
 {
     base.OnModalResult = onModalResult;
     this.modalResult   = result;
     this.title         = this.lang.Get("APPLE_PROMO_SCREEN_TITLE", new object[0]);
     this.message       = this.lang.Get("APPLE_PROMO_SCREEN_DESC", new object[0]);
 }
Esempio n. 2
0
        public static void ShowModal(string title, string message, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            UpdateClientScreen updateClientScreen = new UpdateClientScreen(title, message);

            updateClientScreen.OnModalResult     = onModalResult;
            updateClientScreen.ModalResultCookie = modalResultCookie;
        }
Esempio n. 3
0
        public static void RearmAllTraps()
        {
            int num;
            int num2;
            int num3;

            TrapUtils.GetRearmAllTrapsCost(out num, out num2, out num3);
            if (!GameUtils.CanAffordCredits(num) || !GameUtils.CanAffordMaterials(num2) || !GameUtils.CanAffordContraband(num3))
            {
                int    arg_51_0 = num;
                int    arg_51_1 = num2;
                int    arg_51_2 = num3;
                string arg_51_3 = "Rearm_All_Traps";
                if (TrapUtils.< > f__mg$cache0 == null)
                {
                    TrapUtils.< > f__mg$cache0 = new OnScreenModalResult(TrapUtils.OnPayMeForCurrencyResultForMultiTrap);
                }
                PayMeScreen.ShowIfNotEnoughCurrency(arg_51_0, arg_51_1, arg_51_2, arg_51_3, TrapUtils.< > f__mg$cache0);
                return;
            }
            List <SmartEntity> rearmableTraps = TrapUtils.GetRearmableTraps();
            int i     = 0;
            int count = rearmableTraps.Count;

            while (i < count)
            {
                TrapUtils.RearmTrapForClient(rearmableTraps[i]);
                i++;
            }
            TrapUtils.SendRearmTrapServerCommand(rearmableTraps);
        }
Esempio n. 4
0
        public static bool RearmTrapForClient(SmartEntity selectedBuilding)
        {
            BuildingTypeVO buildingType        = selectedBuilding.BuildingComp.BuildingType;
            TrapTypeVO     trapTypeVO          = Service.StaticDataController.Get <TrapTypeVO>(buildingType.TrapUid);
            int            rearmCreditsCost    = trapTypeVO.RearmCreditsCost;
            int            rearmMaterialsCost  = trapTypeVO.RearmMaterialsCost;
            int            rearmContrabandCost = trapTypeVO.RearmContrabandCost;

            if (!GameUtils.CanAffordCredits(rearmCreditsCost) || !GameUtils.CanAffordMaterials(rearmMaterialsCost))
            {
                int    arg_73_0 = rearmCreditsCost;
                int    arg_73_1 = rearmMaterialsCost;
                int    arg_73_2 = rearmContrabandCost;
                string arg_73_3 = GameUtils.GetBuildingPurchaseContext(buildingType, null, false, false);
                if (TrapUtils.< > f__mg$cache1 == null)
                {
                    TrapUtils.< > f__mg$cache1 = new OnScreenModalResult(TrapUtils.OnPayMeForCurrencyResultSingleTrap);
                }
                PayMeScreen.ShowIfNotEnoughCurrency(arg_73_0, arg_73_1, arg_73_2, arg_73_3, TrapUtils.< > f__mg$cache1);
                return(false);
            }
            GameUtils.SpendCurrency(rearmCreditsCost, rearmMaterialsCost, rearmContrabandCost, true);
            Service.TrapController.SetTrapState(selectedBuilding.TrapComp, TrapState.Armed);
            selectedBuilding.BuildingComp.BuildingTO.CurrentStorage = 1;
            Service.UXController.HUD.ShowContextButtons(selectedBuilding);
            Service.BuildingController.RedrawRadiusForSelectedBuilding();
            return(true);
        }
Esempio n. 5
0
 public NavigationCenterUpgradeScreen(SmartEntity selectedBuilding, BuildingTypeVO buildingTypeVO, OnScreenModalResult callback) : base(selectedBuilding)
 {
     this.buildingInfo    = buildingTypeVO;
     this.callback        = callback;
     this.tutorialMode    = true;
     this.useUpgradeGroup = false;
 }
        public static void ShowModal(PlanetVO planetVO, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();
            bool          flag          = Service.Get <BuildingLookupController>().HasNavigationCenter();

            if (planetVO == null || !planetVO.PlayerFacing || planetVO == currentPlayer.Planet || !currentPlayer.IsPlanetUnlocked(planetVO.Uid) || !flag)
            {
                return;
            }
            string text   = currentPlayer.IsRelocationRequirementMet().ToString();
            string cookie = string.Concat(new object[]
            {
                currentPlayer.GetRawRelocationStarsCount(),
                "|",
                text,
                "|",
                planetVO.PlanetBIName,
                "|",
                currentPlayer.Planet.PlanetBIName
            });

            Service.Get <EventManager>().SendEvent(EventId.PlanetRelocateButtonPressed, cookie);
            ConfirmRelocateScreen confirmRelocateScreen = new ConfirmRelocateScreen(planetVO);

            confirmRelocateScreen.OnModalResult     = onModalResult;
            confirmRelocateScreen.ModalResultCookie = modalResultCookie;
            confirmRelocateScreen.IsAlwaysOnTop     = true;
            Service.Get <ScreenController>().AddScreen(confirmRelocateScreen);
        }
Esempio n. 7
0
        public static bool ShowCompensationMessage()
        {
            List <CrateData> compensationCrates = Service.CurrentPlayer.Prizes.GetCompensationCrates();

            if (compensationCrates.Count == 0)
            {
                return(false);
            }
            uint pref       = Service.SharedPlayerPrefs.GetPref <uint>("CompensationMsgLastViewTime");
            uint serverTime = Service.ServerAPI.ServerTime;

            if (serverTime - pref > 86400u)
            {
                bool   arg_8E_0 = false;
                string arg_8E_1 = Service.Lang.Get("comp_popup_title", new object[0]);
                string arg_8E_2 = Service.Lang.Get("comp_popup_body", new object[0]);
                if (UXUtils.< > f__mg$cache0 == null)
                {
                    UXUtils.< > f__mg$cache0 = new OnScreenModalResult(UXUtils.OnGoToCrates);
                }
                AlertScreen alertScreen = AlertScreen.ShowModal(arg_8E_0, arg_8E_1, arg_8E_2, UXUtils.< > f__mg$cache0, null);
                alertScreen.SetPrimaryLabelText(Service.Lang.Get("comp_popup_cta", new object[0]));
                Service.SharedPlayerPrefs.SetPref("CompensationMsgLastViewTime", serverTime.ToString());
                return(true);
            }
            return(false);
        }
 public void ShowPromoDialog(OnScreenModalResult modalResult, object result)
 {
     if (modalResult != null)
     {
         modalResult(result, null);
     }
 }
Esempio n. 9
0
        public static void ShowModal(Entity building, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            CancelScreen cancelScreen = new CancelScreen(building);

            cancelScreen.OnModalResult     = onModalResult;
            cancelScreen.ModalResultCookie = modalResultCookie;
            Service.ScreenController.AddScreen(cancelScreen);
        }
        public static void ShowModal(OnScreenModalResult onModalResult, object modalResultCookie)
        {
            DisableProtectionAlertScreen disableProtectionAlertScreen = new DisableProtectionAlertScreen();

            disableProtectionAlertScreen.OnModalResult     = onModalResult;
            disableProtectionAlertScreen.ModalResultCookie = modalResultCookie;
            Service.Get <ScreenController>().AddScreen(disableProtectionAlertScreen);
        }
Esempio n. 11
0
 private static FinishNowScreen CreateFinishNowPerkScreen(string perkId, OnScreenModalResult onScreenModalResult, object modalResultCookie)
 {
     return(new FinishNowScreen(perkId)
     {
         OnModalResult = onScreenModalResult,
         ModalResultCookie = modalResultCookie
     });
 }
Esempio n. 12
0
 public NavigationCenterUpgradeScreen(Entity selectedBuilding, BuildingTypeVO buildingTypeVO, OnScreenModalResult callback)
 {
     this.unlockablePlanetList = new List <UXCheckbox>();
     base..ctor(selectedBuilding);
     this.buildingInfo    = buildingTypeVO;
     this.callback        = callback;
     this.tutorialMode    = true;
     this.useUpgradeGroup = false;
 }
Esempio n. 13
0
        public static FinishNowScreen ShowModalPerk(string perkId, OnScreenModalResult onModalResult, object modalResultCookie, int crystalCost, string title, string message, bool alwaysOnTop)
        {
            FinishNowScreen finishNowScreen = FinishNowScreen.CreateFinishNowPerkScreen(perkId, onModalResult, modalResultCookie);

            finishNowScreen.crystals        = crystalCost;
            finishNowScreen.titleOverride   = title;
            finishNowScreen.messageOverride = message;
            finishNowScreen.IsAlwaysOnTop   = alwaysOnTop;
            Service.ScreenController.AddScreen(finishNowScreen);
            return(finishNowScreen);
        }
Esempio n. 14
0
        public static void ShowModal(SmartEntity selectedBuilding, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            Contract contract = Service.ISupportController.FindCurrentContract(selectedBuilding.Get <BuildingComponent>().BuildingTO.Key);

            if (contract == null)
            {
                return;
            }
            FinishNowScreen screen = FinishNowScreen.CreateFinishNowScreen(selectedBuilding, contract, false, onModalResult, modalResultCookie);

            Service.ScreenController.AddScreen(screen);
        }
Esempio n. 15
0
        public static FinishNowScreen ShowModalEpisodeTask(EpisodeTaskVO vo, OnScreenModalResult onModalResult, object modalResultCookie, int crystalCost, string title, string message, bool alwaysOnTop)
        {
            FinishNowScreen finishNowScreen = new FinishNowScreen();

            finishNowScreen.OnModalResult     = onModalResult;
            finishNowScreen.ModalResultCookie = modalResultCookie;
            finishNowScreen.crystals          = crystalCost;
            finishNowScreen.titleOverride     = title;
            finishNowScreen.messageOverride   = message;
            finishNowScreen.IsAlwaysOnTop     = alwaysOnTop;
            Service.ScreenController.AddScreen(finishNowScreen);
            return(finishNowScreen);
        }
Esempio n. 16
0
 protected override void HandleClose(UXButton button)
 {
     if (!this.allowClose)
     {
         return;
     }
     if (this.tutorialMode && this.callback != null)
     {
         this.callback(null, null);
         this.callback = null;
     }
     this.Close(null);
 }
Esempio n. 17
0
 public TwoButtonFueScreen(bool forFactionChoice, OnScreenModalResult onModalResult, object modalResultCookie, string descriptionText, bool showIncent) : base("gui_characterpopup")
 {
     this.descriptionText = descriptionText;
     this.showIncent      = showIncent;
     this.useFaction      = forFactionChoice;
     if (this.useFaction)
     {
         this.faction = (FactionType)modalResultCookie;
     }
     base.AllowFUEBackButton = true;
     base.OnModalResult      = onModalResult;
     base.ModalResultCookie  = modalResultCookie;
 }
Esempio n. 18
0
        public static bool ShowIfNoFreeDroids(OnScreenModalResult onModalResult, object modalResultCookie)
        {
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();
            int           num           = ContractUtils.CalculateDroidsInUse();

            if (num >= currentPlayer.CurrentDroidsAmount)
            {
                Lang   lang    = Service.Get <Lang>();
                string title   = lang.Get("droid_title_AllDroidsBusy", new object[0]);
                string message = (currentPlayer.CurrentDroidsAmount < currentPlayer.MaxDroidsAmount) ? lang.Get("droid_desc_CompletePreviousBuildingOrBuy", new object[0]) : lang.Get("droid_desc_CompletePreviousBuilding", new object[0]);
                int    num2    = ContractUtils.MinimumCostToFinish();
                PayMeScreen.ShowModal(num2, true, title, message, null, onModalResult, modalResultCookie);
                return(true);
            }
            return(false);
        }
        public static AlertScreen ShowModal(LimitedEditionItemVO leiVO, OnScreenModalResult onModalResult, object modalResultCookie)
        {
            LimitedEditionItemPurchaseConfirmationScreen limitedEditionItemPurchaseConfirmationScreen = new LimitedEditionItemPurchaseConfirmationScreen();

            limitedEditionItemPurchaseConfirmationScreen.LeiVO    = leiVO;
            limitedEditionItemPurchaseConfirmationScreen.geometry = leiVO;
            limitedEditionItemPurchaseConfirmationScreen.title    = LangUtils.GetLEIDisplayName(leiVO.Uid);
            limitedEditionItemPurchaseConfirmationScreen.message  = limitedEditionItemPurchaseConfirmationScreen.lang.Get("PURCHASE_LEI", new object[]
            {
                limitedEditionItemPurchaseConfirmationScreen.title
            });
            limitedEditionItemPurchaseConfirmationScreen.OnModalResult     = onModalResult;
            limitedEditionItemPurchaseConfirmationScreen.ModalResultCookie = modalResultCookie;
            limitedEditionItemPurchaseConfirmationScreen.IsAlwaysOnTop     = true;
            Service.Get <ScreenController>().AddScreen(limitedEditionItemPurchaseConfirmationScreen);
            return(limitedEditionItemPurchaseConfirmationScreen);
        }
Esempio n. 20
0
        public void ShowPromoDialog(OnScreenModalResult modalResult, object result)
        {
            int    num = 0;
            string iOS_PROMO_END_DATE = GameConstants.IOS_PROMO_END_DATE;

            if (!string.IsNullOrEmpty(iOS_PROMO_END_DATE))
            {
                DateTime date = DateTime.ParseExact(iOS_PROMO_END_DATE, "HH:mm,dd-MM-yyyy", CultureInfo.InvariantCulture);
                num = DateUtils.GetSecondsFromEpoch(date);
            }
            if ((ulong)ServerTime.Time < (ulong)((long)num))
            {
                Service.ScreenController.AddScreen(new ApplePromoScreen(modalResult, result));
            }
            else if (modalResult != null)
            {
                modalResult(result, null);
            }
        }
Esempio n. 21
0
        public override OnCompleteAction OnFailure(uint status, object data)
        {
            if (SquadUtils.IsNotFatalServerError(status))
            {
                return(base.EatFailure(status, data));
            }
            string text = null;

            if (status == 2414u)
            {
                text = "WAR_ERROR_ENDED";
                Service.SquadController.WarManager.EndSquadWar();
            }
            if (text != null)
            {
                OnScreenModalResult onModalResult = new OnScreenModalResult(Service.UXController.HUD.OnSquadWarAttackResultCallback);
                AlertScreen.ShowModal(false, null, Service.Lang.Get(text, new object[0]), onModalResult, null);
                return(OnCompleteAction.Ok);
            }
            return(OnCompleteAction.Desync);
        }
        public override OnCompleteAction OnFailure(uint status, object data)
        {
            if (SquadUtils.IsNotFatalServerError(status))
            {
                return(base.EatFailure(status, data));
            }
            string text = null;

            switch (status)
            {
            case 2402u:
                text = "WAR_ERROR_BUFF_BASE_OWNED";
                break;

            case 2403u:
                text = "WAR_ERROR_BUFF_BASE_IN_BATTLE";
                break;

            case 2404u:
                text = "WAR_ERROR_OPPONENT_IN_BATTLE";
                break;

            default:
                if (status == 2414u)
                {
                    text = "WAR_ERROR_ENDED";
                    Service.Get <SquadController>().WarManager.EndSquadWar();
                }
                break;
            }
            if (text != null)
            {
                OnScreenModalResult onModalResult = new OnScreenModalResult(Service.Get <UXController>().HUD.OnSquadWarAttackResultCallback);
                AlertScreen.ShowModal(false, null, Service.Get <Lang>().Get(text, new object[0]), onModalResult, null);
                return(OnCompleteAction.Ok);
            }
            return(OnCompleteAction.Desync);
        }
Esempio n. 23
0
 public static void ShowModal(string title, string message, bool textOnRight, bool centerTitle, bool allowFUEBackButton, bool alwaysOnTop, OnScreenModalResult onModalResult, object modalResultCookie, bool useCustomKoreanFont = false)
 {
     YesNoScreen.yesString = "";
     YesNoScreen.noString  = "";
     YesNoScreen.CommonShowModal(title, message, textOnRight, centerTitle, allowFUEBackButton, alwaysOnTop, onModalResult, modalResultCookie, useCustomKoreanFont);
 }
Esempio n. 24
0
 public static void ShowModal(string title, string message, bool textOnRight, OnScreenModalResult onModalResult, object modalResultCookie, bool useCustomKoreanFont = false)
 {
     YesNoScreen.ShowModal(title, message, textOnRight, false, false, onModalResult, modalResultCookie, useCustomKoreanFont);
 }
Esempio n. 25
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);
        }
Esempio n. 26
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));
 }
Esempio n. 27
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));
 }
Esempio n. 28
0
 public static void ShowModal(string title, string message, bool textOnRight, string confirmString, string gobackString, OnScreenModalResult onModalResult, object modalResultCookie, bool useCustomKoreanFont = false)
 {
     YesNoScreen.yesString = confirmString;
     YesNoScreen.noString  = gobackString;
     YesNoScreen.CommonShowModal(title, message, textOnRight, false, false, false, onModalResult, modalResultCookie, useCustomKoreanFont);
 }
Esempio n. 29
0
        private static void CommonShowModal(string title, string message, bool textOnRight, bool centerTitle, bool allowFUEBackButton, bool alwaysOnTop, OnScreenModalResult onModalResult, object modalResultCookie, bool useCustomKoreanFont = false)
        {
            YesNoScreen yesNoScreen = new YesNoScreen(title, message, textOnRight, alwaysOnTop, useCustomKoreanFont);

            yesNoScreen.centerTitle        = centerTitle;
            yesNoScreen.OnModalResult      = onModalResult;
            yesNoScreen.ModalResultCookie  = modalResultCookie;
            yesNoScreen.AllowFUEBackButton = allowFUEBackButton;
            Service.Get <ScreenController>().AddScreen(yesNoScreen);
        }
Esempio n. 30
0
        public static bool ShowIfNotEnoughCurrency(int credits, int materials, int contraband, string purchaseContext, OnScreenModalResult onModalResult)
        {
            CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>();
            CurrencyType  currencyType  = GameUtils.GetCurrencyType(credits, materials, contraband);
            int           num           = 0;

            switch (currencyType)
            {
            case CurrencyType.Credits:
                num = credits - currentPlayer.CurrentCreditsAmount;
                break;

            case CurrencyType.Materials:
                num = materials - currentPlayer.CurrentMaterialsAmount;
                break;

            case CurrencyType.Contraband:
                num = contraband - currentPlayer.CurrentContrabandAmount;
                break;
            }
            if (num > 0)
            {
                if (GameUtils.HasEnoughCurrencyStorage(currencyType, num))
                {
                    Lang   lang             = Service.Get <Lang>();
                    string currencyStringId = LangUtils.GetCurrencyStringId(currencyType);
                    string text             = lang.Get(currencyStringId, new object[0]);
                    string title            = lang.Get("NEED_MORE", new object[]
                    {
                        text
                    });
                    string message = lang.Get("NEED_MORE_BUY_MISSING", new object[]
                    {
                        lang.ThousandsSeparated(num),
                        text
                    });
                    int num2 = 0;
                    switch (currencyType)
                    {
                    case CurrencyType.Credits:
                        num2 = GameUtils.CreditsCrystalCost(num);
                        break;

                    case CurrencyType.Materials:
                        num2 = GameUtils.MaterialsCrystalCost(num);
                        break;

                    case CurrencyType.Contraband:
                        num2 = GameUtils.ContrabandCrystalCost(num);
                        break;
                    }
                    string      currencyItemAssetName = UXUtils.GetCurrencyItemAssetName(currencyType.ToString());
                    CurrencyTag modalResultCookie     = new CurrencyTag(currencyType, num, num2, purchaseContext);
                    PayMeScreen.ShowModal(num2, false, title, message, currencyItemAssetName, onModalResult, modalResultCookie);
                }
                else
                {
                    onModalResult(null, null);
                }
                return(true);
            }
            return(false);
        }