mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Categorized some stuff in components and fixed Trifids star thing maybe (#386)
Organization and fix PR that shouldn't have been merged
This commit is contained in:
commit
b2e46e234d
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
using NewHorizons.Components.Volumes;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Body
|
namespace NewHorizons.Builder.Body
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
@ -10,6 +9,7 @@ using System.Linq;
|
|||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using Color = UnityEngine.Color;
|
using Color = UnityEngine.Color;
|
||||||
|
using NewHorizons.Components.Volumes;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Body
|
namespace NewHorizons.Builder.Body
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
@ -9,6 +8,7 @@ using OWML.ModHelper;
|
|||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using UnityEngine.InputSystem.XR;
|
using UnityEngine.InputSystem.XR;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NewHorizons.Components.Stars;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Body
|
namespace NewHorizons.Builder.Body
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using NewHorizons.External.Modules.VariableSize;
|
using NewHorizons.External.Modules.VariableSize;
|
||||||
using Tessellation;
|
using Tessellation;
|
||||||
|
using NewHorizons.Components.Volumes;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Body
|
namespace NewHorizons.Builder.Body
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Quantum;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Volumes;
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
@ -9,6 +8,8 @@ using NewHorizons.External.Modules.VariableSize;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
using NewHorizons.Components.ShipLog;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.ShipLog
|
namespace NewHorizons.Builder.ShipLog
|
||||||
{
|
{
|
||||||
public static class MapModeBuilder
|
public static class MapModeBuilder
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
@ -9,7 +8,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
using NHNotificationVolume = NewHorizons.Components.NotificationVolume;
|
using NHNotificationVolume = NewHorizons.Components.Volumes.NotificationVolume;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Volumes
|
namespace NewHorizons.Builder.Volumes
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using NewHorizons.Builder.Body;
|
using NewHorizons.Builder.Body;
|
||||||
using NewHorizons.Builder.ShipLog;
|
using NewHorizons.Builder.ShipLog;
|
||||||
using NewHorizons.Builder.Volumes;
|
using NewHorizons.Builder.Volumes;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Volumes;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using System;
|
using System;
|
||||||
@ -61,7 +61,7 @@ namespace NewHorizons.Builder.Volumes
|
|||||||
{
|
{
|
||||||
foreach (var interferenceVolume in config.Volumes.interferenceVolumes)
|
foreach (var interferenceVolume in config.Volumes.interferenceVolumes)
|
||||||
{
|
{
|
||||||
VolumeBuilder.Make<Components.InterferenceVolume>(go, sector, interferenceVolume);
|
VolumeBuilder.Make<Components.Volumes.InterferenceVolume>(go, sector, interferenceVolume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.Volumes.reverbVolumes != null)
|
if (config.Volumes.reverbVolumes != null)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using NewHorizons.Builder.General;
|
using NewHorizons.Builder.General;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Fixers
|
||||||
{
|
{
|
||||||
public class MapSatelliteOrbitFix : MonoBehaviour
|
public class MapSatelliteOrbitFix : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -7,60 +7,60 @@ using UnityEngine;
|
|||||||
|
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Quantum
|
||||||
{
|
{
|
||||||
public class NHMultiStateQuantumObject : MultiStateQuantumObject
|
public class NHMultiStateQuantumObject : MultiStateQuantumObject
|
||||||
{
|
{
|
||||||
|
|
||||||
public override bool ChangeQuantumState(bool skipInstantVisibilityCheck)
|
public override bool ChangeQuantumState(bool skipInstantVisibilityCheck)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _prerequisiteObjects.Length; i++)
|
for (int i = 0; i < _prerequisiteObjects.Length; i++)
|
||||||
{
|
{
|
||||||
if (!_prerequisiteObjects[i].HasCollapsed())
|
if (!_prerequisiteObjects[i].HasCollapsed())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int stateIndex = _stateIndex;
|
int stateIndex = _stateIndex;
|
||||||
if (_stateIndex == -1 && _initialState != -1)
|
if (_stateIndex == -1 && _initialState != -1)
|
||||||
{
|
{
|
||||||
_stateIndex = _initialState;
|
_stateIndex = _initialState;
|
||||||
}
|
}
|
||||||
else if (_sequential)
|
else if (_sequential)
|
||||||
{
|
{
|
||||||
_stateIndex = (_reverse ? (_stateIndex - 1) : (_stateIndex + 1));
|
_stateIndex = _reverse ? _stateIndex - 1 : _stateIndex + 1;
|
||||||
if (_loop)
|
if (_loop)
|
||||||
{
|
{
|
||||||
if (_stateIndex < 0)
|
if (_stateIndex < 0)
|
||||||
{
|
{
|
||||||
_stateIndex = _states.Length - 1;
|
_stateIndex = _states.Length - 1;
|
||||||
}
|
}
|
||||||
else if (_stateIndex > _states.Length - 1)
|
else if (_stateIndex > _states.Length - 1)
|
||||||
{
|
{
|
||||||
_stateIndex = 0;
|
_stateIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_stateIndex = Mathf.Clamp(_stateIndex, 0, _states.Length - 1);
|
_stateIndex = Mathf.Clamp(_stateIndex, 0, _states.Length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: perform this roll for number of states, each time adding the selected state to the end of a list and removing it from the source list
|
// TODO: perform this roll for number of states, each time adding the selected state to the end of a list and removing it from the source list
|
||||||
// this gets us a randomly ordered list that respects states' probability
|
// this gets us a randomly ordered list that respects states' probability
|
||||||
// then we can sequentially attempt collapsing to them, checking at each state whether the new state is invalid due to the player being able to see it, according to this:
|
// then we can sequentially attempt collapsing to them, checking at each state whether the new state is invalid due to the player being able to see it, according to this:
|
||||||
//
|
//
|
||||||
// if (!((!IsPlayerEntangled()) ? (CheckIllumination() ? CheckVisibilityInstantly() : CheckPointInside(Locator.GetPlayerCamera().transform.position)) : CheckIllumination()))
|
// if (!((!IsPlayerEntangled()) ? (CheckIllumination() ? CheckVisibilityInstantly() : CheckPointInside(Locator.GetPlayerCamera().transform.position)) : CheckIllumination()))
|
||||||
// {
|
// {
|
||||||
// return true; // this is a valid state
|
// return true; // this is a valid state
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|
||||||
List<int> indices = new List<int>();
|
List<int> indices = new List<int>();
|
||||||
for (var i = 0; i < _states.Length; i++) if (i != stateIndex) indices.Add(i);
|
for (var i = 0; i < _states.Length; i++) if (i != stateIndex) indices.Add(i);
|
||||||
|
|
||||||
var previousIndex = stateIndex;
|
var previousIndex = stateIndex;
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -69,31 +69,31 @@ namespace NewHorizons.Components
|
|||||||
_stateIndex = RollState(stateIndex, indices);
|
_stateIndex = RollState(stateIndex, indices);
|
||||||
if (previousIndex >= 0 && previousIndex < _states.Length) _states[previousIndex].SetVisible(visible: false);
|
if (previousIndex >= 0 && previousIndex < _states.Length) _states[previousIndex].SetVisible(visible: false);
|
||||||
_states[_stateIndex].SetVisible(visible: true);
|
_states[_stateIndex].SetVisible(visible: true);
|
||||||
|
|
||||||
Logger.LogVerbose($"MultiStateQuantumObject - Trying to change state {_stateIndex}");
|
Logger.LogVerbose($"MultiStateQuantumObject - Trying to change state {_stateIndex}");
|
||||||
|
|
||||||
indices.Remove(_stateIndex);
|
indices.Remove(_stateIndex);
|
||||||
} while (!CurrentStateIsValid() && indices.Count > 0);
|
} while (!CurrentStateIsValid() && indices.Count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var stateIndexIsValid = stateIndex >= 0 && stateIndex < _states.Length;
|
var stateIndexIsValid = stateIndex >= 0 && stateIndex < _states.Length;
|
||||||
if (stateIndexIsValid) _states[stateIndex].SetVisible(visible: false);
|
if (stateIndexIsValid) _states[stateIndex].SetVisible(visible: false);
|
||||||
|
|
||||||
_states[_stateIndex].SetVisible(visible: true);
|
_states[_stateIndex].SetVisible(visible: true);
|
||||||
if (!CurrentStateIsValid() && stateIndexIsValid)
|
if (!CurrentStateIsValid() && stateIndexIsValid)
|
||||||
{
|
{
|
||||||
_states[_stateIndex].SetVisible(visible: false);
|
_states[_stateIndex].SetVisible(visible: false);
|
||||||
_states[stateIndex] .SetVisible(visible: true);
|
_states[stateIndex].SetVisible(visible: true);
|
||||||
_stateIndex = stateIndex;
|
_stateIndex = stateIndex;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sequential && !_loop && _stateIndex == _states.Length - 1)
|
if (_sequential && !_loop && _stateIndex == _states.Length - 1)
|
||||||
{
|
{
|
||||||
SetActivation(active: false);
|
SetActivation(active: false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CurrentStateIsValid()
|
public bool CurrentStateIsValid()
|
||||||
{
|
{
|
||||||
@ -102,20 +102,20 @@ namespace NewHorizons.Components
|
|||||||
var visibility = CheckVisibilityInstantly();
|
var visibility = CheckVisibilityInstantly();
|
||||||
var playerInside = CheckPointInside(Locator.GetPlayerCamera().transform.position);
|
var playerInside = CheckPointInside(Locator.GetPlayerCamera().transform.position);
|
||||||
|
|
||||||
var isVisible =
|
var isVisible =
|
||||||
isPlayerEntangled
|
isPlayerEntangled
|
||||||
? illumination
|
? illumination
|
||||||
: (
|
:
|
||||||
illumination
|
illumination
|
||||||
? visibility
|
? visibility
|
||||||
: playerInside
|
: playerInside
|
||||||
);
|
;
|
||||||
|
|
||||||
return !isVisible;
|
return !isVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int RollState(int excludeIndex, List<int> indices)
|
public int RollState(int excludeIndex, List<int> indices)
|
||||||
{
|
{
|
||||||
var stateIndex = excludeIndex;
|
var stateIndex = excludeIndex;
|
||||||
|
|
||||||
// this function constructs a sort of segmented range:
|
// this function constructs a sort of segmented range:
|
||||||
@ -132,32 +132,32 @@ namespace NewHorizons.Components
|
|||||||
//
|
//
|
||||||
// the second for looop uses num3 and num4 to figure out which segment num2 landed in
|
// the second for looop uses num3 and num4 to figure out which segment num2 landed in
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
foreach (int j in indices)
|
foreach (int j in indices)
|
||||||
{
|
{
|
||||||
if (j != stateIndex)
|
if (j != stateIndex)
|
||||||
{
|
{
|
||||||
_probabilities[j] = _states[j].GetProbability();
|
_probabilities[j] = _states[j].GetProbability();
|
||||||
num += _probabilities[j];
|
num += _probabilities[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int num2 = UnityEngine.Random.Range(0, num);
|
int num2 = UnityEngine.Random.Range(0, num);
|
||||||
int num3 = 0;
|
int num3 = 0;
|
||||||
int num4 = 0;
|
int num4 = 0;
|
||||||
foreach (int k in indices)
|
foreach (int k in indices)
|
||||||
{
|
{
|
||||||
if (k != stateIndex)
|
if (k != stateIndex)
|
||||||
{
|
{
|
||||||
num3 = num4;
|
num3 = num4;
|
||||||
num4 += _probabilities[k];
|
num4 += _probabilities[k];
|
||||||
if (_probabilities[k] > 0 && num2 >= num3 && num2 < num4)
|
if (_probabilities[k] > 0 && num2 >= num3 && num2 < num4)
|
||||||
{
|
{
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return indices[indices.Count-1];
|
return indices[indices.Count - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ using System.Linq;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Quantum
|
||||||
{
|
{
|
||||||
public class QuantumPlanet : QuantumObject
|
public class QuantumPlanet : QuantumObject
|
||||||
{
|
{
|
||||||
@ -162,9 +162,9 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
private void OnPlayerBlink()
|
private void OnPlayerBlink()
|
||||||
{
|
{
|
||||||
if (base.IsVisible())
|
if (IsVisible())
|
||||||
{
|
{
|
||||||
base.Collapse(true);
|
Collapse(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
using NewHorizons.Components.Volumes;
|
||||||
using NewHorizons.External.Modules.VariableSize;
|
using NewHorizons.External.Modules.VariableSize;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.ShipLog
|
||||||
{
|
{
|
||||||
public class ShipLogDetail : MonoBehaviour
|
public class ShipLogDetail : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
private void SetGreyScale(bool greyScale)
|
private void SetGreyScale(bool greyScale)
|
||||||
{
|
{
|
||||||
_revealedImage.material = (greyScale ? _greyScaleMaterial : null);
|
_revealedImage.material = greyScale ? _greyScaleMaterial : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,7 +6,7 @@ using System.Linq;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.ShipLog
|
||||||
{
|
{
|
||||||
public class ShipLogStarChartMode : ShipLogMode
|
public class ShipLogStarChartMode : ShipLogMode
|
||||||
{
|
{
|
||||||
@ -41,7 +41,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource)
|
public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource)
|
||||||
{
|
{
|
||||||
root = base.transform.Find("ScaleRoot/PanRoot");
|
root = transform.Find("ScaleRoot/PanRoot");
|
||||||
_oneShotSource = oneShotSource;
|
_oneShotSource = oneShotSource;
|
||||||
|
|
||||||
_centerPromptList = centerPromptList;
|
_centerPromptList = centerPromptList;
|
||||||
@ -101,11 +101,11 @@ namespace NewHorizons.Components
|
|||||||
if (_cardTemplate == null)
|
if (_cardTemplate == null)
|
||||||
{
|
{
|
||||||
var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot");
|
var panRoot = SearchUtilities.Find("Ship_Body/Module_Cabin/Systems_Cabin/ShipLogPivot/ShipLog/ShipLogPivot/ShipLogCanvas/DetectiveMode/ScaleRoot/PanRoot");
|
||||||
_cardTemplate = GameObject.Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject);
|
_cardTemplate = Instantiate(panRoot.GetComponentInChildren<ShipLogEntryCard>().gameObject);
|
||||||
_cardTemplate.SetActive(false);
|
_cardTemplate.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newCard = GameObject.Instantiate(_cardTemplate, parent);
|
var newCard = Instantiate(_cardTemplate, parent);
|
||||||
var textComponent = newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent<Text>();
|
var textComponent = newCard.transform.Find("EntryCardRoot/NameBackground/Name").GetComponent<Text>();
|
||||||
|
|
||||||
var name = UniqueIDToName(uniqueID);
|
var name = UniqueIDToName(uniqueID);
|
||||||
@ -164,7 +164,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public override void EnterMode(string entryID = "", List<ShipLogFact> revealQueue = null)
|
public override void EnterMode(string entryID = "", List<ShipLogFact> revealQueue = null)
|
||||||
{
|
{
|
||||||
base.gameObject.SetActive(true);
|
gameObject.SetActive(true);
|
||||||
|
|
||||||
Locator.GetPromptManager().AddScreenPrompt(_detectiveModePrompt, _upperRightPromptList, TextAnchor.MiddleRight, -1, true);
|
Locator.GetPromptManager().AddScreenPrompt(_detectiveModePrompt, _upperRightPromptList, TextAnchor.MiddleRight, -1, true);
|
||||||
Locator.GetPromptManager().AddScreenPrompt(_targetSystemPrompt, _centerPromptList, TextAnchor.MiddleCenter, -1, true);
|
Locator.GetPromptManager().AddScreenPrompt(_targetSystemPrompt, _centerPromptList, TextAnchor.MiddleCenter, -1, true);
|
||||||
@ -172,7 +172,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public override void ExitMode()
|
public override void ExitMode()
|
||||||
{
|
{
|
||||||
base.gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
|
|
||||||
Locator.GetPromptManager().RemoveScreenPrompt(_detectiveModePrompt);
|
Locator.GetPromptManager().RemoveScreenPrompt(_detectiveModePrompt);
|
||||||
Locator.GetPromptManager().RemoveScreenPrompt(_targetSystemPrompt);
|
Locator.GetPromptManager().RemoveScreenPrompt(_targetSystemPrompt);
|
||||||
@ -223,7 +223,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
if (oldIndex != _cardIndex)
|
if (oldIndex != _cardIndex)
|
||||||
{
|
{
|
||||||
_oneShotSource.PlayOneShot(global::AudioType.ShipLogMoveBetweenPlanets, 1f);
|
_oneShotSource.PlayOneShot(AudioType.ShipLogMoveBetweenPlanets, 1f);
|
||||||
_startPanTime = Time.unscaledTime;
|
_startPanTime = Time.unscaledTime;
|
||||||
_startPanPos = _panRootPos;
|
_startPanPos = _panRootPos;
|
||||||
_panDuration = 0.25f;
|
_panDuration = 0.25f;
|
||||||
@ -297,7 +297,7 @@ namespace NewHorizons.Components
|
|||||||
{
|
{
|
||||||
if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData);
|
if (_warpNotificationData != null) NotificationManager.SharedInstance.UnpinNotification(_warpNotificationData);
|
||||||
if (_target == null) return;
|
if (_target == null) return;
|
||||||
if (playSound) _oneShotSource.PlayOneShot(global::AudioType.ShipLogMarkLocation, 1f);
|
if (playSound) _oneShotSource.PlayOneShot(AudioType.ShipLogMarkLocation, 1f);
|
||||||
_target.SetMarkedOnHUD(false);
|
_target.SetMarkedOnHUD(false);
|
||||||
_target = null;
|
_target = null;
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using NewHorizons.Builder.Body;
|
using NewHorizons.Builder.Body;
|
||||||
using NewHorizons.Components.Orbital;
|
using NewHorizons.Components.Orbital;
|
||||||
|
using NewHorizons.Components.Stars;
|
||||||
using NewHorizons.External.Modules.VariableSize;
|
using NewHorizons.External.Modules.VariableSize;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
@ -286,9 +287,9 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
{
|
{
|
||||||
_stellarRemnant.SetActive(true);
|
_stellarRemnant.SetActive(true);
|
||||||
var remnantStarController = _stellarRemnant.GetComponentInChildren<StarController>();
|
var remnantStarController = _stellarRemnant.GetComponentInChildren<StarController>();
|
||||||
if (remnantStarController != null) StarLightController.AddStar(remnantStarController);
|
if (remnantStarController != null) SunLightEffectsController.AddStar(remnantStarController);
|
||||||
var remnantStarLight = _stellarRemnant.FindChild("SunLight");
|
var remnantStarLight = _stellarRemnant.FindChild("SunLight");
|
||||||
if (remnantStarLight != null) StarLightController.AddStarLight(remnantStarLight.GetComponent<Light>());
|
if (remnantStarLight != null) SunLightEffectsController.AddStarLight(remnantStarLight.GetComponent<Light>());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Time.time > _supernovaStartTime + supernovaTime)
|
if (Time.time > _supernovaStartTime + supernovaTime)
|
||||||
@ -301,8 +302,8 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
private void DisableStar(bool start = false)
|
private void DisableStar(bool start = false)
|
||||||
{
|
{
|
||||||
if (controller != null) StarLightController.RemoveStar(controller);
|
if (controller != null) SunLightEffectsController.RemoveStar(controller);
|
||||||
if (!isProxy) StarLightController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>());
|
if (!isProxy) SunLightEffectsController.RemoveStarLight(gameObject.FindChild("SunLight").GetComponent<Light>());
|
||||||
|
|
||||||
if (_stellarRemnant != null)
|
if (_stellarRemnant != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
public class StarController : MonoBehaviour
|
public class StarController : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
public class StarDestructionVolume : DestructionVolume
|
public class StarDestructionVolume : DestructionVolume
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
public class StarFluidVolume : SimpleFluidVolume
|
public class StarFluidVolume : SimpleFluidVolume
|
||||||
{
|
{
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(OWAudioSource))]
|
[RequireComponent(typeof(OWAudioSource))]
|
||||||
public class StarSurfaceAudioController : SectoredMonoBehaviour
|
public class StarSurfaceAudioController : SectoredMonoBehaviour
|
||||||
@ -34,7 +34,7 @@ namespace NewHorizons.Components
|
|||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
_fade = Mathf.MoveTowards(_fade, 1, Time.deltaTime * 0.2f);
|
_fade = Mathf.MoveTowards(_fade, 1, Time.deltaTime * 0.2f);
|
||||||
float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, this.transform.position) - (_starEvolutionController != null ? _starEvolutionController.CurrentScale : _size));
|
float value = Mathf.Max(0.0f, Vector3.Distance(Locator.GetPlayerCamera().transform.position, transform.position) - (_starEvolutionController != null ? _starEvolutionController.CurrentScale : _size));
|
||||||
float num = Mathf.InverseLerp(1600f, 100f, value);
|
float num = Mathf.InverseLerp(1600f, 100f, value);
|
||||||
_audioSource.SetLocalVolume(num * num * _fade);
|
_audioSource.SetLocalVolume(num * num * _fade);
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
public class StellarDeathController : MonoBehaviour
|
public class StellarDeathController : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -71,7 +71,7 @@ namespace NewHorizons.Components
|
|||||||
surface.transform.localScale = Vector3.one * _currentSupernovaScale;
|
surface.transform.localScale = Vector3.one * _currentSupernovaScale;
|
||||||
_localSupernovaMat.color = Color.Lerp(Color.black, supernovaMaterial.color, supernovaAlpha.Evaluate(_time));
|
_localSupernovaMat.color = Color.Lerp(Color.black, supernovaMaterial.color, supernovaAlpha.Evaluate(_time));
|
||||||
|
|
||||||
float distanceToPlayer = PlayerState.InDreamWorld() ? 20000f : (Vector3.Distance(transform.position, Locator.GetPlayerCamera().transform.position) - GetSupernovaRadius());
|
float distanceToPlayer = PlayerState.InDreamWorld() ? 20000f : Vector3.Distance(transform.position, Locator.GetPlayerCamera().transform.position) - GetSupernovaRadius();
|
||||||
|
|
||||||
if (_isProxy) return;
|
if (_isProxy) return;
|
||||||
|
|
||||||
@ -1,34 +1,44 @@
|
|||||||
using NewHorizons.Builder.Atmosphere;
|
using NewHorizons.Builder.Atmosphere;
|
||||||
|
using NewHorizons.Utility;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Stars
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(SunLightController))]
|
[RequireComponent(typeof(SunLightController))]
|
||||||
[RequireComponent(typeof(SunLightParamUpdater))]
|
[RequireComponent(typeof(SunLightParamUpdater))]
|
||||||
public class StarLightController : MonoBehaviour
|
public class SunLightEffectsController : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity");
|
private static readonly int SunIntensity = Shader.PropertyToID("_SunIntensity");
|
||||||
private static readonly float hearthSunDistanceSqr = 8593 * 8593;
|
private static readonly float hearthSunDistanceSqr = 8593 * 8593;
|
||||||
|
|
||||||
public static StarLightController Instance { get; private set; }
|
public static SunLightEffectsController Instance { get; private set; }
|
||||||
|
|
||||||
|
private readonly List<StarController> _stars = new();
|
||||||
|
private readonly List<Light> _lights = new();
|
||||||
|
|
||||||
private List<StarController> _stars = new List<StarController>();
|
|
||||||
private List<Light> _lights = new List<Light>();
|
|
||||||
private StarController _activeStar;
|
private StarController _activeStar;
|
||||||
|
|
||||||
private SunLightController _sunLightController;
|
private SunLightController _sunLightController;
|
||||||
private SunLightParamUpdater _sunLightParamUpdater;
|
private SunLightParamUpdater _sunLightParamUpdater;
|
||||||
|
|
||||||
public void Awake()
|
public void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
_sunLightController = GetComponent<SunLightController>();
|
_sunLightController = GetComponent<SunLightController>();
|
||||||
_sunLightController.enabled = true;
|
_sunLightController.enabled = true;
|
||||||
|
|
||||||
_sunLightParamUpdater = GetComponent<SunLightParamUpdater>();
|
_sunLightParamUpdater = GetComponent<SunLightParamUpdater>();
|
||||||
_sunLightParamUpdater._sunLightController = _sunLightController;
|
_sunLightParamUpdater._sunLightController = _sunLightController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
// Using GameObject.Find here so that if its null we just dont find it
|
||||||
|
var sunlight = GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>();
|
||||||
|
if (sunlight != null) AddStarLight(sunlight);
|
||||||
|
}
|
||||||
|
|
||||||
public static void AddStar(StarController star)
|
public static void AddStar(StarController star)
|
||||||
{
|
{
|
||||||
if (star == null) return;
|
if (star == null) return;
|
||||||
@ -56,74 +66,97 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public static void AddStarLight(Light light)
|
public static void AddStarLight(Light light)
|
||||||
{
|
{
|
||||||
if (light == null) return;
|
if (light != null)
|
||||||
|
{
|
||||||
Instance._lights.Add(light);
|
Instance._lights.SafeAdd(light);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveStarLight(Light light)
|
public static void RemoveStarLight(Light light)
|
||||||
{
|
{
|
||||||
if (light == null) return;
|
if (light != null && Instance._lights.Contains(light))
|
||||||
|
{
|
||||||
if (Instance._lights.Contains(light)) Instance._lights.Remove(light);
|
Instance._lights.Remove(light);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy)
|
|
||||||
{
|
|
||||||
if (_stars.Contains(_activeStar)) _stars.Remove(_activeStar);
|
|
||||||
if (_stars.Count > 0) ChangeActiveStar(_stars[0]);
|
|
||||||
else gameObject.SetActive(false);
|
|
||||||
|
|
||||||
foreach (var (_, material) in AtmosphereBuilder.Skys)
|
|
||||||
{
|
|
||||||
material.SetFloat(SunIntensity, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update atmo shaders
|
|
||||||
foreach (var (planet, material) in AtmosphereBuilder.Skys)
|
|
||||||
{
|
|
||||||
var sqrDist = (planet.transform.position - _activeStar.transform.position).sqrMagnitude;
|
|
||||||
var intensity = Mathf.Min(_activeStar.Intensity / (sqrDist / hearthSunDistanceSqr), 1f);
|
|
||||||
|
|
||||||
material.SetFloat(SunIntensity, intensity);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player is always at 0,0,0 more or less so if they arent using the map camera then wtv
|
// Player is always at 0,0,0 more or less so if they arent using the map camera then wtv
|
||||||
var origin = Vector3.zero;
|
var origin = Vector3.zero;
|
||||||
|
|
||||||
foreach (var star in _stars)
|
|
||||||
{
|
|
||||||
if (star == null) continue;
|
|
||||||
if (!(star.gameObject.activeSelf && star.gameObject.activeInHierarchy)) continue;
|
|
||||||
|
|
||||||
if (PlayerState.InMapView())
|
|
||||||
{
|
|
||||||
origin = Locator.GetActiveCamera().transform.position;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStar.Intensity * (_activeStar.transform.position - origin).sqrMagnitude)
|
|
||||||
{
|
|
||||||
ChangeActiveStar(star);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerState.InMapView())
|
if (PlayerState.InMapView())
|
||||||
{
|
{
|
||||||
foreach (var light in _lights) light.enabled = true;
|
origin = Locator.GetActiveCamera().transform.position;
|
||||||
return;
|
|
||||||
|
// Keep all star lights on in map
|
||||||
|
foreach (var light in _lights)
|
||||||
|
{
|
||||||
|
light.enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Outside map, only show lights within 50km range or light.range
|
||||||
|
// For some reason outside of the actual range of the lights they still show reflection effects on water and glass
|
||||||
|
foreach (var light in _lights)
|
||||||
|
{
|
||||||
|
// Minimum 50km range so it's not badly noticeable for dim stars
|
||||||
|
if ((light.transform.position - origin).sqrMagnitude <= Mathf.Max(light.range * light.range, 2500000000))
|
||||||
|
{
|
||||||
|
light.enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
light.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var light in _lights)
|
if (_stars.Count > 0)
|
||||||
{
|
{
|
||||||
// Minimum 50km range so it's not badly noticeable for dim stars
|
if (_activeStar == null || !_activeStar.gameObject.activeInHierarchy)
|
||||||
if ((light.transform.position - origin).sqrMagnitude <= Mathf.Max(light.range * light.range, 2500000000)) light.enabled = true;
|
{
|
||||||
else light.enabled = false;
|
if (_stars.Contains(_activeStar))
|
||||||
|
{
|
||||||
|
_stars.Remove(_activeStar);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_stars.Count > 0)
|
||||||
|
{
|
||||||
|
ChangeActiveStar(_stars[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var (_, material) in AtmosphereBuilder.Skys)
|
||||||
|
{
|
||||||
|
material.SetFloat(SunIntensity, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Update atmo shaders
|
||||||
|
foreach (var (planet, material) in AtmosphereBuilder.Skys)
|
||||||
|
{
|
||||||
|
var sqrDist = (planet.transform.position - _activeStar.transform.position).sqrMagnitude;
|
||||||
|
var intensity = Mathf.Min(_activeStar.Intensity / (sqrDist / hearthSunDistanceSqr), 1f);
|
||||||
|
|
||||||
|
material.SetFloat(SunIntensity, intensity);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var star in _stars)
|
||||||
|
{
|
||||||
|
if (star == null) continue;
|
||||||
|
if (!(star.gameObject.activeSelf && star.gameObject.activeInHierarchy)) continue;
|
||||||
|
|
||||||
|
if (star.Intensity * (star.transform.position - origin).sqrMagnitude < _activeStar.Intensity * (_activeStar.transform.position - origin).sqrMagnitude)
|
||||||
|
{
|
||||||
|
ChangeActiveStar(star);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,8 +184,8 @@ namespace NewHorizons.Components
|
|||||||
_sunLightParamUpdater._propID_OWSunColorIntensity = Shader.PropertyToID("_OWSunColorIntensity");
|
_sunLightParamUpdater._propID_OWSunColorIntensity = Shader.PropertyToID("_OWSunColorIntensity");
|
||||||
|
|
||||||
// For the param thing to work it wants this to be on the star idk
|
// For the param thing to work it wants this to be on the star idk
|
||||||
this.transform.parent = star.transform;
|
transform.parent = star.transform;
|
||||||
this.transform.localPosition = Vector3.zero;
|
transform.localPosition = Vector3.zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(OWTriggerVolume))]
|
[RequireComponent(typeof(OWTriggerVolume))]
|
||||||
public abstract class BaseVolume : MonoBehaviour
|
public abstract class BaseVolume : MonoBehaviour
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
using NewHorizons.OtherMods.AchievementsPlus.NH;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class BlackHoleDestructionVolume : DestructionVolume
|
public class BlackHoleDestructionVolume : DestructionVolume
|
||||||
{
|
{
|
||||||
@ -15,7 +15,7 @@ namespace NewHorizons.Components
|
|||||||
SurveyorProbe requiredComponent = probeBody.GetRequiredComponent<SurveyorProbe>();
|
SurveyorProbe requiredComponent = probeBody.GetRequiredComponent<SurveyorProbe>();
|
||||||
if (requiredComponent.IsLaunched())
|
if (requiredComponent.IsLaunched())
|
||||||
{
|
{
|
||||||
UnityEngine.Object.Destroy(requiredComponent.gameObject);
|
Destroy(requiredComponent.gameObject);
|
||||||
ProbeLostAchievement.Earn();
|
ProbeLostAchievement.Earn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class ChangeStarSystemVolume : BlackHoleDestructionVolume
|
public class ChangeStarSystemVolume : BlackHoleDestructionVolume
|
||||||
{
|
{
|
||||||
@ -6,7 +6,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class InterferenceVolume : BaseVolume
|
public class InterferenceVolume : BaseVolume
|
||||||
{
|
{
|
||||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class MapRestrictionVolume : BaseVolume
|
public class MapRestrictionVolume : BaseVolume
|
||||||
{
|
{
|
||||||
@ -1,5 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class NHFluidVolume : RadialFluidVolume
|
public class NHFluidVolume : RadialFluidVolume
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class NHInnerFogWarpVolume : InnerFogWarpVolume
|
public class NHInnerFogWarpVolume : InnerFogWarpVolume
|
||||||
{
|
{
|
||||||
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class NotificationVolume : BaseVolume
|
public class NotificationVolume : BaseVolume
|
||||||
{
|
{
|
||||||
@ -16,7 +16,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public void SetPinned(bool pin) => _pin = pin;
|
public void SetPinned(bool pin) => _pin = pin;
|
||||||
|
|
||||||
public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse<NotificationTarget>(target.ToString(), NotificationTarget.All));
|
public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse(target.ToString(), NotificationTarget.All));
|
||||||
|
|
||||||
public void SetTarget(NotificationTarget target) => _target = target;
|
public void SetTarget(NotificationTarget target) => _target = target;
|
||||||
|
|
||||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Components
|
namespace NewHorizons.Components.Volumes
|
||||||
{
|
{
|
||||||
public class RingFluidVolume : SimpleFluidVolume
|
public class RingFluidVolume : SimpleFluidVolume
|
||||||
{
|
{
|
||||||
@ -14,7 +14,7 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
ForceDetector forceDetector = hitObj.GetComponent<ForceDetector>();
|
ForceDetector forceDetector = hitObj.GetComponent<ForceDetector>();
|
||||||
if (forceDetector != null && forceDetector._activeVolumes != null && forceDetector._activeVolumes.Count > 0 && forceDetector._activeVolumes.Where(activeVolume => activeVolume is ForceVolume).Select(activeVolume => activeVolume as ForceVolume).Any(activeVolume => activeVolume.GetAffectsAlignment(forceDetector._attachedBody))) return;
|
if (forceDetector != null && forceDetector._activeVolumes != null && forceDetector._activeVolumes.Count > 0 && forceDetector._activeVolumes.Where(activeVolume => activeVolume is ForceVolume).Select(activeVolume => activeVolume as ForceVolume).Any(activeVolume => activeVolume.GetAffectsAlignment(forceDetector._attachedBody))) return;
|
||||||
|
|
||||||
fluidDetector.AddVolume(this);
|
fluidDetector.AddVolume(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace NewHorizons.Handlers
|
namespace NewHorizons.Handlers
|
||||||
{
|
{
|
||||||
using InterferenceVolume = NewHorizons.Components.InterferenceVolume;
|
using InterferenceVolume = Components.Volumes.InterferenceVolume;
|
||||||
|
|
||||||
public static class InterferenceHandler
|
public static class InterferenceHandler
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,8 +4,9 @@ using NewHorizons.Builder.General;
|
|||||||
using NewHorizons.Builder.Orbital;
|
using NewHorizons.Builder.Orbital;
|
||||||
using NewHorizons.Builder.Props;
|
using NewHorizons.Builder.Props;
|
||||||
using NewHorizons.Builder.Volumes;
|
using NewHorizons.Builder.Volumes;
|
||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.Components.Orbital;
|
using NewHorizons.Components.Orbital;
|
||||||
|
using NewHorizons.Components.Quantum;
|
||||||
|
using NewHorizons.Components.Stars;
|
||||||
using NewHorizons.OtherMods.OWRichPresence;
|
using NewHorizons.OtherMods.OWRichPresence;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
@ -57,9 +58,9 @@ namespace NewHorizons.Handlers
|
|||||||
GameObject.Destroy(starLightGO.GetComponent<Light>());
|
GameObject.Destroy(starLightGO.GetComponent<Light>());
|
||||||
starLightGO.name = "StarLightController";
|
starLightGO.name = "StarLightController";
|
||||||
|
|
||||||
starLightGO.AddComponent<StarLightController>();
|
starLightGO.AddComponent<SunLightEffectsController>();
|
||||||
StarLightController.AddStar(starController);
|
SunLightEffectsController.AddStar(starController);
|
||||||
StarLightController.AddStarLight(starController.Light);
|
SunLightEffectsController.AddStarLight(starController.Light);
|
||||||
|
|
||||||
starLightGO.SetActive(true);
|
starLightGO.SetActive(true);
|
||||||
|
|
||||||
@ -499,10 +500,10 @@ namespace NewHorizons.Handlers
|
|||||||
{
|
{
|
||||||
var (star, starController, starEvolutionController) = StarBuilder.Make(go, sector, body.Config.Star, body.Mod, body.Config.isStellarRemnant);
|
var (star, starController, starEvolutionController) = StarBuilder.Make(go, sector, body.Config.Star, body.Mod, body.Config.isStellarRemnant);
|
||||||
|
|
||||||
if (starController != null) StarLightController.AddStar(starController);
|
if (starController != null) SunLightEffectsController.AddStar(starController);
|
||||||
|
|
||||||
var starLight = star.FindChild("SunLight");
|
var starLight = star.FindChild("SunLight");
|
||||||
if (starLight != null) StarLightController.AddStarLight(starLight.GetComponent<Light>());
|
if (starLight != null) SunLightEffectsController.AddStarLight(starLight.GetComponent<Light>());
|
||||||
|
|
||||||
// If it has an evolution controller that means it will die -> we make a remnant (unless its a remnant)
|
// If it has an evolution controller that means it will die -> we make a remnant (unless its a remnant)
|
||||||
if (starEvolutionController != null && !body.Config.isStellarRemnant)
|
if (starEvolutionController != null && !body.Config.isStellarRemnant)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Stars;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
using System;
|
using System;
|
||||||
@ -117,8 +117,8 @@ namespace NewHorizons.Handlers
|
|||||||
break;
|
break;
|
||||||
case AstroObject.Name.Sun:
|
case AstroObject.Name.Sun:
|
||||||
var starController = ao.gameObject.GetComponent<StarController>();
|
var starController = ao.gameObject.GetComponent<StarController>();
|
||||||
StarLightController.RemoveStar(starController);
|
SunLightEffectsController.RemoveStar(starController);
|
||||||
StarLightController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
|
SunLightEffectsController.RemoveStarLight(ao.transform.Find("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
|
||||||
GameObject.Destroy(starController);
|
GameObject.Destroy(starController);
|
||||||
|
|
||||||
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();
|
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components.ShipLog;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components.ShipLog;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using NewHorizons.Builder.Atmosphere;
|
|||||||
using NewHorizons.Builder.Body;
|
using NewHorizons.Builder.Body;
|
||||||
using NewHorizons.Builder.Props;
|
using NewHorizons.Builder.Props;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
|
using NewHorizons.Components.Fixers;
|
||||||
using NewHorizons.Components.SizeControllers;
|
using NewHorizons.Components.SizeControllers;
|
||||||
using NewHorizons.External;
|
using NewHorizons.External;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
@ -353,6 +354,7 @@ namespace NewHorizons
|
|||||||
|
|
||||||
var map = GameObject.FindObjectOfType<MapController>();
|
var map = GameObject.FindObjectOfType<MapController>();
|
||||||
if (map != null) map._maxPanDistance = FurthestOrbit * 1.5f;
|
if (map != null) map._maxPanDistance = FurthestOrbit * 1.5f;
|
||||||
|
|
||||||
// Fix the map satellite
|
// Fix the map satellite
|
||||||
SearchUtilities.Find("HearthianMapSatellite_Body", false).AddComponent<MapSatelliteOrbitFix>();
|
SearchUtilities.Find("HearthianMapSatellite_Body", false).AddComponent<MapSatelliteOrbitFix>();
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components.ShipLog;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Quantum;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.Components;
|
using NewHorizons.Components.Volumes;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Patches
|
namespace NewHorizons.Patches
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NewHorizons.OtherMods.AchievementsPlus;
|
using NewHorizons.OtherMods.AchievementsPlus;
|
||||||
using NewHorizons.Builder.ShipLog;
|
using NewHorizons.Builder.ShipLog;
|
||||||
using NewHorizons.Components;
|
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using System;
|
using System;
|
||||||
@ -10,6 +9,8 @@ using System.Linq;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
using NewHorizons.Components.ShipLog;
|
||||||
|
|
||||||
namespace NewHorizons.Patches
|
namespace NewHorizons.Patches
|
||||||
{
|
{
|
||||||
[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user