From da6bf1a57dc8ead29fbe40b82a20c115451f5442 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 28 Apr 2019 11:58:54 +0000 Subject: [PATCH] Make ActorTags display ChildActivities --- OpenRA.Game/Activities/Activity.cs | 10 ++++++++++ OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Activities/Activity.cs b/OpenRA.Game/Activities/Activity.cs index 36d4177765..b0661577f2 100644 --- a/OpenRA.Game/Activities/Activity.cs +++ b/OpenRA.Game/Activities/Activity.cs @@ -161,6 +161,16 @@ namespace OpenRA.Activities { yield break; } + + public IEnumerable DebugLabelComponents() + { + var act = this; + while (act != null) + { + yield return act.GetType().Name; + act = act.childActivity; + } + } } public static class ActivityExts diff --git a/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs b/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs index b714ee0bab..80336787e8 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderDebugState.cs @@ -80,10 +80,7 @@ namespace OpenRA.Mods.Common.Traits.Render // Get the actor's activity. var activity = self.CurrentActivity; if (activity != null) - { - var activityName = activity.GetType().ToString().Split('.').Last(); - yield return new TextRenderable(font, self.CenterPosition, 0, color, activityName); - } + yield return new TextRenderable(font, self.CenterPosition, 0, color, activity.DebugLabelComponents().JoinWith(".")); // Get the AI squad that this actor belongs to. if (!self.Owner.IsBot)