mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
1.27.3 (#1065)
## Minor features - Added a debug option for visualizing the names of custom bramble warp volumes and their entrances/exits. Resolves #1066 ## Bug fixes - Fixed broken implementation of #1062 by changing TranslationHandler.AddUI to take a bool for translations being uppercase. - NH-made spawn points now show up in Cheat And Debug Menu's spawn point teleporter
This commit is contained in:
commit
4b0d65a0ad
@ -5,6 +5,7 @@ using NewHorizons.External;
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.External.Modules.Props;
|
using NewHorizons.External.Modules.Props;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
using NewHorizons.Utility.DebugTools;
|
||||||
using NewHorizons.Utility.Files;
|
using NewHorizons.Utility.Files;
|
||||||
using NewHorizons.Utility.OWML;
|
using NewHorizons.Utility.OWML;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
@ -189,6 +190,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
outerFogWarpVolume._linkedInnerWarpVolume = null;
|
outerFogWarpVolume._linkedInnerWarpVolume = null;
|
||||||
outerFogWarpVolume._name = OuterFogWarpVolume.Name.None;
|
outerFogWarpVolume._name = OuterFogWarpVolume.Name.None;
|
||||||
outerFogWarpVolume._sector = sector;
|
outerFogWarpVolume._sector = sector;
|
||||||
|
exitWarps.GetAddComponent<DebugFogWarp>().fogWarpVolume = outerFogWarpVolume;
|
||||||
|
|
||||||
PairExit(config.linksTo, outerFogWarpVolume);
|
PairExit(config.linksTo, outerFogWarpVolume);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
using NewHorizons.Components;
|
using NewHorizons.Components;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -16,7 +15,7 @@ namespace NewHorizons.Builder.General
|
|||||||
{
|
{
|
||||||
var module = config.MapMarker;
|
var module = config.MapMarker;
|
||||||
NHMapMarker mapMarker = body.AddComponent<NHMapMarker>();
|
NHMapMarker mapMarker = body.AddComponent<NHMapMarker>();
|
||||||
mapMarker._labelID = (UITextType)TranslationHandler.AddUI(config.name.ToUpperFixed());
|
mapMarker._labelID = (UITextType)TranslationHandler.AddUI(config.name, true);
|
||||||
|
|
||||||
var markerType = MapMarker.MarkerType.Planet;
|
var markerType = MapMarker.MarkerType.Planet;
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,8 @@ namespace NewHorizons.Builder.General
|
|||||||
PlayerSpawn = playerSpawn;
|
PlayerSpawn = playerSpawn;
|
||||||
PlayerSpawnInfo = point;
|
PlayerSpawnInfo = point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spawnGO.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +79,6 @@ namespace NewHorizons.Builder.General
|
|||||||
foreach (var point in module.shipSpawnPoints)
|
foreach (var point in module.shipSpawnPoints)
|
||||||
{
|
{
|
||||||
var spawnGO = GeneralPropBuilder.MakeNew("ShipSpawnPoint", planetGO, null, point);
|
var spawnGO = GeneralPropBuilder.MakeNew("ShipSpawnPoint", planetGO, null, point);
|
||||||
spawnGO.SetActive(false);
|
|
||||||
spawnGO.layer = Layer.PlayerSafetyCollider;
|
spawnGO.layer = Layer.PlayerSafetyCollider;
|
||||||
|
|
||||||
var shipSpawn = spawnGO.AddComponent<SpawnPoint>();
|
var shipSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using NewHorizons.External.Configs;
|
|||||||
using NewHorizons.External.Modules.Props.Audio;
|
using NewHorizons.External.Modules.Props.Audio;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
using NewHorizons.Utility.DebugTools;
|
||||||
using NewHorizons.Utility.OuterWilds;
|
using NewHorizons.Utility.OuterWilds;
|
||||||
using NewHorizons.Utility.OWML;
|
using NewHorizons.Utility.OWML;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@ -204,6 +205,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
foreach (var fogWarpVolume in brambleNode.GetComponentsInChildren<FogWarpVolume>(true).Append(brambleNode.GetComponent<FogWarpVolume>()))
|
foreach (var fogWarpVolume in brambleNode.GetComponentsInChildren<FogWarpVolume>(true).Append(brambleNode.GetComponent<FogWarpVolume>()))
|
||||||
{
|
{
|
||||||
_nhFogWarpVolumes.Add(fogWarpVolume);
|
_nhFogWarpVolumes.Add(fogWarpVolume);
|
||||||
|
if (fogWarpVolume is SphericalFogWarpVolume sphericalFogWarpVolume)
|
||||||
|
{
|
||||||
|
fogWarpVolume.gameObject.GetAddComponent<DebugFogWarp>().fogWarpVolume = sphericalFogWarpVolume;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var innerFogWarpVolume = brambleNode.GetComponent<InnerFogWarpVolume>();
|
var innerFogWarpVolume = brambleNode.GetComponent<InnerFogWarpVolume>();
|
||||||
|
|||||||
@ -96,7 +96,7 @@ namespace NewHorizons.Handlers
|
|||||||
vesselAO._type = AstroObject.Type.SpaceStation;
|
vesselAO._type = AstroObject.Type.SpaceStation;
|
||||||
vesselAO.Register();
|
vesselAO.Register();
|
||||||
vesselMapMarker._markerType = MapMarker.MarkerType.Moon;
|
vesselMapMarker._markerType = MapMarker.MarkerType.Moon;
|
||||||
vesselMapMarker._labelID = (UITextType)TranslationHandler.AddUI("VESSEL");
|
vesselMapMarker._labelID = (UITextType)TranslationHandler.AddUI("Vessel", true);
|
||||||
RFVolumeBuilder.Make(vessel, vesselBody, 600, new External.Modules.ReferenceFrameModule { localPosition = new MVector3(0, 0, -207.375f) });
|
RFVolumeBuilder.Make(vessel, vesselBody, 600, new External.Modules.ReferenceFrameModule { localPosition = new MVector3(0, 0, -207.375f) });
|
||||||
|
|
||||||
// Resize vessel sector so that the vessel is fully collidable.
|
// Resize vessel sector so that the vessel is fully collidable.
|
||||||
|
|||||||
@ -205,11 +205,14 @@ namespace NewHorizons.Handlers
|
|||||||
TextTranslation.Get().m_table.theShipLogTable[key] = value;
|
TextTranslation.Get().m_table.theShipLogTable[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int AddUI(string rawText)
|
public static int AddUI(string rawText) => AddUI(rawText, false);
|
||||||
|
|
||||||
|
public static int AddUI(string rawText, bool upper)
|
||||||
{
|
{
|
||||||
var uiTable = TextTranslation.Get().m_table.theUITable;
|
var uiTable = TextTranslation.Get().m_table.theUITable;
|
||||||
|
|
||||||
var text = GetTranslation(rawText, TextType.UI);
|
var text = GetTranslation(rawText, TextType.UI);
|
||||||
|
if (upper) text = text.ToUpperFixed();
|
||||||
|
|
||||||
var key = uiTable.Keys.Max() + 1;
|
var key = uiTable.Keys.Max() + 1;
|
||||||
try
|
try
|
||||||
|
|||||||
@ -210,7 +210,7 @@ namespace NewHorizons.Handlers
|
|||||||
vesselWarpController._whiteHoleOneShot = vesselWarpController._whiteHole.transform.parent.Find("WhiteHoleAudio_OneShot").GetComponent<OWAudioSource>();
|
vesselWarpController._whiteHoleOneShot = vesselWarpController._whiteHole.transform.parent.Find("WhiteHoleAudio_OneShot").GetComponent<OWAudioSource>();
|
||||||
vesselWarpController._whiteHole._startActive = true;
|
vesselWarpController._whiteHole._startActive = true;
|
||||||
|
|
||||||
vesselObject.GetComponent<MapMarker>()._labelID = (UITextType)TranslationHandler.AddUI("VESSEL");
|
vesselObject.GetComponent<MapMarker>()._labelID = (UITextType)TranslationHandler.AddUI("Vessel", true);
|
||||||
|
|
||||||
var hasParentBody = !string.IsNullOrEmpty(system.Config.Vessel?.vesselSpawn?.parentBody);
|
var hasParentBody = !string.IsNullOrEmpty(system.Config.Vessel?.vesselSpawn?.parentBody);
|
||||||
var hasPhysics = system.Config.Vessel?.hasPhysics ?? !hasParentBody;
|
var hasPhysics = system.Config.Vessel?.hasPhysics ?? !hasParentBody;
|
||||||
|
|||||||
@ -46,6 +46,7 @@ namespace NewHorizons
|
|||||||
// Settings
|
// Settings
|
||||||
public static bool Debug { get; private set; }
|
public static bool Debug { get; private set; }
|
||||||
public static bool VisualizeQuantumObjects { get; private set; }
|
public static bool VisualizeQuantumObjects { get; private set; }
|
||||||
|
public static bool VisualizeBrambleVolumeNames { get; private set; }
|
||||||
public static bool VerboseLogs { get; private set; }
|
public static bool VerboseLogs { get; private set; }
|
||||||
public static bool SequentialPreCaching { get; private set; }
|
public static bool SequentialPreCaching { get; private set; }
|
||||||
public static bool CustomTitleScreen { get; private set; }
|
public static bool CustomTitleScreen { get; private set; }
|
||||||
@ -138,6 +139,7 @@ namespace NewHorizons
|
|||||||
|
|
||||||
Debug = config.GetSettingsValue<bool>(nameof(Debug));
|
Debug = config.GetSettingsValue<bool>(nameof(Debug));
|
||||||
VisualizeQuantumObjects = config.GetSettingsValue<bool>(nameof(VisualizeQuantumObjects));
|
VisualizeQuantumObjects = config.GetSettingsValue<bool>(nameof(VisualizeQuantumObjects));
|
||||||
|
VisualizeBrambleVolumeNames = config.GetSettingsValue<bool>(nameof(VisualizeBrambleVolumeNames));
|
||||||
VerboseLogs = config.GetSettingsValue<bool>(nameof(VerboseLogs));
|
VerboseLogs = config.GetSettingsValue<bool>(nameof(VerboseLogs));
|
||||||
SequentialPreCaching = config.GetSettingsValue<bool>(nameof(SequentialPreCaching));
|
SequentialPreCaching = config.GetSettingsValue<bool>(nameof(SequentialPreCaching));
|
||||||
|
|
||||||
|
|||||||
52
NewHorizons/Utility/DebugTools/DebugFogWarp.cs
Normal file
52
NewHorizons/Utility/DebugTools/DebugFogWarp.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace NewHorizons.Utility.DebugTools
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Adapted from Survivors https://github.com/Hawkbat/ow-mod-jam-2/blob/main/EscapePodFour.cs#L197
|
||||||
|
/// </summary>
|
||||||
|
[RequireComponent(typeof(SphericalFogWarpVolume))]
|
||||||
|
public class DebugFogWarp : MonoBehaviour
|
||||||
|
{
|
||||||
|
public SphericalFogWarpVolume fogWarpVolume;
|
||||||
|
public void OnGUI()
|
||||||
|
{
|
||||||
|
if (Main.Debug && Main.VisualizeBrambleVolumeNames && fogWarpVolume != null)
|
||||||
|
{
|
||||||
|
DrawWorldLabel(fogWarpVolume, fogWarpVolume.name);
|
||||||
|
if (fogWarpVolume._exits != null)
|
||||||
|
{
|
||||||
|
foreach (var e in fogWarpVolume._exits)
|
||||||
|
{
|
||||||
|
if (e != null)
|
||||||
|
{
|
||||||
|
DrawWorldLabel(fogWarpVolume.GetExitPosition(e), e.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DrawWorldLabel(Component component, string text)
|
||||||
|
{
|
||||||
|
DrawWorldLabel(component.transform.position, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DrawWorldLabel(Vector3 worldPos, string text)
|
||||||
|
{
|
||||||
|
var c = Locator.GetPlayerCamera();
|
||||||
|
var d = Vector3.Distance(c.transform.position, worldPos);
|
||||||
|
if (d > 1000f) return;
|
||||||
|
GUI.Label(new Rect(WorldToGui(worldPos), new Vector2(500f, 20f)), text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector2 WorldToGui(Vector3 wp)
|
||||||
|
{
|
||||||
|
var c = Locator.GetPlayerCamera();
|
||||||
|
var sp = c.WorldToScreenPoint(wp);
|
||||||
|
if (sp.z < 0) return new Vector2(Screen.width, Screen.height);
|
||||||
|
var gp = new Vector2(sp.x, Screen.height - sp.y);
|
||||||
|
return gp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -22,6 +22,12 @@
|
|||||||
"value": false,
|
"value": false,
|
||||||
"tooltip": "Draws boundaries around quantum objects when Debug mode is on."
|
"tooltip": "Draws boundaries around quantum objects when Debug mode is on."
|
||||||
},
|
},
|
||||||
|
"VisualizeBrambleVolumeNames": {
|
||||||
|
"title": "Visualize Bramble Volume Names",
|
||||||
|
"type": "toggle",
|
||||||
|
"value": false,
|
||||||
|
"tooltip": "Adds a label to all custom spherical fog warp volumes and entrances/exits when Debug mode is on."
|
||||||
|
},
|
||||||
"VerboseLogs": {
|
"VerboseLogs": {
|
||||||
"title": "Verbose Logs",
|
"title": "Verbose Logs",
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, and friends",
|
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, and friends",
|
||||||
"name": "New Horizons",
|
"name": "New Horizons",
|
||||||
"uniqueName": "xen.NewHorizons",
|
"uniqueName": "xen.NewHorizons",
|
||||||
"version": "1.27.2",
|
"version": "1.27.3",
|
||||||
"owmlVersion": "2.12.1",
|
"owmlVersion": "2.12.1",
|
||||||
"dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
"dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
||||||
"conflicts": [ "PacificEngine.OW_CommonResources" ],
|
"conflicts": [ "PacificEngine.OW_CommonResources" ],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user