增加收获属性逻辑,优化掉落物表现效果
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user