TranslatorTextBuilder: dont do auto spiral if any property is specified

This commit is contained in:
JohnCorby 2023-03-22 22:13:49 -07:00
parent aa88285748
commit ad704d9bf6
2 changed files with 16 additions and 18 deletions

View File

@ -522,14 +522,12 @@ namespace NewHorizons.Builder.Props.TranslatorText
var arcInfo = info.arcInfo[j];
var arc = arranger.spirals[j];
if (arcInfo.position != null) arc.transform.localPosition = new Vector3(arcInfo.position.x, arcInfo.position.y, 0);
if (arcInfo.zRotation != null) arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation.Value);
if (arcInfo.mirror != null)
if (arcInfo.position != null || arcInfo.zRotation != null || arcInfo.mirror != null)
{
if (arcInfo.mirror.Value) arc.transform.localScale = new Vector3(-1, 1, 1);
else arc.transform.localScale = new Vector3(1, 1, 1);
var pos = (Vector2)(arcInfo.position ?? Vector2.zero);
arc.transform.localPosition = new Vector3(pos.x, pos.y, 0);
arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation.GetValueOrDefault());
arc.transform.localScale = arcInfo.mirror.GetValueOrDefault() ? new Vector3(-1, 1, 1) : new Vector3(1, 1, 1);
}
}

View File

@ -610,30 +610,30 @@ namespace NewHorizons.External.Modules
}
/// <summary>
/// Whether to flip the spiral from left-curling to right-curling or vice versa. If not specified, will use auto spiral generated value.
/// The type of text to display.
/// </summary>
public bool? mirror;
[DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult;
/// <summary>
/// The local position of this object on the wall. If not specified, will use auto spiral generated value.
/// The local position of this object on the wall. If specified, auto spiral will not touch this arc.
/// </summary>
public MVector2 position;
/// <summary>
/// The type of text to display.
/// The z euler angle for this arc. If specified, auto spiral will not touch this arc.
/// </summary>
[DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult;
[Range(0f, 360f)] public float? zRotation;
/// <summary>
/// Whether to flip the spiral from left-curling to right-curling or vice versa. If specified, auto spiral will not touch this arc.
/// </summary>
public bool? mirror;
/// <summary>
/// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module.
/// </summary>
[Obsolete("only used in old nomai text")]
[DefaultValue(-1)] public int variation = -1;
/// <summary>
/// The z euler angle for this arc. If not specified, will use auto spiral generated value.
/// </summary>
[Range(0f, 360f)] public float? zRotation;
}
[JsonObject]