Fix tooltips not showing for frozen actors with dead backing actors.
This also documents some old bugs.
This commit is contained in:
@@ -252,11 +252,17 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
if (frozen != null)
|
if (frozen != null)
|
||||||
{
|
{
|
||||||
var actor = frozen.Actor;
|
var actor = frozen.Actor;
|
||||||
if (actor != null && actor.TraitsImplementing<IVisibilityModifier>().All(t => t.IsVisible(actor, world.RenderPlayer)))
|
|
||||||
|
// HACK: This leaks the cloak state through the fog (cloaked buildings will not show tooltips)
|
||||||
|
if (actor == null || actor.TraitsImplementing<IVisibilityModifier>().All(t => t.IsVisible(actor, world.RenderPlayer)))
|
||||||
{
|
{
|
||||||
FrozenActorTooltip = frozen;
|
FrozenActorTooltip = frozen;
|
||||||
|
|
||||||
|
// HACK: This leaks the tooltip state through the fog
|
||||||
|
// This will cause issues for any downstream mods that use IProvideTooltipInfo on enemy actors
|
||||||
if (frozen.Actor != null)
|
if (frozen.Actor != null)
|
||||||
ActorTooltipExtra = frozen.Actor.TraitsImplementing<IProvideTooltipInfo>().ToArray();
|
ActorTooltipExtra = frozen.Actor.TraitsImplementing<IProvideTooltipInfo>().ToArray();
|
||||||
|
|
||||||
TooltipType = WorldTooltipType.FrozenActor;
|
TooltipType = WorldTooltipType.FrozenActor;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user