Merge branch 'dev' into eye-of-the-universe

This commit is contained in:
Noah Pilarski 2022-09-03 10:32:25 -04:00
commit 4640cda4fd
3 changed files with 22 additions and 4 deletions

View File

@ -143,7 +143,7 @@ namespace NewHorizons.Builder.Props
_preCrashRecorderPrefab.name = "Prefab_NOM_Recorder_Vessel"; _preCrashRecorderPrefab.name = "Prefab_NOM_Recorder_Vessel";
_preCrashRecorderPrefab.transform.rotation = Quaternion.identity; _preCrashRecorderPrefab.transform.rotation = Quaternion.identity;
_trailmarkerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/Prefab_NOM_Sign"); _trailmarkerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/Prefab_NOM_Sign").InstantiateInactive();
_trailmarkerPrefab.name = "Prefab_NOM_Trailmarker"; _trailmarkerPrefab.name = "Prefab_NOM_Trailmarker";
_trailmarkerPrefab.transform.rotation = Quaternion.identity; _trailmarkerPrefab.transform.rotation = Quaternion.identity;
} }
@ -537,6 +537,9 @@ namespace NewHorizons.Builder.Props
trailmarkerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero); trailmarkerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
// shrink because that is what mobius does on all trailmarkers or else they are the size of the player
trailmarkerObject.transform.localScale = Vector3.one * 0.75f;
if (info.rotation != null) if (info.rotation != null)
{ {
trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation)); trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));

View File

@ -230,5 +230,20 @@ namespace NewHorizons.Patches
AchievementHandler.OnRevealFact(); AchievementHandler.OnRevealFact();
} }
[HarmonyPrefix]
[HarmonyPatch(typeof(ShipLogFact), nameof(ShipLogFact.GetText))]
public static bool ShipLogFact_GetText(ShipLogFact __instance, ref string __result)
{
if (ShipLogHandler.IsModdedFact(__instance.GetID()))
{
__result = TranslationHandler.GetTranslation(__instance._text, TranslationHandler.TextType.SHIPLOG);
return false;
}
else
{
return true;
}
}
} }
} }

View File

@ -119,9 +119,9 @@ namespace NewHorizons.Utility
var name = names.Last(); var name = names.Last();
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}"); if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
// 3: find resource to include inactive objects // 3: find resource to include inactive objects (but skip prefabs
// also includes prefabs but hopefully thats okay go = Resources.FindObjectsOfTypeAll<GameObject>()
go = FindResourceOfTypeAndName<GameObject>(name); .FirstOrDefault(x => x.name == name && x.scene.name != null);
if (go) if (go)
{ {
CachedGameObjects.Add(path, go); CachedGameObjects.Add(path, go);