From 104ff288d66b3ed3676e44a8ff6b58a3b1a16f5b Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Wed, 1 Feb 2023 22:34:44 -0500 Subject: [PATCH] fixed stranger arcs and removed debug logs --- .../Props/NomaiText/NomaiTextArcBuilder.cs | 4 +- .../Props/NomaiText/NomaiTextBuilder.cs | 37 +++++++++++++++---- NewHorizons/Utility/NewHorizonBody.cs | 2 - 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/NewHorizons/Builder/Props/NomaiText/NomaiTextArcBuilder.cs b/NewHorizons/Builder/Props/NomaiText/NomaiTextArcBuilder.cs index b88cf7ab..039f97a7 100644 --- a/NewHorizons/Builder/Props/NomaiText/NomaiTextArcBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiText/NomaiTextArcBuilder.cs @@ -125,8 +125,8 @@ namespace NewHorizons.Builder.Props skeletonScale = new Vector2(1, 1), numSkeletonPoints = 17, - innerWidth = 1, - outerWidth = 1, + innerWidth = 0.75f, + outerWidth = 0.75f, uvScale = 1f/1.8505f, diff --git a/NewHorizons/Builder/Props/NomaiText/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiText/NomaiTextBuilder.cs index efa7aa7b..e3f80dca 100644 --- a/NewHorizons/Builder/Props/NomaiText/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiText/NomaiTextBuilder.cs @@ -646,11 +646,6 @@ namespace NewHorizons.Builder.Props if (nhBody.Cache?.ContainsKey(cacheKey) ?? false) cachedData = nhBody.Cache.Get(cacheKey); - Logger.LogWarning("CACHE DEBUG: cache key *" + cacheKey+"*"); - Logger.LogWarning("CACHE DEBUG: cache is null? " + (nhBody.Cache == null)); - Logger.LogWarning("CACHE DEBUG: cache contains key? " + (nhBody.Cache?.ContainsKey(cacheKey) ?? false)); - //Logger.LogWarning("CACHE DEBUG: cache keys: " + String.Join(",", nhBody.Cache?.Keys)); - var arranger = nomaiWallText.gameObject.AddComponent(); // Generate spiral meshes/GOs @@ -667,8 +662,6 @@ namespace NewHorizons.Builder.Props GameObject arcReadFromCache = null; if (cachedData != null) { - Logger.LogWarning("CACHE DEBUG: cache was not null, loading meshes and positions"); - var skeletonPoints = cachedData[i].skeletonPoints.Select(mv => (Vector3)mv).ToArray(); arcReadFromCache = NomaiTextArcBuilder.BuildSpiralGameObject(skeletonPoints, cachedData[i].mesh); arcReadFromCache.transform.parent = arranger.transform; @@ -688,7 +681,7 @@ namespace NewHorizons.Builder.Props // no need to arrange if the cache exists if (cachedData == null) { - Logger.LogWarning("CACHE DEBUG: cache was null, proceding with arrangment"); + Logger.LogVerbose("Cache and/or cache entry was null, proceding with wall text arc arrangment."); // auto placement @@ -779,6 +772,34 @@ namespace NewHorizons.Builder.Props arc.GetComponent().SetEntryID(textEntryID); arc.GetComponent().enabled = false; + if (type == PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger && _ghostArcMaterial != null) + { + // curse you jank!! + var meshFilter = arc.GetComponent(); + Vector3 rectangularRadius = meshFilter.sharedMesh.bounds.extents; + MVector3[] verts = new MVector3[] { + new Vector3(-rectangularRadius.x, 0, 0), + new Vector3( rectangularRadius.x, 0, 0), + new Vector3(-rectangularRadius.x, 2*rectangularRadius.y, 0), + new Vector3( rectangularRadius.x, 2*rectangularRadius.y, 0), + }; + int[] triangles = new int[] { + 0, 1, 2, + 1, 3, 2, + }; + MVector3[] normals = new MVector3[verts.Length]; + for (int i = 0; i().sharedMesh = new MMesh(verts, triangles, normals, uv, uv2); + } + arc.SetActive(true); if (arcInfo != null) arcInfoToCorrespondingSpawnedGameObject[arcInfo] = arc; diff --git a/NewHorizons/Utility/NewHorizonBody.cs b/NewHorizons/Utility/NewHorizonBody.cs index f96fe4b0..f3382ec7 100644 --- a/NewHorizons/Utility/NewHorizonBody.cs +++ b/NewHorizons/Utility/NewHorizonBody.cs @@ -13,8 +13,6 @@ namespace NewHorizons.Utility Mod = mod; RelativePath = relativePath; - Logger.LogWarning("CACHE DEBUG: NHBODY CONSTRUCTOR: " + config.name + " - *" + relativePath+"*"); - Migrate(); }