Fixed some bugs, was gonna merge this into main but with 1.5.0 happening now I guess we don't have to
This commit is contained in:
Nick 2022-08-25 21:16:09 -04:00 committed by GitHub
commit 7545b39a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1191 additions and 1170 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Ricardo Lopes
Copyright (c) 2022 New Horizons Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -7,16 +7,16 @@ namespace NewHorizons.Builder.Atmosphere
{
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
{
GameObject airGO = new GameObject("Air");
var airGO = new GameObject("Air");
airGO.SetActive(false);
airGO.layer = 17;
airGO.transform.parent = sector?.transform ? sector.transform : planetGO.transform;
SphereCollider sc = airGO.AddComponent<SphereCollider>();
var sc = airGO.AddComponent<SphereCollider>();
sc.isTrigger = true;
sc.radius = config.Atmosphere.size;
SimpleFluidVolume sfv = airGO.AddComponent<SimpleFluidVolume>();
var sfv = airGO.AddComponent<SimpleFluidVolume>();
sfv._layer = 5;
sfv._priority = 1;
sfv._density = 1.2f;
@ -24,7 +24,11 @@ namespace NewHorizons.Builder.Atmosphere
sfv._allowShipAutoroll = true;
sfv._disableOnStart = false;
ShockLayerRuleset shockLayerRuleset = planetGO.GetComponentInChildren<PlanetoidRuleset>().gameObject.AddComponent<ShockLayerRuleset>();
// Try to parent it to the same as other rulesets to match vanilla but if its null put it on the root object
var ruleSetGO = planetGO.GetComponentInChildren<PlanetoidRuleset>()?.gameObject;
if (ruleSetGO == null) ruleSetGO = planetGO;
var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>();
shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric;
shockLayerRuleset._radialCenter = airGO.transform;
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
@ -56,7 +60,7 @@ namespace NewHorizons.Builder.Atmosphere
vref._layer = 0;
vref._priority = 0;
AudioSource AS = airGO.AddComponent<AudioSource>();
var AS = airGO.AddComponent<AudioSource>();
AS.mute = false;
AS.bypassEffects = false;
AS.bypassListenerEffects = false;

View File

@ -25,6 +25,8 @@ namespace NewHorizons.Builder.Props
public static List<SignalName> QMSignals { get; private set; }
public static List<SignalName> CloakedSignals { get; private set; }
public static bool Initialized;
public static void Init()
{
Logger.LogVerbose($"Initializing SignalBuilder");
@ -77,6 +79,8 @@ namespace NewHorizons.Builder.Props
QMSignals = new List<SignalName>() { SignalName.Quantum_QM };
CloakedSignals = new List<SignalName>();
Initialized = true;
}
public static SignalFrequency AddFrequency(string str)

View File

@ -548,6 +548,7 @@ namespace NewHorizons.Handlers
{
var surfaceSize = body.Config.Base.surfaceSize;
if (body.Config.Atmosphere.size != 0)
AirBuilder.Make(go, sector, body.Config);
if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath))

View File

@ -117,6 +117,8 @@ namespace NewHorizons.Patches
[HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.UpdateSignalStrength))]
public static bool AudioSignal_UpdateSignalStrength(AudioSignal __instance, Signalscope scope, float distToClosestScopeObstruction)
{
if (!SignalBuilder.Initialized) return true;
if (!SignalBuilder.CloakedSignals.Contains(__instance._name) && !SignalBuilder.QMSignals.Contains(__instance._name)) return true;
__instance._canBePickedUpByScope = false;

View File

@ -4,8 +4,8 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Book",
"name": "New Horizons",
"uniqueName": "xen.NewHorizons",
"version": "1.4.3",
"owmlVersion": "2.5.2",
"version": "1.4.4",
"owmlVersion": "2.6.0",
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
"pathsToPreserve": [ "planets", "systems", "translations" ]
}

10
docs/content/pages/404.md Normal file
View File

@ -0,0 +1,10 @@
---
Title: Page not Found
Hide_In_Nav: True
Render_TOC: False
---
# Page Not Found
The page you requested could not be found.

File diff suppressed because it is too large Load Diff