mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make nh work with eye (partially)
This commit is contained in:
parent
7e020b2537
commit
aff44f3f18
@ -1,4 +1,5 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Handlers;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
|
||||
@ -61,7 +62,7 @@ namespace NewHorizons.AchievementsPlus
|
||||
{
|
||||
foreach (var fact in factIDs)
|
||||
{
|
||||
if (!Locator.GetShipLogManager().IsFactRevealed(fact)) return false;
|
||||
if (!ShipLogHandler.KnowsFact(fact)) return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
NewHorizons/Assets/eye symbol.png
Normal file
BIN
NewHorizons/Assets/eye symbol.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
6
NewHorizons/Assets/translations/chinese_simple.json
Normal file
6
NewHorizons/Assets/translations/chinese_simple.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "飞船"
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,8 @@
|
||||
"FREQ_WARP_CORE": "Anti-Graviton Flux",
|
||||
"FREQ_UNKNOWN": "???",
|
||||
"ENGAGE_WARP_PROMPT": "Engage Warp To {0}",
|
||||
"WARP_LOCKED": "AUTOPILOT LOCKED TO:\n{0}"
|
||||
"WARP_LOCKED": "AUTOPILOT LOCKED TO:\n{0}",
|
||||
"Vessel": "Vessel"
|
||||
},
|
||||
"AchievementTranslations": {
|
||||
"NH_EATEN_OUTSIDE_BRAMBLE": {
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"INTERSTELLAR_MODE": "Mode Interstellaire",
|
||||
"FREQ_STATUE": "Statue Nomaï",
|
||||
"FREQ_WARP_CORE": "Flux Anti-Gravitonique",
|
||||
"FREQ_UNKNOWN": "???"
|
||||
"FREQ_UNKNOWN": "???",
|
||||
"Vessel": "Vaisseau"
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@
|
||||
"INTERSTELLAR_MODE": "Interstellar Modus",
|
||||
"FREQ_STATUE": "Nomai-Statue",
|
||||
"FREQ_WARP_CORE": "Anti-Gravitations Flux",
|
||||
"FREQ_UNKNOWN": "???"
|
||||
"FREQ_UNKNOWN": "???",
|
||||
"Vessel": "Gefährts"
|
||||
}
|
||||
}
|
||||
6
NewHorizons/Assets/translations/italian.json
Normal file
6
NewHorizons/Assets/translations/italian.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "Vascello"
|
||||
}
|
||||
}
|
||||
6
NewHorizons/Assets/translations/japanese.json
Normal file
6
NewHorizons/Assets/translations/japanese.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "船"
|
||||
}
|
||||
}
|
||||
6
NewHorizons/Assets/translations/korean.json
Normal file
6
NewHorizons/Assets/translations/korean.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "함선"
|
||||
}
|
||||
}
|
||||
6
NewHorizons/Assets/translations/polish.json
Normal file
6
NewHorizons/Assets/translations/polish.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "Statku"
|
||||
}
|
||||
}
|
||||
6
NewHorizons/Assets/translations/portuguese_br.json
Normal file
6
NewHorizons/Assets/translations/portuguese_br.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "Hospedeiro"
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@
|
||||
"FREQ_WARP_CORE": "Гиперядро",
|
||||
"FREQ_UNKNOWN": "???",
|
||||
"ENGAGE_WARP_PROMPT": "Телепортироваться к {0}",
|
||||
"WARP_LOCKED": "АВТОПИЛОТ ЗАКРЕПЛЁН НА:\n{0}"
|
||||
"WARP_LOCKED": "АВТОПИЛОТ ЗАКРЕПЛЁН НА:\n{0}",
|
||||
"Vessel": "«Звездолёта»"
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
"FREQ_WARP_CORE": "Flujo De Anti-Gravitones",
|
||||
"FREQ_UNKNOWN": "???",
|
||||
"ENGAGE_WARP_PROMPT": "Iniciar teletransporte a {0}",
|
||||
"WARP_LOCKED": "Piloto automático fijado en:\n{0}"
|
||||
"WARP_LOCKED": "Piloto automático fijado en:\n{0}",
|
||||
"Vessel": "Nave"
|
||||
},
|
||||
"AchievementTranslations": {
|
||||
"NH_EATEN_OUTSIDE_BRAMBLE": {
|
||||
|
||||
6
NewHorizons/Assets/translations/turkish.json
Normal file
6
NewHorizons/Assets/translations/turkish.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json",
|
||||
"UIDictionary": {
|
||||
"Vessel": "Tekne"
|
||||
}
|
||||
}
|
||||
@ -36,9 +36,11 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
rulesetGO.AddComponent<AntiTravelMusicRuleset>();
|
||||
|
||||
var gdRuleset = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Volumes_GD/RulesetVolumes_GD")?.GetComponent<EffectRuleset>();
|
||||
if (gdRuleset != null)
|
||||
{
|
||||
EffectRuleset ER = rulesetGO.AddComponent<EffectRuleset>();
|
||||
ER._type = EffectRuleset.BubbleType.Underwater;
|
||||
var gdRuleset = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Volumes_GD/RulesetVolumes_GD").GetComponent<EffectRuleset>();
|
||||
|
||||
ER._material = gdRuleset._material;
|
||||
|
||||
@ -48,6 +50,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
cloudMaterial.SetColor(FogColor, config.Atmosphere.clouds.tint.ToColor());
|
||||
}
|
||||
ER._cloudMaterial = cloudMaterial;
|
||||
}
|
||||
|
||||
if (config.Base.zeroGravityRadius != 0)
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
public static void Make(GameObject planetGO, NewHorizonsBody body)
|
||||
{
|
||||
if (lavaMaterial == null) lavaMaterial = SearchUtilities.FindObjectOfTypeAndName<ProxyOrbiter>("VolcanicMoon_Body").transform.Find("LavaSphere").GetComponent<MeshRenderer>().material;
|
||||
if (lavaMaterial == null) lavaMaterial = SearchUtilities.FindObjectOfTypeAndName<ProxyOrbiter>("VolcanicMoon_Body")?.transform.Find("LavaSphere").GetComponent<MeshRenderer>().material;
|
||||
|
||||
var proxyName = $"{body.Config.name}_Proxy";
|
||||
|
||||
|
||||
@ -6,7 +6,10 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static void Make(GameObject planetGO, Sector sector, float scale, float intensity)
|
||||
{
|
||||
GameObject lightGO = GameObject.Instantiate(SearchUtilities.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), sector?.transform ?? planetGO.transform);
|
||||
var bhAmbientLight = SearchUtilities.Find("BrittleHollow_Body/AmbientLight_BH_Surface");
|
||||
if (bhAmbientLight == null) return;
|
||||
|
||||
GameObject lightGO = GameObject.Instantiate(bhAmbientLight, sector?.transform ?? planetGO.transform);
|
||||
lightGO.transform.position = planetGO.transform.position;
|
||||
lightGO.name = "Light";
|
||||
|
||||
|
||||
17
NewHorizons/Components/EyeAstroObject.cs
Normal file
17
NewHorizons/Components/EyeAstroObject.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using NewHorizons.Utility;
|
||||
|
||||
namespace NewHorizons.Components.Orbital
|
||||
{
|
||||
public class EyeAstroObject : AstroObject
|
||||
{
|
||||
public new void Awake()
|
||||
{
|
||||
_owRigidbody = GetComponent<OWRigidbody>();
|
||||
}
|
||||
|
||||
public void Register()
|
||||
{
|
||||
Locator.RegisterAstroObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,6 +63,7 @@ namespace NewHorizons.Components
|
||||
// Conditions to allow warping into that system (either no planets (stock system) or has a ship spawn point)
|
||||
var flag = false;
|
||||
if (starSystem.Equals("SolarSystem")) flag = true;
|
||||
else if (starSystem.Equals("EyeOfTheUniverse")) flag = false;
|
||||
else if (config.Spawn?.shipSpawnPoint != null) flag = true;
|
||||
|
||||
if (!StarChartHandler.HasUnlockedSystem(starSystem)) continue;
|
||||
@ -73,10 +74,8 @@ namespace NewHorizons.Components
|
||||
}
|
||||
}
|
||||
|
||||
//AddSystemCard("EyeOfTheUniverse");
|
||||
|
||||
/* Ship log manager isnt initiatiized yet
|
||||
if(Locator.GetShipLogManager().IsFactRevealed("OPC_EYE_COORDINATES_X1"))
|
||||
/*
|
||||
if(VesselCoordinatePromptHandler.KnowsEyeCoordinates())
|
||||
{
|
||||
AddSystemCard("EyeOfTheUniverse");
|
||||
}
|
||||
@ -130,6 +129,10 @@ namespace NewHorizons.Components
|
||||
{
|
||||
texture = ImageUtilities.GetTexture(Main.Instance, "Assets/hearthian system.png");
|
||||
}
|
||||
else if (uniqueID.Equals("EyeOfTheUniverse"))
|
||||
{
|
||||
texture = ImageUtilities.GetTexture(Main.Instance, "Assets/eye symbol.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
var path = $"planets/{uniqueID}.png";
|
||||
|
||||
@ -29,22 +29,24 @@ namespace NewHorizons.Components
|
||||
{
|
||||
_blackHolePrefab = SearchUtilities.Find(_blackHolePath);
|
||||
_whiteHolePrefab = SearchUtilities.Find(_whiteHolePath);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
MakeBlackHole();
|
||||
MakeWhiteHole();
|
||||
|
||||
_isWarpingIn = false;
|
||||
|
||||
if (_oneShotSource == null)
|
||||
{
|
||||
var audioObject = new GameObject("WarpOneShot");
|
||||
audioObject.transform.parent = transform;
|
||||
audioObject.SetActive(false);
|
||||
_oneShotSource = audioObject.AddComponent<OWAudioSource>();
|
||||
_oneShotSource._track = OWAudioMixer.TrackName.Ship;
|
||||
audioObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_isWarpingIn = false;
|
||||
GlobalMessenger.AddListener("FinishOpenEyes", new Callback(OnFinishOpenEyes));
|
||||
}
|
||||
|
||||
@ -55,6 +57,9 @@ namespace NewHorizons.Components
|
||||
|
||||
private void MakeBlackHole()
|
||||
{
|
||||
if (_blackhole != null) return;
|
||||
if (_blackHolePrefab == null) return;
|
||||
|
||||
var blackHoleShader = _blackHolePrefab.GetComponent<MeshRenderer>().material.shader;
|
||||
if (blackHoleShader == null) blackHoleShader = _blackHolePrefab.GetComponent<MeshRenderer>().sharedMaterial.shader;
|
||||
|
||||
@ -79,6 +84,9 @@ namespace NewHorizons.Components
|
||||
|
||||
private void MakeWhiteHole()
|
||||
{
|
||||
if (_whitehole != null) return;
|
||||
if (_whiteHolePrefab == null) return;
|
||||
|
||||
var whiteHoleShader = _whiteHolePrefab.GetComponent<MeshRenderer>().material.shader;
|
||||
if (whiteHoleShader == null) whiteHoleShader = _whiteHolePrefab.GetComponent<MeshRenderer>().sharedMaterial.shader;
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@ namespace NewHorizons.Handlers
|
||||
_existingBodyDict = new();
|
||||
_customBodyDict = new();
|
||||
|
||||
if (Main.Instance.CurrentStarSystem != "EyeOfTheUniverse")
|
||||
{
|
||||
// Set up stars
|
||||
// Need to manage this when there are multiple stars
|
||||
var sun = SearchUtilities.Find("Sun_Body");
|
||||
@ -59,6 +61,7 @@ namespace NewHorizons.Handlers
|
||||
StarLightController.AddStar(starController);
|
||||
|
||||
starLightGO.SetActive(true);
|
||||
}
|
||||
|
||||
// Load all planets
|
||||
var toLoad = bodies.ToList();
|
||||
@ -124,7 +127,7 @@ namespace NewHorizons.Handlers
|
||||
|
||||
// Events.FireOnNextUpdate(PlanetDestroyer.RemoveAllProxies);
|
||||
|
||||
if (Main.SystemDict[Main.Instance.CurrentStarSystem].Config.destroyStockPlanets) PlanetDestructionHandler.RemoveSolarSystem();
|
||||
if (Main.SystemDict[Main.Instance.CurrentStarSystem].Config.destroyStockPlanets) PlanetDestructionHandler.RemoveStockPlanets();
|
||||
}
|
||||
|
||||
public static bool LoadBody(NewHorizonsBody body, bool defaultPrimaryToSun = false)
|
||||
|
||||
@ -31,12 +31,26 @@ namespace NewHorizons.Handlers
|
||||
"White Hole"
|
||||
};
|
||||
|
||||
private static readonly string[] _eyeOfTheUniverseBodies = new string[]
|
||||
{
|
||||
"Eye Of The Universe",
|
||||
"Vessel"
|
||||
};
|
||||
|
||||
private static readonly string[] _suspendBlacklist = new string[]
|
||||
{
|
||||
"Player_Body",
|
||||
"Ship_Body"
|
||||
};
|
||||
|
||||
public static void RemoveStockPlanets()
|
||||
{
|
||||
if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse")
|
||||
RemoveEyeOfTheUniverse();
|
||||
else
|
||||
RemoveSolarSystem();
|
||||
}
|
||||
|
||||
public static void RemoveSolarSystem()
|
||||
{
|
||||
// Stop the sun from killing the player
|
||||
@ -54,6 +68,16 @@ namespace NewHorizons.Handlers
|
||||
Delay.FireInNUpdates(() => { if (Locator.GetAstroObject(AstroObject.Name.Sun).gameObject.activeInHierarchy) { sunVolumes.SetActive(true); } }, 3);
|
||||
}
|
||||
|
||||
public static void RemoveEyeOfTheUniverse()
|
||||
{
|
||||
foreach (var name in _eyeOfTheUniverseBodies)
|
||||
{
|
||||
var ao = AstroObjectLocator.GetAstroObject(name);
|
||||
if (ao != null) Delay.FireInNUpdates(() => RemoveBody(ao, false), 2);
|
||||
else Logger.LogError($"Couldn't find [{name}]");
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveBody(AstroObject ao, bool delete = false, List<AstroObject> toDestroy = null)
|
||||
{
|
||||
Logger.LogVerbose($"Removing [{ao.name}]");
|
||||
|
||||
@ -40,6 +40,12 @@ namespace NewHorizons.Handlers
|
||||
SunConfig.name = "Sun";
|
||||
_rootNode = ConstructGraph(new NewHorizonsBody(SunConfig, Main.Instance), bodies);
|
||||
}
|
||||
else if (centers.Length == 0 && Main.Instance.CurrentStarSystem == "EyeOfTheUniverse")
|
||||
{
|
||||
var EyeConfig = new PlanetConfig();
|
||||
EyeConfig.name = "Eye Of The Universe";
|
||||
_rootNode = ConstructGraph(new NewHorizonsBody(EyeConfig, Main.Instance), bodies);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogError($"There must be one and only one centerOfSolarSystem! Found [{centers.Length}]");
|
||||
|
||||
@ -108,5 +108,13 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
return _nhBodyToAstroIDs.ContainsKey(body) && _nhBodyToAstroIDs[body].Length > 0;
|
||||
}
|
||||
|
||||
public static bool KnowsFact(string fact)
|
||||
{
|
||||
// Works normally in the main system, else check save data directly
|
||||
var shipLogManager = Locator.GetShipLogManager();
|
||||
if (Main.Instance.CurrentStarSystem == "SolarSystem" && shipLogManager != null) return shipLogManager.IsFactRevealed(fact);
|
||||
else return PlayerData._currentGameSave.shipLogFactSaves.ContainsKey(fact) && PlayerData._currentGameSave.shipLogFactSaves[fact].revealOrder > -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,9 @@ namespace NewHorizons.Handlers
|
||||
SkyboxBuilder.Make(system.Config.Skybox, system.Mod);
|
||||
}
|
||||
|
||||
|
||||
if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse") return;
|
||||
|
||||
if (system.Config.enableTimeLoop)
|
||||
{
|
||||
var timeLoopController = new GameObject("TimeLoopController");
|
||||
|
||||
@ -44,6 +44,7 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
var texture = MakeTexture(coords.x, coords.y, coords.z);
|
||||
|
||||
if (_textureCache == null) _textureCache = new List<Texture2D>();
|
||||
_textureCache.Add(texture);
|
||||
|
||||
var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(texture.width / 2f, texture.height / 2f));
|
||||
@ -61,15 +62,18 @@ namespace NewHorizons.Handlers
|
||||
// Gets called from the patches
|
||||
public static void SetPromptVisibility(bool visible)
|
||||
{
|
||||
if (_factSystemIDPrompt == null) return;
|
||||
foreach (var pair in _factSystemIDPrompt)
|
||||
{
|
||||
var fact = pair.Item1;
|
||||
var systemID = pair.Item2;
|
||||
var prompt = pair.Item3;
|
||||
|
||||
if (prompt != null)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
if (Main.Instance.CurrentStarSystem != systemID && (string.IsNullOrEmpty(fact) || Locator.GetShipLogManager().IsFactRevealed(fact)))
|
||||
if (Main.Instance.CurrentStarSystem != systemID && (string.IsNullOrEmpty(fact) || ShipLogHandler.KnowsFact(fact)))
|
||||
{
|
||||
prompt.SetVisibility(true);
|
||||
}
|
||||
@ -84,6 +88,7 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Texture2D MakeTexture(params int[][] coords)
|
||||
{
|
||||
@ -191,11 +196,6 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
public static bool KnowsEyeCoordinates()
|
||||
{
|
||||
// Works normally in the main system, else check save data directly
|
||||
if (Main.Instance.CurrentStarSystem == "SolarSystem") return Locator.GetShipLogManager().IsFactRevealed("OPC_EYE_COORDINATES_X1");
|
||||
else return PlayerData._currentGameSave.shipLogFactSaves.ContainsKey("OPC_EYE_COORDINATES_X1") && PlayerData._currentGameSave.shipLogFactSaves["OPC_EYE_COORDINATES_X1"].revealOrder > -1;
|
||||
}
|
||||
public static bool KnowsEyeCoordinates() => ShipLogHandler.KnowsFact("OPC_EYE_COORDINATES_X1");
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ using NewHorizons.Builder.Atmosphere;
|
||||
using NewHorizons.Builder.Body;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Handlers;
|
||||
@ -58,7 +59,7 @@ namespace NewHorizons
|
||||
public static bool HasWarpDrive { get; private set; } = false;
|
||||
|
||||
private string _defaultStarSystem = "SolarSystem";
|
||||
private string _currentStarSystem = "SolarSystem";
|
||||
internal string _currentStarSystem = "SolarSystem";
|
||||
private bool _firstLoad = true;
|
||||
private ShipWarpController _shipWarpController;
|
||||
|
||||
@ -144,6 +145,8 @@ namespace NewHorizons
|
||||
{
|
||||
Config =
|
||||
{
|
||||
destroyStockPlanets = false,
|
||||
factRequiredForWarp = "OPC_EYE_COORDINATES_X1",
|
||||
Vessel = new StarSystemConfig.VesselModule()
|
||||
{
|
||||
coords = new StarSystemConfig.NomaiCoordinates
|
||||
@ -231,6 +234,7 @@ namespace NewHorizons
|
||||
var isTitleScreen = scene.name == "TitleScreen";
|
||||
var isSolarSystem = scene.name == "SolarSystem";
|
||||
var isEyeOfTheUniverse = scene.name == "EyeOfTheUniverse";
|
||||
if (isEyeOfTheUniverse) _currentStarSystem = scene.name;
|
||||
|
||||
if (!SystemDict.ContainsKey(_currentStarSystem) || !BodyDict.ContainsKey(_currentStarSystem))
|
||||
{
|
||||
@ -268,24 +272,55 @@ namespace NewHorizons
|
||||
TitleSceneHandler.InitSubtitles();
|
||||
}
|
||||
|
||||
if (isEyeOfTheUniverse && IsWarpingFromShip)
|
||||
if (isSolarSystem && _ship == null)
|
||||
{
|
||||
if (_ship != null)
|
||||
var ship = SearchUtilities.Find("Ship_Body", false);
|
||||
if (ship != null)
|
||||
{
|
||||
SceneManager.MoveGameObjectToScene(_ship, SceneManager.GetActiveScene());
|
||||
_ship.transform.position = new Vector3(50, 0, 0);
|
||||
_ship.SetActive(true);
|
||||
_ship = ship.InstantiateInactive();
|
||||
_ship.name = ship.name;
|
||||
_ship.AddComponent<ShipWarpController>().Init();
|
||||
DontDestroyOnLoad(_ship);
|
||||
}
|
||||
}
|
||||
|
||||
if (isEyeOfTheUniverse)
|
||||
{
|
||||
var eyeOfTheUniverse = SearchUtilities.Find("EyeOfTheUniverse_Body");
|
||||
var eyeSector = eyeOfTheUniverse.FindChild("Sector_EyeOfTheUniverse").GetComponent<Sector>();
|
||||
var eyeAO = eyeOfTheUniverse.AddComponent<EyeAstroObject>();
|
||||
eyeAO._owRigidbody = eyeOfTheUniverse.GetAttachedOWRigidbody();
|
||||
eyeAO._rootSector = eyeSector;
|
||||
eyeAO._gravityVolume = eyeSector.GetComponentInChildren<GravityVolume>();
|
||||
eyeAO._customName = "Eye Of The Universe";
|
||||
eyeAO._name = AstroObject.Name.Eye;
|
||||
eyeAO._type = AstroObject.Type.None;
|
||||
eyeAO.Register();
|
||||
|
||||
var vessel = SearchUtilities.Find("Vessel_Body");
|
||||
var vesselSector = vessel.FindChild("Sector_VesselBridge").GetComponent<Sector>();
|
||||
var vesselAO = vessel.AddComponent<EyeAstroObject>();
|
||||
vesselAO._owRigidbody = vessel.GetAttachedOWRigidbody();
|
||||
vesselAO._primaryBody = eyeAO;
|
||||
eyeAO._satellite = vesselAO;
|
||||
vesselAO._rootSector = vesselSector;
|
||||
vesselAO._customName = "Vessel";
|
||||
vesselAO._name = AstroObject.Name.CustomString;
|
||||
vesselAO._type = AstroObject.Type.SpaceStation;
|
||||
vesselAO.Register();
|
||||
|
||||
if (IsWarpingFromShip && _ship != null)
|
||||
{
|
||||
var eyeShip = GameObject.Instantiate(_ship);
|
||||
eyeShip.name = "Ship_Body";
|
||||
_shipWarpController = eyeShip.GetComponent<ShipWarpController>();
|
||||
SceneManager.MoveGameObjectToScene(eyeShip, scene);
|
||||
eyeShip.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isSolarSystem || isEyeOfTheUniverse)
|
||||
{
|
||||
if (_ship != null)
|
||||
{
|
||||
_ship = SearchUtilities.Find("Ship_Body").InstantiateInactive();
|
||||
DontDestroyOnLoad(_ship);
|
||||
}
|
||||
|
||||
IsSystemReady = false;
|
||||
|
||||
NewHorizonsData.Load();
|
||||
@ -300,13 +335,9 @@ namespace NewHorizons
|
||||
AtmosphereBuilder.Init();
|
||||
BrambleNodeBuilder.Init(BodyDict[CurrentStarSystem].Select(x => x.Config).Where(x => x.Bramble?.dimension != null).ToArray());
|
||||
|
||||
if (isSolarSystem)
|
||||
{
|
||||
PlanetCreationHandler.Init(BodyDict[CurrentStarSystem]);
|
||||
|
||||
VesselWarpHandler.LoadVessel();
|
||||
if (isSolarSystem) VesselWarpHandler.LoadVessel();
|
||||
SystemCreationHandler.LoadSystem(SystemDict[CurrentStarSystem]);
|
||||
}
|
||||
|
||||
LoadTranslations(ModHelper.Manifest.ModFolderPath + "Assets/", this);
|
||||
|
||||
@ -315,8 +346,11 @@ namespace NewHorizons
|
||||
{
|
||||
// Warp drive
|
||||
HasWarpDrive = StarChartHandler.CanWarp();
|
||||
if (_shipWarpController == null)
|
||||
{
|
||||
_shipWarpController = SearchUtilities.Find("Ship_Body").AddComponent<ShipWarpController>();
|
||||
_shipWarpController.Init();
|
||||
}
|
||||
if (HasWarpDrive == true) EnableWarpDrive();
|
||||
|
||||
var shouldWarpInFromShip = IsWarpingFromShip && _shipWarpController != null;
|
||||
@ -380,6 +414,16 @@ namespace NewHorizons
|
||||
var remoteViewer = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_NorthPoleSurface/Interactables_NorthPoleSurface/LowBuilding/Prefab_NOM_RemoteViewer").GetComponent<NomaiRemoteCameraPlatform>();
|
||||
remoteViewer._visualSector = northPoleSurface;
|
||||
}
|
||||
else if (isEyeOfTheUniverse)
|
||||
{
|
||||
Instance.ModHelper.Events.Unity.FireOnNextUpdate(() =>
|
||||
{
|
||||
IsSystemReady = true;
|
||||
OnSystemReady(false, false);
|
||||
});
|
||||
IsWarpingFromShip = false;
|
||||
IsWarpingFromVessel = false;
|
||||
}
|
||||
|
||||
//Stop starfield from disappearing when there is no lights
|
||||
var playerBody = SearchUtilities.Find("Player_Body");
|
||||
@ -629,6 +673,8 @@ namespace NewHorizons
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerData.SaveEyeCompletion();
|
||||
|
||||
if (SystemDict[_currentStarSystem].Config.enableTimeLoop) SecondsElapsedInLoop = TimeLoop.GetSecondsElapsed();
|
||||
else SecondsElapsedInLoop = -1;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Patches
|
||||
{
|
||||
@ -13,6 +13,13 @@ namespace NewHorizons.Patches
|
||||
return (Main.Instance.CurrentStarSystem != "EyeOfTheUniverse");
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(SubmitActionLoadScene), nameof(SubmitActionLoadScene.ConfirmSubmit))]
|
||||
public static void SubmitActionLoadScene_ConfirmSubmit(SubmitActionLoadScene __instance)
|
||||
{
|
||||
if (__instance._sceneToLoad == SubmitActionLoadScene.LoadableScenes.EYE) Main.Instance._currentStarSystem = "EyeOfTheUniverse";
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShipThrusterController), nameof(ShipThrusterController.ReadTranslationalInput))]
|
||||
public static bool ShipThrusterController_ReadTranslationalInput(ShipThrusterController __instance, ref Vector3 __result)
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
using HarmonyLib;
|
||||
using NewHorizons.Components;
|
||||
|
||||
namespace NewHorizons.Patches
|
||||
{
|
||||
[HarmonyPatch]
|
||||
public static class LocatorPatches
|
||||
{
|
||||
public static AstroObject _eye;
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Locator), nameof(Locator.RegisterCloakFieldController))]
|
||||
public static bool Locator_RegisterCloakFieldController()
|
||||
@ -31,5 +35,36 @@ namespace NewHorizons.Patches
|
||||
{
|
||||
__result = __result || Components.CloakSectorController.isShipInside;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Locator), nameof(Locator.GetAstroObject))]
|
||||
public static bool Locator_GetAstroObject(AstroObject.Name astroObjectName, ref AstroObject __result)
|
||||
{
|
||||
if (astroObjectName == AstroObject.Name.Eye && _eye != null)
|
||||
{
|
||||
__result = _eye;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Locator), nameof(Locator.RegisterAstroObject))]
|
||||
public static bool Locator_RegisterAstroObject(AstroObject astroObject)
|
||||
{
|
||||
if (astroObject._name == AstroObject.Name.Eye)
|
||||
{
|
||||
_eye = astroObject;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(Locator), nameof(Locator.ClearReferences))]
|
||||
public static void Locator_ClearReferences()
|
||||
{
|
||||
_eye = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ namespace NewHorizons.Patches
|
||||
{
|
||||
bool canWarpToEye = __instance._coordinateInterface.CheckEyeCoordinates();
|
||||
bool canWarpToStarSystem = __instance._coordinateInterface.CheckAllCoordinates(out string targetSystem);
|
||||
if (slot == __instance._warpVesselSlot && __instance._hasPower && (canWarpToEye || (canWarpToStarSystem && targetSystem != Main.Instance.CurrentStarSystem)) && __instance._blackHole.GetState() == SingularityController.State.Collapsed && LoadManager.GetCurrentScene() != OWScene.EyeOfTheUniverse)
|
||||
if (slot == __instance._warpVesselSlot && __instance._hasPower && ((canWarpToEye && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse") || (canWarpToStarSystem && targetSystem != Main.Instance.CurrentStarSystem)) && __instance._blackHole.GetState() == SingularityController.State.Collapsed)
|
||||
{
|
||||
__instance._blackHole.Create();
|
||||
RumbleManager.StartVesselWarp();
|
||||
@ -56,7 +56,10 @@ namespace NewHorizons.Patches
|
||||
__instance.enabled = true;
|
||||
Locator.GetPauseCommandListener().AddPauseCommandLock();
|
||||
if (canWarpToEye || (canWarpToStarSystem && targetSystem == "EyeOfTheUniverse"))
|
||||
{
|
||||
Main.Instance._currentStarSystem = "EyeOfTheUniverse";
|
||||
LoadManager.LoadSceneAsync(OWScene.EyeOfTheUniverse, false, LoadManager.FadeType.ToWhite);
|
||||
}
|
||||
else if (canWarpToStarSystem)
|
||||
Main.Instance.ChangeCurrentStarSystem(targetSystem, false, true);
|
||||
__instance._blackHoleOneShot.PlayOneShot(AudioType.VesselSingularityCreate);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using HarmonyLib;
|
||||
using HarmonyLib;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.Handlers;
|
||||
using System;
|
||||
@ -16,14 +16,18 @@ namespace NewHorizons.Patches
|
||||
|
||||
if (ao == null || ao._name != AstroObject.Name.CustomString) return true;
|
||||
|
||||
if (ao is NHAstroObject)
|
||||
__result = string.Empty;
|
||||
|
||||
if (ao is NHAstroObject nhao && nhao.HideDisplayName) return false;
|
||||
|
||||
var customName = ao.GetCustomName();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(customName))
|
||||
{
|
||||
if ((ao as NHAstroObject).HideDisplayName) __result = "";
|
||||
else __result = TranslationHandler.GetTranslation(ao.GetCustomName(), TranslationHandler.TextType.UI);
|
||||
return false;
|
||||
__result = TranslationHandler.GetTranslation(customName, TranslationHandler.TextType.UI);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
|
||||
@ -35,6 +35,7 @@ namespace NewHorizons.Utility
|
||||
if (stringID.Equals("ASH_TWIN")) stringID = "TOWER_TWIN";
|
||||
if (stringID.Equals("EMBER_TWIN")) stringID = "CAVE_TWIN";
|
||||
if (stringID.Equals("INTERLOPER")) stringID = "COMET";
|
||||
if (stringID.Equals("EYE")) stringID = "EYE_OF_THE_UNIVERSE";
|
||||
|
||||
string key;
|
||||
if (stringID.ToUpper().Replace("_", "").Equals("MAPSATELLITE"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user