Add ShowTicks to sellable
This commit is contained in:
committed by
abcdefg30
parent
a3636c69d9
commit
8914227811
@@ -21,9 +21,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
readonly Health health;
|
||||
readonly SellableInfo sellableInfo;
|
||||
readonly PlayerResources playerResources;
|
||||
bool showTicks;
|
||||
|
||||
public Sell(Actor self)
|
||||
public Sell(Actor self, bool showTicks)
|
||||
{
|
||||
this.showTicks = showTicks;
|
||||
health = self.TraitOrDefault<Health>();
|
||||
sellableInfo = self.Info.TraitInfo<SellableInfo>();
|
||||
playerResources = self.Owner.PlayerActor.Trait<PlayerResources>();
|
||||
@@ -40,7 +42,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
foreach (var ns in self.TraitsImplementing<INotifySold>())
|
||||
ns.Sold(self);
|
||||
|
||||
if (refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
if (showTicks && refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color.RGB, FloatingText.FormatCashTick(refund), 30)));
|
||||
|
||||
self.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user