Merge pull request #6262 from Mailaender/silo-placement-loop-glitch-fix
Fixed silo fullness animations loop during building placement
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#region Copyright & License Information
|
||||||
/*
|
/*
|
||||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
* available to you under the terms of the GNU General Public License
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation. For more information,
|
* as published by the Free Software Foundation. For more information,
|
||||||
@@ -8,13 +8,25 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Mods.RA.Graphics;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA.Render
|
namespace OpenRA.Mods.RA.Render
|
||||||
{
|
{
|
||||||
class RenderBuildingSiloInfo : RenderBuildingInfo
|
class RenderBuildingSiloInfo : RenderBuildingInfo
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new RenderBuildingSilo(init, this); }
|
public override object Create(ActorInitializer init) { return new RenderBuildingSilo(init, this); }
|
||||||
|
|
||||||
|
public override IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||||
|
{
|
||||||
|
// Show a static frame instead of animating all of the fullness states
|
||||||
|
var anim = new Animation(init.World, image, () => 0);
|
||||||
|
anim.PlayFetchIndex("idle", () => 0);
|
||||||
|
|
||||||
|
yield return new SpriteActorPreview(anim, WVec.Zero, 0, p, rs.Scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenderBuildingSilo : RenderBuilding, INotifyBuildComplete, INotifyCapture
|
class RenderBuildingSilo : RenderBuilding, INotifyBuildComplete, INotifyCapture
|
||||||
|
|||||||
Reference in New Issue
Block a user