mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
v1.8.6 (#503)
NOTE: CommonResources is now marked as an incompatible mod. ## Minor features - Added `solarSystemVolume` and `creditsVolume` to the `Volumes` module. Lets you change star system without setting up a black hole, and allows going straight to the fast, final, or kazoo credits scenes. ## Improvements - Ghost matter from detail props and from HazardVolumes now should be deactivated when going underwater. - Improved support for Discord Rich Presence - Water, sand, and lava will appear on title screen planets ## Bug fixes - Fixed funnels not working when the planet had no primary
This commit is contained in:
commit
bb2dcb42f9
@ -4,6 +4,7 @@ using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using NewHorizons.Components.Orbital;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -34,7 +35,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (_lavaMaterial == null) _lavaMaterial = new Material(SearchUtilities.Find("VolcanicMoon_Body/MoltenCore_VM/LavaSphere").GetComponent<MeshRenderer>().sharedMaterial).DontDestroyOnLoad();
|
||||
}
|
||||
|
||||
public static void Make(GameObject planetGO, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module)
|
||||
public static void Make(GameObject planetGO, Sector sector, OWRigidbody rigidbody, FunnelModule module)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -55,7 +56,7 @@ namespace NewHorizons.Builder.Body
|
||||
var detectorGO = new GameObject("Detector_Funnel");
|
||||
detectorGO.transform.parent = funnelGO.transform;
|
||||
var funnelDetector = detectorGO.AddComponent<ConstantForceDetector>();
|
||||
funnelDetector._inheritDetector = detector;
|
||||
funnelDetector._inheritDetector = planetGO.GetComponentInChildren<ConstantForceDetector>();
|
||||
funnelDetector._detectableFields = new ForceVolume[0];
|
||||
|
||||
detectorGO.AddComponent<ForceApplier>();
|
||||
@ -165,7 +166,10 @@ namespace NewHorizons.Builder.Body
|
||||
break;
|
||||
}
|
||||
|
||||
var sector = planetGO.GetComponent<AstroObject>().GetPrimaryBody().GetRootSector();
|
||||
// We take the sector of the binary focal point if it exists for this funnel (like with the twins)
|
||||
var primaryBody = planetGO.GetComponent<AstroObject>().GetPrimaryBody();
|
||||
if (primaryBody?.GetComponent<BinaryFocalPoint>() != null) sector = primaryBody.GetRootSector();
|
||||
|
||||
proxyGO.GetComponent<SectorProxy>().SetSector(sector);
|
||||
geoGO.GetComponent<SectorCullGroup>().SetSector(sector);
|
||||
volumesGO.GetComponent<SectorCollisionGroup>().SetSector(sector);
|
||||
|
||||
@ -203,7 +203,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (hasDestructionVolume) destructionVolumeGO.AddComponent<BlackHoleDestructionVolume>();
|
||||
else if (targetStarSystem != null)
|
||||
{
|
||||
var wormholeVolume = destructionVolumeGO.AddComponent<ChangeStarSystemVolume>();
|
||||
var wormholeVolume = destructionVolumeGO.AddComponent<BlackHoleWarpVolume>();
|
||||
wormholeVolume.TargetSolarSystem = targetStarSystem;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (_oceanAmbientLight == null) _oceanAmbientLight = SearchUtilities.Find("Ocean_GD").GetComponent<OceanLODController>()._ambientLight.gameObject.InstantiateInactive().Rename("OceanAmbientLight").DontDestroyOnLoad();
|
||||
}
|
||||
|
||||
public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
|
||||
public static RadialFluidVolume Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
|
||||
{
|
||||
InitPrefabs();
|
||||
|
||||
@ -148,6 +148,8 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
waterGO.transform.position = planetGO.transform.position;
|
||||
waterGO.SetActive(true);
|
||||
|
||||
return fluidVolume;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,6 +312,14 @@ namespace NewHorizons.Builder.Props
|
||||
if (probeVisuals != null) probeVisuals.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (component is DarkMatterSubmergeController submergeController)
|
||||
{
|
||||
var water = planetGO.GetComponentsInChildren<RadialFluidVolume>().FirstOrDefault(x => x._fluidType == FluidVolume.Type.WATER);
|
||||
// dont use SetDetectableFluid here because Awake hasn't been called yet
|
||||
if (submergeController._fluidDetector)
|
||||
submergeController._fluidDetector._onlyDetectableFluid = water;
|
||||
}
|
||||
|
||||
// Fix anglerfish speed on orbiting planets
|
||||
if (component is AnglerfishController angler)
|
||||
{
|
||||
|
||||
18
NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs
Normal file
18
NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
internal static class ChangeStarSystemVolumeBuilder
|
||||
{
|
||||
public static WarpVolume Make(GameObject planetGO, Sector sector, VolumesModule.ChangeStarSystemVolumeInfo info)
|
||||
{
|
||||
var volume = VolumeBuilder.Make<WarpVolume>(planetGO, sector, info);
|
||||
|
||||
volume.TargetSolarSystem = info.targetStarSystem;
|
||||
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs
Normal file
18
NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
internal static class CreditsVolumeBuilder
|
||||
{
|
||||
public static LoadCreditsVolume Make(GameObject planetGO, Sector sector, VolumesModule.LoadCreditsVolumeInfo info)
|
||||
{
|
||||
var volume = VolumeBuilder.Make<LoadCreditsVolume>(planetGO, sector, info);
|
||||
|
||||
volume.creditsType = info.creditsType;
|
||||
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,6 +62,24 @@ namespace NewHorizons.Builder.Volumes
|
||||
var visorFrostEffectVolume = go.AddComponent<VisorFrostEffectVolume>();
|
||||
visorFrostEffectVolume._frostRate = 0.5f;
|
||||
visorFrostEffectVolume._maxFrost = 0.91f;
|
||||
|
||||
var water = planetGO.GetComponentsInChildren<RadialFluidVolume>().FirstOrDefault(x => x._fluidType == FluidVolume.Type.WATER);
|
||||
if (water != null)
|
||||
{
|
||||
var submerge = go.AddComponent<DarkMatterSubmergeController>();
|
||||
submerge._activeWhenSubmerged = false;
|
||||
submerge._effectVolumes = new EffectVolume[] { hazardVolume, visorFrostEffectVolume };
|
||||
// THERE ARE NO RENDERERS??? RUH ROH!!!
|
||||
|
||||
var detectorGO = new GameObject("ConstantFluidDetector");
|
||||
detectorGO.transform.parent = go.transform;
|
||||
detectorGO.transform.localPosition = Vector3.zero;
|
||||
detectorGO.layer = LayerMask.NameToLayer("BasicDetector");
|
||||
var detector = detectorGO.AddComponent<ConstantFluidDetector>();
|
||||
detector.SetDetectableFluid(water);
|
||||
|
||||
submerge._fluidDetector = detector;
|
||||
}
|
||||
}
|
||||
else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.ELECTRICITY)
|
||||
{
|
||||
|
||||
@ -192,6 +192,20 @@ namespace NewHorizons.Builder.Volumes
|
||||
VolumeBuilder.Make<LightlessLightSourceVolume>(go, sector, lightSourceVolume);
|
||||
}
|
||||
}
|
||||
if (config.Volumes.solarSystemVolume != null)
|
||||
{
|
||||
foreach (var solarSystemVolume in config.Volumes.solarSystemVolume)
|
||||
{
|
||||
ChangeStarSystemVolumeBuilder.Make(go, sector, solarSystemVolume);
|
||||
}
|
||||
}
|
||||
if (config.Volumes.creditsVolume != null)
|
||||
{
|
||||
foreach (var creditsVolume in config.Volumes.creditsVolume)
|
||||
{
|
||||
CreditsVolumeBuilder.Make(go, sector, creditsVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
namespace NewHorizons.Components.Volumes
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
public class ChangeStarSystemVolume : BlackHoleDestructionVolume
|
||||
public class BlackHoleWarpVolume : BlackHoleDestructionVolume
|
||||
{
|
||||
public string TargetSolarSystem { get; set; }
|
||||
|
||||
35
NewHorizons/Components/Volumes/LoadCreditsVolume.cs
Normal file
35
NewHorizons/Components/Volumes/LoadCreditsVolume.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
internal class LoadCreditsVolume : BaseVolume
|
||||
{
|
||||
public VolumesModule.LoadCreditsVolumeInfo.CreditsType creditsType = VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast;
|
||||
|
||||
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
||||
{
|
||||
if (hitObj.CompareTag("PlayerDetector"))
|
||||
{
|
||||
switch(creditsType)
|
||||
{
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast:
|
||||
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Final:
|
||||
LoadManager.LoadScene(OWScene.Credits_Final, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Kazoo:
|
||||
TimelineObliterationController.s_hasRealityEnded = true;
|
||||
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTriggerVolumeExit(GameObject hitObj)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
31
NewHorizons/Components/Volumes/WarpVolume.cs
Normal file
31
NewHorizons/Components/Volumes/WarpVolume.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
internal class WarpVolume : BaseVolume
|
||||
{
|
||||
public string TargetSolarSystem;
|
||||
|
||||
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
||||
{
|
||||
if (hitObj.CompareTag("PlayerDetector"))
|
||||
{
|
||||
if (Main.Instance.CurrentStarSystem != TargetSolarSystem) // Otherwise it really breaks idk why
|
||||
{
|
||||
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTriggerVolumeExit(GameObject hitObj)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
37
NewHorizons/External/Modules/VolumesModule.cs
vendored
37
NewHorizons/External/Modules/VolumesModule.cs
vendored
@ -106,6 +106,16 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public PriorityVolumeInfo[] zeroGravityVolumes;
|
||||
|
||||
/// <summary>
|
||||
/// Entering this volume will load a new solar system.
|
||||
/// </summary>
|
||||
public ChangeStarSystemVolumeInfo[] solarSystemVolume;
|
||||
|
||||
/// <summary>
|
||||
/// Enter this volume to be sent to the end credits scene
|
||||
/// </summary>
|
||||
public LoadCreditsVolumeInfo[] creditsVolume;
|
||||
|
||||
[JsonObject]
|
||||
public class VolumeInfo
|
||||
{
|
||||
@ -136,6 +146,33 @@ namespace NewHorizons.External.Modules
|
||||
public string rename;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ChangeStarSystemVolumeInfo : VolumeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The star system that entering this volume will send you to.
|
||||
/// </summary>
|
||||
[DefaultValue("SolarSystem")]
|
||||
public string targetStarSystem;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class LoadCreditsVolumeInfo : VolumeInfo
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum CreditsType
|
||||
{
|
||||
[EnumMember(Value = @"fast")] Fast = 0,
|
||||
|
||||
[EnumMember(Value = @"final")] Final = 1,
|
||||
|
||||
[EnumMember(Value = @"kazoo")] Kazoo = 2
|
||||
}
|
||||
|
||||
[DefaultValue("fast")]
|
||||
public CreditsType creditsType = CreditsType.Fast;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class PriorityVolumeInfo : VolumeInfo
|
||||
{
|
||||
|
||||
@ -466,7 +466,7 @@ namespace NewHorizons.Handlers
|
||||
});
|
||||
}
|
||||
|
||||
RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector);
|
||||
RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector, body.Config.Star != null, body.Config.Atmosphere != null);
|
||||
|
||||
Logger.LogVerbose($"Finished creating [{body.Config.name}]");
|
||||
|
||||
@ -638,7 +638,7 @@ namespace NewHorizons.Handlers
|
||||
|
||||
if (body.Config.Funnel != null)
|
||||
{
|
||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||
FunnelBuilder.Make(go, sector, rb, body.Config.Funnel);
|
||||
}
|
||||
|
||||
// Has to go last probably
|
||||
|
||||
@ -65,6 +65,7 @@ namespace NewHorizons.Handlers
|
||||
var lightGO = new GameObject("Light");
|
||||
lightGO.transform.parent = SearchUtilities.Find("Scene/Background").transform;
|
||||
lightGO.transform.localPosition = new Vector3(-47.9203f, 145.7596f, 43.1802f);
|
||||
lightGO.transform.localRotation = Quaternion.Euler(13.1412f, 122.8785f, 169.4302f);
|
||||
var light = lightGO.AddComponent<Light>();
|
||||
light.type = LightType.Directional;
|
||||
light.color = Color.white;
|
||||
@ -75,31 +76,86 @@ namespace NewHorizons.Handlers
|
||||
private static GameObject LoadTitleScreenBody(NewHorizonsBody body)
|
||||
{
|
||||
Logger.LogVerbose($"Displaying {body.Config.name} on the title screen");
|
||||
GameObject titleScreenGO = new GameObject(body.Config.name + "_TitleScreen");
|
||||
HeightMapModule heightMap = new HeightMapModule();
|
||||
var minSize = 15;
|
||||
var maxSize = 30;
|
||||
float size = minSize;
|
||||
var titleScreenGO = new GameObject(body.Config.name + "_TitleScreen");
|
||||
|
||||
var maxSize = -1f;
|
||||
|
||||
if (body.Config.HeightMap != null)
|
||||
{
|
||||
size = Mathf.Clamp(body.Config.HeightMap.maxHeight / 10, minSize, maxSize);
|
||||
heightMap.textureMap = body.Config.HeightMap.textureMap;
|
||||
heightMap.heightMap = body.Config.HeightMap.heightMap;
|
||||
heightMap.maxHeight = size;
|
||||
heightMap.minHeight = body.Config.HeightMap.minHeight * size / body.Config.HeightMap.maxHeight;
|
||||
heightMap.stretch = body.Config.HeightMap.stretch;
|
||||
HeightMapBuilder.Make(titleScreenGO, null, body.Config.HeightMap, body.Mod, 30);
|
||||
maxSize = Mathf.Max(maxSize, body.Config.HeightMap.maxHeight, body.Config.HeightMap.minHeight);
|
||||
}
|
||||
if (body.Config.Atmosphere?.clouds?.texturePath != null && body.Config.Atmosphere?.clouds?.cloudsPrefab != CloudPrefabType.Transparent)
|
||||
{
|
||||
// Hacky but whatever I just want a sphere
|
||||
size = Mathf.Clamp(body.Config.Atmosphere.size / 10, minSize, maxSize);
|
||||
heightMap.maxHeight = heightMap.minHeight = size + 1;
|
||||
heightMap.textureMap = body.Config.Atmosphere.clouds.texturePath;
|
||||
var cloudTextureMap = new HeightMapModule();
|
||||
cloudTextureMap.maxHeight = cloudTextureMap.minHeight = body.Config.Atmosphere.size;
|
||||
cloudTextureMap.textureMap = body.Config.Atmosphere.clouds.texturePath;
|
||||
HeightMapBuilder.Make(titleScreenGO, null, cloudTextureMap, body.Mod, 30);
|
||||
maxSize = Mathf.Max(maxSize, cloudTextureMap.maxHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (body.Config.Water != null)
|
||||
{
|
||||
var waterGO = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
var size = 2f * Mathf.Max(body.Config.Water.size, body.Config.Water.size * body.Config.Water.curve?.FirstOrDefault()?.value ?? 0f);
|
||||
|
||||
waterGO.transform.localScale = Vector3.one * size;
|
||||
|
||||
var mr = waterGO.GetComponent<MeshRenderer>();
|
||||
var colour = body.Config.Water.tint?.ToColor() ?? Color.blue;
|
||||
mr.material.color = new Color(colour.r, colour.g, colour.b, 0.9f);
|
||||
|
||||
// Make it transparent!
|
||||
mr.material.SetOverrideTag("RenderType", "Transparent");
|
||||
mr.material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
|
||||
mr.material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
|
||||
mr.material.SetInt("_ZWrite", 0);
|
||||
mr.material.DisableKeyword("_ALPHATEST_ON");
|
||||
mr.material.DisableKeyword("_ALPHABLEND_ON");
|
||||
mr.material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
|
||||
mr.material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
|
||||
|
||||
waterGO.transform.parent = titleScreenGO.transform;
|
||||
waterGO.transform.localPosition = Vector3.zero;
|
||||
|
||||
maxSize = Mathf.Max(maxSize, size);
|
||||
}
|
||||
if (body.Config.Lava != null)
|
||||
{
|
||||
var lavaGO = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
var size = 2f * Mathf.Max(body.Config.Lava.size, body.Config.Lava.size * body.Config.Lava.curve?.FirstOrDefault()?.value ?? 0f);
|
||||
|
||||
lavaGO.transform.localScale = Vector3.one * size;
|
||||
|
||||
var mr = lavaGO.GetComponent<MeshRenderer>();
|
||||
mr.material.color = body.Config.Lava.tint?.ToColor() ?? Color.red;
|
||||
mr.material.SetColor("_EmissionColor", mr.material.color * 2f);
|
||||
|
||||
lavaGO.transform.parent = titleScreenGO.transform;
|
||||
lavaGO.transform.localPosition = Vector3.zero;
|
||||
|
||||
maxSize = Mathf.Max(maxSize, size);
|
||||
}
|
||||
if (body.Config.Sand != null)
|
||||
{
|
||||
var sandGO = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
var size = 2f * Mathf.Max(body.Config.Sand.size, body.Config.Sand.size * body.Config.Sand.curve?.FirstOrDefault()?.value ?? 0f);
|
||||
|
||||
sandGO.transform.localScale = Vector3.one * size;
|
||||
var mr = sandGO.GetComponent<MeshRenderer>();
|
||||
mr.material.color = body.Config.Sand.tint?.ToColor() ?? Color.yellow;
|
||||
mr.material.SetFloat("_Glossiness", 0);
|
||||
|
||||
sandGO.transform.parent = titleScreenGO.transform;
|
||||
sandGO.transform.localPosition = Vector3.zero;
|
||||
|
||||
maxSize = Mathf.Max(maxSize, size);
|
||||
}
|
||||
}
|
||||
|
||||
HeightMapBuilder.Make(titleScreenGO, null, heightMap, body.Mod, 30);
|
||||
|
||||
GameObject pivot = GameObject.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform);
|
||||
var pivot = GameObject.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform);
|
||||
pivot.GetComponent<RotateTransform>()._degreesPerSecond = 10f;
|
||||
foreach (Transform child in pivot.transform)
|
||||
{
|
||||
@ -111,17 +167,15 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
foreach (var ring in body.Config.Rings)
|
||||
{
|
||||
RingModule newRing = new RingModule();
|
||||
newRing.innerRadius = size * 1.2f;
|
||||
newRing.outerRadius = size * 2f;
|
||||
newRing.texture = ring.texture;
|
||||
RingBuilder.Make(titleScreenGO, null, newRing, body.Mod);
|
||||
RingBuilder.Make(titleScreenGO, null, ring, body.Mod);
|
||||
|
||||
maxSize = Mathf.Max(maxSize, ring.outerRadius);
|
||||
}
|
||||
titleScreenGO.transform.localScale = Vector3.one * 0.8f;
|
||||
}
|
||||
|
||||
titleScreenGO.transform.parent = pivot.transform;
|
||||
titleScreenGO.transform.localPosition = Vector3.zero;
|
||||
titleScreenGO.transform.localScale = Vector3.one * 30f / maxSize;
|
||||
|
||||
return titleScreenGO;
|
||||
}
|
||||
|
||||
@ -9,6 +9,14 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
||||
public void SetTriggerActivation(bool active);
|
||||
public GameObject CreateTrigger(GameObject parent, string message, string imageKey);
|
||||
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey);
|
||||
public GameObject CreateTrigger(GameObject parent, string message, string imageKey, string fallback);
|
||||
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey, string fallback);
|
||||
public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey);
|
||||
public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey, string fallback);
|
||||
public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey);
|
||||
public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey, string fallback);
|
||||
public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey);
|
||||
public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey, string fallback);
|
||||
public void SetCurrentRootPresence(string message, string imageKey);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetUpPlanet(string name, GameObject go, Sector sector)
|
||||
public static void SetUpPlanet(string name, GameObject go, Sector sector, bool isStar = false, bool hasAtmosphere = false)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
|
||||
@ -47,7 +47,11 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
||||
var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI);
|
||||
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||
|
||||
API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant());
|
||||
string fallbackKey = "defaultplanet";
|
||||
if (isStar) fallbackKey = "defaultstar";
|
||||
else if (hasAtmosphere) fallbackKey = "defaultplanetatmosphere";
|
||||
|
||||
API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant(), fallbackKey);
|
||||
}
|
||||
|
||||
public static void OnStarSystemLoaded(string name)
|
||||
@ -59,7 +63,7 @@ namespace NewHorizons.OtherMods.OWRichPresence
|
||||
var localizedName = ShipLogStarChartMode.UniqueIDToName(name);
|
||||
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
|
||||
|
||||
API.SetCurrentRootPresence(message, "sun");
|
||||
API.SetCurrentRootPresence(message, "newhorizons");
|
||||
}
|
||||
|
||||
public static void OnChangeStarSystem(string destination)
|
||||
|
||||
@ -2715,6 +2715,20 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/PriorityVolumeInfo"
|
||||
}
|
||||
},
|
||||
"solarSystemVolume": {
|
||||
"type": "array",
|
||||
"description": "Entering this volume will load a new solar system.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ChangeStarSystemVolumeInfo"
|
||||
}
|
||||
},
|
||||
"creditsVolume": {
|
||||
"type": "array",
|
||||
"description": "Enter this volume to be sent to the end credits scene",
|
||||
"items": {
|
||||
"$ref": "#/definitions/LoadCreditsVolumeInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -3728,6 +3742,85 @@
|
||||
"default": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"ChangeStarSystemVolumeInfo": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"position": {
|
||||
"description": "The location of this volume. Optional (will default to 0,0,0).",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"radius": {
|
||||
"type": "number",
|
||||
"description": "The radius of this volume.",
|
||||
"format": "float",
|
||||
"default": 1.0
|
||||
},
|
||||
"parentPath": {
|
||||
"type": "string",
|
||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||
},
|
||||
"isRelativeToParent": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the positional coordinates are relative to parent instead of the root planet object."
|
||||
},
|
||||
"rename": {
|
||||
"type": "string",
|
||||
"description": "An optional rename of this volume."
|
||||
},
|
||||
"targetStarSystem": {
|
||||
"type": "string",
|
||||
"description": "The star system that entering this volume will send you to.",
|
||||
"default": "SolarSystem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"LoadCreditsVolumeInfo": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"position": {
|
||||
"description": "The location of this volume. Optional (will default to 0,0,0).",
|
||||
"$ref": "#/definitions/MVector3"
|
||||
},
|
||||
"radius": {
|
||||
"type": "number",
|
||||
"description": "The radius of this volume.",
|
||||
"format": "float",
|
||||
"default": 1.0
|
||||
},
|
||||
"parentPath": {
|
||||
"type": "string",
|
||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||
},
|
||||
"isRelativeToParent": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the positional coordinates are relative to parent instead of the root planet object."
|
||||
},
|
||||
"rename": {
|
||||
"type": "string",
|
||||
"description": "An optional rename of this volume."
|
||||
},
|
||||
"creditsType": {
|
||||
"default": "fast",
|
||||
"$ref": "#/definitions/CreditsType"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CreditsType": {
|
||||
"type": "string",
|
||||
"description": "",
|
||||
"x-enumNames": [
|
||||
"Fast",
|
||||
"Final",
|
||||
"Kazoo"
|
||||
],
|
||||
"enum": [
|
||||
"fast",
|
||||
"final",
|
||||
"kazoo"
|
||||
]
|
||||
}
|
||||
},
|
||||
"$docs": {
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
|
||||
"name": "New Horizons",
|
||||
"uniqueName": "xen.NewHorizons",
|
||||
"version": "1.8.5",
|
||||
"version": "1.8.6",
|
||||
"owmlVersion": "2.9.0",
|
||||
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
|
||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],
|
||||
"pathsToPreserve": [ "planets", "systems", "translations" ]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user