mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merged dev into hawkbar-dreamworld
This commit is contained in:
commit
8a3841730a
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 2245901288
|
||||
CRC: 2356174904
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: e765e5fc418c1ed69586a3826e0cdea3
|
||||
Hash: c9b4a60ca4efa0ba50065dea6e758ce7
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: 65942a71d50cdc9f2387a8fa9383a3f8
|
||||
|
||||
@ -22,7 +22,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
sfv._priority = 0;
|
||||
sfv._density = 1.2f;
|
||||
sfv._fluidType = FluidVolume.Type.AIR;
|
||||
sfv._allowShipAutoroll = true;
|
||||
sfv._allowShipAutoroll = config.Atmosphere.allowShipAutoroll;
|
||||
sfv._disableOnStart = false;
|
||||
|
||||
if (config.Atmosphere.hasShockLayer)
|
||||
|
||||
@ -147,7 +147,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
fluidCLFV._priority = 1;
|
||||
fluidCLFV._density = 1.2f;
|
||||
fluidCLFV._fluidType = atmo.clouds.fluidType.ConvertToOW(FluidVolume.Type.CLOUD);
|
||||
fluidCLFV._allowShipAutoroll = true;
|
||||
fluidCLFV._allowShipAutoroll = atmo.allowShipAutoroll;
|
||||
fluidCLFV._disableOnStart = false;
|
||||
|
||||
// Fix the rotations once the rest is done
|
||||
|
||||
@ -230,6 +230,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (config.fogTint != null)
|
||||
{
|
||||
var color = config.fogTint.ToColor();
|
||||
// Fog alpha has no impact: Must instead use fogDensity.
|
||||
color.a = 1f;
|
||||
fog.fogTint = color;
|
||||
outerFogWarpVolume._fogColor = color;
|
||||
|
||||
@ -96,6 +96,12 @@ namespace NewHorizons.Builder.Body
|
||||
// We want to take the largest size I think
|
||||
var realSize = body.Config.Base.surfaceSize;
|
||||
|
||||
if (realSize <= 0)
|
||||
{
|
||||
// #941 handle proxy body edge case when all scales = 0
|
||||
realSize = 1;
|
||||
}
|
||||
|
||||
if (body.Config.HeightMap != null)
|
||||
{
|
||||
HeightMapBuilder.Make(proxy, null, body.Config.HeightMap, body.Mod, 20);
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using UnityEngine;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using Color = UnityEngine.Color;
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using NewHorizons.Utility.OuterWilds;
|
||||
using NewHorizons.External.SerializableData;
|
||||
using NewHorizons.Builder.Volumes;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using NewHorizons.External.SerializableData;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OuterWilds;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Color = UnityEngine.Color;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -88,7 +87,7 @@ namespace NewHorizons.Builder.Body
|
||||
Vector3 localRotation = singularity?.rotation == null ? Vector3.zero : singularity.rotation;
|
||||
|
||||
GameObject newSingularity = MakeSingularity(go, sector, localPosition, localRotation, polarity, horizonRadius, distortRadius,
|
||||
hasHazardVolume, singularity.targetStarSystem, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride, singularity.rename, singularity.parentPath, singularity.isRelativeToParent);
|
||||
hasHazardVolume, singularity.targetStarSystem, singularity.spawnPointID, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride, singularity.rename, singularity.parentPath, singularity.isRelativeToParent);
|
||||
|
||||
var uniqueID = string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID;
|
||||
|
||||
@ -161,7 +160,7 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
|
||||
public static GameObject MakeSingularity(GameObject planetGO, Sector sector, Vector3 position, Vector3 rotation, bool polarity, float horizon, float distort,
|
||||
bool hasDestructionVolume, string targetStarSystem = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985, string rename = null, string parentPath = null, bool isRelativeToParent = false)
|
||||
bool hasDestructionVolume, string targetStarSystem = null, string targetSpawnID = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985, string rename = null, string parentPath = null, bool isRelativeToParent = false)
|
||||
{
|
||||
// polarity true = black, false = white
|
||||
|
||||
@ -233,6 +232,7 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
var wormholeVolume = destructionVolumeGO.AddComponent<BlackHoleWarpVolume>();
|
||||
wormholeVolume.TargetSolarSystem = targetStarSystem;
|
||||
wormholeVolume.TargetSpawnID = targetSpawnID;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -129,7 +129,7 @@ namespace NewHorizons.Builder.Body
|
||||
fluidVolume._density = module.density;
|
||||
fluidVolume._layer = 5;
|
||||
fluidVolume._priority = 3;
|
||||
fluidVolume._allowShipAutoroll = true;
|
||||
fluidVolume._allowShipAutoroll = module.allowShipAutoroll;
|
||||
fluidVolume._disableOnStart = false;
|
||||
|
||||
var fogGO = Object.Instantiate(_oceanFog, waterGO.transform);
|
||||
|
||||
@ -8,6 +8,8 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class AstroObjectBuilder
|
||||
{
|
||||
public static GameObject CenterOfUniverse { get; private set; }
|
||||
|
||||
public static NHAstroObject Make(GameObject body, AstroObject primaryBody, NewHorizonsBody nhBody, bool isVanilla)
|
||||
{
|
||||
NHAstroObject astroObject = body.AddComponent<NHAstroObject>();
|
||||
@ -17,7 +19,7 @@ namespace NewHorizons.Builder.General
|
||||
|
||||
astroObject.isVanilla = isVanilla;
|
||||
astroObject.HideDisplayName = !config.MapMarker.enabled;
|
||||
astroObject.invulnerableToSun = config.Base.invulnerableToSun;
|
||||
astroObject.invulnerableToSun = !config.Base.hasFluidDetector;
|
||||
|
||||
if (config.Orbit != null) astroObject.SetOrbitalParametersFromConfig(config.Orbit);
|
||||
|
||||
@ -62,6 +64,8 @@ namespace NewHorizons.Builder.General
|
||||
|
||||
if (config.Base.centerOfSolarSystem)
|
||||
{
|
||||
CenterOfUniverse = body;
|
||||
|
||||
NHLogger.Log($"Setting center of universe to {config.name}");
|
||||
|
||||
Delay.RunWhen(
|
||||
|
||||
@ -90,7 +90,7 @@ namespace NewHorizons.Builder.General
|
||||
OWRB.RegisterAttachedForceDetector(forceDetector);
|
||||
|
||||
// For falling into sun
|
||||
if (!config.Base.invulnerableToSun && config.Star == null && config.FocalPoint == null)
|
||||
if (config.Base.hasFluidDetector && config.Star == null && config.FocalPoint == null)
|
||||
{
|
||||
detectorGO.layer = Layer.AdvancedDetector;
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OuterWilds;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
@ -13,52 +14,92 @@ namespace NewHorizons.Builder.General
|
||||
public static class SpawnPointBuilder
|
||||
{
|
||||
private static bool suitUpQueued = false;
|
||||
|
||||
// Ship
|
||||
public static SpawnModule.ShipSpawnPoint ShipSpawnInfo { get; private set; }
|
||||
public static SpawnPoint ShipSpawn { get; private set; }
|
||||
public static Vector3 ShipSpawnOffset { get; private set; }
|
||||
|
||||
// Player
|
||||
public static SpawnModule.PlayerSpawnPoint PlayerSpawnInfo { get; private set; }
|
||||
public static SpawnPoint PlayerSpawn { get; private set; }
|
||||
|
||||
public static void OverridePlayerSpawn(SpawnPoint newSpawn)
|
||||
{
|
||||
PlayerSpawn = newSpawn;
|
||||
PlayerSpawnInfo = null;
|
||||
}
|
||||
|
||||
public static SpawnPoint Make(GameObject planetGO, SpawnModule module, OWRigidbody owRigidBody)
|
||||
{
|
||||
SpawnPoint playerSpawn = null;
|
||||
|
||||
// Make the spawn point even if it won't be used this loop
|
||||
if (module.playerSpawn != null)
|
||||
if (module.playerSpawnPoints != null)
|
||||
{
|
||||
GameObject spawnGO = GeneralPropBuilder.MakeNew("PlayerSpawnPoint", planetGO, null, module.playerSpawn);
|
||||
spawnGO.layer = Layer.PlayerSafetyCollider;
|
||||
foreach (var point in module.playerSpawnPoints)
|
||||
{
|
||||
GameObject spawnGO = GeneralPropBuilder.MakeNew("PlayerSpawnPoint", planetGO, null, point);
|
||||
spawnGO.layer = Layer.PlayerSafetyCollider;
|
||||
|
||||
playerSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||
playerSpawn._attachedBody = owRigidBody;
|
||||
playerSpawn._spawnLocation = SpawnLocation.None;
|
||||
// #601 we need to actually set the right trigger volumes here
|
||||
playerSpawn._triggerVolumes = new OWTriggerVolume[0];
|
||||
playerSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||
playerSpawn._attachedBody = owRigidBody;
|
||||
playerSpawn._spawnLocation = SpawnLocation.None;
|
||||
// #601 we need to actually set the right trigger volumes here
|
||||
playerSpawn._triggerVolumes = new OWTriggerVolume[0];
|
||||
|
||||
// This was a stupid hack to stop players getting stuck in the ground and now we have to keep it forever
|
||||
spawnGO.transform.position += spawnGO.transform.TransformDirection(module.playerSpawn.offset ?? Vector3.up * 4f);
|
||||
// This was a stupid hack to stop players getting stuck in the ground and now we have to keep it forever
|
||||
spawnGO.transform.position += spawnGO.transform.TransformDirection(point.offset ?? Vector3.up * 4f);
|
||||
|
||||
if (PlayerSpawn == null || point.GetPriority() > PlayerSpawnInfo.GetPriority())
|
||||
{
|
||||
PlayerSpawn = playerSpawn;
|
||||
PlayerSpawnInfo = point;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (module.shipSpawn != null)
|
||||
if (module.shipSpawnPoints != null)
|
||||
{
|
||||
var spawnGO = GeneralPropBuilder.MakeNew("ShipSpawnPoint", planetGO, null, module.shipSpawn);
|
||||
spawnGO.SetActive(false);
|
||||
spawnGO.layer = Layer.PlayerSafetyCollider;
|
||||
foreach (var point in module.shipSpawnPoints)
|
||||
{
|
||||
var spawnGO = GeneralPropBuilder.MakeNew("ShipSpawnPoint", planetGO, null, point);
|
||||
spawnGO.SetActive(false);
|
||||
spawnGO.layer = Layer.PlayerSafetyCollider;
|
||||
|
||||
ShipSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||
ShipSpawn._isShipSpawn = true;
|
||||
ShipSpawn._attachedBody = owRigidBody;
|
||||
ShipSpawn._spawnLocation = SpawnLocation.None;
|
||||
var shipSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||
shipSpawn._isShipSpawn = true;
|
||||
shipSpawn._attachedBody = owRigidBody;
|
||||
shipSpawn._spawnLocation = SpawnLocation.None;
|
||||
|
||||
// #601 we need to actually set the right trigger volumes here
|
||||
ShipSpawn._triggerVolumes = new OWTriggerVolume[0];
|
||||
// #601 we need to actually set the right trigger volumes here
|
||||
shipSpawn._triggerVolumes = new OWTriggerVolume[0];
|
||||
|
||||
ShipSpawnOffset = module.shipSpawn.offset ?? (module.shipSpawn.alignRadial.GetValueOrDefault() ? Vector3.up * 4 : Vector3.zero);
|
||||
var shipSpawnOffset = point.offset ?? (point.alignRadial.GetValueOrDefault() ? Vector3.up * 4 : Vector3.zero);
|
||||
|
||||
spawnGO.SetActive(true);
|
||||
if (ShipSpawn == null || point.GetPriority() > ShipSpawnInfo.GetPriority())
|
||||
{
|
||||
ShipSpawn = shipSpawn;
|
||||
ShipSpawnOffset = shipSpawnOffset;
|
||||
ShipSpawnInfo = point;
|
||||
}
|
||||
|
||||
spawnGO.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
if ((Main.Instance.IsWarpingFromVessel || (!Main.Instance.IsWarpingFromShip && (module.playerSpawn?.startWithSuit ?? false))) && !suitUpQueued)
|
||||
// Make sure to queue this up if any spawn point building is happening
|
||||
if (!suitUpQueued)
|
||||
{
|
||||
suitUpQueued = true;
|
||||
Delay.RunWhen(() => Main.IsSystemReady, SuitUp);
|
||||
Delay.RunWhen(() => Main.IsSystemReady, () =>
|
||||
{
|
||||
suitUpQueued = false;
|
||||
if (Main.Instance.IsWarpingFromVessel || (!Main.Instance.IsWarpingFromShip && (PlayerSpawnInfo?.startWithSuit ?? false)))
|
||||
{
|
||||
SuitUp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
NHLogger.Log($"Made spawnpoint on [{planetGO.name}]");
|
||||
@ -68,7 +109,6 @@ namespace NewHorizons.Builder.General
|
||||
|
||||
public static void SuitUp()
|
||||
{
|
||||
suitUpQueued = false;
|
||||
if (!Locator.GetPlayerController()._isWearingSuit)
|
||||
{
|
||||
Locator.GetPlayerSuit().SuitUp(false, true, true);
|
||||
@ -87,8 +127,22 @@ namespace NewHorizons.Builder.General
|
||||
handler.Method.Invoke(handler.Target, new object[] { command });
|
||||
}
|
||||
spv._interactVolume._listInteractions.First(x => x.promptText == UITextType.SuitUpPrompt).interactionEnabled = true;
|
||||
|
||||
// Fix Disappearing Signalscope UI #934 after warping to new system wearing suit
|
||||
Delay.StartCoroutine(SignalScopeZoomCoroutine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerator SignalScopeZoomCoroutine()
|
||||
{
|
||||
while (!Locator.GetToolModeSwapper().GetSignalScope().InZoomMode())
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
yield return null;
|
||||
Locator.GetToolModeSwapper().GetSignalScope().ExitSignalscopeZoom();
|
||||
Locator.GetToolModeSwapper().GetSignalScope().EnterSignalscopeZoom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.Components.Props;
|
||||
using NewHorizons.External.Modules.Props;
|
||||
using NewHorizons.Handlers;
|
||||
@ -67,6 +68,8 @@ namespace NewHorizons.Builder.Props
|
||||
/// </summary>
|
||||
public static GameObject Make(GameObject planetGO, Sector sector, IModBehaviour mod, DetailInfo info)
|
||||
{
|
||||
if (sector == null) info.keepLoaded = true;
|
||||
|
||||
if (info.assetBundle != null)
|
||||
{
|
||||
// Shouldn't happen
|
||||
@ -98,6 +101,8 @@ namespace NewHorizons.Builder.Props
|
||||
{
|
||||
if (prefab == null) return null;
|
||||
|
||||
if (sector == null) detail.keepLoaded = true;
|
||||
|
||||
GameObject prop;
|
||||
bool isItem;
|
||||
bool invalidComponentFound = false;
|
||||
@ -370,6 +375,12 @@ namespace NewHorizons.Builder.Props
|
||||
// Fix anglerfish speed on orbiting planets
|
||||
else if (component is AnglerfishController angler)
|
||||
{
|
||||
if (planetGO?.GetComponent<NHAstroObject>() is NHAstroObject nhao && !nhao.invulnerableToSun)
|
||||
{
|
||||
// Has a fluid detector, will go gorp (#830)
|
||||
NHLogger.LogWarning("Having an anglerfish on a planet that has a fluid detector can lead to things breaking!");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
angler._chaseSpeed += OWPhysics.CalculateOrbitVelocity(planetGO.GetAttachedOWRigidbody(), planetGO.GetComponent<AstroObject>().GetPrimaryBody().GetAttachedOWRigidbody()).magnitude;
|
||||
|
||||
@ -9,6 +9,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
@ -35,7 +36,7 @@ namespace NewHorizons.Builder.Props
|
||||
}
|
||||
else
|
||||
{
|
||||
return (AddToExistingDialogue(go, info, xml, dialogueName), null);
|
||||
return (AddToExistingDialogue(go, sector, info, xml, dialogueName), null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +53,8 @@ namespace NewHorizons.Builder.Props
|
||||
}
|
||||
|
||||
var dialogue = MakeConversationZone(go, sector, info, xml, dialogueName);
|
||||
|
||||
MakeAttentionPoints(go, sector, dialogue, info);
|
||||
|
||||
RemoteDialogueTrigger remoteTrigger = null;
|
||||
if (info.remoteTrigger != null)
|
||||
@ -70,7 +73,7 @@ namespace NewHorizons.Builder.Props
|
||||
return (dialogue, remoteTrigger);
|
||||
}
|
||||
|
||||
private static CharacterDialogueTree AddToExistingDialogue(GameObject go, DialogueInfo info, string xml, string dialogueName)
|
||||
private static CharacterDialogueTree AddToExistingDialogue(GameObject go, Sector sector, DialogueInfo info, string xml, string dialogueName)
|
||||
{
|
||||
var dialogueObject = go.FindChild(info.pathToExistingDialogue);
|
||||
if (dialogueObject == null) dialogueObject = SearchUtilities.Find(info.pathToExistingDialogue);
|
||||
@ -163,6 +166,8 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
FixDialogueNextFrame(existingDialogue);
|
||||
|
||||
MakeAttentionPoints(go, sector, existingDialogue, info);
|
||||
|
||||
return existingDialogue;
|
||||
}
|
||||
|
||||
@ -332,6 +337,32 @@ namespace NewHorizons.Builder.Props
|
||||
return dialogueTree;
|
||||
}
|
||||
|
||||
private static void MakeAttentionPoints(GameObject go, Sector sector, CharacterDialogueTree dialogue, DialogueInfo info)
|
||||
{
|
||||
if (info.attentionPoint != null)
|
||||
{
|
||||
var ptGo = GeneralPropBuilder.MakeNew("AttentionPoint", go, sector, info.attentionPoint, defaultParent: dialogue.transform);
|
||||
dialogue._attentionPoint = ptGo.transform;
|
||||
dialogue._attentionPointOffset = info.attentionPoint.offset;
|
||||
ptGo.SetActive(true);
|
||||
}
|
||||
if (info.swappedAttentionPoints != null && info.swappedAttentionPoints.Length > 0)
|
||||
{
|
||||
foreach (var pointInfo in info.swappedAttentionPoints)
|
||||
{
|
||||
var ptGo = GeneralPropBuilder.MakeNew($"AttentionPoint_{pointInfo.dialogueNode}_{pointInfo.dialoguePage}", go, sector, pointInfo, defaultParent: dialogue.transform);
|
||||
var swapper = ptGo.AddComponent<DialogueAttentionPointSwapper>();
|
||||
swapper._dialogueTree = dialogue;
|
||||
swapper._attentionPoint = ptGo.transform;
|
||||
swapper._attentionPointOffset = pointInfo.offset;
|
||||
swapper._nodeName = pointInfo.dialogueNode;
|
||||
swapper._dialoguePage = pointInfo.dialoguePage;
|
||||
swapper._lookEasing = pointInfo.lookEasing;
|
||||
ptGo.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void MakePlayerTrackingZone(GameObject go, CharacterDialogueTree dialogue, DialogueInfo info)
|
||||
{
|
||||
var character = go.transform.Find(info.pathToAnimController);
|
||||
|
||||
@ -18,8 +18,9 @@ namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public static class ProjectionBuilder
|
||||
{
|
||||
public const string INVERTED_SLIDE_CACHE_FOLDER = "SlideReelCache/Inverted";
|
||||
public const string ATLAS_SLIDE_CACHE_FOLDER = "SlideReelCache/Atlas";
|
||||
public static string CurrentSlideReelFolder => "SlideReelCache_" + Main.Instance.CurrentStarSystem;
|
||||
public static string InvertedSlideReelCacheFolder => CurrentSlideReelFolder + "/Inverted";
|
||||
public static string AtlasSlideReelCacheFolder => CurrentSlideReelFolder + "/Atlas";
|
||||
|
||||
public static GameObject SlideReelWholePrefab { get; private set; }
|
||||
public static GameObject SlideReelWholePristinePrefab { get; private set; }
|
||||
@ -45,7 +46,7 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
private static bool _isInit;
|
||||
|
||||
public static bool CacheExists(IModBehaviour mod) => Directory.Exists(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ATLAS_SLIDE_CACHE_FOLDER));
|
||||
public static bool CacheExists(IModBehaviour mod) => Directory.Exists(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, AtlasSlideReelCacheFolder));
|
||||
|
||||
internal static void InitPrefabs()
|
||||
{
|
||||
@ -521,7 +522,7 @@ namespace NewHorizons.Builder.Props
|
||||
{
|
||||
NHLogger.LogVerbose($"The atlas cache for slide reel containing [{slides.FirstOrDefault(x => !string.IsNullOrEmpty(x.imagePath))?.imagePath}] is {atlasKey}");
|
||||
// Load the atlas texture used to draw onto the physical slide reel object
|
||||
atlasImageLoader.PathsToLoad.Add((0, Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ATLAS_SLIDE_CACHE_FOLDER, $"{atlasKey}.png")));
|
||||
atlasImageLoader.PathsToLoad.Add((0, Path.Combine(mod.ModHelper.Manifest.ModFolderPath, AtlasSlideReelCacheFolder, $"{atlasKey}.png")));
|
||||
}
|
||||
|
||||
for (int i = 0; i < slides.Length; i++)
|
||||
@ -548,7 +549,7 @@ namespace NewHorizons.Builder.Props
|
||||
if (useInvertedCache && cacheExists)
|
||||
{
|
||||
// Load the inverted images used when displaying slide reels to a screen
|
||||
invertedImageLoader.PathsToLoad.Add((i, Path.Combine(mod.ModHelper.Manifest.ModFolderPath, INVERTED_SLIDE_CACHE_FOLDER, slideInfo.imagePath)));
|
||||
invertedImageLoader.PathsToLoad.Add((i, Path.Combine(mod.ModHelper.Manifest.ModFolderPath, InvertedSlideReelCacheFolder, slideInfo.imagePath)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -37,6 +37,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
if (shipLogAstroObject._id == "POWER_STATION")
|
||||
{
|
||||
astroObject = GameObject.FindObjectsOfType<AstroObject>().FirstOrDefault(x => x._customName == "Power Station");
|
||||
if (astroObject == null) continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -11,6 +11,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var volume = VolumeBuilder.Make<WarpVolume>(planetGO, sector, info);
|
||||
|
||||
volume.TargetSolarSystem = info.targetStarSystem;
|
||||
volume.TargetSpawnID = info.spawnPointID;
|
||||
|
||||
return volume;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ namespace NewHorizons.Components.ShipLog
|
||||
if (_cardTemplate == null)
|
||||
{
|
||||
var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot");
|
||||
_cardTemplate = Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject);
|
||||
_cardTemplate = Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>(true).gameObject);
|
||||
_cardTemplate.SetActive(false);
|
||||
}
|
||||
|
||||
@ -209,6 +209,12 @@ namespace NewHorizons.Components.ShipLog
|
||||
|
||||
private void UpdateMapCamera()
|
||||
{
|
||||
if (_starSystemCards.Count == 0)
|
||||
{
|
||||
NHLogger.LogWarning("Showing star chart mode when there are no available systems");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 b = -_starSystemCards[_cardIndex].transform.localPosition;
|
||||
float num = Mathf.InverseLerp(_startPanTime, _startPanTime + _panDuration, Time.unscaledTime);
|
||||
num = 1f - (num - 1f) * (num - 1f);
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
using NewHorizons.Handlers;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
public class BlackHoleWarpVolume : BlackHoleDestructionVolume
|
||||
{
|
||||
public string TargetSolarSystem { get; set; }
|
||||
public string TargetSpawnID { get; set; }
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
@ -19,6 +22,7 @@ namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
Locator.GetPlayerAudioController().PlayOneShotInternal(AudioType.BH_BlackHoleEmission);
|
||||
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
||||
PlayerSpawnHandler.TargetSpawnID = TargetSpawnID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Handlers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
@ -5,6 +6,7 @@ namespace NewHorizons.Components.Volumes
|
||||
internal class WarpVolume : BaseVolume
|
||||
{
|
||||
public string TargetSolarSystem;
|
||||
public string TargetSpawnID;
|
||||
|
||||
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
||||
{
|
||||
@ -13,6 +15,7 @@ namespace NewHorizons.Components.Volumes
|
||||
if (Main.Instance.CurrentStarSystem != TargetSolarSystem) // Otherwise it really breaks idk why
|
||||
{
|
||||
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
||||
PlayerSpawnHandler.TargetSpawnID = TargetSpawnID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
NewHorizons/External/Configs/AddonConfig.cs
vendored
1
NewHorizons/External/Configs/AddonConfig.cs
vendored
@ -41,6 +41,7 @@ namespace NewHorizons.External.Configs
|
||||
/// <summary>
|
||||
/// The path to the addons subtitle for the main menu.
|
||||
/// Defaults to "subtitle.png".
|
||||
/// The dimensions of the Echoes of the Eye subtitle is 669 x 67, so aim for that size
|
||||
/// </summary>
|
||||
public string subtitlePath = "subtitle.png";
|
||||
}
|
||||
|
||||
28
NewHorizons/External/Configs/PlanetConfig.cs
vendored
28
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -11,9 +11,7 @@ using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.External.Configs
|
||||
{
|
||||
@ -25,9 +23,8 @@ namespace NewHorizons.External.Configs
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Unique name of your planet
|
||||
/// Unique name of your planet. If not specified, the file name (without the extension) is used.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
@ -286,7 +283,7 @@ namespace NewHorizons.External.Configs
|
||||
}
|
||||
|
||||
// Stars and focal points shouldnt be destroyed by stars
|
||||
if (Star != null || FocalPoint != null) Base.invulnerableToSun = true;
|
||||
if (Star != null || FocalPoint != null) Base.hasFluidDetector = false;
|
||||
|
||||
// Disable map marker for dream dimensions
|
||||
if (Dream != null && Dream.inDreamWorld) MapMarker.enabled = false;
|
||||
@ -551,6 +548,22 @@ namespace NewHorizons.External.Configs
|
||||
};
|
||||
}
|
||||
|
||||
// Spawn points are now a list
|
||||
if (Spawn != null && Spawn.playerSpawn != null && Spawn.playerSpawnPoints == null)
|
||||
{
|
||||
Spawn.playerSpawnPoints = new SpawnModule.PlayerSpawnPoint[] { Spawn.playerSpawn };
|
||||
}
|
||||
if (Spawn != null && Spawn.shipSpawn != null && Spawn.shipSpawnPoints == null)
|
||||
{
|
||||
Spawn.shipSpawnPoints = new SpawnModule.ShipSpawnPoint[] { Spawn.shipSpawn };
|
||||
}
|
||||
|
||||
// Because these guys put TWO spawn points
|
||||
if (starSystem == "2walker2.OogaBooga" && name == "The Campground")
|
||||
{
|
||||
Spawn.playerSpawnPoints[0].isDefault = true;
|
||||
}
|
||||
|
||||
// Remote dialogue trigger reorganized to use GeneralPointPropInfo
|
||||
if (Props?.dialogue != null)
|
||||
{
|
||||
@ -672,6 +685,11 @@ namespace NewHorizons.External.Configs
|
||||
if (destructionVolume.onlyAffectsPlayerAndShip) destructionVolume.onlyAffectsPlayerRelatedBodies = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Base.invulnerableToSun)
|
||||
{
|
||||
Base.hasFluidDetector = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
37
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
37
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
@ -2,6 +2,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.External.SerializableData;
|
||||
using Newtonsoft.Json;
|
||||
@ -15,6 +16,11 @@ namespace NewHorizons.External.Configs
|
||||
[JsonObject]
|
||||
public class StarSystemConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique name of your system. If not specified, the file name (without the extension) is used.
|
||||
/// </summary>
|
||||
public string name;
|
||||
|
||||
/// <summary>
|
||||
/// In this system should the player be able to rotate their map camera freely or be stuck above the plane of the solar system?
|
||||
/// </summary>
|
||||
@ -31,10 +37,29 @@ namespace NewHorizons.External.Configs
|
||||
public float farClipPlaneOverride;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this system can be warped to via the warp drive. If you set factRequiredForWarp, this will be true.
|
||||
/// Whether this system can be warped to via the warp drive. If you set `factRequiredForWarp`, this will be true.
|
||||
/// Does NOT effect the base SolarSystem. For that, see `canExitViaWarpDrive` and `factRequiredToExitViaWarpDrive`
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool canEnterViaWarpDrive = true;
|
||||
|
||||
/// <summary>
|
||||
/// The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if
|
||||
/// you're using this, because it will be overwritten.
|
||||
/// </summary>
|
||||
public string factRequiredForWarp;
|
||||
|
||||
/// <summary>
|
||||
/// Can you use the warp drive to leave this system? If you set `factRequiredToExitViaWarpDrive`
|
||||
/// this will be true.
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool canExitViaWarpDrive = true;
|
||||
|
||||
/// <summary>
|
||||
/// The FactID that must be revealed for you to warp back to the main solar system from here. Don't set `canWarpHome`
|
||||
/// to `false` if you're using this, because it will be overwritten.
|
||||
/// </summary>
|
||||
public string factRequiredToExitViaWarpDrive;
|
||||
|
||||
/// <summary>
|
||||
/// Do you want a clean slate for this star system? Or will it be a modified version of the original.
|
||||
/// </summary>
|
||||
@ -45,12 +70,6 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool enableTimeLoop = true;
|
||||
|
||||
/// <summary>
|
||||
/// The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if
|
||||
/// you're using this, because it will be overwritten.
|
||||
/// </summary>
|
||||
public string factRequiredForWarp;
|
||||
|
||||
/// <summary>
|
||||
/// The duration of the time loop in minutes. This is the time the sun explodes. End Times plays 85 seconds before this time, and your memories get sent back about 40 seconds after this time.
|
||||
/// </summary>
|
||||
@ -414,6 +433,10 @@ namespace NewHorizons.External.Configs
|
||||
Vessel.warpExit.attachToVessel = true;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(factRequiredToExitViaWarpDrive))
|
||||
{
|
||||
canExitViaWarpDrive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -107,6 +107,12 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
[DefaultValue(300f)] public float maxShockSpeed = 300f;
|
||||
|
||||
/// <summary>
|
||||
/// Will the ship automatically try to orient itself to face upwards while in this volume?
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool allowShipAutoroll = true;
|
||||
|
||||
[JsonObject]
|
||||
public class CloudInfo
|
||||
{
|
||||
|
||||
11
NewHorizons/External/Modules/BaseModule.cs
vendored
11
NewHorizons/External/Modules/BaseModule.cs
vendored
@ -37,9 +37,11 @@ namespace NewHorizons.External.Modules
|
||||
public float groundSize;
|
||||
|
||||
/// <summary>
|
||||
/// Can this planet survive entering a star?
|
||||
/// Is this planet able to detect fluid volumes? Disabling this means that entering a star or lava volume will not destroy this planet
|
||||
/// May have adverse effects if anglerfish are added to this planet, disable this if you want those to work (they have fluid volumes in their mouths)
|
||||
/// </summary>
|
||||
public bool invulnerableToSun;
|
||||
[DefaultValue(true)]
|
||||
public bool hasFluidDetector = true;
|
||||
|
||||
/// <summary>
|
||||
/// Do we show the minimap when walking around this planet?
|
||||
@ -58,6 +60,8 @@ namespace NewHorizons.External.Modules
|
||||
|
||||
/// <summary>
|
||||
/// A scale height used for a number of things. Should be the approximate radius of the body.
|
||||
///
|
||||
/// Affected settings include: Base sector size, proxy body scaling, surface gravity
|
||||
/// </summary>
|
||||
public float surfaceSize;
|
||||
|
||||
@ -82,6 +86,9 @@ namespace NewHorizons.External.Modules
|
||||
|
||||
#region Obsolete
|
||||
|
||||
[Obsolete("invulnerableToSun is deprecated, please use hasFluidDetector instead")]
|
||||
public bool invulnerableToSun;
|
||||
|
||||
[Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")]
|
||||
public bool isSatellite;
|
||||
|
||||
|
||||
@ -41,11 +41,12 @@ namespace NewHorizons.External.Modules
|
||||
/// <summary>
|
||||
/// The color of the fog inside this dimension.
|
||||
/// Leave blank for the default grayish color: (84, 83, 73)
|
||||
/// The alpha value has no effect of the fog: Use fogDensity instead!
|
||||
/// </summary>
|
||||
public MColor fogTint;
|
||||
|
||||
/// <summary>
|
||||
/// The density of the fog inside this dimension. The default is 6.
|
||||
/// The density of the fog inside this dimension. The default is 6. If you want no fog, set this to 0.
|
||||
/// </summary>
|
||||
[DefaultValue(6f)] public float fogDensity = 6f;
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ namespace NewHorizons.External.Modules.Props
|
||||
/// <summary>
|
||||
/// Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?
|
||||
/// Also makes this detail visible on the map.
|
||||
/// Keeping many props loaded is bad for performance so use this only when it's actually relevant
|
||||
/// Most logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided.
|
||||
/// </summary>
|
||||
public bool keepLoaded;
|
||||
|
||||
32
NewHorizons/External/Modules/Props/Dialogue/AttentionPointInfo.cs
vendored
Normal file
32
NewHorizons/External/Modules/Props/Dialogue/AttentionPointInfo.cs
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
using NewHorizons.External.SerializableData;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace NewHorizons.External.Modules.Props.Dialogue
|
||||
{
|
||||
[JsonObject]
|
||||
public class AttentionPointInfo : GeneralPointPropInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// An additional offset to apply to apply when the camera looks at this attention point.
|
||||
/// </summary>
|
||||
public MVector3 offset;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SwappedAttentionPointInfo : AttentionPointInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the dialogue node to activate this attention point for. If null or blank, activates for every node.
|
||||
/// </summary>
|
||||
public string dialogueNode;
|
||||
/// <summary>
|
||||
/// The index of the page in the current dialogue node to activate this attention point for, if the node has multiple pages.
|
||||
/// </summary>
|
||||
public int dialoguePage;
|
||||
/// <summary>
|
||||
/// The easing factor which determines how 'snappy' the camera is when looking at the attention point.
|
||||
/// </summary>
|
||||
[DefaultValue(1)] public float lookEasing = 1f;
|
||||
}
|
||||
}
|
||||
@ -47,6 +47,16 @@ namespace NewHorizons.External.Modules.Props.Dialogue
|
||||
/// </summary>
|
||||
[DefaultValue(2f)] public float range = 2f;
|
||||
|
||||
/// <summary>
|
||||
/// The point that the camera looks at when dialogue advances.
|
||||
/// </summary>
|
||||
public AttentionPointInfo attentionPoint;
|
||||
|
||||
/// <summary>
|
||||
/// Additional points that the camera looks at when dialogue advances through specific dialogue nodes and pages.
|
||||
/// </summary>
|
||||
public SwappedAttentionPointInfo[] swappedAttentionPoints;
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to trigger dialogue from a distance when you walk into an area.
|
||||
/// </summary>
|
||||
|
||||
68
NewHorizons/External/Modules/SpawnModule.cs
vendored
68
NewHorizons/External/Modules/SpawnModule.cs
vendored
@ -1,4 +1,6 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.External.SerializableData;
|
||||
using NewHorizons.Handlers;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
@ -9,12 +11,20 @@ namespace NewHorizons.External.Modules
|
||||
{
|
||||
/// <summary>
|
||||
/// If you want the player to spawn on the new body, set a value for this.
|
||||
/// Different spawns can be unlocked with persistent conditions and facts
|
||||
/// </summary>
|
||||
public PlayerSpawnPoint playerSpawn;
|
||||
public PlayerSpawnPoint[] playerSpawnPoints;
|
||||
|
||||
/// <summary>
|
||||
/// Required for the system to be accessible by warp drive.
|
||||
/// Different spawns can be unlocked with persistent conditions and facts
|
||||
/// </summary>
|
||||
public ShipSpawnPoint[] shipSpawnPoints;
|
||||
|
||||
[Obsolete("Use playerSpawnPoints instead")]
|
||||
public PlayerSpawnPoint playerSpawn;
|
||||
|
||||
[Obsolete("Use shipSpawnPoints instead")]
|
||||
public ShipSpawnPoint shipSpawn;
|
||||
|
||||
[Obsolete("playerSpawnPoint is deprecated. Use playerSpawn.position instead")] public MVector3 playerSpawnPoint;
|
||||
@ -30,6 +40,56 @@ namespace NewHorizons.External.Modules
|
||||
/// Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).
|
||||
/// </summary>
|
||||
public MVector3 offset;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this planet's spawn point is the one the player/ship will initially spawn at, if multiple spawn points exist.
|
||||
/// Do not use at the same time as makeDefaultIfFactRevealed or makeDefaultIfPersistentCondition
|
||||
/// Spawns unlocked with this have lowest priority
|
||||
/// </summary>
|
||||
public bool isDefault;
|
||||
|
||||
/// <summary>
|
||||
/// If the given ship log fact is revealed, this spawn point will be used
|
||||
/// Do not use at the same time as isDefault or makeDefaultIfPersistentCondition
|
||||
/// Spawns unlocked with this have highest priority
|
||||
/// </summary>
|
||||
public string makeDefaultIfFactRevealed;
|
||||
|
||||
/// <summary>
|
||||
/// If the given persistent condition is true, this spawn point will be used
|
||||
/// Do not use at the same time as isDefault or makeDefaultIfFactRevealed
|
||||
/// Spawns unlocked with this have second highest priority
|
||||
/// </summary>
|
||||
public string makeDefaultIfPersistentCondition;
|
||||
|
||||
/// <summary>
|
||||
/// ID used to have a black hole or warp volume bring the player to this spawn specifically
|
||||
/// </summary>
|
||||
public string id;
|
||||
|
||||
public int GetPriority()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(PlayerSpawnHandler.TargetSpawnID) && id == PlayerSpawnHandler.TargetSpawnID)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(makeDefaultIfFactRevealed) && ShipLogHandler.KnowsFact(makeDefaultIfFactRevealed))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(makeDefaultIfPersistentCondition) && PlayerData.GetPersistentCondition(makeDefaultIfPersistentCondition))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (isDefault)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
@ -39,12 +99,6 @@ namespace NewHorizons.External.Modules
|
||||
/// If you spawn on a planet with no oxygen, you probably want to set this to true ;;)
|
||||
/// </summary>
|
||||
public bool startWithSuit;
|
||||
/// <summary>
|
||||
/// Whether this planet's spawn point is the one the player will initially spawn at, if multiple spawn points exist.
|
||||
/// </summary>
|
||||
public bool isDefault;
|
||||
|
||||
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
@ -54,6 +54,12 @@ namespace NewHorizons.External.Modules.VariableSize
|
||||
/// </summary>
|
||||
public string targetStarSystem;
|
||||
|
||||
/// <summary>
|
||||
/// If this is a black hole loading a new star system, set the ID of the spawn point you want to use
|
||||
/// Otherwise, will use the default spawn
|
||||
/// </summary>
|
||||
public string spawnPointID;
|
||||
|
||||
/// <summary>
|
||||
/// Type of singularity (white hole or black hole)
|
||||
/// </summary>
|
||||
|
||||
@ -26,5 +26,11 @@ namespace NewHorizons.External.Modules.VariableSize
|
||||
/// Tint of the water
|
||||
/// </summary>
|
||||
public MColor tint;
|
||||
|
||||
/// <summary>
|
||||
/// Will the ship automatically try to orient itself to face upwards while in this volume?
|
||||
/// </summary>
|
||||
[DefaultValue(true)]
|
||||
public bool allowShipAutoroll = true;
|
||||
}
|
||||
}
|
||||
@ -10,5 +10,11 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos
|
||||
/// The star system that entering this volume will send you to.
|
||||
/// </summary>
|
||||
[DefaultValue("SolarSystem")] public string targetStarSystem;
|
||||
|
||||
/// <summary>
|
||||
/// ID assigned to a spawn point in the other system that the player will be sent to
|
||||
/// Uses the default spawn if not set
|
||||
/// </summary>
|
||||
public string spawnPointID;
|
||||
}
|
||||
}
|
||||
|
||||
13
NewHorizons/External/NewHorizonBody.cs
vendored
13
NewHorizons/External/NewHorizonBody.cs
vendored
@ -3,6 +3,7 @@ using NewHorizons.Utility.Files;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
@ -16,6 +17,12 @@ namespace NewHorizons.External
|
||||
Mod = mod;
|
||||
RelativePath = relativePath;
|
||||
|
||||
// Fall back to file name if name not given
|
||||
if (!string.IsNullOrEmpty(relativePath) && string.IsNullOrEmpty(config.name))
|
||||
{
|
||||
config.name = Path.GetFileNameWithoutExtension(relativePath);
|
||||
}
|
||||
|
||||
Migrate();
|
||||
}
|
||||
|
||||
@ -102,12 +109,6 @@ namespace NewHorizons.External
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Because these guys put TWO spawn points
|
||||
if (Mod.ModHelper.Manifest.UniqueName == "2walker2.Evacuation" && Config.name == "The Campground")
|
||||
{
|
||||
Config.Spawn.playerSpawn.isDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
11
NewHorizons/External/NewHorizonsSystem.cs
vendored
11
NewHorizons/External/NewHorizonsSystem.cs
vendored
@ -1,6 +1,6 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using OWML.Common;
|
||||
using System.Linq;
|
||||
|
||||
namespace NewHorizons.External
|
||||
{
|
||||
@ -8,10 +8,9 @@ namespace NewHorizons.External
|
||||
{
|
||||
public string UniqueID;
|
||||
public string RelativePath;
|
||||
public SpawnModule Spawn = null;
|
||||
public SpawnPoint SpawnPoint = null;
|
||||
public StarSystemConfig Config;
|
||||
public IModBehaviour Mod;
|
||||
public bool HasShipSpawn;
|
||||
|
||||
public NewHorizonsSystem(string uniqueID, StarSystemConfig config, string relativePath, IModBehaviour mod)
|
||||
{
|
||||
@ -19,6 +18,12 @@ namespace NewHorizons.External
|
||||
Config = config;
|
||||
RelativePath = relativePath;
|
||||
Mod = mod;
|
||||
|
||||
// Backwards compat
|
||||
if (new string[] { "2walker2.OogaBooga", "2walker2.EndingIfYouWarpHereYouAreMean", "FeldsparSystem" }.Contains(uniqueID))
|
||||
{
|
||||
config.canExitViaWarpDrive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,8 +422,8 @@ namespace NewHorizons.Handlers
|
||||
if (defaultPrimaryToSun)
|
||||
{
|
||||
NHLogger.LogError($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to center of solar system");
|
||||
// TODO: Make this work in other systems. We tried using Locator.GetCenterOfUniverse before but that doesn't work since its too early now
|
||||
primaryBody = SearchUtilities.Find("Sun_Body")?.GetComponent<AstroObject>();
|
||||
// Fix #933 not defaulting primary body
|
||||
primaryBody = (SearchUtilities.Find("Sun_Body") ?? AstroObjectBuilder.CenterOfUniverse)?.GetComponent<AstroObject>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -503,13 +503,6 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
NHLogger.LogVerbose($"Making spawn point on {body.Config.name}");
|
||||
var spawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody);
|
||||
var isVanillaSystem = body.Config.starSystem == "SolarSystem" || body.Config.starSystem == "EyeOfTheUniverse";
|
||||
var needsSpawnPoint = Main.SystemDict[body.Config.starSystem].SpawnPoint == null || isVanillaSystem;
|
||||
var isDefaultSpawn = body.Config.Spawn.playerSpawn?.isDefault ?? true; // Backwards compat
|
||||
if (needsSpawnPoint || isDefaultSpawn)
|
||||
{
|
||||
Main.SystemDict[body.Config.starSystem].SpawnPoint = spawnPoint;
|
||||
}
|
||||
}
|
||||
|
||||
if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic)
|
||||
|
||||
@ -9,6 +9,11 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
public static class PlayerSpawnHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Set during the previous loop, force the player to spawn here
|
||||
/// </summary>
|
||||
public static string TargetSpawnID { get; set; }
|
||||
|
||||
public static void SetUpPlayerSpawn()
|
||||
{
|
||||
if (UsingCustomSpawn())
|
||||
@ -146,6 +151,9 @@ namespace NewHorizons.Handlers
|
||||
FixPlayerVelocity();
|
||||
|
||||
InvulnerabilityHandler.MakeInvulnerable(false);
|
||||
|
||||
// Done spawning
|
||||
TargetSpawnID = null;
|
||||
}
|
||||
|
||||
private static void FixPlayerVelocity(bool recenter = true)
|
||||
@ -200,8 +208,8 @@ namespace NewHorizons.Handlers
|
||||
return vector;
|
||||
}
|
||||
|
||||
public static bool UsingCustomSpawn() => Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint != null;
|
||||
public static bool UsingCustomSpawn() => SpawnPointBuilder.PlayerSpawn != null;
|
||||
public static PlayerSpawner GetPlayerSpawner() => GameObject.FindObjectOfType<PlayerSpawner>();
|
||||
public static SpawnPoint GetDefaultSpawn() => Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint ?? GetPlayerSpawner().GetSpawnPoint(SpawnLocation.TimberHearth);
|
||||
public static SpawnPoint GetDefaultSpawn() => SpawnPointBuilder.PlayerSpawn ?? GetPlayerSpawner().GetSpawnPoint(SpawnLocation.TimberHearth);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,10 +114,8 @@ namespace NewHorizons.Handlers
|
||||
|
||||
public static bool KnowsFact(string fact)
|
||||
{
|
||||
// Works normally in the main system, else check save data directly
|
||||
var shipLogManager = Locator.GetShipLogManager();
|
||||
if (Main.Instance.CurrentStarSystem == "SolarSystem" && shipLogManager != null) return shipLogManager.IsFactRevealed(fact);
|
||||
else return PlayerData.GetShipLogFactSave(fact)?.revealOrder > -1;
|
||||
// Use save data directly so stuff works between systems
|
||||
return PlayerData.GetShipLogFactSave(fact)?.revealOrder > -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,9 @@ namespace NewHorizons.Handlers
|
||||
private static Dictionary<string, string> _starSystemToFactID;
|
||||
private static Dictionary<string, string> _factIDToStarSystem;
|
||||
|
||||
private static bool _canExitViaWarpDrive;
|
||||
private static string _factRequiredToExitViaWarpDrive;
|
||||
|
||||
private static NewHorizonsSystem[] _systems;
|
||||
|
||||
public static void Init(NewHorizonsSystem[] systems)
|
||||
@ -56,12 +59,21 @@ namespace NewHorizons.Handlers
|
||||
_starSystemToFactID = new Dictionary<string, string>();
|
||||
_factIDToStarSystem = new Dictionary<string, string>();
|
||||
|
||||
_factRequiredToExitViaWarpDrive = string.Empty;
|
||||
|
||||
foreach (NewHorizonsSystem system in _systems)
|
||||
{
|
||||
if (system.Config.factRequiredForWarp != default)
|
||||
if (system.Config.factRequiredForWarp != default && system.UniqueID != "SolarSystem")
|
||||
{
|
||||
RegisterFactForSystem(system.Config.factRequiredForWarp, system.UniqueID);
|
||||
}
|
||||
|
||||
if (system.UniqueID == Main.Instance.CurrentStarSystem)
|
||||
{
|
||||
_factRequiredToExitViaWarpDrive = system.Config.factRequiredToExitViaWarpDrive;
|
||||
_canExitViaWarpDrive = system.Config.canExitViaWarpDrive || !string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive);
|
||||
NHLogger.LogVerbose($"In system {system.UniqueID} can exit via warp drive? {system.Config.canExitViaWarpDrive} {_canExitViaWarpDrive} {_factRequiredToExitViaWarpDrive}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,6 +100,10 @@ namespace NewHorizons.Handlers
|
||||
/// <returns></returns>
|
||||
public static bool HasUnlockedSystem(string system)
|
||||
{
|
||||
// If warp drive is entirely disabled, then no
|
||||
if (!CanExitViaWarpDrive())
|
||||
return false;
|
||||
|
||||
if (_starSystemToFactID == null || _starSystemToFactID.Count == 0)
|
||||
return true;
|
||||
|
||||
@ -99,6 +115,9 @@ namespace NewHorizons.Handlers
|
||||
return ShipLogHandler.KnowsFact(factID);
|
||||
}
|
||||
|
||||
public static bool CanExitViaWarpDrive() => Main.Instance.CurrentStarSystem == "SolarSystem" || (_canExitViaWarpDrive
|
||||
&& (string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive)));
|
||||
|
||||
/// <summary>
|
||||
/// Is it actually a valid warp target
|
||||
/// </summary>
|
||||
@ -111,23 +130,63 @@ namespace NewHorizons.Handlers
|
||||
var canWarpTo = false;
|
||||
if (system.Equals("SolarSystem")) canWarpTo = true;
|
||||
else if (system.Equals("EyeOfTheUniverse")) canWarpTo = false;
|
||||
else if (config.Spawn?.shipSpawn != null) canWarpTo = true;
|
||||
else if (config.HasShipSpawn) canWarpTo = true;
|
||||
|
||||
var canEnterViaWarpDrive = Main.SystemDict[system].Config.canEnterViaWarpDrive || system == "SolarSystem";
|
||||
|
||||
var canExitViaWarpDrive = CanExitViaWarpDrive();
|
||||
|
||||
// Make base system always ignore canExitViaWarpDrive
|
||||
if (Main.Instance.CurrentStarSystem == "SolarSystem")
|
||||
canExitViaWarpDrive = true;
|
||||
|
||||
NHLogger.LogVerbose(canEnterViaWarpDrive, canExitViaWarpDrive, system, HasUnlockedSystem(system));
|
||||
|
||||
return canWarpTo
|
||||
&& Main.SystemDict[system].Config.canEnterViaWarpDrive
|
||||
&& canEnterViaWarpDrive
|
||||
&& canExitViaWarpDrive
|
||||
&& system != Main.Instance.CurrentStarSystem
|
||||
&& HasUnlockedSystem(system);
|
||||
}
|
||||
|
||||
public static void OnRevealFact(string factID)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) && factID == _factRequiredToExitViaWarpDrive)
|
||||
{
|
||||
_canExitViaWarpDrive = true;
|
||||
if (!Main.HasWarpDrive)
|
||||
{
|
||||
var flagActuallyAddedACard = false;
|
||||
// Add all cards that now work
|
||||
foreach (var starSystem in Main.SystemDict.Keys)
|
||||
{
|
||||
if (CanWarpToSystem(starSystem))
|
||||
{
|
||||
ShipLogStarChartMode.AddSystemCard(starSystem);
|
||||
flagActuallyAddedACard = true;
|
||||
}
|
||||
}
|
||||
if (flagActuallyAddedACard)
|
||||
{
|
||||
Main.Instance.EnableWarpDrive();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NHLogger.LogWarning("Warp drive was enabled before learning fact?");
|
||||
}
|
||||
}
|
||||
|
||||
if (_factIDToStarSystem != null && _factIDToStarSystem.TryGetValue(factID, out var systemUnlocked))
|
||||
{
|
||||
var knowsWarpFact = string.IsNullOrEmpty(_factRequiredToExitViaWarpDrive) || ShipLogHandler.KnowsFact(_factRequiredToExitViaWarpDrive);
|
||||
|
||||
NHLogger.Log($"Just learned [{factID}] and unlocked [{systemUnlocked}]");
|
||||
if (!Main.HasWarpDrive)
|
||||
if (!Main.HasWarpDrive && knowsWarpFact)
|
||||
{
|
||||
Main.Instance.EnableWarpDrive();
|
||||
if (ShipLogStarChartMode != null)
|
||||
ShipLogStarChartMode.AddSystemCard(systemUnlocked);
|
||||
}
|
||||
ShipLogStarChartMode?.AddSystemCard(systemUnlocked);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.Files;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using OWML.Common;
|
||||
@ -31,6 +32,8 @@ namespace NewHorizons.Handlers
|
||||
|
||||
private static List<(IModBehaviour mod, string filePath)> _additionalSubtitles = new();
|
||||
|
||||
private CanvasGroup _titleCanvasGroup;
|
||||
|
||||
public static void RegisterAdditionalSubtitle(IModBehaviour mod, string filePath)
|
||||
{
|
||||
_additionalSubtitles.Add((mod, filePath));
|
||||
@ -64,6 +67,8 @@ namespace NewHorizons.Handlers
|
||||
var layout = GetComponent<LayoutElement>();
|
||||
layout.minHeight = SUBTITLE_HEIGHT;
|
||||
|
||||
_titleCanvasGroup = SearchUtilities.Find("TitleCanvas").GetComponent<CanvasGroup>();
|
||||
|
||||
CheckForEOTE();
|
||||
|
||||
// We add our subtitles as a child object so that their sizing doesnt shift the layout of the main menu
|
||||
@ -104,7 +109,7 @@ namespace NewHorizons.Handlers
|
||||
var tex = ImageUtilities.GetTexture(mod, filepath, false);
|
||||
if (tex == null) return;
|
||||
|
||||
var sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, Mathf.Max(SUBTITLE_HEIGHT, tex.height)), new Vector2(0.5f, 0.5f), 100.0f);
|
||||
var sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, tex.height), new Vector2(0.5f, 0.5f), 100.0f);
|
||||
AddSubtitle(sprite);
|
||||
}
|
||||
|
||||
@ -137,6 +142,12 @@ namespace NewHorizons.Handlers
|
||||
return;
|
||||
}
|
||||
|
||||
// Fix subtitles start cycling before the main menu is visible #844
|
||||
if (_titleCanvasGroup.alpha < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (pauseTimer > 0)
|
||||
{
|
||||
pauseTimer--;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Builder.General;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.EyeOfTheUniverse;
|
||||
@ -240,7 +241,7 @@ namespace NewHorizons.Handlers
|
||||
VesselSpawnPoint spawnPoint = vesselObject.GetComponentInChildren<VesselSpawnPoint>(true);
|
||||
if (ShouldSpawnAtVessel())
|
||||
{
|
||||
system.SpawnPoint = spawnPoint;
|
||||
SpawnPointBuilder.OverridePlayerSpawn(spawnPoint);
|
||||
}
|
||||
|
||||
vesselObject.SetActive(true);
|
||||
|
||||
@ -214,5 +214,12 @@ namespace NewHorizons
|
||||
/// <param name="mod"></param>
|
||||
/// <param name="filePath"></param>
|
||||
void AddSubtitle(IModBehaviour mod, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// Whatever system the player is warping to next, they will spawn at the spawn point with this ID
|
||||
/// Gets reset after warping. Is also overriden by entering a system-changing black hole or warp volume by their `spawnPointID`
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
void SetNextSpawnID(string id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ namespace NewHorizons
|
||||
|
||||
BodyDict["SolarSystem"] = new List<NewHorizonsBody>();
|
||||
BodyDict["EyeOfTheUniverse"] = new List<NewHorizonsBody>(); // Keep this empty tho fr
|
||||
SystemDict["SolarSystem"] = new NewHorizonsSystem("SolarSystem", new StarSystemConfig(), "", Instance)
|
||||
SystemDict["SolarSystem"] = new NewHorizonsSystem("SolarSystem", new StarSystemConfig() { name = "SolarSystem" }, "", Instance)
|
||||
{
|
||||
Config =
|
||||
{
|
||||
@ -190,7 +190,7 @@ namespace NewHorizons
|
||||
}
|
||||
}
|
||||
};
|
||||
SystemDict["EyeOfTheUniverse"] = new NewHorizonsSystem("EyeOfTheUniverse", new StarSystemConfig(), "", Instance)
|
||||
SystemDict["EyeOfTheUniverse"] = new NewHorizonsSystem("EyeOfTheUniverse", new StarSystemConfig() { name = "EyeOfTheUniverse" }, "", Instance)
|
||||
{
|
||||
Config =
|
||||
{
|
||||
@ -680,8 +680,15 @@ namespace NewHorizons
|
||||
}
|
||||
|
||||
#region Load
|
||||
public void LoadStarSystemConfig(string starSystemName, StarSystemConfig starSystemConfig, string relativePath, IModBehaviour mod)
|
||||
public void LoadStarSystemConfig(StarSystemConfig starSystemConfig, string relativePath, IModBehaviour mod)
|
||||
{
|
||||
if (string.IsNullOrEmpty(starSystemConfig.name))
|
||||
{
|
||||
starSystemConfig.name = Path.GetFileNameWithoutExtension(relativePath);
|
||||
}
|
||||
|
||||
var starSystemName = starSystemConfig.name;
|
||||
|
||||
starSystemConfig.Migrate();
|
||||
starSystemConfig.FixCoordinates();
|
||||
|
||||
@ -751,13 +758,12 @@ namespace NewHorizons
|
||||
|
||||
foreach (var file in systemFiles)
|
||||
{
|
||||
var starSystemName = Path.GetFileNameWithoutExtension(file);
|
||||
|
||||
NHLogger.LogVerbose($"Loading system {starSystemName}");
|
||||
|
||||
var relativePath = file.Replace(folder, "");
|
||||
|
||||
NHLogger.LogVerbose($"Loading system {Path.GetFileNameWithoutExtension(relativePath)}");
|
||||
|
||||
var starSystemConfig = mod.ModHelper.Storage.Load<StarSystemConfig>(relativePath, false);
|
||||
LoadStarSystemConfig(starSystemName, starSystemConfig, relativePath, mod);
|
||||
LoadStarSystemConfig(starSystemConfig, relativePath, mod);
|
||||
}
|
||||
}
|
||||
if (Directory.Exists(planetsFolder))
|
||||
@ -786,9 +792,6 @@ namespace NewHorizons
|
||||
|
||||
if (body != null)
|
||||
{
|
||||
// Wanna track the spawn point of each system
|
||||
if (body.Config.Spawn != null) SystemDict[body.Config.starSystem].Spawn = body.Config.Spawn;
|
||||
|
||||
// Add the new planet to the planet dictionary
|
||||
if (!BodyDict.ContainsKey(body.Config.starSystem)) BodyDict[body.Config.starSystem] = new List<NewHorizonsBody>();
|
||||
BodyDict[body.Config.starSystem].Add(body);
|
||||
@ -906,11 +909,7 @@ namespace NewHorizons
|
||||
{
|
||||
if (!SystemDict.ContainsKey(config.starSystem))
|
||||
{
|
||||
// Since we didn't load it earlier there shouldn't be a star system config
|
||||
var starSystemConfig = mod.ModHelper.Storage.Load<StarSystemConfig>(Path.Combine("systems", config.starSystem + ".json"), false);
|
||||
if (starSystemConfig == null) starSystemConfig = new StarSystemConfig();
|
||||
else NHLogger.LogWarning($"Loaded system config for {config.starSystem}. Why wasn't this loaded earlier?");
|
||||
|
||||
var starSystemConfig = new StarSystemConfig() { name = config.starSystem };
|
||||
starSystemConfig.Migrate();
|
||||
starSystemConfig.FixCoordinates();
|
||||
|
||||
@ -925,6 +924,12 @@ namespace NewHorizons
|
||||
config.Validate();
|
||||
config.Migrate();
|
||||
|
||||
// Check if this system can be warped to
|
||||
if (config.Spawn?.shipSpawnPoints?.Any() ?? false)
|
||||
{
|
||||
SystemDict[config.starSystem].HasShipSpawn = true;
|
||||
}
|
||||
|
||||
return new NewHorizonsBody(config, mod, relativePath);
|
||||
}
|
||||
|
||||
@ -938,6 +943,10 @@ namespace NewHorizons
|
||||
{
|
||||
_defaultStarSystem = defaultSystem;
|
||||
}
|
||||
if (LoadManager.GetCurrentScene() != OWScene.SolarSystem && LoadManager.GetCurrentScene() != OWScene.EyeOfTheUniverse)
|
||||
{
|
||||
CurrentStarSystem = _defaultStarSystem;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Load
|
||||
@ -1068,7 +1077,7 @@ namespace NewHorizons
|
||||
{
|
||||
IsWarpingFromVessel = true;
|
||||
}
|
||||
else if (BodyDict.TryGetValue(DefaultSystemOverride, out var bodies) && bodies.Any(x => x.Config?.Spawn?.shipSpawn != null))
|
||||
else if (BodyDict.TryGetValue(DefaultSystemOverride, out var bodies) && bodies.Any(x => x.Config?.Spawn?.shipSpawnPoints?.Any() ?? false))
|
||||
{
|
||||
IsWarpingFromShip = true;
|
||||
}
|
||||
|
||||
@ -261,7 +261,8 @@ namespace NewHorizons
|
||||
public void DefineStarSystem(string name, string config, IModBehaviour mod)
|
||||
{
|
||||
var starSystemConfig = JsonConvert.DeserializeObject<StarSystemConfig>(config);
|
||||
Main.Instance.LoadStarSystemConfig(name, starSystemConfig, null, mod);
|
||||
starSystemConfig.name = name;
|
||||
Main.Instance.LoadStarSystemConfig(starSystemConfig, null, mod);
|
||||
}
|
||||
|
||||
public (CharacterDialogueTree, RemoteDialogueTrigger) CreateDialogueFromXML(string textAssetID, string xml, string dialogueInfo, GameObject planetGO)
|
||||
@ -312,6 +313,7 @@ namespace NewHorizons
|
||||
|
||||
var system = new StarSystemConfig()
|
||||
{
|
||||
name = starSystem,
|
||||
entryPositions = entryPositions?
|
||||
.Select((pair) => new EntryPositionInfo() { id = pair.Key, position = pair.Value })
|
||||
.ToArray(),
|
||||
@ -320,7 +322,7 @@ namespace NewHorizons
|
||||
.ToArray()
|
||||
};
|
||||
|
||||
Main.Instance.LoadStarSystemConfig(starSystem, system, null, mod);
|
||||
Main.Instance.LoadStarSystemConfig(system, null, mod);
|
||||
|
||||
RumorModeBuilder.AddShipLogXML(GameObject.FindObjectOfType<ShipLogManager>(), xml, body);
|
||||
}
|
||||
@ -340,5 +342,7 @@ namespace NewHorizons
|
||||
public string GetTranslationForOtherText(string text) => TranslationHandler.GetTranslation(text, TranslationHandler.TextType.OTHER);
|
||||
|
||||
public void AddSubtitle(IModBehaviour mod, string filePath) => SubtitlesHandler.RegisterAdditionalSubtitle(mod, filePath);
|
||||
|
||||
public void SetNextSpawnID(string id) => PlayerSpawnHandler.TargetSpawnID = id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace NewHorizons.Patches.SignalPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(SignalscopeReticleController))]
|
||||
public static class SignalScopeReticleControllerPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(SignalscopeReticleController.UpdateBrackets))]
|
||||
public static void SignalscopeReticleController_UpdateBrackets(SignalscopeReticleController __instance)
|
||||
{
|
||||
var listSignals = Locator.GetAudioSignals();
|
||||
for (int i = listSignals.Count; i < __instance._clonedLeftBrackets.Count; i++)
|
||||
{
|
||||
__instance._clonedLeftBrackets[i].enabled = false;
|
||||
__instance._clonedRightBrackets[i].enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,7 @@
|
||||
},
|
||||
"subtitlePath": {
|
||||
"type": "string",
|
||||
"description": "The path to the addons subtitle for the main menu.\nDefaults to \"subtitle.png\"."
|
||||
"description": "The path to the addons subtitle for the main menu.\nDefaults to \"subtitle.png\".\nThe dimensions of the Echoes of the Eye subtitle is 669 x 67, so aim for that size"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string",
|
||||
|
||||
@ -4,14 +4,10 @@
|
||||
"type": "object",
|
||||
"description": "Describes a celestial body to generate",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Unique name of your planet",
|
||||
"minLength": 1
|
||||
"description": "Unique name of your planet. If not specified, the file name (without the extension) is used."
|
||||
},
|
||||
"starSystem": {
|
||||
"type": "string",
|
||||
@ -409,6 +405,11 @@
|
||||
"description": "Maximum speed that your ship can go in the atmosphere where flames will appear at their brightest.",
|
||||
"format": "float",
|
||||
"default": 300.0
|
||||
},
|
||||
"allowShipAutoroll": {
|
||||
"type": "boolean",
|
||||
"description": "Will the ship automatically try to orient itself to face upwards while in this volume?",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -547,9 +548,10 @@
|
||||
"description": "Radius of a simple sphere used as the ground for the planet. If you want to use more complex terrain, leave this as\n0.",
|
||||
"format": "float"
|
||||
},
|
||||
"invulnerableToSun": {
|
||||
"hasFluidDetector": {
|
||||
"type": "boolean",
|
||||
"description": "Can this planet survive entering a star?"
|
||||
"description": "Is this planet able to detect fluid volumes? Disabling this means that entering a star or lava volume will not destroy this planet\nMay have adverse effects if anglerfish are added to this planet, disable this if you want those to work (they have fluid volumes in their mouths)",
|
||||
"default": true
|
||||
},
|
||||
"showMinimap": {
|
||||
"type": "boolean",
|
||||
@ -568,7 +570,7 @@
|
||||
},
|
||||
"surfaceSize": {
|
||||
"type": "number",
|
||||
"description": "A scale height used for a number of things. Should be the approximate radius of the body.",
|
||||
"description": "A scale height used for a number of things. Should be the approximate radius of the body.\n\nAffected settings include: Base sector size, proxy body scaling, surface gravity",
|
||||
"format": "float"
|
||||
},
|
||||
"gravityVolumePriority": {
|
||||
@ -621,12 +623,12 @@
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"fogTint": {
|
||||
"description": "The color of the fog inside this dimension. \nLeave blank for the default grayish color: (84, 83, 73)",
|
||||
"description": "The color of the fog inside this dimension. \nLeave blank for the default grayish color: (84, 83, 73)\nThe alpha value has no effect of the fog: Use fogDensity instead!",
|
||||
"$ref": "#/definitions/MColor"
|
||||
},
|
||||
"fogDensity": {
|
||||
"type": "number",
|
||||
"description": "The density of the fog inside this dimension. The default is 6.",
|
||||
"description": "The density of the fog inside this dimension. The default is 6. If you want no fog, set this to 0.",
|
||||
"format": "float",
|
||||
"default": 6.0
|
||||
},
|
||||
@ -1118,7 +1120,6 @@
|
||||
"type": "number",
|
||||
"description": "The semi-major axis of the ellipse that is the body's orbit. For a circular orbit this is the radius.",
|
||||
"format": "float",
|
||||
"default": 5000.0,
|
||||
"minimum": 0.0
|
||||
},
|
||||
"inclination": {
|
||||
@ -1376,7 +1377,7 @@
|
||||
},
|
||||
"keepLoaded": {
|
||||
"type": "boolean",
|
||||
"description": "Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?\nAlso makes this detail visible on the map.\nMost logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided."
|
||||
"description": "Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?\nAlso makes this detail visible on the map.\nKeeping many props loaded is bad for performance so use this only when it's actually relevant\nMost logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided."
|
||||
},
|
||||
"hasPhysics": {
|
||||
"type": "boolean",
|
||||
@ -1639,6 +1640,17 @@
|
||||
"format": "float",
|
||||
"default": 2.0
|
||||
},
|
||||
"attentionPoint": {
|
||||
"description": "The point that the camera looks at when dialogue advances.",
|
||||
"$ref": "#/definitions/AttentionPointInfo"
|
||||
},
|
||||
"swappedAttentionPoints": {
|
||||
"type": "array",
|
||||
"description": "Additional points that the camera looks at when dialogue advances through specific dialogue nodes and pages.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/SwappedAttentionPointInfo"
|
||||
}
|
||||
},
|
||||
"remoteTrigger": {
|
||||
"description": "Allows you to trigger dialogue from a distance when you walk into an area.",
|
||||
"$ref": "#/definitions/RemoteTriggerInfo"
|
||||
@ -1654,6 +1666,73 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"AttentionPointInfo": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"position": {
|
||||
"description": "Position of the object",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"isRelativeToParent": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||
},
|
||||
"parentPath": {
|
||||
"type": "string",
|
||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||
},
|
||||
"rename": {
|
||||
"type": "string",
|
||||
"description": "An optional rename of this object"
|
||||
},
|
||||
"offset": {
|
||||
"description": "An additional offset to apply to apply when the camera looks at this attention point.",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SwappedAttentionPointInfo": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"offset": {
|
||||
"description": "An additional offset to apply to apply when the camera looks at this attention point.",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"position": {
|
||||
"description": "Position of the object",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"isRelativeToParent": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||
},
|
||||
"parentPath": {
|
||||
"type": "string",
|
||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||
},
|
||||
"rename": {
|
||||
"type": "string",
|
||||
"description": "An optional rename of this object"
|
||||
},
|
||||
"dialogueNode": {
|
||||
"type": "string",
|
||||
"description": "The name of the dialogue node to activate this attention point for. If null or blank, activates for every node."
|
||||
},
|
||||
"dialoguePage": {
|
||||
"type": "integer",
|
||||
"description": "The index of the page in the current dialogue node to activate this attention point for, if the node has multiple pages.",
|
||||
"format": "int32"
|
||||
},
|
||||
"lookEasing": {
|
||||
"type": "number",
|
||||
"description": "The easing factor which determines how 'snappy' the camera is when looking at the attention point.",
|
||||
"format": "float",
|
||||
"default": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"RemoteTriggerInfo": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@ -2657,6 +2736,10 @@
|
||||
"type": "string",
|
||||
"description": "If you want a black hole to load a new star system scene, put its name here."
|
||||
},
|
||||
"spawnPointID": {
|
||||
"type": "string",
|
||||
"description": "If this is a black hole loading a new star system, set the ID of the spawn point you want to use\nOtherwise, will use the default spawn"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type of singularity (white hole or black hole)",
|
||||
"$ref": "#/definitions/SingularityType"
|
||||
@ -3632,13 +3715,19 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"playerSpawn": {
|
||||
"description": "If you want the player to spawn on the new body, set a value for this.",
|
||||
"$ref": "#/definitions/PlayerSpawnPoint"
|
||||
"playerSpawnPoints": {
|
||||
"type": "array",
|
||||
"description": "If you want the player to spawn on the new body, set a value for this.\nDifferent spawns can be unlocked with persistent conditions and facts",
|
||||
"items": {
|
||||
"$ref": "#/definitions/PlayerSpawnPoint"
|
||||
}
|
||||
},
|
||||
"shipSpawn": {
|
||||
"description": "Required for the system to be accessible by warp drive.",
|
||||
"$ref": "#/definitions/ShipSpawnPoint"
|
||||
"shipSpawnPoints": {
|
||||
"type": "array",
|
||||
"description": "Required for the system to be accessible by warp drive.\nDifferent spawns can be unlocked with persistent conditions and facts",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ShipSpawnPoint"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -3650,6 +3739,22 @@
|
||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"isDefault": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this planet's spawn point is the one the player/ship will initially spawn at, if multiple spawn points exist.\nDo not use at the same time as makeDefaultIfFactRevealed or makeDefaultIfPersistentCondition\nSpawns unlocked with this have lowest priority"
|
||||
},
|
||||
"makeDefaultIfFactRevealed": {
|
||||
"type": "string",
|
||||
"description": "If the given ship log fact is revealed, this spawn point will be used\nDo not use at the same time as isDefault or makeDefaultIfPersistentCondition\nSpawns unlocked with this have highest priority"
|
||||
},
|
||||
"makeDefaultIfPersistentCondition": {
|
||||
"type": "string",
|
||||
"description": "If the given persistent condition is true, this spawn point will be used\nDo not use at the same time as isDefault or makeDefaultIfFactRevealed\nSpawns unlocked with this have second highest priority"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "ID used to have a black hole or warp volume bring the player to this spawn specifically"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotation of the object",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
@ -3680,10 +3785,6 @@
|
||||
"startWithSuit": {
|
||||
"type": "boolean",
|
||||
"description": "If you spawn on a planet with no oxygen, you probably want to set this to true ;;)"
|
||||
},
|
||||
"isDefault": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this planet's spawn point is the one the player will initially spawn at, if multiple spawn points exist."
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -3695,6 +3796,22 @@
|
||||
"description": "Offsets the player/ship by this local vector when spawning. Used to prevent spawning in the floor. Optional: defaults to (0, 4, 0).",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"isDefault": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this planet's spawn point is the one the player/ship will initially spawn at, if multiple spawn points exist.\nDo not use at the same time as makeDefaultIfFactRevealed or makeDefaultIfPersistentCondition\nSpawns unlocked with this have lowest priority"
|
||||
},
|
||||
"makeDefaultIfFactRevealed": {
|
||||
"type": "string",
|
||||
"description": "If the given ship log fact is revealed, this spawn point will be used\nDo not use at the same time as isDefault or makeDefaultIfPersistentCondition\nSpawns unlocked with this have highest priority"
|
||||
},
|
||||
"makeDefaultIfPersistentCondition": {
|
||||
"type": "string",
|
||||
"description": "If the given persistent condition is true, this spawn point will be used\nDo not use at the same time as isDefault or makeDefaultIfFactRevealed\nSpawns unlocked with this have second highest priority"
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "ID used to have a black hole or warp volume bring the player to this spawn specifically"
|
||||
},
|
||||
"rotation": {
|
||||
"description": "Rotation of the object",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
@ -3921,6 +4038,11 @@
|
||||
"tint": {
|
||||
"description": "Tint of the water",
|
||||
"$ref": "#/definitions/MColor"
|
||||
},
|
||||
"allowShipAutoroll": {
|
||||
"type": "boolean",
|
||||
"description": "Will the ship automatically try to orient itself to face upwards while in this volume?",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -5176,6 +5298,10 @@
|
||||
"type": "string",
|
||||
"description": "The star system that entering this volume will send you to.",
|
||||
"default": "SolarSystem"
|
||||
},
|
||||
"spawnPointID": {
|
||||
"type": "string",
|
||||
"description": "ID assigned to a spawn point in the other system that the player will be sent to\nUses the default spawn if not set"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -81,7 +81,7 @@
|
||||
<xs:element name="AltPhotoCondition" type="xs:string" minOccurs="0" maxOccurs="1">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
If this fact is revealed, show the Alt picture
|
||||
If this fact is revealed, show the Alt picture. Alt photos use the same file name as default but suffixed with "_alt"
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
"description": "Configuration for a specific star system",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Unique name of your system. If not specified, the file name (without the extension) is used."
|
||||
},
|
||||
"freeMapAngle": {
|
||||
"type": "boolean",
|
||||
"description": "In this system should the player be able to rotate their map camera freely or be stuck above the plane of the solar system?"
|
||||
@ -20,9 +24,22 @@
|
||||
},
|
||||
"canEnterViaWarpDrive": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this system can be warped to via the warp drive. If you set factRequiredForWarp, this will be true.",
|
||||
"description": "Whether this system can be warped to via the warp drive. If you set `factRequiredForWarp`, this will be true.\nDoes NOT effect the base SolarSystem. For that, see `canExitViaWarpDrive` and `factRequiredToExitViaWarpDrive`",
|
||||
"default": true
|
||||
},
|
||||
"factRequiredForWarp": {
|
||||
"type": "string",
|
||||
"description": "The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if\nyou're using this, because it will be overwritten."
|
||||
},
|
||||
"canExitViaWarpDrive": {
|
||||
"type": "boolean",
|
||||
"description": "Can you use the warp drive to leave this system? If you set `factRequiredToExitViaWarpDrive`\nthis will be true.",
|
||||
"default": true
|
||||
},
|
||||
"factRequiredToExitViaWarpDrive": {
|
||||
"type": "string",
|
||||
"description": "The FactID that must be revealed for you to warp back to the main solar system from here. Don't set `canWarpHome`\nto `false` if you're using this, because it will be overwritten."
|
||||
},
|
||||
"destroyStockPlanets": {
|
||||
"type": "boolean",
|
||||
"description": "Do you want a clean slate for this star system? Or will it be a modified version of the original.",
|
||||
@ -33,10 +50,6 @@
|
||||
"description": "Should the time loop be enabled in this system?",
|
||||
"default": true
|
||||
},
|
||||
"factRequiredForWarp": {
|
||||
"type": "string",
|
||||
"description": "The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if\nyou're using this, because it will be overwritten."
|
||||
},
|
||||
"loopDuration": {
|
||||
"type": "number",
|
||||
"description": "The duration of the time loop in minutes. This is the time the sun explodes. End Times plays 85 seconds before this time, and your memories get sent back about 40 seconds after this time.",
|
||||
|
||||
@ -114,7 +114,7 @@ namespace NewHorizons.Utility.Files
|
||||
// Not sure why we check if the originalPath is null but it did that before so
|
||||
if (!string.IsNullOrEmpty(originalPath))
|
||||
{
|
||||
cachedPath = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ProjectionBuilder.INVERTED_SLIDE_CACHE_FOLDER, originalPath.Replace(mod.ModHelper.Manifest.ModFolderPath, ""));
|
||||
cachedPath = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ProjectionBuilder.InvertedSlideReelCacheFolder, originalPath.Replace(mod.ModHelper.Manifest.ModFolderPath, ""));
|
||||
key = GetKey(cachedPath);
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ namespace NewHorizons.Utility.Files
|
||||
|
||||
// Since doing this is expensive we cache the results to the disk
|
||||
// Preloading cached values is done in ProjectionBuilder
|
||||
var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ProjectionBuilder.ATLAS_SLIDE_CACHE_FOLDER, $"{uniqueSlideReelID}.png");
|
||||
var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, ProjectionBuilder.AtlasSlideReelCacheFolder, $"{uniqueSlideReelID}.png");
|
||||
NHLogger.LogVerbose($"Caching atlas image to {path}");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
File.WriteAllBytes(path, texture.EncodeToPNG());
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Utility.OWML;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@ -115,7 +116,7 @@ public class SlideReelAsyncImageLoader
|
||||
if (hasError)
|
||||
{
|
||||
NHLogger.LogError($"Failed to load {index}:{url} - {uwr.error}");
|
||||
if (url.Contains("SlideReelCache"))
|
||||
if (url.Contains(ProjectionBuilder.CurrentSlideReelFolder))
|
||||
{
|
||||
NHLogger.LogError("Missing image in SlideReelCache: If you are a dev, try deleting the folder so that New Horizons can regenerate the cache. If you are a player: do that and then complain to the mod dev.");
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/amazingalek/owml/master/schemas/manifest_schema.json",
|
||||
"filename": "NewHorizons.dll",
|
||||
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends",
|
||||
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends",
|
||||
"name": "New Horizons",
|
||||
"uniqueName": "xen.NewHorizons",
|
||||
"version": "1.22.4",
|
||||
"version": "1.22.8",
|
||||
"owmlVersion": "2.12.1",
|
||||
"dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
||||
"conflicts": [ "PacificEngine.OW_CommonResources" ],
|
||||
|
||||
@ -81,7 +81,6 @@ public static class SchemaExporter
|
||||
switch (_title)
|
||||
{
|
||||
case "Celestial Body Schema":
|
||||
schema.Definitions["OrbitModule"].Properties["semiMajorAxis"].Default = 5000f;
|
||||
schema.Definitions["NomaiTextType"].Enumeration.Remove("cairn");
|
||||
schema.Definitions["NomaiTextType"].EnumerationNames.Remove("Cairn");
|
||||
schema.Definitions["NomaiTextType"].Enumeration.Remove("cairnVariant");
|
||||
|
||||
@ -12,18 +12,18 @@
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/starlight": "^0.19.1",
|
||||
"astro": "4.4.1",
|
||||
"@astrojs/starlight": "^0.24.2",
|
||||
"astro": "4.10.2",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"sharp": "^0.33.2"
|
||||
"sharp": "^0.33.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apidevtools/json-schema-ref-parser": "^11.1.0",
|
||||
"@apidevtools/json-schema-ref-parser": "^11.6.4",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"fast-xml-parser": "^4.3.4",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-astro": "^0.13.0",
|
||||
"fast-xml-parser": "^4.4.0",
|
||||
"prettier": "^3.3.2",
|
||||
"prettier-plugin-astro": "^0.14.0",
|
||||
"xml-js": "^1.6.11"
|
||||
}
|
||||
}
|
||||
|
||||
2559
docs/pnpm-lock.yaml
generated
2559
docs/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
19
docs/src/content/docs/guides/troubleshooting.md
Normal file
19
docs/src/content/docs/guides/troubleshooting.md
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Troubleshooting
|
||||
description: A guide to troubleshooting common issues with mods
|
||||
---
|
||||
|
||||
## My slide reels aren't updating when I change them
|
||||
|
||||
Certain images (such as slide reels) get modified by New Horizons before usage, to save on resources NH will cache
|
||||
the modified version of these images on the file system to be recalled later for easier access. If you are changing
|
||||
an image you'll need to clear the cache located in the `SlideReelsCache` folder of your mod's directory to see changes. To do this simply delete the folder and restart the game.
|
||||
|
||||
## My planet is flying away at light speed and also I have anglerfish
|
||||
|
||||
Be sure to disable `hasFluidDetector` (previous had to enable `invulnerableToSun`). The anglerfish have fluid volumes in their mouths for killing you
|
||||
which interact poorly with the fluid detector and can mess up the movement of the planet.
|
||||
|
||||
## My Nomai text isn't updating
|
||||
|
||||
Either clear the .nhcache files or enable Debug mode to always regenerate the text cache.
|
||||
Loading…
x
Reference in New Issue
Block a user