Make player stance colours universally respected

This commit is contained in:
Gustas
2023-02-25 13:42:43 +02:00
committed by Matthias Mailänder
parent 2f331548e1
commit 5fc36bd45f
38 changed files with 110 additions and 88 deletions

View File

@@ -99,7 +99,7 @@ namespace OpenRA.Mods.Cnc.Traits
public override object Create(ActorInitializer init) { return new Disguise(init.Self, this); }
}
sealed class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, IRadarColorModifier, INotifyAttack,
sealed class Disguise : IEffectiveOwner, IIssueOrder, IResolveOrder, IOrderVoice, INotifyAttack,
INotifyDamage, INotifyLoadCargo, INotifyUnloadCargo, INotifyDemolition, INotifyInfiltration, ITick
{
public ActorInfo AsActor { get; private set; }
@@ -158,14 +158,6 @@ namespace OpenRA.Mods.Cnc.Traits
return order.OrderString == "Disguise" ? info.Voice : null;
}
Color IRadarColorModifier.RadarColorOverride(Actor self, Color color)
{
if (!Disguised || self.Owner.IsAlliedWith(self.World.RenderPlayer))
return color;
return Game.Settings.Game.UsePlayerStanceColors ? Player.PlayerRelationshipColor(self) : AsPlayer.Color;
}
public void DisguiseAs(Actor target)
{
var oldEffectiveActor = AsActor;

View File

@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Cnc.Traits
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
if (info.ShowTicks)
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color, FloatingText.FormatCashTick(toGive), 30)));
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.OwnerColor(), FloatingText.FormatCashTick(toGive), 30)));
}
}
}

View File

@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Traits
{
var temp = currentDisplayValue;
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color, FloatingText.FormatCashTick(temp), Info.TickLifetime)));
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.OwnerColor(), FloatingText.FormatCashTick(temp), Info.TickLifetime)));
currentDisplayTick = Info.TickRate;
currentDisplayValue = 0;