private static void ClientShowErrorNotification( TradingStationLot lot, TradingResult error, bool isPlayerBuying) { var message = error.GetDescription(); if (error == TradingResult.ErrorNotEnoughMoneyOnPlayer) { // calculate how many coins are needed var character = Client.Characters.CurrentPlayerCharacter; long deficitShiny = 0, deficitPenny = 0; if (lot.PriceCoinShiny > 0) { deficitShiny = lot.PriceCoinShiny - character.CountItemsOfType(ProtoItemCoinShiny.Value); } if (lot.PriceCoinPenny > 0) { deficitPenny = lot.PriceCoinPenny - character.CountItemsOfType(ProtoItemCoinPenny.Value); } if (deficitShiny > 0 || deficitPenny > 0) { if (deficitShiny > 0) { // ReSharper disable once CanExtractXamlLocalizableStringCSharp message += "[br]" + string.Format(NotificationNeedMoreShinyCoins, deficitShiny); } if (deficitPenny > 0) { // ReSharper disable once CanExtractXamlLocalizableStringCSharp message += "[br]" + string.Format(NotificationNeedMorePennyCoins, deficitPenny); } } } NotificationSystem.ClientShowNotification( isPlayerBuying ? NotiticationCannotBuy_Title : NotiticationCannotSell_Title, message, NotificationColor.Bad, icon: lot.ProtoItem.Icon); }
private static void ClientShowErrorNotification( TradingStationLot lot, TradingResult error, bool isPlayerBuying) { var message = error.GetDescription(); if (error == TradingResult.ErrorNotEnoughMoneyOnPlayer) { // calculate how many coins are needed long shinyNotEnough = 0, pennyNotEnough = 0; if (lot.PriceCoinShiny > 0) { shinyNotEnough = lot.PriceCoinShiny - Client.Characters.CurrentPlayerCharacter.CountItemsOfType( ProtoItemCoinShiny.Value); } if (lot.PriceCoinPenny > 0) { pennyNotEnough = lot.PriceCoinPenny - Client.Characters.CurrentPlayerCharacter.CountItemsOfType( ProtoItemCoinPenny.Value); } if (shinyNotEnough > 0 || pennyNotEnough > 0) { if (shinyNotEnough > 0) { message += Environment.NewLine + string.Format(NotificationNeedMoreShinyCoins, shinyNotEnough); } if (pennyNotEnough > 0) { message += Environment.NewLine + string.Format(NotificationNeedMorePennyCoins, pennyNotEnough); } } } NotificationSystem.ClientShowNotification( isPlayerBuying ? NotiticationCannotBuy_Title : NotiticationCannotSell_Title, message, NotificationColor.Bad, icon: lot.ProtoItem.Icon); }