Esempio n. 1
0
        public static FinishNowScreen ShowModalWithNoContract(SmartEntity selectedBuilding, OnScreenModalResult onModalResult, object modalResultCookie, int crystalCost)
        {
            FinishNowScreen finishNowScreen = FinishNowScreen.CreateFinishNowScreen(selectedBuilding, null, true, onModalResult, modalResultCookie);

            finishNowScreen.crystals = crystalCost;
            Service.ScreenController.AddScreen(finishNowScreen);
            return(finishNowScreen);
        }
Esempio n. 2
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. 3
0
        public static FinishNowScreen ShowModalWithNoContract(SmartEntity selectedBuilding, OnScreenModalResult onModalResult, object modalResultCookie, int crystalCost, string title, string message, bool alwaysOnTop)
        {
            FinishNowScreen finishNowScreen = FinishNowScreen.CreateFinishNowScreen(selectedBuilding, null, true, onModalResult, modalResultCookie);

            finishNowScreen.crystals        = crystalCost;
            finishNowScreen.titleOverride   = title;
            finishNowScreen.messageOverride = message;
            finishNowScreen.IsAlwaysOnTop   = alwaysOnTop;
            Service.ScreenController.AddScreen(finishNowScreen);
            return(finishNowScreen);
        }
Esempio n. 4
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. 5
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. 6
0
        private void OnFinishClicked(UXButton button)
        {
            if (this.activeContract == null)
            {
                return;
            }
            int crystalCostToFinishContract = ContractUtils.GetCrystalCostToFinishContract(this.activeContract);

            if (crystalCostToFinishContract >= GameConstants.CRYSTAL_SPEND_WARNING_MINIMUM)
            {
                FinishNowScreen.ShowModal(this.selectedBuilding, new OnScreenModalResult(this.FinishContract), null);
            }
            else
            {
                this.FinishContract(this.selectedBuilding, null);
            }
        }
Esempio n. 7
0
        protected virtual void OnInstantUpgradeButtonClicked(UXButton button)
        {
            if (!this.HasEnoughResourceCapacityToUpgrade(this.nextBuildingInfo))
            {
                CurrencyType currencyType = GameUtils.GetCurrencyType(this.nextBuildingInfo.UpgradeCredits, this.nextBuildingInfo.UpgradeMaterials, this.nextBuildingInfo.UpgradeContraband);
                Service.ICurrencyController.HandleUnableToCollect(currencyType);
                return;
            }
            int num = GameUtils.CrystalCostToInstantUpgrade(this.nextBuildingInfo);

            if (num >= GameConstants.CRYSTAL_SPEND_WARNING_MINIMUM)
            {
                FinishNowScreen.ShowModalWithNoContract(this.selectedBuilding, new OnScreenModalResult(this.ConfirmInstantUpgrade), null, num);
                return;
            }
            this.ConfirmInstantUpgrade(true, null);
        }
Esempio n. 8
0
        protected override void OnInstantUpgradeButtonClicked(UXButton button)
        {
            if (!base.HasEnoughResourceCapacityToUpgrade(this.nextBuildingInfo))
            {
                CurrencyType currencyType = GameUtils.GetCurrencyType(this.nextBuildingInfo.UpgradeCredits, this.nextBuildingInfo.UpgradeMaterials, this.nextBuildingInfo.UpgradeContraband);
                Service.ICurrencyController.HandleUnableToCollect(currencyType);
                return;
            }
            int             num = GameUtils.CrystalCostToInstantUpgrade(this.nextBuildingInfo);
            string          planetDisplayName = LangUtils.GetPlanetDisplayName(this.selectedPlanet);
            string          text            = this.lang.ThousandsSeparated(num);
            FinishNowScreen finishNowScreen = FinishNowScreen.ShowModalWithNoContract(this.selectedBuilding, new OnScreenModalResult(base.ConfirmInstantUpgrade), null, num, this.lang.Get("PLANETS_GNC_UNLOCK_MODAL_TITLE", new object[0]), this.lang.Get("PLANETS_GNC_INSTANT_MODAL_DESC", new object[]
            {
                text,
                planetDisplayName
            }), true);

            finishNowScreen.SetTextureInset("PlanetEnvIcon-" + this.selectedPlanet.Abbreviation);
        }
Esempio n. 9
0
 public unsafe static long $Invoke12(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(FinishNowScreen.ShowModalWithNoContract((Entity)GCHandledObjects.GCHandleToObject(*args), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[1]), GCHandledObjects.GCHandleToObject(args[2]), *(int *)(args + 3), Marshal.PtrToStringUni(*(IntPtr *)(args + 4)), Marshal.PtrToStringUni(*(IntPtr *)(args + 5)), *(sbyte *)(args + 6) != 0)));
 }
Esempio n. 10
0
 public unsafe static long $Invoke11(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(FinishNowScreen.ShowModalWithNoContract((Entity)GCHandledObjects.GCHandleToObject(*args), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[1]), GCHandledObjects.GCHandleToObject(args[2]), *(int *)(args + 3))));
 }
Esempio n. 11
0
 public unsafe static long $Invoke9(long instance, long *args)
 {
     FinishNowScreen.ShowModal((Entity)GCHandledObjects.GCHandleToObject(*args), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[1]), GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Esempio n. 12
0
 public unsafe static long $Invoke2(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(FinishNowScreen.CreateFinishNowScreen((Entity)GCHandledObjects.GCHandleToObject(*args), (Contract)GCHandledObjects.GCHandleToObject(args[1]), *(sbyte *)(args + 2) != 0, (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[3]), GCHandledObjects.GCHandleToObject(args[4]))));
 }
Esempio n. 13
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(FinishNowScreen.CreateFinishNowPerkScreen(Marshal.PtrToStringUni(*(IntPtr *)args), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[1]), GCHandledObjects.GCHandleToObject(args[2]))));
 }