mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Vessel prop tweaks
This commit is contained in:
parent
6553bf1d05
commit
f928309596
@ -62,8 +62,8 @@ namespace NewHorizons.Builder.Props
|
||||
go.transform.localRotation = rot;
|
||||
} else if (parent)
|
||||
{
|
||||
go.transform.position = parent.TransformPoint(pos);
|
||||
go.transform.rotation = parent.TransformRotation(rot);
|
||||
go.transform.position = parent.root.TransformPoint(pos);
|
||||
go.transform.rotation = parent.root.TransformRotation(rot);
|
||||
} else
|
||||
{
|
||||
go.transform.position = pos;
|
||||
|
||||
26
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
26
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
@ -85,16 +85,16 @@ namespace NewHorizons.External.Configs
|
||||
[Obsolete("coords is deprecated, please use Vessel.coords instead")]
|
||||
public NomaiCoordinates coords;
|
||||
|
||||
[Obsolete("vesselPosition is deprecated, please use Vessel.vesselPosition instead")]
|
||||
[Obsolete("vesselPosition is deprecated, please use Vessel.vesselSpawn.position instead")]
|
||||
public MVector3 vesselPosition;
|
||||
|
||||
[Obsolete("vesselRotation is deprecated, please use Vessel.vesselRotation instead")]
|
||||
[Obsolete("vesselRotation is deprecated, please use Vessel.vesselSpawn.rotation instead")]
|
||||
public MVector3 vesselRotation;
|
||||
|
||||
[Obsolete("warpExitPosition is deprecated, please use Vessel.warpExitPosition instead")]
|
||||
[Obsolete("warpExitPosition is deprecated, please use Vessel.warpExit.position instead")]
|
||||
public MVector3 warpExitPosition;
|
||||
|
||||
[Obsolete("warpExitRotation is deprecated, please use Vessel.warpExitRotation instead")]
|
||||
[Obsolete("warpExitRotation is deprecated, please use Vessel.warpExit.rotation instead")]
|
||||
public MVector3 warpExitRotation;
|
||||
|
||||
/// <summary>
|
||||
@ -193,17 +193,17 @@ namespace NewHorizons.External.Configs
|
||||
/// <summary>
|
||||
/// The location that the vessel will warp to.
|
||||
/// </summary>
|
||||
public VesselInfo vessel;
|
||||
public VesselInfo vesselSpawn;
|
||||
|
||||
/// <summary>
|
||||
/// The location that you will be teleported to when you exit the vessel through the black hole.
|
||||
/// </summary>
|
||||
public WarpExitInfo warpExit;
|
||||
|
||||
[Obsolete("vesselPosition is deprecated, use vessel.position instead")] public MVector3 vesselPosition;
|
||||
[Obsolete("vesselRotation is deprecated, use vessel.rotation instead")] public MVector3 vesselRotation;
|
||||
[Obsolete("warpExitPosition is deprecated, use warpExit.position instead")] public MVector3 warpExitPosition;
|
||||
[Obsolete("warpExitRotation is deprecated, use warpExit.rotation instead")] public MVector3 warpExitRotation;
|
||||
[Obsolete("vesselPosition is deprecated, use vesselSpawn.position instead")] public MVector3 vesselPosition;
|
||||
[Obsolete("vesselRotation is deprecated, use vesselSpawn.rotation instead")] public MVector3 vesselRotation;
|
||||
[Obsolete("warpExitPosition is deprecated, use vesselSpawn.position instead")] public MVector3 warpExitPosition;
|
||||
[Obsolete("warpExitRotation is deprecated, use vesselSpawn.rotation instead")] public MVector3 warpExitRotation;
|
||||
|
||||
[JsonObject]
|
||||
public class VesselInfo : PropModule.GeneralSolarSystemPropInfo
|
||||
@ -291,12 +291,12 @@ namespace NewHorizons.External.Configs
|
||||
{
|
||||
if (Vessel.vesselPosition != null || Vessel.vesselRotation != null)
|
||||
{
|
||||
if (Vessel.vessel == null)
|
||||
if (Vessel.vesselSpawn == null)
|
||||
{
|
||||
Vessel.vessel = new VesselModule.VesselInfo();
|
||||
Vessel.vesselSpawn = new VesselModule.VesselInfo();
|
||||
}
|
||||
Vessel.vessel.position ??= Vessel.vesselPosition;
|
||||
Vessel.vessel.rotation ??= Vessel.vesselRotation;
|
||||
Vessel.vesselSpawn.position ??= Vessel.vesselPosition;
|
||||
Vessel.vesselSpawn.rotation ??= Vessel.vesselRotation;
|
||||
}
|
||||
if (Vessel.warpExitPosition != null || Vessel.warpExitRotation != null)
|
||||
{
|
||||
|
||||
@ -85,7 +85,7 @@ namespace NewHorizons.Handlers
|
||||
if (VesselPrefab == null) return null;
|
||||
|
||||
Logger.LogVerbose("Creating Vessel");
|
||||
var vesselObject = GeneralPropBuilder.MakeFromPrefab(VesselPrefab, VesselPrefab.name, null, system.Config.Vessel?.vessel);
|
||||
var vesselObject = GeneralPropBuilder.MakeFromPrefab(VesselPrefab, VesselPrefab.name, null, system.Config.Vessel?.vesselSpawn);
|
||||
VesselObject = vesselObject;
|
||||
|
||||
vesselObject.transform.parent = null;
|
||||
@ -142,7 +142,13 @@ namespace NewHorizons.Handlers
|
||||
|
||||
vesselWarpController._targetWarpPlatform.OnReceiveWarpedBody += OnReceiveWarpedBody;
|
||||
|
||||
GeneralPropBuilder.MakeFromExisting(vesselWarpController._targetWarpPlatform.gameObject, vesselWarpController._targetWarpPlatform.transform.parent, system.Config.Vessel?.warpExit);
|
||||
var attachWarpExitToVessel = system.Config.Vessel?.warpExit?.attachToVessel ?? false;
|
||||
var warpExitParent = vesselWarpController._targetWarpPlatform.transform.parent;
|
||||
var warpExit = GeneralPropBuilder.MakeFromExisting(vesselWarpController._targetWarpPlatform.gameObject, attachWarpExitToVessel ? warpExitParent : null, system.Config.Vessel?.warpExit);
|
||||
if (attachWarpExitToVessel)
|
||||
{
|
||||
warpExit.transform.parent = warpExitParent;
|
||||
}
|
||||
|
||||
vesselObject.GetComponent<MapMarker>()._labelID = (UITextType)TranslationHandler.AddUI("Vessel");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user