Remove TiberianSunRefinery

Also add IDockClientBody interface,
move WithDockingOverlay cnc -> common,
remove HarvesterDockSequence implementing classes
This commit is contained in:
Gustas
2023-01-20 13:53:31 +02:00
committed by Matthias Mailänder
parent 3f0c3a8b9c
commit 049d0283f9
13 changed files with 159 additions and 186 deletions

View File

@@ -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);