private void OnCompanyCashChanged(CurrencyNumber oldCound, CurrencyNumber newCount) { if (generator != null) { UpdateViews(); } }
private void OnCompanyCashChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { if (Data != null && Data.CurrencyType == CurrencyType.CompanyCash) { UpdateBuyButtonState(Data); } }
private void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { if (IsLoaded) { SendEventToNonCompleted(new TutorialEventData(TutorialEventName.CopanyCashChanged, newValue.Value)); } }
private void OnSecuritiesChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { if (Data != null && Data.CurrencyType == CurrencyType.Securities) { UpdateBuyButtonState(Data); } }
private void OnSecuritiesChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { if (Planet.State == PlanetState.Closed) { UpdatePlanetView(); } }
private void OnCompanyCashChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { if (Planet.State == PlanetState.Closed) { UpdatePlanetView(); } }
private void OnSecuritiesChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { if (securitiesText != null) { //securitiesText.text = GetCurrencyString(newValue); GetSecuritiesCurrencyNumberText()?.SetValue(newValue.Value); } }
private void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { if (companyCashText != null) { //companyCashText.text = GetCurrencyString(newValue); GetCompanyCashCurrencyNumberText()?.SetValue(newValue.Value); } }
private void OnPlayerCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { if (playerCashText != null) { //playerCashText.text = GetCurrencyString(newValue); GetPlayerCashCurrencyNumberText()?.SetValue(newValue.Value); } }
private void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { NumberTextView.text = newValue.PrefixedAbbreviation(); if (WordTextView != null) { WordTextView.text = string.Empty; } //WordTextView.text = string.Empty; }
public void AddSecurities(CurrencyNumber value) { var oldValue = currency.Securities; currency.AddSecurities(value.Value); if (currency.Securities != oldValue) { GameEvents.OnSecuritiesChanged(oldValue.ToCurrencyNumber(), currency.Securities.ToCurrencyNumber()); } }
public void AddPlayerCash(CurrencyNumber value) { var oldValue = currency.PlayerCash; currency.AddPlayerCash(value.Value); if (currency.PlayerCash != oldValue) { GameEvents.OnPlayerCashChanged(oldValue.ToCurrencyNumber(), currency.PlayerCash.ToCurrencyNumber()); } }
private void UpdatePriceTexts() { if (generator != null) { var reportCount = Services.SecretaryService.GetReportCount(generator.GeneratorId); CurrencyNumber price = Services.AuditorService.GetAuditorPrice(generator, reportCount).ToCurrencyNumber(); string[] legacyComponents = price.LegacyComponents(); priceText.text = legacyComponents[0] + (legacyComponents[1].IsValid() ? " " + legacyComponents[1].Colored("#fdee21") : string.Empty); } }
public override void OnEnable() { base.OnEnable(); //var product = IAPManager.instance.GetProduct(productId); var resourceData = Services.ResourceService.Products.GetProduct(productId); Services.Inap.GetProductByResourceId(productId).Match(() => { //Clear(); buyButton.Activate(); buyButton.SetListener(() => Services.Inap.PurchaseProduct(resourceData)); priceText.text = "0.00"; return(F.None); }, product => { buyButton.Activate(); buyButton.SetListener(() => Services.Inap.PurchaseProduct(resourceData)); if (longDescriptionText != null) { /* * if(resourceData.UseCash || resourceData.UseSecurities || resourceData.UsePlayerCash) { * var value = Services.Currency.CreatePriceStringSeparated(GetSoldCurrencyValue(resourceData)); * if(value.Length > 1) { * longDescriptionText.text = $"{value[0]} {value[1]}"; * } else { * longDescriptionText.text = $"{value[0]}"; * } * } else { * longDescriptionText.text = string.Empty; * }*/ longDescriptionText.text = string.Empty; } if (descriptionText != null) { if (resourceData.UseCash || resourceData.UseSecurities || resourceData.UsePlayerCash) { var cost = GetSoldCurrencyValue(resourceData); CurrencyNumber num = new CurrencyNumber(cost); string costShortText = "$ " + BosUtils.GetCurrencyString(num, "#f0b03c", "#f9f7bc"); descriptionText.text = costShortText; } else { descriptionText.text = string.Empty; } } priceText.text = product.metadata.localizedPriceString; return(F.Some(product)); }); AnimateIcon(); }
private void OnPlayerCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { if (cachedProductData != null) { UpdateButtonState(cachedProductData); } else { buyButton.interactable = false; } }
public static string GetCurrencyStringSimple(CurrencyNumber num) { string[] prettyArr = num.AbbreviationComponents(); string result = prettyArr[0]; if (!string.IsNullOrEmpty(prettyArr[1])) { result += " " + prettyArr[1]; } return(result); }
public static string GetCurrencyString(CurrencyNumber num, string numberComponentColor = "", string suffixColor = "#FFE565") { string[] prettyArr = num.AbbreviationColoredComponents(numberComponentColor, suffixColor); string result = prettyArr[0]; if (!string.IsNullOrEmpty(prettyArr[1])) { result += " " + prettyArr[1]; } return(result); }
private string FormatProfit(CurrencyNumber number) { string[] components = number.AbbreviationComponents(); if (!string.IsNullOrEmpty(components[1])) { return($"${components[0]} {components[1]}/SEC"); } else { return($"${components[0]} {DollarsString}/SEC"); } }
private string GetCurrencyString(CurrencyNumber num) { /* * if(num != null) { * string[] prettyArr = num.AbbreviationColoredComponents("", "#FFE565"); * string result = prettyArr[0]; * if (!string.IsNullOrEmpty(prettyArr[1])) { * result += " " + prettyArr[1]; * } * return result; * } * return "0";*/ return(BosUtils.GetCurrencyString(num)); }
private void UpdateIncomeText(int brokenedCount) { if (manager != null) { ProfitResult profitResult = Generator.ConstructProfitResult(Services.GenerationService.Generators); //Services.GenerationService.CalculateProfitPerSecond(Generator, //Services.TransportService.GetUnitLiveCount(manager.Id)); CurrencyNumber number = profitResult.ValuePerSecond.ToCurrencyNumber(); if (brokenedCount == 0) { incomeText.text = string.Format(Services.ResourceService.Localization.GetString("fmt_your_profit_normal"), FormatProfit(number).Colored("#F9F7BC")); } else { incomeText.text = string.Format(Services.ResourceService.Localization.GetString("fmt_income_drop"), FormatProfit(number).Colored("#F9F7BC")); } } }
public void Setup(ManagerInfo manager) { this.manager = manager; GeneratorInfo generator = Services.GenerationService.GetGetenerator(manager.Id); updateTimer.Setup(1.0f, (delta) => { ProfitResult profitResult = generator.ConstructProfitResult(Services.GenerationService.Generators); //Services.GenerationService.CalculateProfitPerSecond(generator,Services.TransportService.GetUnitLiveCount(manager.Id)); CurrencyNumber number = profitResult.ValuePerSecond.ToCurrencyNumber(); profitText.text = FormatProfit(profitResult.ValuePerSecond.ToCurrencyNumber()); UpdateEfficiencyText(); }, invokeImmediatly: true); UpdateManagerIcon(); UpdateMegaTextObject(); UpdateRollbackChanged(); if (!isInitialized) { isInitialized = true; } }
public static void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) => CompanyCashChanged?.Invoke(oldValue, newValue);
public static void OnPlayerCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) => PlayerCashChanged?.Invoke(oldValue, newValue);
public static void OnSecuritiesChanged(CurrencyNumber oldValue, CurrencyNumber newValue) => SecuritiesChanged?.Invoke(oldValue, newValue);
private void OnPlayerCashChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { UpdateForCurrencyType(CurrencyType.PlayerCash); }
private void OnSecuritiesChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { UpdateForCurrencyType(CurrencyType.Securities); }
private void OnCompanyCashChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { UpdateCompanyCash(); UpdatePlayerCash(); }
private void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { //UpdateBuyGeneratorControls(LastBuyCount > 0 ? LastBuyCount : generatorCountButton.StateInt); UpdateBuyManagerButton(); UpdateBuyGeneratorControls(generatorCountButton.GetBuyInfo()); }
private void OnCompanyCashChanged(CurrencyNumber oldCount, CurrencyNumber newCount) { UpdateCompanyCash(); UpdateSessionEarningsCompanyCash(); UpdateLifetimeEarningsCompanyCash(); }
private void OnCompanyCashChanged(CurrencyNumber oldValue, CurrencyNumber newValue) { Reload(newValue.Value); }