替换玩家模型素材,添加 ChildrenMap 配置挂点
This commit is contained in:
@@ -12,6 +12,7 @@ namespace SepCore.UI
|
||||
protected override UIFormType UIFormType => UIFormType.ItemTooltipForm;
|
||||
|
||||
private Action<int, int> _onRecycle;
|
||||
private Action<int> _onCombine;
|
||||
|
||||
private bool _subscribed = false;
|
||||
|
||||
@@ -19,7 +20,9 @@ namespace SepCore.UI
|
||||
{
|
||||
if (_subscribed) return;
|
||||
GameEntry.Event.Subscribe(ItemTooltipRecycleEventArgs.EventId, ItemTooltipRecycle);
|
||||
GameEntry.Event.Subscribe(ItemTooltipCombineEventArgs.EventId, ItemTooltipCombine);
|
||||
GameEntry.Event.Subscribe(ItemTooltipHideEventArgs.EventId, ItemTooltipHide);
|
||||
GameEntry.Event.Subscribe(DisplayItemLockEventArgs.EventId, DisplayItemLock);
|
||||
_subscribed = true;
|
||||
}
|
||||
|
||||
@@ -27,7 +30,9 @@ namespace SepCore.UI
|
||||
{
|
||||
if (!_subscribed) return;
|
||||
GameEntry.Event.Unsubscribe(ItemTooltipRecycleEventArgs.EventId, ItemTooltipRecycle);
|
||||
GameEntry.Event.Unsubscribe(ItemTooltipCombineEventArgs.EventId, ItemTooltipCombine);
|
||||
GameEntry.Event.Unsubscribe(ItemTooltipHideEventArgs.EventId, ItemTooltipHide);
|
||||
GameEntry.Event.Unsubscribe(DisplayItemLockEventArgs.EventId, DisplayItemLock);
|
||||
_subscribed = false;
|
||||
}
|
||||
|
||||
@@ -75,12 +80,14 @@ namespace SepCore.UI
|
||||
}
|
||||
|
||||
_onRecycle = rawData.OnRecycle;
|
||||
_onCombine = rawData.OnCombine;
|
||||
await OpenFormAsync(context, timeout);
|
||||
}
|
||||
|
||||
public override async UniTask CloseUIAsync(object userData = null, float timeout = 30f)
|
||||
{
|
||||
_onRecycle = null;
|
||||
_onCombine = null;
|
||||
await base.CloseUIAsync(userData, timeout);
|
||||
}
|
||||
|
||||
@@ -94,6 +101,19 @@ namespace SepCore.UI
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
private void DisplayItemLock(object sender, GameEventArgs e)
|
||||
{
|
||||
if (e is not DisplayItemLockEventArgs)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Form != null && Form.Visible)
|
||||
{
|
||||
Form.SetMaskEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void ItemTooltipRecycle(object sender, GameEventArgs e)
|
||||
{
|
||||
if (e is not ItemTooltipRecycleEventArgs args)
|
||||
@@ -104,6 +124,16 @@ namespace SepCore.UI
|
||||
_onRecycle?.Invoke(args.Index, args.Price);
|
||||
}
|
||||
|
||||
private void ItemTooltipCombine(object sender, GameEventArgs e)
|
||||
{
|
||||
if (e is not ItemTooltipCombineEventArgs args)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_onCombine?.Invoke(args.Index);
|
||||
}
|
||||
|
||||
private void ItemTooltipHide(object sender, GameEventArgs e)
|
||||
{
|
||||
if (e is not ItemTooltipHideEventArgs args) return;
|
||||
|
||||
Reference in New Issue
Block a user