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:
kanym 2026-10-28 12:40:33 +01:00
commit f3d3c0ebb5
5 changed files with 222 additions and 3 deletions

View file

@ -218,6 +218,7 @@ namespace RacesOfValheim
}
prefab.transform.localScale = Vector3.one * TableScale;
Dress(prefab, family);
ServantTableBehaviour table = prefab.AddComponent<ServantTableBehaviour>();
table.m_switch = prefab.AddComponent<Switch>();
@ -255,6 +256,36 @@ namespace RacesOfValheim
}));
}
// The look, in the table's own space BEFORE TableScale, like the Dvergar bank's coin pile.
// TableTop is that pile's height: the same vanilla mesh, so the same surface.
private static readonly Color BoneSlateTint = new Color(0.72f, 0.74f, 0.78f, 1f);
private const float TableTop = 1.05f;
private static readonly Vector3 SkullSpot = new Vector3(1.6f, TableTop, -0.5f);
private static readonly Vector3 TradeSpot = new Vector3(-1.55f, TableTop, 0.3f);
/// <summary>
/// "A slab of bone and slate": the cartography table greyed down, a skeleton's skull on one end
/// and the trade's own tool on the other - an anvil for the smith, a mortar for the cook.
/// </summary>
private static void Dress(GameObject prefab, ButlerFamily family)
{
PieceLook.Tint(prefab.transform, BoneSlateTint);
ModelBorrow.Attach(prefab.transform, "TableSkull", "TrophySkeleton",
SkullSpot, Quaternion.Euler(0f, -120f, 0f), 0.3f, "Butler", activeOnly: true);
if (family == ButlerFamily.Forge)
{
ModelBorrow.Attach(prefab.transform, "TableAnvil", "forge_ext2",
TradeSpot, Quaternion.identity, 0.55f, "Butler", activeOnly: true);
}
else
{
ModelBorrow.Attach(prefab.transform, "TableMortar", "cauldron_ext5_mortarandpestle",
TradeSpot, Quaternion.identity, 0.6f, "Butler", activeOnly: true);
}
}
public static void EnsureKnown(Player player)
{
if (player == null) return;