feat: new looks for the Race Menu Ward, Contract Bank and Bone Servant tables
Recolour and kitbash from vanilla parts, no new assets. PieceLook copies materials before tinting so vanilla pieces keep their colours. ModelBorrow gains activeOnly, which drops hidden snow, fire and broken meshes before a borrowed piece is measured.
This commit is contained in:
parent
cb29f54a28
commit
f3d3c0ebb5
5 changed files with 222 additions and 3 deletions
|
|
@ -44,6 +44,8 @@ namespace RacesOfValheim
|
|||
|
||||
prefab.AddComponent<RaceMenuWardBehavior>();
|
||||
|
||||
Restyle(prefab);
|
||||
|
||||
PieceConfig config = new PieceConfig
|
||||
{
|
||||
Name = "$rov_piece_racemenuward_name",
|
||||
|
|
@ -60,6 +62,44 @@ namespace RacesOfValheim
|
|||
PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, config));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- the look
|
||||
/// <summary>Seidr blue in place of the Ward's hearth orange: every race builds this, so no race's colour.</summary>
|
||||
private static readonly Color Glow = new Color(0.55f, 0.62f, 1f, 1f);
|
||||
/// <summary>A colder stone, so it reads as a different thing from the vanilla Ward across a base.</summary>
|
||||
private static readonly Color StoneTint = new Color(0.78f, 0.82f, 0.92f, 1f);
|
||||
/// <summary>Narrower and taller than the Ward, on a plinth: a statue rather than a waystone.</summary>
|
||||
private static readonly Vector3 StatueShape = new Vector3(0.9f, 1.12f, 0.9f);
|
||||
private const float PlinthWidth = 1.3f;
|
||||
|
||||
/// <summary>
|
||||
/// Odin's stone on a plinth, glowing blue. The statue, its light and its sparks are lifted by the
|
||||
/// plinth's MEASURED height, so a different plinth model needs no new offset.
|
||||
/// </summary>
|
||||
private static void Restyle(GameObject prefab)
|
||||
{
|
||||
Transform statue = prefab.transform.Find("new");
|
||||
if (statue == null)
|
||||
{
|
||||
Jotunn.Logger.LogWarning("guard_stone has no 'new' model; the Race Menu Ward keeps the vanilla look.");
|
||||
return;
|
||||
}
|
||||
|
||||
PieceLook.Tint(statue, StoneTint);
|
||||
PieceLook.Rehue(prefab.transform, Glow);
|
||||
statue.localScale = Vector3.Scale(statue.localScale, StatueShape);
|
||||
|
||||
GameObject plinth = ModelBorrow.Attach(prefab.transform, "WardPlinth", "stone_floor_2x2",
|
||||
Vector3.zero, Quaternion.identity, PlinthWidth,
|
||||
"RaceMenuWard", activeOnly: true);
|
||||
float lift = ModelBorrow.HeightOf(plinth);
|
||||
|
||||
foreach (string child in new[] { "new", "WayEffect", "GuidePoint" })
|
||||
{
|
||||
Transform part = prefab.transform.Find(child);
|
||||
if (part != null) part.localPosition += Vector3.up * lift;
|
||||
}
|
||||
}
|
||||
|
||||
// Marks a world as already having its starter ward, so it is placed exactly once rather
|
||||
// than every time someone loads in.
|
||||
private const string PlacedKey = "RacesOfValheim_StarterWardPlaced";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue