From 1615e2f6aab2ff85d221bffdbe53ae23cbc64334 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 17 Apr 2019 12:42:35 +0300 Subject: [PATCH] (3c4a367f1) Added structural section damage indication to DebugDraw --- Barotrauma/BarotraumaClient/Source/Map/Structure.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Structure.cs b/Barotrauma/BarotraumaClient/Source/Map/Structure.cs index b1ea776e0..f5739d49e 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Structure.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Structure.cs @@ -322,6 +322,17 @@ namespace Barotrauma -Bodies[i].Rotation, Color.White); } } + + if (SectionCount > 0 && HasBody) + { + for (int i = 0; i < SectionCount; i++) + { + var textPos = SectionPosition(i, true); + textPos.Y = -textPos.Y; + GUI.DrawString(spriteBatch, textPos, "Damage: " + (int)((GetSection(i).damage / Health) * 100f) + "%", Color.Yellow); + } + } + AiTarget?.Draw(spriteBatch); } }