Add custom palette support to With*Overlay.
This commit is contained in:
@@ -23,6 +23,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithBuildingPlacedOverlay(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +49,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
rs.Add("crane_overlay_{0}".F(info.Sequence),
|
rs.Add("crane_overlay_{0}".F(info.Sequence),
|
||||||
new AnimationWithOffset(overlay,
|
new AnimationWithOffset(overlay,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !buildComplete));
|
() => !buildComplete),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingComplete(Actor self)
|
public void BuildingComplete(Actor self)
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Sequence name to use")]
|
[Desc("Sequence name to use")]
|
||||||
public readonly string Sequence = "crumble-overlay";
|
public readonly string Sequence = "crumble-overlay";
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init, this); }
|
public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +41,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
var overlay = new Animation(init.world, rs.GetImage(init.self));
|
var overlay = new Animation(init.world, rs.GetImage(init.self));
|
||||||
overlay.PlayThen(info.Sequence, () => buildComplete = false);
|
overlay.PlayThen(info.Sequence, () => buildComplete = false);
|
||||||
rs.Add("make_overlay_{0}".F(info.Sequence),
|
rs.Add("make_overlay_{0}".F(info.Sequence),
|
||||||
new AnimationWithOffset(overlay, null, () => !buildComplete));
|
new AnimationWithOffset(overlay, null, () => !buildComplete),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithDeliveryOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithDeliveryOverlay(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +53,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
rs.Add("delivery_overlay_{0}".F(info.Sequence),
|
rs.Add("delivery_overlay_{0}".F(info.Sequence),
|
||||||
new AnimationWithOffset(overlay,
|
new AnimationWithOffset(overlay,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !buildComplete));
|
() => !buildComplete),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayDeliveryOverlay()
|
void PlayDeliveryOverlay()
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithDockingOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithDockingOverlay(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +53,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
rs.Add("docking_overlay_{0}".F(info.Sequence),
|
rs.Add("docking_overlay_{0}".F(info.Sequence),
|
||||||
new AnimationWithOffset(overlay,
|
new AnimationWithOffset(overlay,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !buildComplete));
|
() => !buildComplete),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayDockingOverlay()
|
void PlayDockingOverlay()
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithProductionOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithProductionOverlay(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +58,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
rs.Add("production_overlay_{0}".F(info.Sequence),
|
rs.Add("production_overlay_{0}".F(info.Sequence),
|
||||||
new AnimationWithOffset(overlay,
|
new AnimationWithOffset(overlay,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !IsProducing || !buildComplete));
|
() => !IsProducing || !buildComplete),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(Actor self)
|
public void Tick(Actor self)
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
public readonly bool PauseOnLowPower = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithIdleOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithIdleOverlay(init.self, this); }
|
||||||
@@ -48,7 +54,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !buildComplete,
|
() => !buildComplete,
|
||||||
() => info.PauseOnLowPower && disabled.Any(d => d.Disabled),
|
() => info.PauseOnLowPower && disabled.Any(d => d.Disabled),
|
||||||
p => WithTurret.ZOffsetFromCenter(self, p, 1)));
|
p => WithTurret.ZOffsetFromCenter(self, p, 1)),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingComplete(Actor self)
|
public void BuildingComplete(Actor self)
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Custom palette name")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
public readonly bool PauseOnLowPower = false;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithRepairOverlay(init.self, this); }
|
public object Create(ActorInitializer init) { return new WithRepairOverlay(init.self, this); }
|
||||||
@@ -49,7 +55,8 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !buildComplete,
|
() => !buildComplete,
|
||||||
() => info.PauseOnLowPower && disabled.Any(d => d.Disabled),
|
() => info.PauseOnLowPower && disabled.Any(d => d.Disabled),
|
||||||
p => WithTurret.ZOffsetFromCenter(self, p, 1)));
|
p => WithTurret.ZOffsetFromCenter(self, p, 1)),
|
||||||
|
info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingComplete(Actor self)
|
public void BuildingComplete(Actor self)
|
||||||
|
|||||||
Reference in New Issue
Block a user