Make ActorTags display ChildActivities
This commit is contained in:
@@ -161,6 +161,16 @@ namespace OpenRA.Activities
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public IEnumerable<string> DebugLabelComponents()
|
||||
{
|
||||
var act = this;
|
||||
while (act != null)
|
||||
{
|
||||
yield return act.GetType().Name;
|
||||
act = act.childActivity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class ActivityExts
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user