Remove TiberianSunRefinery
Also add IDockClientBody interface, move WithDockingOverlay cnc -> common, remove HarvesterDockSequence implementing classes
This commit is contained in:
committed by
Matthias Mailänder
parent
3f0c3a8b9c
commit
049d0283f9
@@ -45,9 +45,9 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
public class WithVoxelUnloadBody : IAutoMouseBounds
|
||||
public class WithVoxelUnloadBody : IAutoMouseBounds, IDockClientBody
|
||||
{
|
||||
public bool Docked;
|
||||
bool docked;
|
||||
|
||||
readonly ModelAnimation modelAnimation;
|
||||
readonly RenderVoxels rv;
|
||||
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
var idleModel = self.World.ModelCache.GetModelSequence(rv.Image, info.IdleSequence);
|
||||
modelAnimation = new ModelAnimation(idleModel, () => WVec.Zero,
|
||||
() => body.QuantizeOrientation(self.Orientation),
|
||||
() => Docked,
|
||||
() => docked,
|
||||
() => 0, info.ShowShadow);
|
||||
|
||||
rv.Add(modelAnimation);
|
||||
@@ -68,10 +68,22 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
var unloadModel = self.World.ModelCache.GetModelSequence(rv.Image, info.UnloadSequence);
|
||||
rv.Add(new ModelAnimation(unloadModel, () => WVec.Zero,
|
||||
() => body.QuantizeOrientation(self.Orientation),
|
||||
() => !Docked,
|
||||
() => !docked,
|
||||
() => 0, info.ShowShadow));
|
||||
}
|
||||
|
||||
void IDockClientBody.PlayDockAnimation(Actor self, Action after)
|
||||
{
|
||||
docked = true;
|
||||
after();
|
||||
}
|
||||
|
||||
void IDockClientBody.PlayReverseDockAnimation(Actor self, Action after)
|
||||
{
|
||||
docked = false;
|
||||
after();
|
||||
}
|
||||
|
||||
Rectangle IAutoMouseBounds.AutoMouseoverBounds(Actor self, WorldRenderer wr)
|
||||
{
|
||||
return modelAnimation.ScreenBounds(self.CenterPosition, wr, rv.Info.Scale);
|
||||
|
||||
Reference in New Issue
Block a user