(3d7994d75) Added a command that resets selected items and structures to prefab values

This commit is contained in:
Joonas Rikkonen
2019-04-11 18:22:49 +03:00
parent 5f4797bb1a
commit 2db312f71e

View File

@@ -555,6 +555,28 @@ namespace Barotrauma
}
}));
commands.Add(new Command("resetselected", "Reset selected items and structures to prefabs. Only applicable in the subeditor.", args =>
{
if (Screen.Selected == GameMain.SubEditorScreen)
{
foreach (MapEntity entity in MapEntity.SelectedList)
{
if (entity is Item item)
{
item.Reset();
item.CreateEditingHUD();
break;
}
else if (entity is Structure structure)
{
structure.Reset();
structure.CreateEditingHUD();
break;
}
}
}
}));
commands.Add(new Command("alpha", "Change the alpha (as bytes from 0 to 255) of the selected item/structure instances. Applied only in the subeditor.", (string[] args) =>
{
if (Screen.Selected == GameMain.SubEditorScreen)