From 2db312f71ed68288e59e2a26b6ba7c6cb8f8f51a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 11 Apr 2019 18:22:49 +0300 Subject: [PATCH] (3d7994d75) Added a command that resets selected items and structures to prefab values --- .../BarotraumaClient/Source/DebugConsole.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index 697d8f31d..cc080dd98 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -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)