Modified actor tooltips to include friendly name and internal name
This commit is contained in:
@@ -69,8 +69,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Footprint = new ReadOnlyDictionary<CPos, SubCell>(footprint);
|
Footprint = new ReadOnlyDictionary<CPos, SubCell>(footprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
var tooltipInfo = Info.Traits.GetOrDefault<ITooltipInfo>();
|
var tooltip = Info.Traits.GetOrDefault<TooltipInfo>();
|
||||||
Tooltip = "{0} ({1})".F(tooltipInfo != null ? tooltipInfo.TooltipForPlayerStance(Stance.None) : Info.Name, ID);
|
Tooltip = tooltip == null ? Info.Name + " - " + ID : tooltip.Name + " (" + Info.Name + ") - " + ID;
|
||||||
|
|
||||||
GeneratePreviews();
|
GeneratePreviews();
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
item.Bounds.Width = preview.Bounds.Width + 2 * preview.Bounds.X;
|
item.Bounds.Width = preview.Bounds.Width + 2 * preview.Bounds.X;
|
||||||
item.Bounds.Height = preview.Bounds.Height + 2 * preview.Bounds.Y;
|
item.Bounds.Height = preview.Bounds.Height + 2 * preview.Bounds.Y;
|
||||||
item.IsVisible = () => true;
|
item.IsVisible = () => true;
|
||||||
item.GetTooltipText = () => actor.Name;
|
|
||||||
|
var tooltip = actor.Traits.GetOrDefault<TooltipInfo>();
|
||||||
|
item.GetTooltipText = () => tooltip == null ? actor.Name : tooltip.Name + " (" + actor.Name + ")";
|
||||||
|
|
||||||
panel.AddChild(item);
|
panel.AddChild(item);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user