mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix Stranger Text Misalignment #924
This commit is contained in:
parent
dd78f62f33
commit
3de8dabe12
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
@ -37,7 +38,6 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
)
|
||||
.ToArray();
|
||||
|
||||
|
||||
return BuildSpiralGameObject(_points, mesh, goName);
|
||||
}
|
||||
|
||||
@ -67,15 +67,52 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
public struct SpiralProfile {
|
||||
// all of the Vector2 params here refer to a range of valid values
|
||||
public string profileName;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public Vector2 a;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public Vector2 b;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public Vector2 startS;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public Vector2 endS;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public Vector2 skeletonScale;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public int numSkeletonPoints;
|
||||
|
||||
/// <summary>
|
||||
/// What is this
|
||||
/// </summary>
|
||||
public float uvScale;
|
||||
public float innerWidth; // width at the tip
|
||||
public float outerWidth; // width at the base
|
||||
|
||||
/// <summary>
|
||||
/// Width at tip
|
||||
/// </summary>
|
||||
public float innerWidth;
|
||||
|
||||
/// <summary>
|
||||
/// Width at base
|
||||
/// </summary>
|
||||
public float outerWidth;
|
||||
|
||||
public Material material;
|
||||
}
|
||||
|
||||
@ -119,8 +156,6 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
innerWidth = 0.75f,
|
||||
outerWidth = 0.75f,
|
||||
uvScale = 1f/1.8505f,
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -583,7 +583,12 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
case NomaiTextArcInfo.NomaiTextArcType.Stranger when _ghostArcMaterial != null:
|
||||
profile = NomaiTextArcBuilder.strangerSpiralProfile;
|
||||
mat = _ghostArcMaterial;
|
||||
overrideMesh = MeshUtilities.RectangleMeshFromCorners(new Vector3[]{ new Vector3(-0.9f, 0.0f, 0.0f), new Vector3(0.9f, 0.0f, 0.0f), new Vector3(-0.9f, 2.0f, 0.0f), new Vector3(0.9f, 2.0f, 0.0f) });
|
||||
overrideMesh = MeshUtilities.RectangleMeshFromCorners(new Vector3[]{
|
||||
new Vector3(-0.9f, 0.0f, 0.0f),
|
||||
new Vector3(0.9f, 0.0f, 0.0f),
|
||||
new Vector3(-0.9f, 2.0f, 0.0f),
|
||||
new Vector3(0.9f, 2.0f, 0.0f)
|
||||
});
|
||||
overrideColor = new Color(0.0158f, 1.0f, 0.5601f, 1f);
|
||||
break;
|
||||
case NomaiTextArcInfo.NomaiTextArcType.Adult:
|
||||
@ -603,6 +608,19 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
||||
else arc = NomaiTextArcArranger.CreateSpiral(profile, conversationZone).gameObject;
|
||||
}
|
||||
|
||||
// Hardcoded stranger point fix
|
||||
if (type == NomaiTextArcInfo.NomaiTextArcType.Stranger)
|
||||
{
|
||||
Delay.FireOnNextUpdate(() =>
|
||||
{
|
||||
var text = arc.GetComponent<NomaiTextLine>();
|
||||
for (int i = 0; i < text._points.Length; i++)
|
||||
{
|
||||
text._points[i] = new Vector3(0f, 2f * i / text._points.Length, 0f);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (mat != null) arc.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||
|
||||
arc.transform.parent = conversationZone.transform;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user