商品刷新优化;文本优化

This commit is contained in:
milimoe 2025-07-26 02:35:55 +08:00
parent 00429c2de0
commit 482f281d36
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 11 additions and 10 deletions

View File

@ -52,15 +52,15 @@ namespace Milimoe.FunGame.Core.Entity
builder.AppendLine($"商品描述:{Description}"); builder.AppendLine($"商品描述:{Description}");
builder.AppendLine($"商品售价:{(Prices.Count > 0 ? string.Join("", Prices.Select(kv => $"{kv.Value} {kv.Key}")) : "")}"); builder.AppendLine($"商品售价:{(Prices.Count > 0 ? string.Join("", Prices.Select(kv => $"{kv.Value} {kv.Key}")) : "")}");
builder.AppendLine($"包含物品:{string.Join("", Items.Select(i => $"[{ItemSet.GetQualityTypeName(i.QualityType)}|{ItemSet.GetItemTypeName(i.ItemType)}] {i.Name}"))}"); builder.AppendLine($"包含物品:{string.Join("", Items.Select(i => $"[{ItemSet.GetQualityTypeName(i.QualityType)}|{ItemSet.GetItemTypeName(i.ItemType)}] {i.Name}"))}");
builder.AppendLine($"剩余库存:{(Stock == -1 ? "" : Stock)}");
if (Quota > 0)
{
int buyCount = 0; int buyCount = 0;
if (user != null) if (user != null)
{ {
UsersBuyCount.TryGetValue(user.Id, out buyCount); UsersBuyCount.TryGetValue(user.Id, out buyCount);
} }
builder.AppendLine($"限购数量:{Quota}(已购:{buyCount}"); builder.AppendLine($"剩余库存:{(Stock == -1 ? "" : Stock)}(已购:{buyCount}");
if (Quota > 0)
{
builder.AppendLine($"限购数量:{Quota}");
} }
return builder.ToString().Trim(); return builder.ToString().Trim();
} }

View File

@ -151,12 +151,13 @@ namespace Milimoe.FunGame.Core.Entity
} }
} }
public void CopyGoodsToNextRefreshGoods() public void CopyGoodsToNextRefreshGoods(Dictionary<long, Goods>? goods = null)
{ {
goods ??= Goods;
NextRefreshGoods.Clear(); NextRefreshGoods.Clear();
foreach (long goodsId in Goods.Keys) foreach (long goodsId in goods.Keys)
{ {
NextRefreshGoods.Add(goodsId, Goods[goodsId]); NextRefreshGoods.Add(goodsId, goods[goodsId]);
} }
} }