Exemple #1
0
 private void OnCreateClicked(UXButton button)
 {
     if (!GameUtils.CanAffordCredits(GameConstants.SQUAD_CREATE_COST))
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append("create");
         stringBuilder.Append("|");
         string text = this.openEnrollment ? "public" : "private";
         stringBuilder.Append(text);
         stringBuilder.Append("|");
         stringBuilder.Append(this.scoreReq);
         PayMeScreen.ShowIfNotEnoughCurrency(GameConstants.SQUAD_CREATE_COST, 0, 0, stringBuilder.ToString(), new OnScreenModalResult(this.OnPurchaseSoftCurrency));
         return;
     }
     this.CreateSquad();
 }
Exemple #2
0
        protected override void OnPurchaseClicked(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);

            if (PayMeScreen.ShowIfNotEnoughCurrency(upgradeCredits, upgradeMaterials, upgradeContraband, buildingPurchaseContext, new OnScreenModalResult(this.OnPayMeForCurrencyResult)))
            {
                return;
            }
            if (PayMeScreen.ShowIfNoFreeDroids(new OnScreenModalResult(this.OnPayMeForDroidResult), null))
            {
                return;
            }
            this.ConfirmUpgrade();
        }
Exemple #3
0
        private void OnSwapConfirmButtonClicked(UXButton button)
        {
            if (this.selectedTurret == null)
            {
                return;
            }
            BuildingTypeVO buildingInfo            = this.selectedTurret.BuildingInfo;
            int            swapCredits             = buildingInfo.SwapCredits;
            int            swapMaterials           = buildingInfo.SwapMaterials;
            int            swapContraband          = buildingInfo.SwapContraband;
            string         buildingPurchaseContext = GameUtils.GetBuildingPurchaseContext(buildingInfo, this.buildingInfo, false, true);

            if (PayMeScreen.ShowIfNotEnoughCurrency(swapCredits, swapMaterials, swapContraband, buildingPurchaseContext, new OnScreenModalResult(this.OnSwapPayMeForCurrencyResult)))
            {
                return;
            }
            if (PayMeScreen.ShowIfNoFreeDroids(new OnScreenModalResult(this.OnSwapPayMeForDroidResult), null))
            {
                return;
            }
            this.OnSwapStartContractSuccess();
        }
Exemple #4
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);
        }
Exemple #5
0
 public unsafe static long $Invoke7(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(PayMeScreen.ShowIfNotEnoughCurrency(*(int *)args, *(int *)(args + 1), *(int *)(args + 2), Marshal.PtrToStringUni(*(IntPtr *)(args + 3)), (OnScreenModalResult)GCHandledObjects.GCHandleToObject(args[4]))));
 }
Exemple #6
0
 public static bool ShowIfNotEnoughCurrency(int credits, int materials, int contraband, string purchaseContext, OnScreenModalResult onModalResult)
 {
     return(PayMeScreen.ShowIfNotEnoughCurrency(credits, materials, contraband, purchaseContext, null, onModalResult));
 }