WithTextDecoration Fix
This commit is contained in:
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public object Create(ActorInitializer init) { return new WithTextControlGroupDecoration(init.Self, this); }
|
public object Create(ActorInitializer init) { return new WithTextControlGroupDecoration(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithTextControlGroupDecoration : IRenderAboveShroudWhenSelected, INotifyCapture
|
public class WithTextControlGroupDecoration : IRenderAboveShroudWhenSelected, INotifyOwnerChanged
|
||||||
{
|
{
|
||||||
readonly WithTextControlGroupDecorationInfo info;
|
readonly WithTextControlGroupDecorationInfo info;
|
||||||
readonly SpriteFont font;
|
readonly SpriteFont font;
|
||||||
@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
yield return new TextRenderable(font, wr.ProjectedPosition(screenPos), info.ZOffset, color, number);
|
yield return new TextRenderable(font, wr.ProjectedPosition(screenPos), info.ZOffset, color, number);
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyCapture.OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
|
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||||
{
|
{
|
||||||
if (info.UsePlayerColor)
|
if (info.UsePlayerColor)
|
||||||
color = newOwner.Color.RGB;
|
color = newOwner.Color.RGB;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithTextDecoration : ConditionalTrait<WithTextDecorationInfo>, IRender, IRenderAboveShroudWhenSelected, INotifyCapture
|
public class WithTextDecoration : ConditionalTrait<WithTextDecorationInfo>, IRender, IRenderAboveShroudWhenSelected, INotifyOwnerChanged
|
||||||
{
|
{
|
||||||
readonly SpriteFont font;
|
readonly SpriteFont font;
|
||||||
Color color;
|
Color color;
|
||||||
@@ -126,7 +126,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return new IRenderable[] { new TextRenderable(font, wr.ProjectedPosition(screenPos), Info.ZOffset, color, Info.Text) };
|
return new IRenderable[] { new TextRenderable(font, wr.ProjectedPosition(screenPos), Info.ZOffset, color, Info.Text) };
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyCapture.OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
|
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||||
{
|
{
|
||||||
if (Info.UsePlayerColor)
|
if (Info.UsePlayerColor)
|
||||||
color = newOwner.Color.RGB;
|
color = newOwner.Color.RGB;
|
||||||
|
|||||||
Reference in New Issue
Block a user