Route inventory renames through checkpoints
This commit is contained in:
parent
b152f7fceb
commit
30eda5c82e
5 changed files with 49 additions and 2 deletions
|
|
@ -1415,6 +1415,15 @@ public class ActionGameManager : MonoBehaviour
|
|||
QueueRunCheckpoint("entity-override-shutdown");
|
||||
}
|
||||
|
||||
public void CommitEntityName(Entity entity, string name)
|
||||
{
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
entity.Name = name ?? "";
|
||||
QueueRunCheckpoint("entity-name");
|
||||
}
|
||||
|
||||
public void CommitEquippedItemOverrideShutdown(EquippedItem item, bool enabled)
|
||||
{
|
||||
if (item?.EquippableItem == null)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
Dialog.AddField("Name", () => entityName, s => entityName = s);
|
||||
Dialog.Show(() =>
|
||||
{
|
||||
_displayedEntity.Name = entityName;
|
||||
GameManager.CommitEntityName(_displayedEntity, entityName);
|
||||
Title.text = _displayedEntity.Name;
|
||||
});
|
||||
Dialog.MoveToCursor();
|
||||
|
|
|
|||
Loading…
Reference in a new issue