Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
JohnCorby 2022-07-23 18:01:40 -07:00
commit 551eeddfb9
3 changed files with 41 additions and 3 deletions

View File

@ -18,6 +18,7 @@ namespace NewHorizons.Builder.Props
private static List<GameObject> _ghostArcPrefabs; private static List<GameObject> _ghostArcPrefabs;
private static GameObject _scrollPrefab; private static GameObject _scrollPrefab;
private static GameObject _computerPrefab; private static GameObject _computerPrefab;
private static GameObject _preCrashComputerPrefab;
private static GameObject _cairnPrefab; private static GameObject _cairnPrefab;
private static GameObject _recorderPrefab; private static GameObject _recorderPrefab;
private static GameObject _preCrashRecorderPrefab; private static GameObject _preCrashRecorderPrefab;
@ -80,6 +81,10 @@ namespace NewHorizons.Builder.Props
_computerPrefab.name = "Prefab_NOM_Computer"; _computerPrefab.name = "Prefab_NOM_Computer";
_computerPrefab.transform.rotation = Quaternion.identity; _computerPrefab.transform.rotation = Quaternion.identity;
_preCrashComputerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_EscapePodCrashSite/Sector_CrashFragment/EscapePod_Socket/Interactibles_EscapePod/Prefab_NOM_Vessel_Computer").InstantiateInactive();
_preCrashComputerPrefab.name = "Prefab_NOM_Vessel_Computer";
_preCrashComputerPrefab.transform.rotation = Quaternion.identity;
_cairnPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_Crossroads/Interactables_Crossroads/Trailmarkers/Prefab_NOM_BH_Cairn_Arc (1)").InstantiateInactive(); _cairnPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_Crossroads/Interactables_Crossroads/Trailmarkers/Prefab_NOM_BH_Cairn_Arc (1)").InstantiateInactive();
_cairnPrefab.name = "Prefab_NOM_Cairn"; _cairnPrefab.name = "Prefab_NOM_Cairn";
_cairnPrefab.transform.rotation = Quaternion.identity; _cairnPrefab.transform.rotation = Quaternion.identity;
@ -203,6 +208,35 @@ namespace NewHorizons.Builder.Props
// Make sure the computer model is loaded // Make sure the computer model is loaded
StreamingHandler.SetUpStreaming(computerObject, sector); StreamingHandler.SetUpStreaming(computerObject, sector);
computerObject.SetActive(true);
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
break;
}
case PropModule.NomaiTextInfo.NomaiTextType.PreCrashComputer:
{
var computerObject = _preCrashComputerPrefab.InstantiateInactive();
computerObject.transform.parent = sector?.transform ?? planetGO.transform;
computerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
var up = computerObject.transform.position - planetGO.transform.position;
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
// Move it slightly up more
computerObject.transform.position += up.normalized * 0.1f;
var computer = computerObject.GetComponent<NomaiVesselComputer>();
computer.SetSector(sector);
computer._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
computer._nomaiTextAsset = new TextAsset(xmlPath);
computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
AddTranslation(xmlPath);
// Make sure the computer model is loaded
StreamingHandler.SetUpStreaming(computerObject, sector);
computerObject.SetActive(true); computerObject.SetActive(true);
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject; conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
break; break;

View File

@ -462,7 +462,9 @@ namespace NewHorizons.External.Modules
[EnumMember(Value = @"recorder")] Recorder = 4, [EnumMember(Value = @"recorder")] Recorder = 4,
[EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5 [EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5,
[EnumMember(Value = @"preCrashComputer")] PreCrashComputer = 6
} }
/// <summary> /// <summary>

View File

@ -1202,7 +1202,8 @@
"Computer", "Computer",
"Cairn", "Cairn",
"Recorder", "Recorder",
"PreCrashRecorder" "PreCrashRecorder",
"PreCrashComputer"
], ],
"enum": [ "enum": [
"wall", "wall",
@ -1210,7 +1211,8 @@
"computer", "computer",
"cairn", "cairn",
"recorder", "recorder",
"preCrashRecorder" "preCrashRecorder",
"preCrashComputer"
] ]
}, },
"RaftInfo": { "RaftInfo": {