增加收获属性逻辑,优化掉落物表现效果

This commit is contained in:
2026-10-05 17:02:29 +08:00
parent d55b1013ca
commit 7590d78e74
53 changed files with 1633 additions and 241 deletions
@@ -25,6 +25,7 @@ namespace SepCore.UI
protected override void SubscribeCustomEvents()
{
GameEntry.Event.Subscribe(ShopRefreshEventArgs.EventId, ShopRefresh);
GameEntry.Event.Subscribe(ShopGoodsLockEventArgs.EventId, ShopGoodsLock);
GameEntry.Event.Subscribe(ShopPurchaseEventArgs.EventId, ShopPurchase);
GameEntry.Event.Subscribe(ShopContinueEventArgs.EventId, ShopContinue);
GameEntry.Event.Subscribe(DisplayItemHoverEventArgs.EventId, DisplayItemHover);
@@ -38,6 +39,7 @@ namespace SepCore.UI
protected override void UnsubscribeCustomEvents()
{
GameEntry.Event.Unsubscribe(ShopRefreshEventArgs.EventId, ShopRefresh);
GameEntry.Event.Unsubscribe(ShopGoodsLockEventArgs.EventId, ShopGoodsLock);
GameEntry.Event.Unsubscribe(ShopPurchaseEventArgs.EventId, ShopPurchase);
GameEntry.Event.Unsubscribe(ShopContinueEventArgs.EventId, ShopContinue);
GameEntry.Event.Unsubscribe(DisplayItemHoverEventArgs.EventId, DisplayItemHover);
@@ -355,6 +357,27 @@ namespace SepCore.UI
ApplyGoodsPurchased(result);
}
private void ShopGoodsLock(object sender, GameEventArgs e)
{
if (e is not ShopGoodsLockEventArgs args)
{
return;
}
if (_useCase == null || Context == null)
{
return;
}
bool isLocked = _useCase.ToggleLock(args.GoodsIndex);
if (args.GoodsIndex >= 0 && args.GoodsIndex < Context.GoodsItems.Count && Context.GoodsItems[args.GoodsIndex] != null)
{
Context.GoodsItems[args.GoodsIndex].IsLocked = isLocked;
Context.NeedRefreshGoodsItems = true;
RefreshUI(Form, Context);
}
}
private void ShopContinue(object sender, GameEventArgs e)
{
if (e is not ShopContinueEventArgs)