Small fixes (#344)

- forgor to instantiate inactive trailmarker
- Don't do funny entry name prepend for modded facts
This commit is contained in:
Nick 2022-09-03 10:27:44 -04:00 committed by GitHub
commit 3dc6baca4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -99,7 +99,7 @@ namespace NewHorizons.Builder.Props
_preCrashRecorderPrefab.name = "Prefab_NOM_Recorder_Vessel";
_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.transform.rotation = Quaternion.identity;
}
@ -492,6 +492,9 @@ namespace NewHorizons.Builder.Props
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)
{
trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));

View File

@ -230,5 +230,20 @@ namespace NewHorizons.Patches
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;
}
}
}
}