feat: Alfar chests get bodies of their own
Players mistook a plain Wood chest for the Eldividarkista, so neither Alfar chest looks like a buildable vanilla chest any more. Eldividarkista: the Mistlands dvergr crate stretched to 1.6 x 0.8 m, blackened iron with a bronze frame and an iron grate on the front. The grate glows and throws sparks only while the chest holds wood the drones may burn. Inngangskista: the dvergr town loot chest, navy steel with silver trim. A cyan line in the lid shines while it holds anything but the sigil. Both have new hammer icons, and their hover names say their role (input, fuel) in English, Italian and Russian. If a borrowed vanilla model is missing, the chest falls back to the old tinted wood chest. scripts/paint_*_chest.py repaint the textures and render previews and icons offline with scripts/render_obj.py.
This commit is contained in:
parent
16cacde532
commit
b661fa6516
15 changed files with 634 additions and 10 deletions
79
JotunnModStub/Alfar/AlfarChestGlow.cs
Normal file
79
JotunnModStub/Alfar/AlfarChestGlow.cs
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// The light on the two Alfar chests, which says whether the drones have work there: the fire
|
||||
/// chest's grate burns while it holds wood they may burn, the entry chest's inlay shines while it
|
||||
/// holds anything but the sigil. Every client asks its own copy of the inventory, which Container
|
||||
/// keeps in step with the ZDO, so nothing travels over the network for it.
|
||||
/// </summary>
|
||||
public class AlfarChestGlow : MonoBehaviour
|
||||
{
|
||||
public Renderer[] Glows;
|
||||
public ParticleSystem Embers;
|
||||
public Color GlowColor;
|
||||
public bool WoodOnly;
|
||||
|
||||
private Container m_container;
|
||||
private Material m_lit;
|
||||
private Material m_cold;
|
||||
private bool? m_shown;
|
||||
private float m_nextCheck;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_container = GetComponent<Container>();
|
||||
if (Glows == null || Glows.Length == 0 || Glows[0] == null) return;
|
||||
|
||||
m_cold = Glows[0].sharedMaterial;
|
||||
m_lit = new Material(m_cold) { name = m_cold.name + "_lit" };
|
||||
m_lit.color = Color.black;
|
||||
m_lit.EnableKeyword("_EMISSION");
|
||||
m_lit.SetColor("_EmissionColor", GlowColor);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Time.time < m_nextCheck) return;
|
||||
m_nextCheck = Time.time + 1f;
|
||||
|
||||
bool lit = HasWork();
|
||||
if (m_shown == lit) return;
|
||||
m_shown = lit;
|
||||
|
||||
if (m_lit != null)
|
||||
{
|
||||
foreach (Renderer glow in Glows)
|
||||
{
|
||||
if (glow != null) glow.sharedMaterial = lit ? m_lit : m_cold;
|
||||
}
|
||||
}
|
||||
if (Embers != null)
|
||||
{
|
||||
if (lit) Embers.Play(true);
|
||||
else Embers.Stop(true, ParticleSystemStopBehavior.StopEmitting);
|
||||
}
|
||||
}
|
||||
|
||||
private bool HasWork()
|
||||
{
|
||||
Inventory inventory = m_container != null ? m_container.GetInventory() : null;
|
||||
if (inventory == null) return false;
|
||||
|
||||
foreach (ItemDrop.ItemData item in inventory.GetAllItems())
|
||||
{
|
||||
if (item == null || item.m_dropPrefab == null) continue;
|
||||
|
||||
string name = item.m_dropPrefab.name;
|
||||
if (WoodOnly ? AlfarDroneAI.IsWood(name) : name != AlfarSigil.PrefabName) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (m_lit != null) Destroy(m_lit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -61,12 +61,15 @@ namespace RacesOfValheim
|
|||
public static void Register()
|
||||
{
|
||||
RegisterOne(EntryName, "$rov_piece_alfar_inngangskista_name", "$rov_piece_alfar_inngangskista_desc",
|
||||
new Color(0.62f, 0.80f, 1f, 1f));
|
||||
"$rov_hover_alfar_inngangskista", new Color(0.62f, 0.80f, 1f, 1f),
|
||||
AlfarInputChest.Build, "AlfarInputChest_icon.png");
|
||||
RegisterOne(WoodName, "$rov_piece_alfar_eldividarkista_name", "$rov_piece_alfar_eldividarkista_desc",
|
||||
new Color(0.85f, 0.62f, 0.36f, 1f));
|
||||
"$rov_hover_alfar_eldividarkista", new Color(0.85f, 0.62f, 0.36f, 1f),
|
||||
AlfarFireChest.Build, "AlfarFireChest_icon.png");
|
||||
}
|
||||
|
||||
private static void RegisterOne(string pieceName, string display, string description, Color tint)
|
||||
private static void RegisterOne(string pieceName, string display, string description, string hoverName, Color tint,
|
||||
System.Func<GameObject, bool> build, string iconResource)
|
||||
{
|
||||
GameObject source = PrefabManager.Cache.GetPrefab<GameObject>("piece_chest_wood");
|
||||
if (source == null)
|
||||
|
|
@ -91,15 +94,19 @@ namespace RacesOfValheim
|
|||
}
|
||||
requirements.Add(new RequirementConfig("GreydwarfEye", AlfarNexusConfig.ChestEyes.Value, 0, true));
|
||||
|
||||
// The hover and the chest window say what the chest is for, not only its name.
|
||||
Container container = prefab.GetComponent<Container>();
|
||||
if (container != null) container.m_name = display;
|
||||
if (container != null) container.m_name = hoverName;
|
||||
|
||||
Piece piece = prefab.GetComponent<Piece>();
|
||||
if (piece == null) { Jotunn.Logger.LogWarning("[Alfar] The chest has no Piece: " + pieceName); return; }
|
||||
piece.m_name = display;
|
||||
piece.m_description = description;
|
||||
|
||||
AlfarConstructs.Tint(prefab, tint);
|
||||
// Each chest has a body of its own; the tint stays as the fallback if it cannot be built.
|
||||
Sprite icon = piece.m_icon;
|
||||
if (!build(prefab)) AlfarConstructs.Tint(prefab, tint);
|
||||
else icon = IconFrom(iconResource) ?? icon;
|
||||
|
||||
PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, new PieceConfig
|
||||
{
|
||||
|
|
@ -107,7 +114,7 @@ namespace RacesOfValheim
|
|||
Description = description,
|
||||
PieceTable = PieceTables.Hammer,
|
||||
Category = PieceCategories.Crafting,
|
||||
Icon = piece.m_icon,
|
||||
Icon = icon,
|
||||
Requirements = requirements.ToArray(),
|
||||
}));
|
||||
|
||||
|
|
@ -130,5 +137,12 @@ namespace RacesOfValheim
|
|||
|
||||
AlfarPieces.Extra.Add(pieceName);
|
||||
}
|
||||
|
||||
private static Sprite IconFrom(string resource)
|
||||
{
|
||||
Texture2D texture = PieceLook.LoadTexture(resource);
|
||||
if (texture == null) return null;
|
||||
return Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1637,7 +1637,7 @@ namespace RacesOfValheim
|
|||
"Wood", "FineWood", "RoundLog", "ElderBark", "YggdrasilWood", "Blackwood",
|
||||
};
|
||||
|
||||
private static bool IsWood(string prefabName) => s_woodFamily.Contains(prefabName);
|
||||
internal static bool IsWood(string prefabName) => s_woodFamily.Contains(prefabName);
|
||||
|
||||
/// <summary>
|
||||
/// The first thing a station will take, and the chest it is in: raw material from the ENTRY chest
|
||||
|
|
|
|||
166
JotunnModStub/Alfar/AlfarFireChest.cs
Normal file
166
JotunnModStub/Alfar/AlfarFireChest.cs
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
using System.Collections.Generic;
|
||||
using Jotunn.Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// The Eldividarkista's own body. Players kept mistaking a plain "Wood chest" for it, so it must
|
||||
/// not look like any chest they can build: the box and lid are the Mistlands dvergr crate (a prop
|
||||
/// nobody can place), repainted as blackened iron with an aged-bronze frame
|
||||
/// (scripts/paint_fire_chest.py), with an iron grate on the front.
|
||||
///
|
||||
/// Behind the grate the fire shows only while the chest holds wood the drones may burn: a dark
|
||||
/// grate means empty. No light source, on purpose - a base full of chests must not glow.
|
||||
/// </summary>
|
||||
public static class AlfarFireChest
|
||||
{
|
||||
private const string CrateName = "dvergrprops_crate";
|
||||
private const string EmbersSource = "fx_Torch_Carried";
|
||||
|
||||
// The crate is a 1.02 m cube, stretched into a chest about the size of the vanilla one:
|
||||
// 1.6 m wide, 0.8 m deep. Its front face (+z, away from the lid's hinge) ends up here.
|
||||
private static readonly Vector3 Stretch = new Vector3(1.6f, 1f, 0.8f);
|
||||
private const float FrontZ = 0.515f * 0.8f;
|
||||
private const float LidY = 0.81f;
|
||||
private const float GrateWidth = 0.62f * 1.6f;
|
||||
private const int GrateGaps = 10;
|
||||
private const float GrateHeight = 0.36f;
|
||||
private const float GrateY = 0.42f;
|
||||
|
||||
private static readonly Color Ember = new Color(1f, 0.42f, 0.1f);
|
||||
|
||||
/// <summary>Swaps the cloned wood chest's meshes for the fire chest. False leaves the wood
|
||||
/// chest's look in place, with a warning, rather than an invisible chest.</summary>
|
||||
public static bool Build(GameObject prefab)
|
||||
{
|
||||
GameObject crate = PrefabManager.Cache.GetPrefab<GameObject>(CrateName);
|
||||
Transform crateNew = crate != null ? crate.transform.Find("new") : null;
|
||||
Transform visual = prefab.transform.Find("New");
|
||||
if (crateNew == null || crateNew.childCount < 3 || visual == null)
|
||||
{
|
||||
Jotunn.Logger.LogWarning("[Alfar] No dvergr crate to build the Eldividarkista from; it keeps the wood chest's look.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// The wood chest's box, lids and LOD group go; "New" itself stays, because WearNTear
|
||||
// switches it as the piece's healthy look.
|
||||
for (int i = visual.childCount - 1; i >= 0; i--) Object.DestroyImmediate(visual.GetChild(i).gameObject);
|
||||
LODGroup lod = visual.GetComponent<LODGroup>();
|
||||
if (lod != null) Object.DestroyImmediate(lod);
|
||||
|
||||
// The crate's high meshes, in the order the prefab keeps them: box, contents, lid. The
|
||||
// contents are the glowing dvergr cargo and stay behind.
|
||||
GameObject body = Object.Instantiate(crateNew.GetChild(0).gameObject, visual, false);
|
||||
body.name = "body";
|
||||
body.transform.localScale = Vector3.Scale(body.transform.localScale, Stretch);
|
||||
GameObject lidClosed = Object.Instantiate(crateNew.GetChild(2).gameObject, visual, false);
|
||||
lidClosed.name = "lid_closed";
|
||||
lidClosed.transform.localScale = Vector3.Scale(lidClosed.transform.localScale, Stretch);
|
||||
|
||||
// The open lid: the closed one turned up 100 degrees about its back edge.
|
||||
GameObject lidOpen = Object.Instantiate(lidClosed, visual, false);
|
||||
lidOpen.name = "lid_open";
|
||||
foreach (Collider collider in lidOpen.GetComponentsInChildren<Collider>(true)) Object.DestroyImmediate(collider);
|
||||
Vector3 hinge = new Vector3(0f, LidY, -FrontZ);
|
||||
Quaternion turn = Quaternion.Euler(-100f, 0f, 0f);
|
||||
lidOpen.transform.localPosition = hinge + turn * (lidClosed.transform.localPosition - hinge);
|
||||
lidOpen.transform.localRotation = turn * lidClosed.transform.localRotation;
|
||||
lidOpen.SetActive(false);
|
||||
|
||||
Container container = prefab.GetComponent<Container>();
|
||||
if (container != null)
|
||||
{
|
||||
container.m_open = lidOpen;
|
||||
container.m_closed = lidClosed;
|
||||
}
|
||||
|
||||
// Only a retextured material is a copy; without the paint, writing to it would change every
|
||||
// dvergr crate in the Mistlands too.
|
||||
Texture2D paint = PieceLook.LoadTexture("AlfarFireChest_d.png");
|
||||
if (paint != null) PieceLook.Retexture(visual, new Dictionary<string, Texture> { { "Crate_d", paint } });
|
||||
Material iron = paint != null ? body.GetComponent<MeshRenderer>()?.sharedMaterial : null;
|
||||
if (iron != null)
|
||||
{
|
||||
// The crate's normal map is wood planks; on plates it would draw seams that are not there.
|
||||
if (iron.HasProperty("_BumpMap")) iron.SetTexture("_BumpMap", null);
|
||||
if (iron.HasProperty("_Metallic")) iron.SetFloat("_Metallic", 0.6f);
|
||||
if (iron.HasProperty("_Glossiness")) iron.SetFloat("_Glossiness", 0.45f);
|
||||
}
|
||||
|
||||
Transform grate = BuildGrate(visual, iron, out Renderer glow);
|
||||
ParticleSystem embers = AddEmbers(grate);
|
||||
|
||||
AlfarChestGlow look = prefab.AddComponent<AlfarChestGlow>();
|
||||
look.Glows = new[] { glow };
|
||||
look.Embers = embers;
|
||||
look.GlowColor = Ember * 2f;
|
||||
look.WoodOnly = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>The grate: a glowing plate just off the front face, a frame and bars in front of it.</summary>
|
||||
private static Transform BuildGrate(Transform visual, Material iron, out Renderer glow)
|
||||
{
|
||||
Transform grate = new GameObject("grate").transform;
|
||||
grate.SetParent(visual, false);
|
||||
grate.gameObject.layer = visual.gameObject.layer;
|
||||
|
||||
Material bars = iron != null ? new Material(iron) { name = "AlfarFireChest_bars" } : null;
|
||||
if (bars != null)
|
||||
{
|
||||
bars.SetTexture("_MainTex", null);
|
||||
bars.color = new Color(0.16f, 0.15f, 0.15f);
|
||||
}
|
||||
|
||||
glow = Block(grate, "glow", new Vector3(0f, GrateY, FrontZ + 0.005f), new Vector3(GrateWidth, GrateHeight, 0.01f), bars).GetComponent<Renderer>();
|
||||
|
||||
const float frame = 0.035f;
|
||||
foreach (float x in new[] { -GrateWidth / 2f, GrateWidth / 2f })
|
||||
Block(grate, "frame", new Vector3(x, GrateY, FrontZ + 0.02f), new Vector3(frame, GrateHeight + frame, 0.04f), bars);
|
||||
foreach (float y in new[] { GrateY - GrateHeight / 2f, GrateY + GrateHeight / 2f })
|
||||
Block(grate, "frame", new Vector3(0f, y, FrontZ + 0.02f), new Vector3(GrateWidth + frame, frame, 0.04f), bars);
|
||||
|
||||
for (int i = 1; i < GrateGaps; i++)
|
||||
{
|
||||
float x = -GrateWidth / 2f + GrateWidth * i / GrateGaps;
|
||||
Block(grate, "bar", new Vector3(x, GrateY, FrontZ + 0.02f), new Vector3(0.022f, GrateHeight, 0.03f), bars);
|
||||
}
|
||||
Block(grate, "bar", new Vector3(0f, GrateY, FrontZ + 0.022f), new Vector3(GrateWidth, 0.022f, 0.03f), bars);
|
||||
|
||||
return grate;
|
||||
}
|
||||
|
||||
/// <summary>A plain box with no collider, for trim the borrowed meshes do not have.</summary>
|
||||
internal static GameObject Block(Transform parent, string name, Vector3 position, Vector3 size, Material material)
|
||||
{
|
||||
GameObject block = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
Object.DestroyImmediate(block.GetComponent<Collider>());
|
||||
block.name = name;
|
||||
block.layer = parent.gameObject.layer;
|
||||
block.transform.SetParent(parent, false);
|
||||
block.transform.localPosition = position;
|
||||
block.transform.localScale = size;
|
||||
if (material != null) block.GetComponent<Renderer>().sharedMaterial = material;
|
||||
return block;
|
||||
}
|
||||
|
||||
/// <summary>The carried torch's embers, rising off the top of the grate.</summary>
|
||||
private static ParticleSystem AddEmbers(Transform grate)
|
||||
{
|
||||
GameObject torch = PrefabManager.Cache.GetPrefab<GameObject>(EmbersSource);
|
||||
Transform source = torch != null ? torch.transform.Find("Embers") : null;
|
||||
if (source == null)
|
||||
{
|
||||
Jotunn.Logger.LogWarning("[Alfar] No torch embers for the Eldividarkista; its grate glows without sparks.");
|
||||
return null;
|
||||
}
|
||||
|
||||
GameObject embers = Object.Instantiate(source.gameObject, grate, false);
|
||||
embers.name = "embers";
|
||||
embers.transform.localPosition = new Vector3(0f, GrateY + GrateHeight / 2f, FrontZ + 0.05f);
|
||||
embers.transform.localRotation = Quaternion.identity;
|
||||
return embers.GetComponent<ParticleSystem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
137
JotunnModStub/Alfar/AlfarInputChest.cs
Normal file
137
JotunnModStub/Alfar/AlfarInputChest.cs
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
using System.Collections.Generic;
|
||||
using Jotunn.Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// The Inngangskista's own body, the cold twin of <see cref="AlfarFireChest"/>: the dvergr loot
|
||||
/// chest of the Mistlands towns (seen, never built), its panels repainted navy steel
|
||||
/// (scripts/paint_input_chest.py) and its copper trim turned silver. A cyan line set into the
|
||||
/// lid shines while the chest holds anything for the drones, and goes dark once they have
|
||||
/// emptied it.
|
||||
/// </summary>
|
||||
public static class AlfarInputChest
|
||||
{
|
||||
private const string SourceName = "TreasureChest_dvergrtown";
|
||||
|
||||
// The town chest is placed at 1.2 and its meshes at 1.5 on top: 1.66 m wide, a vanilla chest's size.
|
||||
private const float SourceScale = 1.2f;
|
||||
private const float MeshScale = 1.5f * SourceScale;
|
||||
private const float LidTop = 0.48f * MeshScale;
|
||||
private const float LidHalfX = 0.42f * MeshScale;
|
||||
private const float LidHalfZ = 0.24f * MeshScale;
|
||||
private const float InlayInset = 0.10f;
|
||||
private const float InlayWidth = 0.03f;
|
||||
|
||||
private static readonly Color Trim = new Color(0.9f, 0.95f, 1f);
|
||||
private static readonly Color Inlay = new Color(0.35f, 0.9f, 1f);
|
||||
|
||||
/// <summary>Swaps the cloned wood chest's meshes for the input chest. False leaves the wood
|
||||
/// chest's look in place, with a warning.</summary>
|
||||
public static bool Build(GameObject prefab)
|
||||
{
|
||||
GameObject source = PrefabManager.Cache.GetPrefab<GameObject>(SourceName);
|
||||
Transform sourceNew = source != null ? source.transform.Find("New") : null;
|
||||
Transform box = sourceNew != null ? sourceNew.Find("stonechest") : null;
|
||||
Transform closed = sourceNew != null ? sourceNew.Find("stonechesttop_closed") : null;
|
||||
Transform open = sourceNew != null ? sourceNew.Find("stonechesttop_open") : null;
|
||||
Transform visual = prefab.transform.Find("New");
|
||||
if (box == null || closed == null || open == null || visual == null)
|
||||
{
|
||||
Jotunn.Logger.LogWarning("[Alfar] No dvergr chest to build the Inngangskista from; it keeps the wood chest's look.");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = visual.childCount - 1; i >= 0; i--) Object.DestroyImmediate(visual.GetChild(i).gameObject);
|
||||
LODGroup lod = visual.GetComponent<LODGroup>();
|
||||
if (lod != null) Object.DestroyImmediate(lod);
|
||||
|
||||
GameObject body = Copy(box, visual, "body");
|
||||
GameObject lidClosed = Copy(closed, visual, "lid_closed");
|
||||
GameObject lidOpen = Copy(open, visual, "lid_open");
|
||||
lidOpen.SetActive(false);
|
||||
|
||||
Container container = prefab.GetComponent<Container>();
|
||||
if (container != null)
|
||||
{
|
||||
container.m_open = lidOpen;
|
||||
container.m_closed = lidClosed;
|
||||
}
|
||||
|
||||
Texture2D paint = PieceLook.LoadTexture("AlfarInputChest_d.png");
|
||||
if (paint == null) return true; // the dvergr chest as it is: still not a vanilla chest
|
||||
PieceLook.Retexture(visual, new Dictionary<string, Texture> { { "dvergrchestWorn_d", paint } });
|
||||
|
||||
// The trim shares the anvil's texture, so it is recoloured on a copy instead; the panels'
|
||||
// material is already a copy from Retexture.
|
||||
var copies = new Dictionary<Material, Material>();
|
||||
Material panel = null;
|
||||
foreach (Renderer renderer in visual.GetComponentsInChildren<Renderer>(true))
|
||||
{
|
||||
Material[] materials = renderer.sharedMaterials;
|
||||
for (int i = 0; i < materials.Length; i++)
|
||||
{
|
||||
Material material = materials[i];
|
||||
if (material == null) continue;
|
||||
if (material.name.EndsWith("_rov")) { panel = panel ?? material; continue; }
|
||||
if (!material.name.StartsWith("dvergr_metal_furnmiture")) continue;
|
||||
|
||||
if (!copies.TryGetValue(material, out Material trim))
|
||||
{
|
||||
trim = new Material(material) { name = material.name + "_rov" };
|
||||
trim.color = Trim;
|
||||
if (trim.HasProperty("_MetalColor")) trim.SetColor("_MetalColor", Trim);
|
||||
copies[material] = trim;
|
||||
}
|
||||
materials[i] = trim;
|
||||
}
|
||||
renderer.sharedMaterials = materials;
|
||||
}
|
||||
|
||||
AlfarChestGlow look = prefab.AddComponent<AlfarChestGlow>();
|
||||
look.Glows = BuildInlay(lidClosed.transform, panel);
|
||||
look.GlowColor = Inlay * 1.6f;
|
||||
look.WoodOnly = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>A copy of one of the town chest's parts, at the town chest's size and on the piece layer.</summary>
|
||||
private static GameObject Copy(Transform part, Transform parent, string name)
|
||||
{
|
||||
GameObject copy = Object.Instantiate(part.gameObject, parent, false);
|
||||
copy.name = name;
|
||||
copy.transform.localPosition = part.localPosition * SourceScale;
|
||||
copy.transform.localScale = part.localScale * SourceScale;
|
||||
foreach (Transform t in copy.GetComponentsInChildren<Transform>(true)) t.gameObject.layer = parent.gameObject.layer;
|
||||
return copy;
|
||||
}
|
||||
|
||||
/// <summary>The cyan line on the lid: four thin strips just above it, inset from the edge. They
|
||||
/// hang off the closed lid, so they go with it when the chest opens. The lid is scaled, so the
|
||||
/// sizes are divided back out of it.</summary>
|
||||
private static Renderer[] BuildInlay(Transform lid, Material panel)
|
||||
{
|
||||
Material cold = panel != null ? new Material(panel) { name = "AlfarInputChest_inlay" } : null;
|
||||
if (cold != null)
|
||||
{
|
||||
cold.SetTexture("_MainTex", null);
|
||||
cold.color = new Color(0.08f, 0.12f, 0.16f);
|
||||
}
|
||||
|
||||
float k = 1f / lid.localScale.x;
|
||||
float x = LidHalfX - InlayInset, z = LidHalfZ - InlayInset, y = LidTop + 0.004f;
|
||||
var strips = new List<Renderer>();
|
||||
foreach (float side in new[] { -z, z })
|
||||
strips.Add(Strip(lid, new Vector3(0f, y, side) * k, new Vector3(2f * x + InlayWidth, 0.01f, InlayWidth) * k, cold));
|
||||
foreach (float side in new[] { -x, x })
|
||||
strips.Add(Strip(lid, new Vector3(side, y, 0f) * k, new Vector3(InlayWidth, 0.01f, 2f * z) * k, cold));
|
||||
return strips.ToArray();
|
||||
}
|
||||
|
||||
private static Renderer Strip(Transform lid, Vector3 position, Vector3 size, Material material)
|
||||
{
|
||||
return AlfarFireChest.Block(lid, "inlay", position, size, material).GetComponent<Renderer>();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
JotunnModStub/Assets/AlfarFireChest/AlfarFireChest_d.png
Normal file
BIN
JotunnModStub/Assets/AlfarFireChest/AlfarFireChest_d.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
JotunnModStub/Assets/AlfarFireChest/AlfarFireChest_icon.png
Normal file
BIN
JotunnModStub/Assets/AlfarFireChest/AlfarFireChest_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
BIN
JotunnModStub/Assets/AlfarInputChest/AlfarInputChest_d.png
Normal file
BIN
JotunnModStub/Assets/AlfarInputChest/AlfarInputChest_d.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
JotunnModStub/Assets/AlfarInputChest/AlfarInputChest_icon.png
Normal file
BIN
JotunnModStub/Assets/AlfarInputChest/AlfarInputChest_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
|
|
@ -52,5 +52,7 @@
|
|||
"rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\n$1 progression - $2 ($3/$4)\n[<color=yellow><b>$KEY_Use</b></color>] Open\n[<color=yellow><b>Use item</b></color>] Offer a boss relic",
|
||||
"rov_hover_ward_world": "World",
|
||||
"rov_hover_boneship_roster": "\nmelee $1/$2 of $3\narchers $4/$5 of $6\naboard $7",
|
||||
"rov_hover_boneship_bone_hand": "\nbone in hand to buy a place"
|
||||
"rov_hover_boneship_bone_hand": "\nbone in hand to buy a place",
|
||||
"rov_hover_alfar_inngangskista": "Inngangskista (input)",
|
||||
"rov_hover_alfar_eldividarkista": "Eldividarkista (fuel)"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,5 +52,7 @@
|
|||
"rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\nProgressione $1 - $2 ($3/$4)\n[<color=yellow><b>$KEY_Use</b></color>] Apri\n[<color=yellow><b>Usa oggetto</b></color>] Offri una reliquia di boss",
|
||||
"rov_hover_ward_world": "del mondo",
|
||||
"rov_hover_boneship_roster": "\nmischia $1/$2 di $3\narcieri $4/$5 di $6\na bordo $7",
|
||||
"rov_hover_boneship_bone_hand": "\nosso in mano per comprare un posto"
|
||||
"rov_hover_boneship_bone_hand": "\nosso in mano per comprare un posto",
|
||||
"rov_hover_alfar_inngangskista": "Inngangskista (ingresso)",
|
||||
"rov_hover_alfar_eldividarkista": "Eldividarkista (combustibile)"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,5 +52,7 @@
|
|||
"rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\n$1 прогресс — $2 ($3/$4)\n[<color=yellow><b>$KEY_Use</b></color>] Открыть\n[<color=yellow><b>Использовать предмет</b></color>] Пожертвовать реликвию босса",
|
||||
"rov_hover_ward_world": "Общий",
|
||||
"rov_hover_boneship_roster": "\nближний бой $1/$2 из $3\nлучники $4/$5 из $6\nна борту $7",
|
||||
"rov_hover_boneship_bone_hand": "\nкость в руке — купить место"
|
||||
"rov_hover_boneship_bone_hand": "\nкость в руке — купить место",
|
||||
"rov_hover_alfar_inngangskista": "Инганг-киста (вход)",
|
||||
"rov_hover_alfar_eldividarkista": "Эльдивидар-киста (топливо)"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue