diff --git a/NewHorizons/AchievementsPlus/AchievementHandler.cs b/NewHorizons/AchievementsPlus/AchievementHandler.cs new file mode 100644 index 00000000..12fe2f6d --- /dev/null +++ b/NewHorizons/AchievementsPlus/AchievementHandler.cs @@ -0,0 +1,49 @@ +using NewHorizons.Utility; +using OWML.ModHelper; +using System; + +namespace NewHorizons.AchievementsPlus +{ + public static class AchievementHandler + { + private static bool _enabled; + private static IAchievements API; + + public static void Init() + { + API = Main.Instance.ModHelper.Interaction.TryGetModApi("xen.AchievementTracker"); + + if (API == null) + { + Logger.Log("Achievements+ isn't installed"); + _enabled = false; + return; + } + + _enabled = true; + + // Register base NH achievements + NH.WarpDriveAchievement.Init(); + NH.MultipleSystemAchievement.Init(); + NH.EatenOutsideBrambleAchievement.Init(); + NH.NewFrequencyAchievement.Init(); + NH.ProbeLostAchievement.Init(); + + API.RegisterTranslationsFromFiles(Main.Instance, "Assets/translations"); + } + + public static void Earn(string unique_id) + { + if (!_enabled) return; + + API.EarnAchievement(unique_id); + } + + public static void Register(string unique_id, bool secret, ModBehaviour mod) + { + if (!_enabled) return; + + API.RegisterAchievement(unique_id, secret, mod); + } + } +} diff --git a/NewHorizons/AchievementsPlus/IAchievements.cs b/NewHorizons/AchievementsPlus/IAchievements.cs new file mode 100644 index 00000000..351acbbf --- /dev/null +++ b/NewHorizons/AchievementsPlus/IAchievements.cs @@ -0,0 +1,12 @@ +using OWML.ModHelper; + +namespace NewHorizons.AchievementsPlus +{ + public interface IAchievements + { + void RegisterAchievement(string uniqueID, bool secret, ModBehaviour mod); + void RegisterTranslation(string uniqueID, TextTranslation.Language language, string name, string description); + void RegisterTranslationsFromFiles(ModBehaviour mod, string folderPath); + void EarnAchievement(string uniqueID); + } +} diff --git a/NewHorizons/AchievementsPlus/NH/EatenOutsideBrambleAchievement.cs b/NewHorizons/AchievementsPlus/NH/EatenOutsideBrambleAchievement.cs new file mode 100644 index 00000000..8df509ce --- /dev/null +++ b/NewHorizons/AchievementsPlus/NH/EatenOutsideBrambleAchievement.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.AchievementsPlus.NH +{ + public static class EatenOutsideBrambleAchievement + { + public static readonly string UNIQUE_ID = "NH_EATEN_OUTSIDE_BRAMBLE"; + + public static void Init() + { + AchievementHandler.Register(UNIQUE_ID, false, Main.Instance); + GlobalMessenger.AddListener("PlayerDeath", OnPlayerDeath); + } + + public static void OnPlayerDeath(DeathType death) + { + if (death == DeathType.Digestion && !PlayerState.InBrambleDimension()) AchievementHandler.Earn(UNIQUE_ID); + } + } +} diff --git a/NewHorizons/AchievementsPlus/NH/MultipleSystemAchievement.cs b/NewHorizons/AchievementsPlus/NH/MultipleSystemAchievement.cs new file mode 100644 index 00000000..f2ae29c5 --- /dev/null +++ b/NewHorizons/AchievementsPlus/NH/MultipleSystemAchievement.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.AchievementsPlus.NH +{ + public static class MultipleSystemAchievement + { + public static readonly string UNIQUE_ID = "NH_MULTIPLE_SYSTEM"; + + private static List _uniqueSystems = new List(); + + public static void Init() + { + AchievementHandler.Register(UNIQUE_ID, false, Main.Instance); + Main.Instance.OnChangeStarSystem.AddListener(OnChangeStarSystem); + GlobalMessenger.AddListener("PlayerDeath", OnPlayerDeath); + } + + public static void OnPlayerDeath(DeathType _) + { + if (Main.Instance.IsChangingStarSystem) return; + + _uniqueSystems.Clear(); + } + + public static void OnChangeStarSystem(string system) + { + if (_uniqueSystems.Contains(system)) return; + _uniqueSystems.Add(system); + if(_uniqueSystems.Count > 5) + { + AchievementHandler.Earn(UNIQUE_ID); + _uniqueSystems.Clear(); + } + } + } +} diff --git a/NewHorizons/AchievementsPlus/NH/NewFrequencyAchievement.cs b/NewHorizons/AchievementsPlus/NH/NewFrequencyAchievement.cs new file mode 100644 index 00000000..7cde8861 --- /dev/null +++ b/NewHorizons/AchievementsPlus/NH/NewFrequencyAchievement.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.AchievementsPlus.NH +{ + public static class NewFrequencyAchievement + { + public static readonly string UNIQUE_ID = "NH_NEW_FREQ"; + + public static void Init() + { + AchievementHandler.Register(UNIQUE_ID, false, Main.Instance); + } + + public static void Earn() + { + AchievementHandler.Earn(UNIQUE_ID); + } + } +} diff --git a/NewHorizons/AchievementsPlus/NH/ProbeLostAchievement.cs b/NewHorizons/AchievementsPlus/NH/ProbeLostAchievement.cs new file mode 100644 index 00000000..9ddef4b8 --- /dev/null +++ b/NewHorizons/AchievementsPlus/NH/ProbeLostAchievement.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.AchievementsPlus.NH +{ + public static class ProbeLostAchievement + { + public static readonly string UNIQUE_ID = "NH_PROBE_LOST"; + + public static void Init() + { + AchievementHandler.Register(UNIQUE_ID, false, Main.Instance); + } + + public static void Earn() + { + AchievementHandler.Earn(UNIQUE_ID); + } + } +} diff --git a/NewHorizons/AchievementsPlus/NH/WarpDriveAchievement.cs b/NewHorizons/AchievementsPlus/NH/WarpDriveAchievement.cs new file mode 100644 index 00000000..e697891b --- /dev/null +++ b/NewHorizons/AchievementsPlus/NH/WarpDriveAchievement.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.AchievementsPlus.NH +{ + public static class WarpDriveAchievement + { + public static readonly string UNIQUE_ID = "NH_WARP_DRIVE"; + + public static void Init() + { + AchievementHandler.Register(UNIQUE_ID, false, Main.Instance); + Main.Instance.OnChangeStarSystem.AddListener(OnChangeStarSystem); + } + + private static void OnChangeStarSystem(string system) + { + if (Main.Instance.IsWarping) AchievementHandler.Earn(UNIQUE_ID); + } + } +} diff --git a/NewHorizons/AssetBundle/DefaultMapModNoAtmo.png b/NewHorizons/Assets/DefaultMapModNoAtmo.png similarity index 100% rename from NewHorizons/AssetBundle/DefaultMapModNoAtmo.png rename to NewHorizons/Assets/DefaultMapModNoAtmo.png diff --git a/NewHorizons/AssetBundle/DefaultMapModePlanet.png b/NewHorizons/Assets/DefaultMapModePlanet.png similarity index 100% rename from NewHorizons/AssetBundle/DefaultMapModePlanet.png rename to NewHorizons/Assets/DefaultMapModePlanet.png diff --git a/NewHorizons/AssetBundle/DefaultMapModeStar.png b/NewHorizons/Assets/DefaultMapModeStar.png similarity index 100% rename from NewHorizons/AssetBundle/DefaultMapModeStar.png rename to NewHorizons/Assets/DefaultMapModeStar.png diff --git a/NewHorizons/AssetBundle/WarpDriveConfig.json b/NewHorizons/Assets/WarpDriveConfig.json similarity index 89% rename from NewHorizons/AssetBundle/WarpDriveConfig.json rename to NewHorizons/Assets/WarpDriveConfig.json index 982af456..1821c6e3 100644 --- a/NewHorizons/AssetBundle/WarpDriveConfig.json +++ b/NewHorizons/Assets/WarpDriveConfig.json @@ -8,7 +8,7 @@ "position":{"x": -0.3071011, "y": 2.741472, "z": -4.005298}, "radius": 0, "remoteTriggerRadius": 1, - "xmlFile":"AssetBundle/WarpDriveDialogue.xml", + "xmlFile":"Assets/WarpDriveDialogue.xml", "remoteTriggerPosition": {"x": -0.05656214, "y": 0.5362684, "z": 0.5467669}, "blockAfterPersistentCondition" : "KnowsAboutWarpDrive" } diff --git a/NewHorizons/AssetBundle/WarpDriveDialogue.xml b/NewHorizons/Assets/WarpDriveDialogue.xml similarity index 100% rename from NewHorizons/AssetBundle/WarpDriveDialogue.xml rename to NewHorizons/Assets/WarpDriveDialogue.xml diff --git a/NewHorizons/AssetBundle/hearthian system.png b/NewHorizons/Assets/hearthian system.png similarity index 100% rename from NewHorizons/AssetBundle/hearthian system.png rename to NewHorizons/Assets/hearthian system.png diff --git a/NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png b/NewHorizons/Assets/textures/Clouds_Bottom_ramp.png similarity index 100% rename from NewHorizons/AssetBundle/textures/Clouds_Bottom_ramp.png rename to NewHorizons/Assets/textures/Clouds_Bottom_ramp.png diff --git a/NewHorizons/AssetBundle/textures/Effects_SUN_Supernova_d.png b/NewHorizons/Assets/textures/Effects_SUN_Supernova_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/Effects_SUN_Supernova_d.png rename to NewHorizons/Assets/textures/Effects_SUN_Supernova_d.png diff --git a/NewHorizons/AssetBundle/textures/FogColorRamp.png b/NewHorizons/Assets/textures/FogColorRamp.png similarity index 100% rename from NewHorizons/AssetBundle/textures/FogColorRamp.png rename to NewHorizons/Assets/textures/FogColorRamp.png diff --git a/NewHorizons/AssetBundle/textures/OceanEntry_PlayerShip_d.png b/NewHorizons/Assets/textures/OceanEntry_PlayerShip_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/OceanEntry_PlayerShip_d.png rename to NewHorizons/Assets/textures/OceanEntry_PlayerShip_d.png diff --git a/NewHorizons/AssetBundle/textures/OceanEntry_PlayerShip_d_greyscale.png b/NewHorizons/Assets/textures/OceanEntry_PlayerShip_d_greyscale.png similarity index 100% rename from NewHorizons/AssetBundle/textures/OceanEntry_PlayerShip_d_greyscale.png rename to NewHorizons/Assets/textures/OceanEntry_PlayerShip_d_greyscale.png diff --git a/NewHorizons/AssetBundle/textures/OceanExit_PlayerShip_d.png b/NewHorizons/Assets/textures/OceanExit_PlayerShip_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/OceanExit_PlayerShip_d.png rename to NewHorizons/Assets/textures/OceanExit_PlayerShip_d.png diff --git a/NewHorizons/AssetBundle/textures/OceanExit_PlayerShip_d_greyscale.png b/NewHorizons/Assets/textures/OceanExit_PlayerShip_d_greyscale.png similarity index 100% rename from NewHorizons/AssetBundle/textures/OceanExit_PlayerShip_d_greyscale.png rename to NewHorizons/Assets/textures/OceanExit_PlayerShip_d_greyscale.png diff --git a/NewHorizons/AssetBundle/textures/Splash_GD_Island2_d.png b/NewHorizons/Assets/textures/Splash_GD_Island2_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/Splash_GD_Island2_d.png rename to NewHorizons/Assets/textures/Splash_GD_Island2_d.png diff --git a/NewHorizons/AssetBundle/textures/StarColorOverTime.png b/NewHorizons/Assets/textures/StarColorOverTime.png similarity index 100% rename from NewHorizons/AssetBundle/textures/StarColorOverTime.png rename to NewHorizons/Assets/textures/StarColorOverTime.png diff --git a/NewHorizons/AssetBundle/textures/Tornado_BH_CycloneDetail_d.png b/NewHorizons/Assets/textures/Tornado_BH_CycloneDetail_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/Tornado_BH_CycloneDetail_d.png rename to NewHorizons/Assets/textures/Tornado_BH_CycloneDetail_d.png diff --git a/NewHorizons/AssetBundle/textures/Tornado_BH_Cyclone_02_d.png b/NewHorizons/Assets/textures/Tornado_BH_Cyclone_02_d.png similarity index 100% rename from NewHorizons/AssetBundle/textures/Tornado_BH_Cyclone_02_d.png rename to NewHorizons/Assets/textures/Tornado_BH_Cyclone_02_d.png diff --git a/NewHorizons/AssetBundle/translations/english.json b/NewHorizons/Assets/translations/english.json similarity index 56% rename from NewHorizons/AssetBundle/translations/english.json rename to NewHorizons/Assets/translations/english.json index ddd88a5b..97b34535 100644 --- a/NewHorizons/AssetBundle/translations/english.json +++ b/NewHorizons/Assets/translations/english.json @@ -14,5 +14,27 @@ "FREQ_UNKNOWN" : "???", "ENGAGE_WARP_PROMPT" : "Engage Warp To {0}", "WARP_LOCKED" : "AUTOPILOT LOCKED TO:\n{0}" - } + }, + "AchievementTranslations": { + "NH_EATEN_OUTSIDE_BRAMBLE" : { + "Name": "Containment Breach", + "Description": "Get eaten outside of Dark Bramble" + }, + "NH_MULTIPLE_SYSTEM" : { + "Name": "Traveller", + "Description": "Visit 5 unique star systems in a row." + }, + "NH_NEW_FREQ" : { + "Name": "Anomalous Frequencies", + "Description": "Discover a new frequency." + }, + "NH_PROBE_LOST" : { + "Name": "Connection Lost", + "Description": "Lose your little scout." + }, + "NH_WARP_DRIVE": { + "Name": "Lore Inaccurate", + "Description": "Use your ship's warp drive." + } + } } \ No newline at end of file diff --git a/NewHorizons/AssetBundle/translations/french.json b/NewHorizons/Assets/translations/french.json similarity index 100% rename from NewHorizons/AssetBundle/translations/french.json rename to NewHorizons/Assets/translations/french.json diff --git a/NewHorizons/AssetBundle/translations/german.json b/NewHorizons/Assets/translations/german.json similarity index 100% rename from NewHorizons/AssetBundle/translations/german.json rename to NewHorizons/Assets/translations/german.json diff --git a/NewHorizons/AssetBundle/translations/russian.json b/NewHorizons/Assets/translations/russian.json similarity index 100% rename from NewHorizons/AssetBundle/translations/russian.json rename to NewHorizons/Assets/translations/russian.json diff --git a/NewHorizons/AssetBundle/translations/spanish_la.json b/NewHorizons/Assets/translations/spanish_la.json similarity index 100% rename from NewHorizons/AssetBundle/translations/spanish_la.json rename to NewHorizons/Assets/translations/spanish_la.json diff --git a/NewHorizons/AssetBundle/xen.newhorizons b/NewHorizons/Assets/xen.newhorizons similarity index 100% rename from NewHorizons/AssetBundle/xen.newhorizons rename to NewHorizons/Assets/xen.newhorizons diff --git a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs index ae0a3243..fce3ada5 100644 --- a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs @@ -1,227 +1,227 @@ -using NewHorizons.External.Modules; -using NewHorizons.Utility; -using OWML.Common; -using System; -using UnityEngine; -using Logger = NewHorizons.Utility.Logger; -namespace NewHorizons.Builder.Atmosphere -{ - public static class CloudsBuilder - { - private static Shader _sphereShader = null; - private static Material[] _gdCloudMaterials; - private static Material[] _qmCloudMaterials; - private static GameObject _lightningPrefab; - private static Texture2D _colorRamp; - private static readonly int Color1 = Shader.PropertyToID("_Color"); - private static readonly int TintColor = Shader.PropertyToID("_TintColor"); - private static readonly int MainTex = Shader.PropertyToID("_MainTex"); - private static readonly int RampTex = Shader.PropertyToID("_RampTex"); - private static readonly int CapTex = Shader.PropertyToID("_CapTex"); - private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); - - public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod) - { - if (_lightningPrefab == null) _lightningPrefab = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Clouds_GD/LightningGenerator_GD"); - if (_colorRamp == null) _colorRamp = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Clouds_Bottom_ramp.png"); - - GameObject cloudsMainGO = new GameObject("Clouds"); - cloudsMainGO.SetActive(false); - cloudsMainGO.transform.parent = sector?.transform ?? planetGO.transform; - - MakeTopClouds(cloudsMainGO, atmo, mod); - - GameObject cloudsBottomGO = new GameObject("BottomClouds"); - cloudsBottomGO.SetActive(false); - cloudsBottomGO.transform.parent = cloudsMainGO.transform; - cloudsBottomGO.transform.localScale = Vector3.one * atmo.clouds.innerCloudRadius; - - TessellatedSphereRenderer bottomTSR = cloudsBottomGO.AddComponent(); - bottomTSR.tessellationMeshGroup = SearchUtilities.Find("CloudsBottomLayer_QM").GetComponent().tessellationMeshGroup; - var bottomTSRMaterials = SearchUtilities.Find("CloudsBottomLayer_QM").GetComponent().sharedMaterials; - - // If they set a colour apply it to all the materials else keep the default QM one - if (atmo.clouds.tint != null) - { - var bottomColor = atmo.clouds.tint.ToColor(); - - var bottomTSRTempArray = new Material[2]; - - bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]); - bottomTSRTempArray[0].SetColor(Color1, bottomColor); - bottomTSRTempArray[0].SetColor(TintColor, bottomColor); - bottomTSRTempArray[0].SetTexture(ColorRamp, ImageUtilities.TintImage(_colorRamp, bottomColor)); - - bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]); - - bottomTSR.sharedMaterials = bottomTSRTempArray; - } - else - { - bottomTSR.sharedMaterials = bottomTSRMaterials; - } - - bottomTSR.maxLOD = 6; - bottomTSR.LODBias = 0; - bottomTSR.LODRadius = 1f; - - TessSphereSectorToggle bottomTSST = cloudsBottomGO.AddComponent(); - bottomTSST._sector = sector; - - GameObject cloudsFluidGO = new GameObject("CloudsFluid"); - cloudsFluidGO.SetActive(false); - cloudsFluidGO.layer = 17; - cloudsFluidGO.transform.parent = cloudsMainGO.transform; - - SphereCollider fluidSC = cloudsFluidGO.AddComponent(); - fluidSC.isTrigger = true; - fluidSC.radius = atmo.size; - - OWShellCollider fluidOWSC = cloudsFluidGO.AddComponent(); - fluidOWSC._innerRadius = atmo.size * 0.9f; - - CloudLayerFluidVolume fluidCLFV = cloudsFluidGO.AddComponent(); - fluidCLFV._layer = 5; - fluidCLFV._priority = 1; - fluidCLFV._density = 1.2f; - - var fluidType = FluidVolume.Type.CLOUD; - - try - { - fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), atmo.clouds.fluidType).ToUpper()); - } - catch (Exception ex) - { - Logger.LogError($"Couldn't parse fluid volume type [{atmo.clouds.fluidType}]: {ex.Message}, {ex.StackTrace}"); - } - - fluidCLFV._fluidType = fluidType; - fluidCLFV._allowShipAutoroll = true; - fluidCLFV._disableOnStart = false; - - // Fix the rotations once the rest is done - cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(0, 0, 0)); - // For the base shader it has to be rotated idk - if (atmo.clouds.cloudsPrefab == CloudPrefabType.Basic) cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0)); - - // Lightning - if (atmo.clouds.hasLightning) - { - var lightning = _lightningPrefab.InstantiateInactive(); - lightning.transform.parent = cloudsMainGO.transform; - lightning.transform.localPosition = Vector3.zero; - - var lightningGenerator = lightning.GetComponent(); - lightningGenerator._altitude = (atmo.clouds.outerCloudRadius + atmo.clouds.innerCloudRadius) / 2f; - lightningGenerator._audioSector = sector; - if (atmo.clouds.lightningGradient != null) - { - var gradient = new GradientColorKey[atmo.clouds.lightningGradient.Length]; - - for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++) - { - var pair = atmo.clouds.lightningGradient[i]; - gradient[i] = new GradientColorKey(pair.tint.ToColor(), pair.time); - } - - lightningGenerator._lightColor.colorKeys = gradient; - } - lightning.SetActive(true); - } - - cloudsMainGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); - cloudsBottomGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); - cloudsFluidGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); - - cloudsBottomGO.SetActive(true); - cloudsFluidGO.SetActive(true); - cloudsMainGO.SetActive(true); - } - - public static GameObject MakeTopClouds(GameObject rootObject, AtmosphereModule atmo, IModBehaviour mod) - { - Color cloudTint = atmo.clouds.tint?.ToColor() ?? Color.white; - - Texture2D image, cap, ramp; - - try - { - image = ImageUtilities.GetTexture(mod, atmo.clouds.texturePath); - - if (atmo.clouds.capPath == null) cap = ImageUtilities.ClearTexture(128, 128); - else cap = ImageUtilities.GetTexture(mod, atmo.clouds.capPath); - if (atmo.clouds.rampPath == null) ramp = ImageUtilities.CanvasScaled(image, 1, image.height); - else ramp = ImageUtilities.GetTexture(mod, atmo.clouds.rampPath); - } - catch (Exception e) - { - Logger.LogError($"Couldn't load Cloud textures for [{rootObject.name}], {e.Message}, {e.StackTrace}"); - return null; - } - - GameObject cloudsTopGO = new GameObject("TopClouds"); - cloudsTopGO.SetActive(false); - cloudsTopGO.transform.parent = rootObject.transform; - cloudsTopGO.transform.localScale = Vector3.one * atmo.clouds.outerCloudRadius; - - MeshFilter topMF = cloudsTopGO.AddComponent(); - topMF.mesh = SearchUtilities.Find("CloudsTopLayer_GD").GetComponent().mesh; - - MeshRenderer topMR = cloudsTopGO.AddComponent(); - - if (_sphereShader == null) _sphereShader = Main.NHAssetBundle.LoadAsset("Assets/Shaders/SphereTextureWrapper.shader"); - if (_gdCloudMaterials == null) _gdCloudMaterials = SearchUtilities.Find("CloudsTopLayer_GD").GetComponent().sharedMaterials; - if (_qmCloudMaterials == null) _qmCloudMaterials = SearchUtilities.Find("CloudsTopLayer_QM").GetComponent().sharedMaterials; - Material[] prefabMaterials = atmo.clouds.cloudsPrefab == CloudPrefabType.GiantsDeep ? _gdCloudMaterials : _qmCloudMaterials; - var tempArray = new Material[2]; - - if (atmo.clouds.cloudsPrefab == CloudPrefabType.Basic) - { - var material = new Material(_sphereShader); - if (atmo.clouds.unlit) material.renderQueue = 2550; - material.name = atmo.clouds.unlit ? "BasicCloud" : "BasicShadowCloud"; - - tempArray[0] = material; - } - else - { - var material = new Material(prefabMaterials[0]); - if (atmo.clouds.unlit) material.renderQueue = 2550; - material.name = atmo.clouds.unlit ? "AdvancedCloud" : "AdvancedShadowCloud"; - tempArray[0] = material; - } - - // This is the stencil material for the fog under the clouds - tempArray[1] = new Material(prefabMaterials[1]); - topMR.sharedMaterials = tempArray; - - foreach (var material in topMR.sharedMaterials) - { - material.SetColor(Color1, cloudTint); - material.SetColor(TintColor, cloudTint); - - material.SetTexture(MainTex, image); - material.SetTexture(RampTex, ramp); - material.SetTexture(CapTex, cap); - } - - if (atmo.clouds.unlit) - { - cloudsTopGO.layer = LayerMask.NameToLayer("IgnoreSun"); - } - - RotateTransform topRT = cloudsTopGO.AddComponent(); - // Idk why but the axis is weird - topRT._localAxis = atmo.clouds.cloudsPrefab == CloudPrefabType.Basic ? Vector3.forward : Vector3.up; - topRT._degreesPerSecond = 10; - topRT._randomizeRotationRate = false; - - cloudsTopGO.transform.localPosition = Vector3.zero; - - cloudsTopGO.SetActive(true); - - return cloudsTopGO; - } - } -} +using NewHorizons.External.Modules; +using NewHorizons.Utility; +using OWML.Common; +using System; +using UnityEngine; +using Logger = NewHorizons.Utility.Logger; +namespace NewHorizons.Builder.Atmosphere +{ + public static class CloudsBuilder + { + private static Shader _sphereShader = null; + private static Material[] _gdCloudMaterials; + private static Material[] _qmCloudMaterials; + private static GameObject _lightningPrefab; + private static Texture2D _colorRamp; + private static readonly int Color1 = Shader.PropertyToID("_Color"); + private static readonly int TintColor = Shader.PropertyToID("_TintColor"); + private static readonly int MainTex = Shader.PropertyToID("_MainTex"); + private static readonly int RampTex = Shader.PropertyToID("_RampTex"); + private static readonly int CapTex = Shader.PropertyToID("_CapTex"); + private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); + + public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, IModBehaviour mod) + { + if (_lightningPrefab == null) _lightningPrefab = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Clouds_GD/LightningGenerator_GD"); + if (_colorRamp == null) _colorRamp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/Clouds_Bottom_ramp.png"); + + GameObject cloudsMainGO = new GameObject("Clouds"); + cloudsMainGO.SetActive(false); + cloudsMainGO.transform.parent = sector?.transform ?? planetGO.transform; + + MakeTopClouds(cloudsMainGO, atmo, mod); + + GameObject cloudsBottomGO = new GameObject("BottomClouds"); + cloudsBottomGO.SetActive(false); + cloudsBottomGO.transform.parent = cloudsMainGO.transform; + cloudsBottomGO.transform.localScale = Vector3.one * atmo.clouds.innerCloudRadius; + + TessellatedSphereRenderer bottomTSR = cloudsBottomGO.AddComponent(); + bottomTSR.tessellationMeshGroup = SearchUtilities.Find("CloudsBottomLayer_QM").GetComponent().tessellationMeshGroup; + var bottomTSRMaterials = SearchUtilities.Find("CloudsBottomLayer_QM").GetComponent().sharedMaterials; + + // If they set a colour apply it to all the materials else keep the default QM one + if (atmo.clouds.tint != null) + { + var bottomColor = atmo.clouds.tint.ToColor(); + + var bottomTSRTempArray = new Material[2]; + + bottomTSRTempArray[0] = new Material(bottomTSRMaterials[0]); + bottomTSRTempArray[0].SetColor(Color1, bottomColor); + bottomTSRTempArray[0].SetColor(TintColor, bottomColor); + bottomTSRTempArray[0].SetTexture(ColorRamp, ImageUtilities.TintImage(_colorRamp, bottomColor)); + + bottomTSRTempArray[1] = new Material(bottomTSRMaterials[1]); + + bottomTSR.sharedMaterials = bottomTSRTempArray; + } + else + { + bottomTSR.sharedMaterials = bottomTSRMaterials; + } + + bottomTSR.maxLOD = 6; + bottomTSR.LODBias = 0; + bottomTSR.LODRadius = 1f; + + TessSphereSectorToggle bottomTSST = cloudsBottomGO.AddComponent(); + bottomTSST._sector = sector; + + GameObject cloudsFluidGO = new GameObject("CloudsFluid"); + cloudsFluidGO.SetActive(false); + cloudsFluidGO.layer = 17; + cloudsFluidGO.transform.parent = cloudsMainGO.transform; + + SphereCollider fluidSC = cloudsFluidGO.AddComponent(); + fluidSC.isTrigger = true; + fluidSC.radius = atmo.size; + + OWShellCollider fluidOWSC = cloudsFluidGO.AddComponent(); + fluidOWSC._innerRadius = atmo.size * 0.9f; + + CloudLayerFluidVolume fluidCLFV = cloudsFluidGO.AddComponent(); + fluidCLFV._layer = 5; + fluidCLFV._priority = 1; + fluidCLFV._density = 1.2f; + + var fluidType = FluidVolume.Type.CLOUD; + + try + { + fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), atmo.clouds.fluidType).ToUpper()); + } + catch (Exception ex) + { + Logger.LogError($"Couldn't parse fluid volume type [{atmo.clouds.fluidType}]: {ex.Message}, {ex.StackTrace}"); + } + + fluidCLFV._fluidType = fluidType; + fluidCLFV._allowShipAutoroll = true; + fluidCLFV._disableOnStart = false; + + // Fix the rotations once the rest is done + cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(0, 0, 0)); + // For the base shader it has to be rotated idk + if (atmo.clouds.cloudsPrefab == CloudPrefabType.Basic) cloudsMainGO.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0)); + + // Lightning + if (atmo.clouds.hasLightning) + { + var lightning = _lightningPrefab.InstantiateInactive(); + lightning.transform.parent = cloudsMainGO.transform; + lightning.transform.localPosition = Vector3.zero; + + var lightningGenerator = lightning.GetComponent(); + lightningGenerator._altitude = (atmo.clouds.outerCloudRadius + atmo.clouds.innerCloudRadius) / 2f; + lightningGenerator._audioSector = sector; + if (atmo.clouds.lightningGradient != null) + { + var gradient = new GradientColorKey[atmo.clouds.lightningGradient.Length]; + + for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++) + { + var pair = atmo.clouds.lightningGradient[i]; + gradient[i] = new GradientColorKey(pair.tint.ToColor(), pair.time); + } + + lightningGenerator._lightColor.colorKeys = gradient; + } + lightning.SetActive(true); + } + + cloudsMainGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); + cloudsBottomGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); + cloudsFluidGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero); + + cloudsBottomGO.SetActive(true); + cloudsFluidGO.SetActive(true); + cloudsMainGO.SetActive(true); + } + + public static GameObject MakeTopClouds(GameObject rootObject, AtmosphereModule atmo, IModBehaviour mod) + { + Color cloudTint = atmo.clouds.tint?.ToColor() ?? Color.white; + + Texture2D image, cap, ramp; + + try + { + image = ImageUtilities.GetTexture(mod, atmo.clouds.texturePath); + + if (atmo.clouds.capPath == null) cap = ImageUtilities.ClearTexture(128, 128); + else cap = ImageUtilities.GetTexture(mod, atmo.clouds.capPath); + if (atmo.clouds.rampPath == null) ramp = ImageUtilities.CanvasScaled(image, 1, image.height); + else ramp = ImageUtilities.GetTexture(mod, atmo.clouds.rampPath); + } + catch (Exception e) + { + Logger.LogError($"Couldn't load Cloud textures for [{rootObject.name}], {e.Message}, {e.StackTrace}"); + return null; + } + + GameObject cloudsTopGO = new GameObject("TopClouds"); + cloudsTopGO.SetActive(false); + cloudsTopGO.transform.parent = rootObject.transform; + cloudsTopGO.transform.localScale = Vector3.one * atmo.clouds.outerCloudRadius; + + MeshFilter topMF = cloudsTopGO.AddComponent(); + topMF.mesh = SearchUtilities.Find("CloudsTopLayer_GD").GetComponent().mesh; + + MeshRenderer topMR = cloudsTopGO.AddComponent(); + + if (_sphereShader == null) _sphereShader = Main.NHAssetBundle.LoadAsset("Assets/Shaders/SphereTextureWrapper.shader"); + if (_gdCloudMaterials == null) _gdCloudMaterials = SearchUtilities.Find("CloudsTopLayer_GD").GetComponent().sharedMaterials; + if (_qmCloudMaterials == null) _qmCloudMaterials = SearchUtilities.Find("CloudsTopLayer_QM").GetComponent().sharedMaterials; + Material[] prefabMaterials = atmo.clouds.cloudsPrefab == CloudPrefabType.GiantsDeep ? _gdCloudMaterials : _qmCloudMaterials; + var tempArray = new Material[2]; + + if (atmo.clouds.cloudsPrefab == CloudPrefabType.Basic) + { + var material = new Material(_sphereShader); + if (atmo.clouds.unlit) material.renderQueue = 2550; + material.name = atmo.clouds.unlit ? "BasicCloud" : "BasicShadowCloud"; + + tempArray[0] = material; + } + else + { + var material = new Material(prefabMaterials[0]); + if (atmo.clouds.unlit) material.renderQueue = 2550; + material.name = atmo.clouds.unlit ? "AdvancedCloud" : "AdvancedShadowCloud"; + tempArray[0] = material; + } + + // This is the stencil material for the fog under the clouds + tempArray[1] = new Material(prefabMaterials[1]); + topMR.sharedMaterials = tempArray; + + foreach (var material in topMR.sharedMaterials) + { + material.SetColor(Color1, cloudTint); + material.SetColor(TintColor, cloudTint); + + material.SetTexture(MainTex, image); + material.SetTexture(RampTex, ramp); + material.SetTexture(CapTex, cap); + } + + if (atmo.clouds.unlit) + { + cloudsTopGO.layer = LayerMask.NameToLayer("IgnoreSun"); + } + + RotateTransform topRT = cloudsTopGO.AddComponent(); + // Idk why but the axis is weird + topRT._localAxis = atmo.clouds.cloudsPrefab == CloudPrefabType.Basic ? Vector3.forward : Vector3.up; + topRT._degreesPerSecond = 10; + topRT._randomizeRotationRate = false; + + cloudsTopGO.transform.localPosition = Vector3.zero; + + cloudsTopGO.SetActive(true); + + return cloudsTopGO; + } + } +} diff --git a/NewHorizons/Builder/Atmosphere/FogBuilder.cs b/NewHorizons/Builder/Atmosphere/FogBuilder.cs index 4eae1a82..687f6a0b 100644 --- a/NewHorizons/Builder/Atmosphere/FogBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/FogBuilder.cs @@ -9,7 +9,7 @@ namespace NewHorizons.Builder.Atmosphere public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo) { - if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/FogColorRamp.png"); + if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png"); GameObject fogGO = new GameObject("FogSphere"); fogGO.SetActive(false); diff --git a/NewHorizons/Builder/Body/CloakBuilder.cs b/NewHorizons/Builder/Body/CloakBuilder.cs index ab18f6bf..ddb60013 100644 --- a/NewHorizons/Builder/Body/CloakBuilder.cs +++ b/NewHorizons/Builder/Body/CloakBuilder.cs @@ -12,16 +12,26 @@ namespace NewHorizons.Builder.Body var radius = module.radius; AudioClip clip = null; - if (module.audioClip != null) clip = SearchUtilities.FindResourceOfTypeAndName(module.audioClip); - else if (module.audioFilePath != null) + if (!string.IsNullOrEmpty(module.audioClip)) + { + clip = SearchUtilities.FindResourceOfTypeAndName(module.audioClip); + + if (clip == null) + { + Utility.Logger.LogError($"Couldn't get audio from clip [{module.audioClip}]"); + } + } + else if (!string.IsNullOrEmpty(module.audioFilePath)) { try { clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + module.audioFilePath); } - catch (System.Exception e) + catch { } + + if (clip == null) { - Utility.Logger.LogError($"Couldn't load audio file {module.audioFilePath} : {e.Message}"); + Utility.Logger.LogError($"Couldn't get audio from file [{module.audioFilePath}]"); } } diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index b722e6fe..ec728ead 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -177,7 +177,7 @@ namespace NewHorizons.Builder.Body public static GameObject MakeStarGraphics(GameObject rootObject, Sector sector, StarModule starModule) { - if (_colorOverTime == null) _colorOverTime = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/StarColorOverTime.png"); + if (_colorOverTime == null) _colorOverTime = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/StarColorOverTime.png"); var starGO = new GameObject("Star"); starGO.transform.parent = sector?.transform ?? rootObject.transform; @@ -253,7 +253,7 @@ namespace NewHorizons.Builder.Body var colour = starModule.supernovaTint.ToColor(); var supernovaMaterial = new Material(supernova._supernovaMaterial); - var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Effects_SUN_Supernova_d.png"), Color.white, colour); + var ramp = ImageUtilities.LerpGreyscaleImage(ImageUtilities.GetTexture(Main.Instance, "Assets/textures/Effects_SUN_Supernova_d.png"), Color.white, colour); supernovaMaterial.SetTexture(ColorRamp, ramp); supernova._supernovaMaterial = supernovaMaterial; diff --git a/NewHorizons/Builder/General/GravityBuilder.cs b/NewHorizons/Builder/General/GravityBuilder.cs index 95f8a886..1a61f0f3 100644 --- a/NewHorizons/Builder/General/GravityBuilder.cs +++ b/NewHorizons/Builder/General/GravityBuilder.cs @@ -18,7 +18,7 @@ namespace NewHorizons.Builder.General // To let you actually orbit things the way you would expect we cap this at 4x the diameter if its not a star or black hole (this is what giants deep has) if (config.Star == null && config.Singularity == null) gravityRadius = Mathf.Min(gravityRadius, 4 * config.Base.surfaceSize); else gravityRadius = Mathf.Min(gravityRadius, 15 * config.Base.surfaceSize); - if (config.Base.sphereOfInfluence != 0f) gravityRadius = config.Base.sphereOfInfluence; + if (config.Base.soiOverride != 0f) gravityRadius = config.Base.soiOverride; var gravityGO = new GameObject("GravityWell"); gravityGO.transform.parent = planetGO.transform; diff --git a/NewHorizons/Builder/General/RFVolumeBuilder.cs b/NewHorizons/Builder/General/RFVolumeBuilder.cs index 178234e4..1d4815a9 100644 --- a/NewHorizons/Builder/General/RFVolumeBuilder.cs +++ b/NewHorizons/Builder/General/RFVolumeBuilder.cs @@ -15,6 +15,7 @@ namespace NewHorizons.Builder.General var SC = rfGO.AddComponent(); SC.isTrigger = true; + // This radius ends up being set by min and max collider radius on the RFV but we set it anyway because why fix what aint broke SC.radius = sphereOfInfluence * 2; var RFV = rfGO.AddComponent(); @@ -23,7 +24,8 @@ namespace NewHorizons.Builder.General var RV = new ReferenceFrame(owrb); RV._minSuitTargetDistance = minTargetDistance; - RV._maxTargetDistance = 0; + // The game raycasts to 100km, but if the target is farther than this max distance it ignores it + RV._maxTargetDistance = module.maxTargetDistance; RV._autopilotArrivalDistance = 2.0f * sphereOfInfluence; RV._autoAlignmentDistance = sphereOfInfluence * 1.5f; @@ -35,7 +37,7 @@ namespace NewHorizons.Builder.General RFV._referenceFrame = RV; RFV._minColliderRadius = minTargetDistance; - RFV._maxColliderRadius = module.maxTargetDistance > -1 ? module.maxTargetDistance : sphereOfInfluence * 2f; + RFV._maxColliderRadius = module.targetColliderRadius > 0 ? module.targetColliderRadius : sphereOfInfluence * 2f; RFV._isPrimaryVolume = true; RFV._isCloseRangeVolume = false; diff --git a/NewHorizons/Builder/Orbital/FocalPointBuilder.cs b/NewHorizons/Builder/Orbital/FocalPointBuilder.cs index 98a51bd9..18b055f1 100644 --- a/NewHorizons/Builder/Orbital/FocalPointBuilder.cs +++ b/NewHorizons/Builder/Orbital/FocalPointBuilder.cs @@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Orbital // Other stuff to make the fake barycenter not interact with anything in any way fakeMassConfig.name = config.name + "_FakeBarycenterMass"; - fakeMassConfig.Base.sphereOfInfluence = 0; + fakeMassConfig.Base.soiOverride = 0; fakeMassConfig.Base.hasMapMarker = false; fakeMassConfig.ReferenceFrame.hideInMap = true; diff --git a/NewHorizons/Builder/Props/SignalBuilder.cs b/NewHorizons/Builder/Props/SignalBuilder.cs index 097ea6cb..856e57d6 100644 --- a/NewHorizons/Builder/Props/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/SignalBuilder.cs @@ -153,17 +153,14 @@ namespace NewHorizons.Builder.Props var name = StringToSignalName(info.name); AudioClip clip = null; - if (info.audioClip != null) clip = SearchUtilities.FindResourceOfTypeAndName(info.audioClip); - else if (info.audioFilePath != null) + if (!string.IsNullOrEmpty(info.audioClip)) clip = SearchUtilities.FindResourceOfTypeAndName(info.audioClip); + else if (!string.IsNullOrEmpty(info.audioFilePath)) { try { clip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + info.audioFilePath); } - catch (Exception e) - { - Logger.LogError($"Couldn't load audio file {info.audioFilePath} : {e.Message}"); - } + catch { } } if (clip == null) diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index 843923c9..22b8ff20 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -55,11 +55,11 @@ namespace NewHorizons.Builder.Props } if (_mainTexture == null) { - _mainTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Tornado_BH_Cyclone_02_d.png"); + _mainTexture = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/Tornado_BH_Cyclone_02_d.png"); } if (_detailTexture == null) { - _detailTexture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/textures/Tornado_BH_CycloneDetail_d.png"); + _detailTexture = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/Tornado_BH_CycloneDetail_d.png"); } Vector3 position; @@ -109,16 +109,20 @@ namespace NewHorizons.Builder.Props var audioSpreadController = soundGO.GetComponentInChildren(); audioSpreadController.SetSector(sector); - var audioSource = audioRail._audioTransform.GetComponent(); + var audioSource = audioRail._audioTransform.GetComponent(); audioSource.playOnAwake = true; var scale = info.height == 0 ? 1 : info.height / 10f; tornadoGO.transform.localScale = Vector3.one * scale; // Resize the distance it can be heard from to match roughly with the size - var maxDistance = info.audioDistance == 0 ? 10 * scale : info.audioDistance; - audioSource.maxDistance = maxDistance; - audioSource.minDistance = maxDistance / 10f; + var maxDistance = info.audioDistance; + if (maxDistance <= 0) maxDistance = scale * 10f; + Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => + { + audioSource.maxDistance = maxDistance; + audioSource.minDistance = maxDistance / 10f; + }); var controller = tornadoGO.GetComponent(); controller.SetSector(sector); diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index 157ff721..06be3068 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -506,9 +506,9 @@ namespace NewHorizons.Builder.ShipLog { Texture2D texture; - if (body.Config.Star != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModeStar.png"); - else if (body.Config.Atmosphere != null) texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModNoAtmo.png"); - else texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/DefaultMapModePlanet.png"); + if (body.Config.Star != null) texture = ImageUtilities.GetTexture(Main.Instance, "Assets/DefaultMapModeStar.png"); + else if (body.Config.Atmosphere != null) texture = ImageUtilities.GetTexture(Main.Instance, "Assets/DefaultMapModNoAtmo.png"); + else texture = ImageUtilities.GetTexture(Main.Instance, "Assets/DefaultMapModePlanet.png"); var color = GetDominantPlanetColor(body); var darkColor = new Color(color.r / 3f, color.g / 3f, color.b / 3f); diff --git a/NewHorizons/Components/BlackHoleDestructionVolume.cs b/NewHorizons/Components/BlackHoleDestructionVolume.cs index 8a24f510..4ed3d759 100644 --- a/NewHorizons/Components/BlackHoleDestructionVolume.cs +++ b/NewHorizons/Components/BlackHoleDestructionVolume.cs @@ -1,4 +1,6 @@ -namespace NewHorizons.Components +using NewHorizons.AchievementsPlus.NH; + +namespace NewHorizons.Components { public class BlackHoleDestructionVolume : DestructionVolume { @@ -14,6 +16,7 @@ if (requiredComponent.IsLaunched()) { UnityEngine.Object.Destroy(requiredComponent.gameObject); + ProbeLostAchievement.Earn(); } } } diff --git a/NewHorizons/Components/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLogStarChartMode.cs index 1b25d99b..2d568bd6 100644 --- a/NewHorizons/Components/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLogStarChartMode.cs @@ -128,7 +128,7 @@ namespace NewHorizons.Components { if (uniqueID.Equals("SolarSystem")) { - texture = ImageUtilities.GetTexture(Main.Instance, "AssetBundle/hearthian system.png"); + texture = ImageUtilities.GetTexture(Main.Instance, "Assets/hearthian system.png"); } else { diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index 84c851a9..6b03aed7 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -238,16 +238,17 @@ namespace NewHorizons.External.Configs Atmosphere.useAtmosphereShader = true; // useBasicCloudShader is obsolete - if (Atmosphere.clouds != null && Atmosphere.clouds.useBasicCloudShader) + if (Atmosphere.clouds != null && Atmosphere.clouds.useBasicCloudShader) Atmosphere.clouds.cloudsPrefab = CloudPrefabType.Basic; } if (Props?.tornados != null) foreach (var tornado in Props.tornados) if (tornado.downwards) - tornado.type = PropModule.TornadoInfo.TornadoType.Downwards; + tornado.type = PropModule.TornadoInfo.TornadoType.Downwards; + + if (Base.sphereOfInfluence != 0f) Base.soiOverride = Base.sphereOfInfluence; - // for each quantum group, verify the following: // this group's id should be unique // if type == sockets, group.sockets should not be null or empty diff --git a/NewHorizons/External/Modules/BaseModule.cs b/NewHorizons/External/Modules/BaseModule.cs index 27858633..8c8e0ede 100644 --- a/NewHorizons/External/Modules/BaseModule.cs +++ b/NewHorizons/External/Modules/BaseModule.cs @@ -69,7 +69,7 @@ namespace NewHorizons.External.Modules /// /// An override for the radius of the planet's gravitational sphere of influence. Optional /// - public float sphereOfInfluence; + public float soiOverride; /// /// The acceleration due to gravity felt as the surfaceSize. Timber Hearth has 12 for reference @@ -112,6 +112,9 @@ namespace NewHorizons.External.Modules [Obsolete("CloakRadius is deprecated, please use CloakModule instead")] public float cloakRadius; + [Obsolete("SphereOfInfluence is deprecated, please use soiOverride instead")] + public float sphereOfInfluence; + #endregion Obsolete } } \ No newline at end of file diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 6b46b2f2..9414d1eb 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -81,7 +81,7 @@ namespace NewHorizons.External.Modules public class ScatterInfo { /// - /// Relative filepath to an asset-bundle" + /// Relative filepath to an asset-bundle /// public string assetBundle; @@ -130,7 +130,7 @@ namespace NewHorizons.External.Modules public bool alignToNormal; /// - /// Relative filepath to an asset-bundle to load the prefab defined in `path` from/ + /// Relative filepath to an asset-bundle to load the prefab defined in `path` from /// public string assetBundle; diff --git a/NewHorizons/External/Modules/ReferenceFrameModule.cs b/NewHorizons/External/Modules/ReferenceFrameModule.cs index 793bb5f0..88adda68 100644 --- a/NewHorizons/External/Modules/ReferenceFrameModule.cs +++ b/NewHorizons/External/Modules/ReferenceFrameModule.cs @@ -16,7 +16,7 @@ namespace NewHorizons.External.Modules public bool hideInMap; /// - /// Radius of the brackets that show up when you target this. Defaults to the sphereOfInfluence. + /// Radius of the brackets that show up when you target this. Defaults to the sphere of influence. /// [DefaultValue(-1)] public float bracketRadius = -1; @@ -26,8 +26,13 @@ namespace NewHorizons.External.Modules public bool targetWhenClose; /// - /// The maximum distance that the reference frame can be targeted from. Defaults to double the sphereOfInfluence. + /// The maximum distance that the reference frame can be targeted from. Defaults to 100km and cannot be greater than that. /// - [DefaultValue(-1)] public float maxTargetDistance = -1; + public float maxTargetDistance; // If it's less than or equal to zero the game makes it 100km + + /// + /// The radius of the sphere around the planet which you can click on to target it. Defaults to twice the sphere of influence. + /// + public float targetColliderRadius; } } \ No newline at end of file diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 1470b5f6..4b9c8ff4 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -365,7 +365,7 @@ namespace NewHorizons.Handlers { var atmoSize = body.Config.Atmosphere != null ? body.Config.Atmosphere.size : 0f; float sphereOfInfluence = Mathf.Max(Mathf.Max(atmoSize, 50), body.Config.Base.surfaceSize * 2f); - var overrideSOI = body.Config.Base.sphereOfInfluence; + var overrideSOI = body.Config.Base.soiOverride; if (overrideSOI != 0) sphereOfInfluence = overrideSOI; return sphereOfInfluence; } diff --git a/NewHorizons/Handlers/SystemCreationHandler.cs b/NewHorizons/Handlers/SystemCreationHandler.cs index f4c0ca99..af59fb81 100644 --- a/NewHorizons/Handlers/SystemCreationHandler.cs +++ b/NewHorizons/Handlers/SystemCreationHandler.cs @@ -2,6 +2,7 @@ using NewHorizons.Builder.StarSystem; using NewHorizons.Components; using NewHorizons.Utility; using UnityEngine; +using Logger = NewHorizons.Utility.Logger; using Object = UnityEngine.Object; namespace NewHorizons.Handlers { @@ -28,27 +29,40 @@ namespace NewHorizons.Handlers } AudioClip clip = null; - if (system.Config.travelAudioClip != null) clip = SearchUtilities.FindResourceOfTypeAndName(system.Config.travelAudioClip); - else if (system.Config.travelAudioFilePath != null) + if (!string.IsNullOrEmpty(system.Config.travelAudioClip)) + { + clip = SearchUtilities.FindResourceOfTypeAndName(system.Config.travelAudioClip); + + if (clip == null) + { + Logger.LogError($"Couldn't get audio from clip [{system.Config.travelAudioClip}]"); + } + } + else if (!string.IsNullOrEmpty(system.Config.travelAudioFilePath)) { try { clip = AudioUtilities.LoadAudio(system.Mod.ModHelper.Manifest.ModFolderPath + "/" + system.Config.travelAudioFilePath); } - catch (System.Exception e) + catch { } + + if (clip == null) { - Utility.Logger.LogError($"Couldn't load audio file {system.Config.travelAudioFilePath} : {e.Message}"); + Logger.LogError($"Couldn't get audio from file [{system.Config.travelAudioFilePath}]"); } } if (clip != null) { - var travelSource = Locator.GetGlobalMusicController()._travelSource; - travelSource._audioLibraryClip = AudioType.None; - travelSource._clipArrayIndex = 0; - travelSource._clipArrayLength = 0; - travelSource._clipSelectionOnPlay = OWAudioSource.ClipSelectionOnPlay.MANUAL; - travelSource.clip = clip; + Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => + { + var travelSource = Locator.GetGlobalMusicController()._travelSource; + travelSource._audioLibraryClip = AudioType.None; + travelSource._clipArrayIndex = 0; + travelSource._clipArrayLength = 0; + travelSource._clipSelectionOnPlay = OWAudioSource.ClipSelectionOnPlay.MANUAL; + travelSource.clip = clip; + }); } } } diff --git a/NewHorizons/Icons/New Horizons.png b/NewHorizons/Icons/New Horizons.png new file mode 100644 index 00000000..aa2b86f8 Binary files /dev/null and b/NewHorizons/Icons/New Horizons.png differ diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 8ad7f38e..4904430b 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -47,11 +47,12 @@ namespace NewHorizons public bool IsWarping { get; private set; } = false; public bool WearingSuit { get; private set; } = false; + public bool IsChangingStarSystem { get; private set; } = false; + public static bool HasWarpDrive { get; private set; } = false; private string _defaultStarSystem = "SolarSystem"; private string _currentStarSystem = "SolarSystem"; - private bool _isChangingStarSystem = false; private bool _firstLoad = true; private ShipWarpController _shipWarpController; @@ -130,8 +131,9 @@ namespace NewHorizons Instance = this; GlobalMessenger.AddListener("PlayerDeath", OnDeath); + GlobalMessenger.AddListener("WakeUp", OnWakeUp); - NHAssetBundle = ModHelper.Assets.LoadBundle("AssetBundle/xen.newhorizons"); + NHAssetBundle = ModHelper.Assets.LoadBundle("Assets/xen.newhorizons"); ResetConfigs(resetTranslation: false); @@ -149,6 +151,8 @@ namespace NewHorizons Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OnSceneLoaded(SceneManager.GetActiveScene(), LoadSceneMode.Single)); Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => _firstLoad = false); Instance.ModHelper.Menus.PauseMenu.OnInit += DebugReload.InitializePauseMenu; + + AchievementsPlus.AchievementHandler.Init(); } public void OnDestroy() @@ -186,7 +190,7 @@ namespace NewHorizons Logger.Log($"Scene Loaded: {scene.name} {mode}"); // Set time loop stuff if its enabled and if we're warping to a new place - if (_isChangingStarSystem && (SystemDict[_currentStarSystem].Config.enableTimeLoop || _currentStarSystem == "SolarSystem") && SecondsLeftInLoop > 0f) + if (IsChangingStarSystem && (SystemDict[_currentStarSystem].Config.enableTimeLoop || _currentStarSystem == "SolarSystem") && SecondsLeftInLoop > 0f) { TimeLoop.SetSecondsRemaining(SecondsLeftInLoop); // Prevent the OPC from firing @@ -207,7 +211,7 @@ namespace NewHorizons // Reset this SecondsLeftInLoop = -1; - _isChangingStarSystem = false; + IsChangingStarSystem = false; if (scene.name == "TitleScreen" && _useCustomTitleScreen) { @@ -243,7 +247,7 @@ namespace NewHorizons OWAssetHandler.Init(); PlanetCreationHandler.Init(BodyDict[CurrentStarSystem]); SystemCreationHandler.LoadSystem(SystemDict[CurrentStarSystem]); - LoadTranslations(ModHelper.Manifest.ModFolderPath + "AssetBundle/", this); + LoadTranslations(ModHelper.Manifest.ModFolderPath + "Assets/", this); // Warp drive StarChartHandler.Init(SystemDict.Values.ToArray()); @@ -295,7 +299,7 @@ namespace NewHorizons public void EnableWarpDrive() { Logger.Log("Setting up warp drive"); - PlanetCreationHandler.LoadBody(LoadConfig(this, "AssetBundle/WarpDriveConfig.json")); + PlanetCreationHandler.LoadBody(LoadConfig(this, "Assets/WarpDriveConfig.json")); HasWarpDrive = true; } @@ -432,14 +436,14 @@ namespace NewHorizons #region Change star system public void ChangeCurrentStarSystem(string newStarSystem, bool warp = false) { - if (_isChangingStarSystem) return; + if (IsChangingStarSystem) return; + IsWarping = warp; OnChangeStarSystem?.Invoke(newStarSystem); Logger.Log($"Warping to {newStarSystem}"); if (warp && _shipWarpController) _shipWarpController.WarpOut(); - _isChangingStarSystem = true; - IsWarping = warp; + IsChangingStarSystem = true; WearingSuit = PlayerState.IsWearingSuit(); // We kill them so they don't move as much @@ -468,7 +472,7 @@ namespace NewHorizons void OnDeath(DeathType _) { // We reset the solar system on death (unless we just killed the player) - if (!_isChangingStarSystem) + if (!IsChangingStarSystem) { // If the override is a valid system then we go there if (SystemDict.Keys.Contains(_defaultSystemOverride)) diff --git a/NewHorizons/NewHorizons.csproj b/NewHorizons/NewHorizons.csproj index 7548e84c..72b21de4 100644 --- a/NewHorizons/NewHorizons.csproj +++ b/NewHorizons/NewHorizons.csproj @@ -16,7 +16,7 @@ - + @@ -30,7 +30,10 @@ PreserveNewest - + + PreserveNewest + + PreserveNewest diff --git a/NewHorizons/Patches/PlayerDataPatches.cs b/NewHorizons/Patches/PlayerDataPatches.cs index 1bcf18fd..176b9547 100644 --- a/NewHorizons/Patches/PlayerDataPatches.cs +++ b/NewHorizons/Patches/PlayerDataPatches.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using HarmonyLib; +using NewHorizons.AchievementsPlus.NH; using NewHorizons.Builder.Props; using NewHorizons.External; using NewHorizons.Handlers; @@ -31,6 +32,7 @@ namespace NewHorizons.Patches if (freqString != null && freqString != "") { NewHorizonsData.LearnFrequency(freqString); + NewFrequencyAchievement.Earn(); return false; } return true; diff --git a/NewHorizons/Patches/RaftPatches.cs b/NewHorizons/Patches/RaftPatches.cs index 3ecdf0f7..23ff888a 100644 --- a/NewHorizons/Patches/RaftPatches.cs +++ b/NewHorizons/Patches/RaftPatches.cs @@ -1,4 +1,4 @@ -using HarmonyLib; +using HarmonyLib; using NewHorizons.Components; using UnityEngine; namespace NewHorizons.Patches @@ -104,14 +104,5 @@ namespace NewHorizons.Patches return false; } - - /* For debugging - [HarmonyPrefix] - [HarmonyPatch(typeof(FluidDetector), nameof(FluidDetector.AddVolume), new Type[] { typeof(EffectVolume) })] - public static void FluidDetector_AddVolume(FluidDetector __instance, EffectVolume eVol) - { - Logger.Log($"[{__instance}] : AddVolume [{eVol}]"); - } - */ } } diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index fff468c4..8d1966ad 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -436,7 +436,7 @@ "description": "Do we show the minimap when walking around this planet?", "default": true }, - "sphereOfInfluence": { + "soiOverride": { "type": "number", "description": "An override for the radius of the planet's gravitational sphere of influence. Optional", "format": "float" @@ -821,7 +821,7 @@ }, "assetBundle": { "type": "string", - "description": "Relative filepath to an asset-bundle to load the prefab defined in `path` from/" + "description": "Relative filepath to an asset-bundle to load the prefab defined in `path` from" }, "path": { "type": "string", @@ -1096,7 +1096,7 @@ "properties": { "assetBundle": { "type": "string", - "description": "Relative filepath to an asset-bundle\"" + "description": "Relative filepath to an asset-bundle" }, "count": { "type": "integer", @@ -1354,7 +1354,7 @@ }, "bracketRadius": { "type": "number", - "description": "Radius of the brackets that show up when you target this. Defaults to the sphereOfInfluence.", + "description": "Radius of the brackets that show up when you target this. Defaults to the sphere of influence.", "format": "float", "default": -1 }, @@ -1364,9 +1364,13 @@ }, "maxTargetDistance": { "type": "number", - "description": "The maximum distance that the reference frame can be targeted from. Defaults to double the sphereOfInfluence.", - "format": "float", - "default": -1 + "description": "The maximum distance that the reference frame can be targeted from. Defaults to 100km and cannot be greater than that.", + "format": "float" + }, + "targetColliderRadius": { + "type": "number", + "description": "The radius of the sphere around the planet which you can click on to target it. Defaults to twice the sphere of influence.", + "format": "float" } } }, diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 129a60c2..b0bf4eb0 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -3,7 +3,7 @@ "author": "xen, Bwc9876, & Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.2.5", + "version": "1.3.0", "owmlVersion": "2.3.3", "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.AutoResume", "PacificEngine.OW_Randomizer" ], "pathsToPreserve": [ "planets", "systems", "translations" ] diff --git a/SchemaExporter/SchemaExporter.csproj b/SchemaExporter/SchemaExporter.csproj index c55b8e38..af626a17 100644 --- a/SchemaExporter/SchemaExporter.csproj +++ b/SchemaExporter/SchemaExporter.csproj @@ -19,7 +19,7 @@ PreserveNewest - + diff --git a/docs/Pipfile.lock b/docs/Pipfile.lock index f5fd8bf3..c1fa2170 100644 --- a/docs/Pipfile.lock +++ b/docs/Pipfile.lock @@ -30,7 +30,7 @@ "sha256:58d5c3d29f5a36ffeb94f02f0d786cd53014cf9b3b3951d42e0080d8a9498d30", "sha256:ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==4.11.1" }, "certifi": { @@ -38,7 +38,7 @@ "sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7", "sha256:f1d53542ee8cbedbe2118b5686372fb33c297fcd6379b050cca0ef13a597382a" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==2022.5.18.1" }, "charset-normalizer": { @@ -46,7 +46,7 @@ "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597", "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df" ], - "markers": "python_version >= '3'", + "markers": "python_version >= '3.5'", "version": "==2.0.12" }, "click": { @@ -70,16 +70,16 @@ "sha256:bc285b5f892094c3a53d558858a88553dd6a61a11ab1a8128a0e554385dcc5dd", "sha256:c2c11bc8214fbf709ffc369d11446ff6945254a7f09128154a7620613d8fda90" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==0.5.7" }, "elementpath": { "hashes": [ - "sha256:07f2a34bac7a2a909d745da1cb3c7b8cd43ca1d7d1134546db41ffb997bcb11c", - "sha256:25368810a76a5d9e464c0e721a12645409fc8c113ffde9e01d88557b4a7663d3" + "sha256:5ef1d51e8daa670f007914ff0f78ca7b2ecaa47e0ea0c5c699a29e6bc5f50385", + "sha256:b8aeb6f27dddc10fb9201b62090628a846cbae8577f3544cb1075fa38d0817f6" ], "markers": "python_version >= '3.7'", - "version": "==2.5.2" + "version": "==2.5.3" }, "htmlmin": { "hashes": [ @@ -92,7 +92,7 @@ "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" ], - "markers": "python_version >= '3'", + "markers": "python_version >= '3.5'", "version": "==3.3" }, "jinja2": { @@ -120,11 +120,11 @@ }, "jsonschema": { "hashes": [ - "sha256:71b5e39324422543546572954ce71c67728922c104902cb7ce252e522235b33f", - "sha256:7c6d882619340c3347a1bf7315e147e6d3dae439033ae6383d6acb908c101dfc" + "sha256:1c92d2db1900b668201f1797887d66453ab1fbfea51df8e4b46236689c427baf", + "sha256:9d6397ba4a6c0bf0300736057f649e3e12ecbc07d3e81a0dacb72de4e9801957" ], "markers": "python_version >= '3.7'", - "version": "==4.5.1" + "version": "==4.6.0" }, "libsass": { "hashes": [ @@ -146,7 +146,7 @@ "sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874", "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==3.3.7" }, "markdown2": { @@ -205,11 +205,11 @@ }, "marshmallow": { "hashes": [ - "sha256:2aaaab4f01ef4f5a011a21319af9fce17ab13bf28a026d1252adab0e035648d5", - "sha256:ff79885ed43b579782f48c251d262e062bce49c65c52412458769a4fb57ac30f" + "sha256:53a1e0ee69f79e1f3e80d17393b25cfc917eda52f859e8183b4af72c3390c1f1", + "sha256:a762c1d8b2bcb0e5c8e964850d03f9f3bffd6a12b626f3c14b9d6b1841999af5" ], "markers": "python_version >= '3.7'", - "version": "==3.15.0" + "version": "==3.16.0" }, "marshmallow-enum": { "hashes": [ @@ -220,11 +220,11 @@ }, "menagerie-docs": { "hashes": [ - "sha256:5f02204f4c8a6a3eee947ee4c91266159b567fd8e22d69be43531ef2e4a99f6a", - "sha256:ad69a97a65a73ad3f2be0f28638b74d1a6af68a5ce00c7b9726a9e0e89bb3d82" + "sha256:689f21de2b7c5b87457d7081e549ada2e5fcc39437b13f8e2158ac5be9864757", + "sha256:a6375d949f53f2fd918efb11bbea6ecd3fa1913a2610be417511db62361d775f" ], "index": "pypi", - "version": "==0.1.8" + "version": "==0.1.9" }, "mypy-extensions": { "hashes": [ @@ -246,7 +246,7 @@ "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==21.3" }, "pillow": { @@ -298,7 +298,7 @@ "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb", "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==2.12.0" }, "pyparsing": { @@ -379,7 +379,7 @@ "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==6.0" }, "rcssmin": { @@ -409,11 +409,11 @@ }, "requests": { "hashes": [ - "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61", - "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d" + "sha256:bc7861137fbce630f17b03d3ad02ad0bf978c844f3536d0edda6499dafce2b6f", + "sha256:d568723a7ebd25875d8d1eaf5dfa068cd2fc8194b2e483d7b1f7c81918dbec6b" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==2.27.1" + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==2.28.0" }, "rjsmin": { "hashes": [ @@ -453,7 +453,7 @@ "sha256:3b2503d3c7084a42b1ebd08116e5f81aadfaea95863628c80a3b774a11b7c759", "sha256:fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==2.3.2.post1" }, "typing-extensions": { @@ -482,11 +482,11 @@ }, "xmlschema": { "hashes": [ - "sha256:319f5e3e77beb6ab3b4166f699d9dafd59141487bd1a07675fd01af6483211a4", - "sha256:8ed246d97e7ab0393cf435ca98c8da6a0d2ab2f4e81949e149d8b2c97ec89357" + "sha256:0706c84de20686c940fa07e2b88425cff1471c89544a49e9365b9636236ccd2f", + "sha256:e6f8d1d44f8d95d8693698154d57c4a0557825483ccbedaca78eca2cd98ba6e7" ], "markers": "python_version >= '3.7'", - "version": "==1.11.0" + "version": "==1.11.2" } } } diff --git a/docs/content/pages/tutorials/api.md b/docs/content/pages/tutorials/api.md index f1a774e4..8689943c 100644 --- a/docs/content/pages/tutorials/api.md +++ b/docs/content/pages/tutorials/api.md @@ -20,7 +20,7 @@ public interface INewHorizons UnityEvent GetStarSystemLoadedEvent(); - GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignWithNormal) + GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignWithNormal); string[] GetInstalledAddons(); }