mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
1.23.1 (#963)
## Bug fixes - Fix a bug breaking Eyes of the Past and Band Together - Better handle when a mod tries using DLC props when the DLC is not installed
This commit is contained in:
commit
d530957b1a
@ -271,6 +271,15 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
||||||
|
|
||||||
|
// For DLC related props
|
||||||
|
// Make sure to do this before its set active
|
||||||
|
if (!string.IsNullOrEmpty(detail?.path) &&
|
||||||
|
(detail.path.ToLowerInvariant().StartsWith("ringworld") || detail.path.ToLowerInvariant().StartsWith("dreamworld")))
|
||||||
|
{
|
||||||
|
prop.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true;
|
||||||
|
}
|
||||||
|
|
||||||
prop.SetActive(true);
|
prop.SetActive(true);
|
||||||
|
|
||||||
if (detail.hasPhysics)
|
if (detail.hasPhysics)
|
||||||
|
|||||||
@ -2,10 +2,6 @@ using NewHorizons.Utility;
|
|||||||
using NewHorizons.Utility.OWML;
|
using NewHorizons.Utility.OWML;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace NewHorizons.Handlers
|
namespace NewHorizons.Handlers
|
||||||
@ -32,57 +28,5 @@ namespace NewHorizons.Handlers
|
|||||||
return DreamArrivalPoint.Location.Undefined;
|
return DreamArrivalPoint.Location.Undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MigrateDreamWorldController()
|
|
||||||
{
|
|
||||||
// Create new DreamWorldController instance since the existing one is disabled
|
|
||||||
var managerObj = new GameObject("DreamWorldManager");
|
|
||||||
managerObj.SetActive(false);
|
|
||||||
var oldDWC = Locator.GetDreamWorldController();
|
|
||||||
var dwc = managerObj.AddComponent<DreamWorldController>();
|
|
||||||
|
|
||||||
var simRootObj = MigrateCopy(oldDWC._primarySimulationRoot.gameObject, managerObj);
|
|
||||||
|
|
||||||
dwc._primarySimulationRoot = simRootObj.transform;
|
|
||||||
dwc._simulationRoots = new Transform[] { simRootObj.transform };
|
|
||||||
dwc._simulationCamera = simRootObj.FindChild("Camera_Simulation").GetComponent<SimulationCamera>();
|
|
||||||
dwc._simulationSphere = simRootObj.FindChild("SimulationSphere").GetComponent<OWRenderer>();
|
|
||||||
|
|
||||||
dwc._tempSkyboxColor = oldDWC._tempSkyboxColor;
|
|
||||||
dwc._sarcophagusController = oldDWC._sarcophagusController;
|
|
||||||
dwc._prisonerDirector = oldDWC._prisonerDirector;
|
|
||||||
|
|
||||||
// These should correspond to the arrival point's attached body
|
|
||||||
dwc._dreamBody = null;
|
|
||||||
dwc._dreamWorldSector = null;
|
|
||||||
dwc._dreamWorldVolume = null;
|
|
||||||
|
|
||||||
// These should correspond to the campfire's attached body
|
|
||||||
dwc._planetBody = null;
|
|
||||||
dwc._ringWorldController = null;
|
|
||||||
|
|
||||||
managerObj.SetActive(true);
|
|
||||||
|
|
||||||
// Run after Start() completes
|
|
||||||
Delay.FireOnNextUpdate(() =>
|
|
||||||
{
|
|
||||||
dwc._dreamBody = null;
|
|
||||||
dwc._dreamWorldSector = null;
|
|
||||||
dwc._dreamWorldVolume = null;
|
|
||||||
dwc._planetBody = null;
|
|
||||||
dwc._ringWorldController = null;
|
|
||||||
|
|
||||||
// Dreamworld has a giant plane for simulation water, we don't want that in our custom world
|
|
||||||
dwc._primarySimulationRoot.Find("water_simulation").gameObject.SetActive(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static GameObject MigrateCopy(GameObject go, GameObject newParent)
|
|
||||||
{
|
|
||||||
var clone = GameObject.Instantiate(go);
|
|
||||||
clone.transform.SetParent(newParent.transform, false);
|
|
||||||
return clone;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,13 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
private static void DreamWorldRemoved()
|
private static void DreamWorldRemoved()
|
||||||
{
|
{
|
||||||
DreamHandler.MigrateDreamWorldController();
|
// No you didn't
|
||||||
|
// Needs to stay alive so that custom Dreamworlds can use its Dreamworld controller
|
||||||
|
// We had a separate dreamworld controller solution before, but that broke Eyes of the Past somehow
|
||||||
|
Locator.GetAstroObject(AstroObject.Name.DreamWorld).gameObject.SetActive(true);
|
||||||
|
// We thought of disabling the children for consistency: However this broke the tronworld for some reason
|
||||||
|
// Basically, leaving the real Dreamworld in is fine since as long as you don't place your own custom dreamworld on top
|
||||||
|
// of it, you'll never have it appear when you dont want it to
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SunRemoved()
|
private static void SunRemoved()
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends",
|
"author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends",
|
||||||
"name": "New Horizons",
|
"name": "New Horizons",
|
||||||
"uniqueName": "xen.NewHorizons",
|
"uniqueName": "xen.NewHorizons",
|
||||||
"version": "1.23.0",
|
"version": "1.23.1",
|
||||||
"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