Fixed an issue where items held in hand would not refresh when placing them in a selected slot.
修复将物品放到已选中的槽位时,手中持有的物品没刷新的问题。
This commit is contained in:
parent
9416993849
commit
88813fe837
|
@ -169,7 +169,7 @@ public class UniversalItemContainer(int totalCapacity) : IItemContainer
|
|||
{
|
||||
NewItem = item,
|
||||
NewIndex = nextAvailableIndex,
|
||||
Type = Config.ItemDataChangeEventType.QuantityAdded
|
||||
Type = Config.ItemDataChangeEventType.Add
|
||||
});
|
||||
return item.Quantity;
|
||||
}
|
||||
|
@ -279,6 +279,18 @@ public class UniversalItemContainer(int totalCapacity) : IItemContainer
|
|||
OldItem = oldItem,
|
||||
Type = Config.ItemDataChangeEventType.Replace
|
||||
});
|
||||
if (SupportSelect && index == _selectIndex)
|
||||
{
|
||||
oldItem?.HideSelf();
|
||||
item.ShowSelf();
|
||||
SelectedItemChangeEvent?.Invoke(new SelectedItemChangeEvent
|
||||
{
|
||||
NewIndex = index,
|
||||
OldIndex = index,
|
||||
NewItem = item,
|
||||
OldItem = oldItem
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using ColdMint.scripts.debug;
|
||||
using ColdMint.scripts.map.dateBean;
|
||||
using ColdMint.scripts.map.events;
|
||||
using ColdMint.scripts.map.preview;
|
||||
using ColdMint.scripts.map.room;
|
||||
|
|
Loading…
Reference in New Issue
Block a user