moved all tools into seperate folders, including probe (so removed QSB.ProbeSync)

This commit is contained in:
Mister_Nebula 2021-11-09 17:46:46 +00:00
parent 0ee56305fd
commit 381df32826
24 changed files with 380 additions and 321 deletions

View File

@ -2,6 +2,7 @@
using QSB.Patches;
using QSB.Player;
using QSB.Tools;
using QSB.Tools.FlashlightTool;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -12,7 +12,6 @@ using QSB.ItemSync.Events;
using QSB.LogSync.Events;
using QSB.OrbSync.Events;
using QSB.Player.Events;
using QSB.ProbeSync.Events;
using QSB.QuantumSync.Events;
using QSB.RoastingSync.Events;
using QSB.SatelliteSync.Events;
@ -21,8 +20,10 @@ using QSB.ShipSync.Events.Component;
using QSB.ShipSync.Events.Hull;
using QSB.StatueSync.Events;
using QSB.TimeSync.Events;
using QSB.Tools.Events;
using QSB.Tools.FlashlightTool.Events;
using QSB.Tools.ProbeLauncherTool.Events;
using QSB.Tools.ProbeTool.Events;
using QSB.Tools.SignalscopeTool.Events;
using QSB.Tools.TranslatorTool.Events;
using QSB.TranslationSync.Events;
using QSB.Utility;

View File

@ -6,11 +6,12 @@ using QSB.ClientServerStateSync;
using QSB.ItemSync.WorldObjects;
using QSB.ItemSync.WorldObjects.Items;
using QSB.Player.TransformSync;
using QSB.ProbeSync;
using QSB.QuantumSync;
using QSB.RoastingSync;
using QSB.Tools;
using QSB.Tools.FlashlightTool;
using QSB.Tools.ProbeLauncherTool;
using QSB.Tools.ProbeTool;
using QSB.Utility;
using System.Linq;
using UnityEngine;

View File

@ -3,6 +3,7 @@ using QSB.ItemSync.WorldObjects.Items;
using QSB.Player.Events;
using QSB.Player.TransformSync;
using QSB.Tools;
using QSB.Tools.FlashlightTool;
using QSB.Utility;
using System;
using System.Collections.Generic;

View File

@ -169,13 +169,13 @@
<Compile Include="PoolSync\Patches\PoolPatches.cs" />
<Compile Include="PoolSync\PoolManager.cs" />
<Compile Include="Inputs\QSBInputManager.cs" />
<Compile Include="ProbeSync\Events\PlayerProbeEvent.cs" />
<Compile Include="ProbeSync\Events\ProbeStartRetrieveEvent.cs" />
<Compile Include="ProbeSync\ProbeEvent.cs" />
<Compile Include="ProbeSync\ProbeListener.cs" />
<Compile Include="ProbeSync\QSBProbeEffects.cs" />
<Compile Include="ProbeSync\QSBProbeLantern.cs" />
<Compile Include="ProbeSync\QSBProbeSpotlight.cs" />
<Compile Include="Tools\ProbeTool\Events\PlayerProbeEvent.cs" />
<Compile Include="Tools\ProbeTool\Events\ProbeStartRetrieveEvent.cs" />
<Compile Include="Tools\ProbeTool\ProbeEvent.cs" />
<Compile Include="Tools\ProbeTool\ProbeListener.cs" />
<Compile Include="Tools\ProbeTool\QSBProbeEffects.cs" />
<Compile Include="Tools\ProbeTool\QSBProbeLantern.cs" />
<Compile Include="Tools\ProbeTool\QSBProbeSpotlight.cs" />
<Compile Include="Patches\QSBPatch.cs" />
<Compile Include="Patches\QSBPatchTypes.cs" />
<Compile Include="QSBSceneManager.cs" />
@ -239,15 +239,20 @@
<Compile Include="TimeSync\FastForwardReason.cs" />
<Compile Include="TimeSync\Patches\TimePatches.cs" />
<Compile Include="TimeSync\PauseReason.cs" />
<Compile Include="Tools\FlashlightTool\FlashlightCreator.cs" />
<Compile Include="Tools\ProbeLauncherTool\Events\LaunchProbeEvent.cs" />
<Compile Include="Tools\ProbeLauncherTool\Events\PlayerLaunchProbeEvent.cs" />
<Compile Include="Tools\ProbeLauncherTool\Events\PlayerRetrieveProbeEvent.cs" />
<Compile Include="Tools\ProbeLauncherTool\Events\RetrieveProbeEvent.cs" />
<Compile Include="Tools\ProbeLauncherTool\Patches\LauncherPatches.cs" />
<Compile Include="Tools\ProbeLauncherTool\ProbeLauncherCreator.cs" />
<Compile Include="Tools\ProbeLauncherTool\ProbeLauncherListener.cs" />
<Compile Include="Tools\ProbeLauncherTool\ProbeLauncherManager.cs" />
<Compile Include="Tools\ProbeLauncherTool\QSBProbeLauncherTool.cs" />
<Compile Include="Tools\ProbeLauncherTool\WorldObjects\QSBProbeLauncher.cs" />
<Compile Include="Tools\ProbeTool\ProbeCreator.cs" />
<Compile Include="Tools\SignalscopeTool\SignalscopeCreator.cs" />
<Compile Include="Tools\TranslatorTool\TranslatorCreator.cs" />
<Compile Include="Utility\CustomRelativisticParticleSystem.cs" />
<Compile Include="RoastingSync\QSBMarshmallow.cs" />
<Compile Include="RoastingSync\Events\EnterExitRoastingEvent.cs" />
@ -274,7 +279,7 @@
<Compile Include="TranslationSync\Patches\SpiralPatches.cs" />
<Compile Include="TimeSync\TimeSyncType.cs" />
<Compile Include="TimeSync\TimeSyncUI.cs" />
<Compile Include="Tools\Events\PlayerFlashlightEvent.cs" />
<Compile Include="Tools\FlashlightTool\Events\PlayerFlashlightEvent.cs" />
<Compile Include="Player\Events\PlayerJoinEvent.cs" />
<Compile Include="Player\Events\PlayerReadyEvent.cs" />
<Compile Include="Animation\Player\Events\PlayerSuitEvent.cs" />
@ -283,7 +288,7 @@
<Compile Include="GeyserSync\GeyserManager.cs" />
<Compile Include="GeyserSync\WorldObjects\QSBGeyser.cs" />
<Compile Include="Tools\ProbeLauncherTool\Events\EquipProbeLauncherEvent.cs" />
<Compile Include="Tools\Events\PlayerSignalscopeEvent.cs" />
<Compile Include="Tools\SignalscopeTool\Events\PlayerSignalscopeEvent.cs" />
<Compile Include="Tools\TranslatorTool\Events\PlayerTranslatorEvent.cs" />
<Compile Include="Events\QSBEvent.cs" />
<Compile Include="Player\Events\PlayerJoinMessage.cs" />
@ -316,11 +321,11 @@
<Compile Include="WorldSync\Events\BoolWorldObjectMessage.cs" />
<Compile Include="WorldSync\Events\EnumWorldObjectMessage.cs" />
<Compile Include="WorldSync\Events\WorldObjectMessage.cs" />
<Compile Include="Tools\QSBFlashlight.cs" />
<Compile Include="ProbeSync\QSBProbe.cs" />
<Compile Include="Tools\FlashlightTool\QSBFlashlight.cs" />
<Compile Include="Tools\ProbeTool\QSBProbe.cs" />
<Compile Include="Tools\QSBTool.cs" />
<Compile Include="Tools\ToolType.cs" />
<Compile Include="ProbeSync\TransformSync\PlayerProbeSync.cs" />
<Compile Include="Tools\ProbeTool\TransformSync\PlayerProbeSync.cs" />
<Compile Include="Utility\DebugActions.cs" />
<Compile Include="Events\QSBEventManager.cs" />
<Compile Include="DeathSync\Necronomicon.cs" />

View File

@ -11,9 +11,9 @@ using QSB.Patches;
using QSB.Player;
using QSB.Player.TransformSync;
using QSB.PoolSync;
using QSB.ProbeSync.TransformSync;
using QSB.ShipSync.TransformSync;
using QSB.TimeSync;
using QSB.Tools.ProbeTool.TransformSync;
using QSB.Utility;
using QSB.WorldSync;
using QuantumUNET;

View File

@ -2,7 +2,7 @@
using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events
namespace QSB.Tools.FlashlightTool.Events
{
public class PlayerFlashlightEvent : QSBEvent<ToggleMessage>
{

View File

@ -0,0 +1,25 @@
using UnityEngine;
namespace QSB.Tools.FlashlightTool
{
static class FlashlightCreator
{
private static readonly Vector3 FlashlightOffset = new Vector3(0.7196316f, -0.2697681f, 0.3769455f);
internal static void CreateFlashlight(Transform cameraBody)
{
var flashlightRoot = Object.Instantiate(GameObject.Find("FlashlightRoot"));
flashlightRoot.name = "REMOTE_FlashlightRoot";
flashlightRoot.SetActive(false);
var oldComponent = flashlightRoot.GetComponent<Flashlight>();
var component = flashlightRoot.AddComponent<QSBFlashlight>();
component.Init(oldComponent);
oldComponent.enabled = false;
flashlightRoot.transform.parent = cameraBody;
flashlightRoot.transform.localPosition = FlashlightOffset;
flashlightRoot.SetActive(true);
}
}
}

View File

@ -1,7 +1,7 @@
using OWML.Utils;
using UnityEngine;
namespace QSB.Tools
namespace QSB.Tools.FlashlightTool
{
public class QSBFlashlight : MonoBehaviour, ILightSource
{

View File

@ -1,8 +1,9 @@
using OWML.Utils;
using QSB.Player;
using QSB.ProbeSync;
using QSB.Tools.FlashlightTool;
using QSB.Tools.ProbeLauncherTool;
using QSB.Utility;
using QSB.Tools.SignalscopeTool;
using QSB.Tools.TranslatorTool;
using System.Linq;
using UnityEngine;
using UnityEngine.PostProcessing;
@ -11,16 +12,12 @@ namespace QSB.Tools
{
public class PlayerToolsManager
{
private static Transform _toolStowTransform;
private static Transform _toolHoldTransform;
private static Material Props_HEA_PlayerTool_mat;
private static Material Props_HEA_Lightbulb_mat;
private static Material Props_HEA_Lightbulb_OFF_mat;
public static Transform StowTransform;
public static Transform HoldTransform;
private static readonly Vector3 FlashlightOffset = new Vector3(0.7196316f, -0.2697681f, 0.3769455f);
private static readonly Vector3 ProbeLauncherOffset = new Vector3(0.5745087f, -0.26f, 0.4453125f);
private static readonly Vector3 SignalscopeScale = new Vector3(1.5f, 1.5f, 1.5f);
private static readonly Vector3 TranslatorScale = new Vector3(0.75f, 0.75f, 0.75f);
public static Material Props_HEA_PlayerTool_mat;
public static Material Props_HEA_Lightbulb_mat;
public static Material Props_HEA_Lightbulb_OFF_mat;
public static void Init(Transform playerCamera)
{
@ -41,144 +38,22 @@ namespace QSB.Tools
Props_HEA_Lightbulb_OFF_mat = null;
}
CreateFlashlight(playerCamera);
CreateSignalscope(playerCamera);
CreateProbeLauncher(playerCamera);
CreateTranslator(playerCamera);
}
public static void CreateProbe(Transform newProbe, PlayerInfo player)
{
var qsbProbe = newProbe.gameObject.AddComponent<QSBProbe>();
player.Probe = qsbProbe;
qsbProbe.SetOwner(player);
// Probe_Body
Object.Destroy(newProbe.GetComponent<ProbeAnchor>());
Object.Destroy(newProbe.GetComponent<AlignWithFluid>());
Object.Destroy(newProbe.GetComponent<MapMarker>());
Object.Destroy(newProbe.GetComponent<ProbeSeeking>());
Object.Destroy(newProbe.GetComponent<SurveyorProbe>());
Object.Destroy(newProbe.GetComponent<ProbeHUDMarker>());
Object.Destroy(newProbe.GetComponent<LightFlickerController>());
Object.Destroy(newProbe.GetComponent<OWRigidbody>());
Object.Destroy(newProbe.GetComponent<Rigidbody>());
Object.Destroy(newProbe.GetComponent<CenterOfTheUniverseOffsetApplier>());
// ProbeDetector
//Object.Destroy(newProbe.Find("ProbeDetector").gameObject);
var probeDetector = newProbe.Find("ProbeDetector").gameObject;
Object.Destroy(probeDetector.GetComponent<ForceApplier>());
Object.Destroy(probeDetector.GetComponent<ProbeFluidDetector>());
Object.Destroy(probeDetector.GetComponent<AlignmentForceDetector>());
// CameraPivot
var cameraPivot = newProbe.Find("CameraPivot");
Object.Destroy(cameraPivot.GetComponent<ProbeHorizonTracker>());
// TODO : Sync probe animations
// CameraPivot/Geometry/Props_HEA_Probe_ANIM
var animRoot = cameraPivot.Find("Geometry").Find("Props_HEA_Probe_ANIM");
Object.Destroy(animRoot.GetComponent<ProbeAnimatorController>());
Object.Destroy(animRoot.GetComponent<Animator>());
// TODO : Set up QSB cameras for these two cameras - that's why im not just destroying the GOs here
// CameraPivot/ForwardCamera
var forwardCamera = cameraPivot.Find("ForwardCamera");
Object.Destroy(forwardCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(forwardCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(forwardCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(forwardCamera.GetComponent<ProbeCamera>());
Object.Destroy(forwardCamera.GetComponent<OWCamera>());
Object.Destroy(forwardCamera.GetComponent<Camera>());
var oldForwardSpotlight = forwardCamera.GetComponent<ProbeSpotlight>();
var newForwardSpotlight = forwardCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newForwardSpotlight._id = oldForwardSpotlight.GetValue<ProbeCamera.ID>("_id");
newForwardSpotlight._fadeInLength = oldForwardSpotlight.GetValue<float>("_fadeInLength");
newForwardSpotlight._intensity = 0.8f;
Object.Destroy(oldForwardSpotlight);
// CameraPivot/RotatingCameraPivot/RotatingCamera
var rotatingCamera = cameraPivot.Find("RotatingCameraPivot").Find("RotatingCamera");
Object.Destroy(rotatingCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(rotatingCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(rotatingCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(rotatingCamera.GetComponent<ProbeCamera>());
Object.Destroy(rotatingCamera.GetComponent<OWCamera>());
Object.Destroy(rotatingCamera.GetComponent<Camera>());
// ProbeEffects
var probeEffects = newProbe.Find("ProbeEffects");
var oldEffects = probeEffects.GetComponent<ProbeEffects>();
var newEffects = probeEffects.gameObject.AddComponent<QSBProbeEffects>();
newEffects._flightLoopAudio = oldEffects.GetValue<OWAudioSource>("_flightLoopAudio");
newEffects._anchorAudio = oldEffects.GetValue<OWAudioSource>("_anchorAudio");
newEffects._anchorParticles = oldEffects.GetValue<ParticleSystem>("_anchorParticles");
Object.Destroy(oldEffects);
Object.Destroy(probeEffects.Find("CloudsEffectBubble").gameObject);
Object.Destroy(probeEffects.Find("SandEffectBubble").gameObject);
Object.Destroy(probeEffects.Find("ProbeElectricityEffect").gameObject);
// AmbientLight_Probe
var ambientLight = newProbe.Find("AmbientLight_Probe");
var oldAmbLantern = ambientLight.GetComponent<ProbeLantern>();
var newAmbLantern = ambientLight.gameObject.AddComponent<QSBProbeLantern>();
newAmbLantern._fadeInDuration = oldAmbLantern.GetValue<float>("_fadeInDuration");
newAmbLantern._fadeInCurve = oldAmbLantern.GetValue<AnimationCurve>("_fadeInCurve");
newAmbLantern._fadeOutCurve = oldAmbLantern.GetValue<AnimationCurve>("_fadeOutCurve");
newAmbLantern._emissiveRenderer = oldAmbLantern.GetValue<OWEmissiveRenderer>("_emissiveRenderer");
newAmbLantern._originalRange = 60f;
Object.Destroy(oldAmbLantern);
// Lantern
var lantern = newProbe.Find("Lantern");
var oldLantern = lantern.GetComponent<ProbeLantern>();
var newLantern = lantern.gameObject.AddComponent<QSBProbeLantern>();
newLantern._fadeInDuration = oldLantern.GetValue<float>("_fadeInDuration");
newLantern._fadeInCurve = oldLantern.GetValue<AnimationCurve>("_fadeInCurve");
newLantern._fadeOutCurve = oldLantern.GetValue<AnimationCurve>("_fadeOutCurve");
newLantern._emissiveRenderer = oldLantern.GetValue<OWEmissiveRenderer>("_emissiveRenderer");
newLantern._originalRange = 35f;
Object.Destroy(oldLantern);
// RearCamera
var rearCamera = newProbe.Find("RearCamera");
Object.Destroy(rearCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(rearCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(rearCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(rearCamera.GetComponent<ProbeCamera>());
Object.Destroy(rearCamera.GetComponent<OWCamera>());
Object.Destroy(rearCamera.GetComponent<Camera>());
var oldRearSpotlight = rearCamera.GetComponent<ProbeSpotlight>();
var newRearSpotlight = rearCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newRearSpotlight._id = oldRearSpotlight.GetValue<ProbeCamera.ID>("_id");
newRearSpotlight._fadeInLength = oldRearSpotlight.GetValue<float>("_fadeInLength");
newRearSpotlight._intensity = 0.8f;
Object.Destroy(oldRearSpotlight);
// PlaneOffsetMarker_Probe
Object.Destroy(newProbe.Find("PlaneOffsetMarker_Probe").gameObject);
newProbe.Find("RecallEffect").gameObject.GetComponent<SingularityController>().enabled = true;
newProbe.Find("RecallEffect").gameObject.GetComponent<SingularityWarpEffect>().enabled = true;
newProbe.Find("RecallEffect").name = "RemoteProbeRecallEffect";
newProbe.gameObject.SetActive(true);
FlashlightCreator.CreateFlashlight(playerCamera);
SignalscopeCreator.CreateSignalscope(playerCamera);
ProbeLauncherCreator.CreateProbeLauncher(playerCamera);
TranslatorCreator.CreateTranslator(playerCamera);
}
private static void CreateStowTransforms(Transform cameraBody)
{
var stow = new GameObject("REMOTE_ToolStowTransform");
_toolStowTransform = stow.transform;
StowTransform = stow.transform;
stow.transform.parent = cameraBody;
stow.transform.localPosition = Vector3.zero;
stow.transform.localRotation = Quaternion.Euler(45f, 0f, 0f);
var hold = new GameObject("REMOTE_ToolHoldTransform");
_toolHoldTransform = hold.transform;
HoldTransform = hold.transform;
hold.transform.parent = cameraBody;
hold.transform.localPosition = Vector3.zero;
hold.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
@ -238,159 +113,7 @@ namespace QSB.Tools
visionTorch.transform.localScale = new Vector3(0.33f, 0.33f, 0.33f);
}
private static void CreateFlashlight(Transform cameraBody)
{
var flashlightRoot = Object.Instantiate(GameObject.Find("FlashlightRoot"));
flashlightRoot.name = "REMOTE_FlashlightRoot";
flashlightRoot.SetActive(false);
var oldComponent = flashlightRoot.GetComponent<Flashlight>();
var component = flashlightRoot.AddComponent<QSBFlashlight>();
component.Init(oldComponent);
oldComponent.enabled = false;
flashlightRoot.transform.parent = cameraBody;
flashlightRoot.transform.localPosition = FlashlightOffset;
flashlightRoot.SetActive(true);
}
private static void CreateSignalscope(Transform cameraBody)
{
var signalscopeRoot = Object.Instantiate(GameObject.Find("Signalscope"));
signalscopeRoot.name = "REMOTE_Signalscope";
signalscopeRoot.SetActive(false);
Object.Destroy(signalscopeRoot.GetComponent<SignalscopePromptController>());
Object.Destroy(signalscopeRoot.transform.Find("Props_HEA_Signalscope")
.Find("Props_HEA_Signalscope_Prepass").gameObject);
var oldSignalscope = signalscopeRoot.GetComponent<Signalscope>();
var tool = signalscopeRoot.AddComponent<QSBTool>();
tool.MoveSpring = oldSignalscope.GetValue<DampedSpringQuat>("_moveSpring");
tool.StowTransform = _toolStowTransform;
tool.HoldTransform = _toolHoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.Signalscope;
tool.ToolGameObject = signalscopeRoot.transform.Find("Props_HEA_Signalscope").gameObject;
oldSignalscope.enabled = false;
GetRenderer(signalscopeRoot, "Props_HEA_Signalscope").material = Props_HEA_PlayerTool_mat;
signalscopeRoot.transform.parent = cameraBody;
signalscopeRoot.transform.localPosition = Vector3.zero;
signalscopeRoot.transform.localScale = SignalscopeScale;
signalscopeRoot.SetActive(true);
}
private static void CreateTranslator(Transform cameraBody)
{
var original = GameObject.Find("NomaiTranslatorProp");
var translatorRoot = original.InstantiateInactive();
translatorRoot.name = "REMOTE_NomaiTranslatorProp";
var group = translatorRoot.transform.Find("TranslatorGroup");
var model = group.Find("Props_HEA_Translator");
Object.Destroy(translatorRoot.GetComponent<NomaiTranslatorProp>());
Object.Destroy(group.Find("Canvas").gameObject);
Object.Destroy(group.Find("Lighting").gameObject);
Object.Destroy(group.Find("TranslatorBeams").gameObject);
Object.Destroy(model.Find("Props_HEA_Translator_Pivot_RotatingPart")
.Find("Props_HEA_Translator_RotatingPart")
.Find("Props_HEA_Translator_RotatingPart_Prepass").gameObject);
Object.Destroy(model.Find("Props_HEA_Translator_Prepass").gameObject);
var oldTranslator = translatorRoot.GetComponent<NomaiTranslator>();
var tool = translatorRoot.AddComponent<QSBTool>();
tool.MoveSpring = oldTranslator.GetValue<DampedSpringQuat>("_moveSpring");
tool.StowTransform = _toolStowTransform;
tool.HoldTransform = _toolHoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.Translator;
tool.ToolGameObject = group.gameObject;
Object.Destroy(oldTranslator);
GetRenderer(translatorRoot, "Props_HEA_Translator_Geo").material = Props_HEA_PlayerTool_mat;
GetRenderer(translatorRoot, "Props_HEA_Translator_RotatingPart").material = Props_HEA_PlayerTool_mat;
GetRenderer(translatorRoot, "Props_HEA_Translator_Button_L").material = Props_HEA_Lightbulb_mat;
GetRenderer(translatorRoot, "Props_HEA_Translator_Button_R").material = Props_HEA_Lightbulb_mat;
translatorRoot.transform.parent = cameraBody;
translatorRoot.transform.localPosition = Vector3.zero;
translatorRoot.transform.localScale = TranslatorScale;
QSBCore.UnityEvents.FireOnNextUpdate(() => translatorRoot.SetActive(true));
}
private static void CreateProbeLauncher(Transform cameraBody)
{
var ProbeLauncher = GameObject.Find("PlayerCamera/ProbeLauncher");
// Create new ProbeLauncher
var REMOTE_ProbeLauncher = new GameObject("REMOTE_ProbeLauncher");
REMOTE_ProbeLauncher.SetActive(false);
// Copy children of ProbeLauncher
var Props_HEA_ProbeLauncher = ProbeLauncher.transform.Find("Props_HEA_ProbeLauncher");
var REMOTE_Props_HEA_ProbeLauncher = Object.Instantiate(Props_HEA_ProbeLauncher, REMOTE_ProbeLauncher.transform, false);
var LaunchParticleEffect_Underwater = ProbeLauncher.transform.Find("LaunchParticleEffect_Underwater");
var REMOTE_LaunchParticleEffect_Underwater = Object.Instantiate(LaunchParticleEffect_Underwater, REMOTE_ProbeLauncher.transform, false);
var LaunchParticleEffect = ProbeLauncher.transform.Find("LaunchParticleEffect");
var REMOTE_LaunchParticleEffect = Object.Instantiate(LaunchParticleEffect, REMOTE_ProbeLauncher.transform, false);
// Set up effects
var effects = REMOTE_ProbeLauncher.AddComponent<ProbeLauncherEffects>();
effects.SetValue("_launchParticles", REMOTE_LaunchParticleEffect.GetComponent<ParticleSystem>());
effects.SetValue("_underwaterLaunchParticles", REMOTE_LaunchParticleEffect_Underwater.GetComponent<ParticleSystem>());
effects.SetValue("_owAudioSource", ProbeLauncher.GetComponent<ProbeLauncherEffects>().GetValue<OWAudioSource>("_owAudioSource"));
var recallEffect = REMOTE_Props_HEA_ProbeLauncher.Find("RecallEffect");
REMOTE_Props_HEA_ProbeLauncher.Find("PressureGauge_Arrow").GetComponent<MeshRenderer>().material = Props_HEA_PlayerTool_mat;
REMOTE_Props_HEA_ProbeLauncher.Find("ProbeLauncherChassis").GetComponent<MeshRenderer>().material = Props_HEA_PlayerTool_mat;
Object.Destroy(REMOTE_Props_HEA_ProbeLauncher.Find("Props_HEA_ProbeLauncher_Prepass").gameObject);
var preLaunchProbe = REMOTE_Props_HEA_ProbeLauncher.Find("Props_HEA_Probe_Prelaunch");
Object.Destroy(preLaunchProbe.Find("Props_HEA_Probe_Prelaunch_Prepass").gameObject);
// fuck you unity
var materials = preLaunchProbe.GetComponent<MeshRenderer>().materials;
materials[0] = Props_HEA_PlayerTool_mat;
materials[1] = Props_HEA_Lightbulb_OFF_mat;
preLaunchProbe.GetComponent<MeshRenderer>().materials = materials;
var tool = REMOTE_ProbeLauncher.AddComponent<QSBProbeLauncherTool>();
var spring = new DampedSpringQuat
{
velocity = Vector4.zero,
settings = new DampedSpringSettings
{
springConstant = 50f,
dampingCoefficient = 8.485282f,
mass = 1
}
};
tool.MoveSpring = spring;
tool.StowTransform = _toolStowTransform;
tool.HoldTransform = _toolHoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.ProbeLauncher;
tool.ToolGameObject = REMOTE_Props_HEA_ProbeLauncher.gameObject;
tool.PreLaunchProbeProxy = preLaunchProbe.gameObject;
tool.ProbeRetrievalEffect = recallEffect.GetComponent<SingularityWarpEffect>();
tool.Effects = effects;
REMOTE_ProbeLauncher.transform.parent = cameraBody;
REMOTE_ProbeLauncher.transform.localPosition = ProbeLauncherOffset;
//QSBCore.UnityEvents.FireInNUpdates(() => REMOTE_ProbeLauncher.SetActive(true), 5);
REMOTE_ProbeLauncher.SetActive(true);
}
private static MeshRenderer GetRenderer(GameObject root, string gameObjectName) =>
internal static MeshRenderer GetRenderer(GameObject root, string gameObjectName) =>
root.GetComponentsInChildren<MeshRenderer>(true).First(x => x.name == gameObjectName);
}
}

View File

@ -0,0 +1,77 @@
using UnityEngine;
namespace QSB.Tools.ProbeLauncherTool
{
static class ProbeLauncherCreator
{
private static readonly Vector3 ProbeLauncherOffset = new Vector3(0.5745087f, -0.26f, 0.4453125f);
internal static void CreateProbeLauncher(Transform cameraBody)
{
var ProbeLauncher = GameObject.Find("PlayerCamera/ProbeLauncher");
// Create new ProbeLauncher
var REMOTE_ProbeLauncher = new GameObject("REMOTE_ProbeLauncher");
REMOTE_ProbeLauncher.SetActive(false);
// Copy children of ProbeLauncher
var Props_HEA_ProbeLauncher = ProbeLauncher.transform.Find("Props_HEA_ProbeLauncher");
var REMOTE_Props_HEA_ProbeLauncher = Object.Instantiate(Props_HEA_ProbeLauncher, REMOTE_ProbeLauncher.transform, false);
var LaunchParticleEffect_Underwater = ProbeLauncher.transform.Find("LaunchParticleEffect_Underwater");
var REMOTE_LaunchParticleEffect_Underwater = Object.Instantiate(LaunchParticleEffect_Underwater, REMOTE_ProbeLauncher.transform, false);
var LaunchParticleEffect = ProbeLauncher.transform.Find("LaunchParticleEffect");
var REMOTE_LaunchParticleEffect = Object.Instantiate(LaunchParticleEffect, REMOTE_ProbeLauncher.transform, false);
// Set up effects
var effects = REMOTE_ProbeLauncher.AddComponent<ProbeLauncherEffects>();
effects._launchParticles = REMOTE_LaunchParticleEffect.GetComponent<ParticleSystem>();
effects._underwaterLaunchParticles = REMOTE_LaunchParticleEffect_Underwater.GetComponent<ParticleSystem>();
effects._owAudioSource = ProbeLauncher.GetComponent<ProbeLauncherEffects>()._owAudioSource;
var recallEffect = REMOTE_Props_HEA_ProbeLauncher.Find("RecallEffect");
REMOTE_Props_HEA_ProbeLauncher.Find("PressureGauge_Arrow").GetComponent<MeshRenderer>().material = PlayerToolsManager.Props_HEA_PlayerTool_mat;
REMOTE_Props_HEA_ProbeLauncher.Find("ProbeLauncherChassis").GetComponent<MeshRenderer>().material = PlayerToolsManager.Props_HEA_PlayerTool_mat;
Object.Destroy(REMOTE_Props_HEA_ProbeLauncher.Find("Props_HEA_ProbeLauncher_Prepass").gameObject);
var preLaunchProbe = REMOTE_Props_HEA_ProbeLauncher.Find("Props_HEA_Probe_Prelaunch");
Object.Destroy(preLaunchProbe.Find("Props_HEA_Probe_Prelaunch_Prepass").gameObject);
// fuck you unity
var materials = preLaunchProbe.GetComponent<MeshRenderer>().materials;
materials[0] = PlayerToolsManager.Props_HEA_PlayerTool_mat;
materials[1] = PlayerToolsManager.Props_HEA_Lightbulb_OFF_mat;
preLaunchProbe.GetComponent<MeshRenderer>().materials = materials;
var tool = REMOTE_ProbeLauncher.AddComponent<QSBProbeLauncherTool>();
var spring = new DampedSpringQuat
{
velocity = Vector4.zero,
settings = new DampedSpringSettings
{
springConstant = 50f,
dampingCoefficient = 8.485282f,
mass = 1
}
};
tool.MoveSpring = spring;
tool.StowTransform = PlayerToolsManager.StowTransform;
tool.HoldTransform = PlayerToolsManager.HoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.ProbeLauncher;
tool.ToolGameObject = REMOTE_Props_HEA_ProbeLauncher.gameObject;
tool.PreLaunchProbeProxy = preLaunchProbe.gameObject;
tool.ProbeRetrievalEffect = recallEffect.GetComponent<SingularityWarpEffect>();
tool.Effects = effects;
REMOTE_ProbeLauncher.transform.parent = cameraBody;
REMOTE_ProbeLauncher.transform.localPosition = ProbeLauncherOffset;
//QSBCore.UnityEvents.FireInNUpdates(() => REMOTE_ProbeLauncher.SetActive(true), 5);
REMOTE_ProbeLauncher.SetActive(true);
}
}
}

View File

@ -2,7 +2,7 @@
using QSB.Messaging;
using QSB.Player;
namespace QSB.ProbeSync.Events
namespace QSB.Tools.ProbeTool.Events
{
internal class PlayerProbeEvent : QSBEvent<EnumMessage<ProbeEvent>>
{

View File

@ -2,7 +2,7 @@
using QSB.Messaging;
using QSB.Player;
namespace QSB.ProbeSync.Events
namespace QSB.Tools.ProbeTool.Events
{
internal class ProbeStartRetrieveEvent : QSBEvent<FloatMessage>
{

View File

@ -0,0 +1,134 @@
using QSB.Player;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine.PostProcessing;
using UnityEngine;
namespace QSB.Tools.ProbeTool
{
static class ProbeCreator
{
public static void CreateProbe(Transform newProbe, PlayerInfo player)
{
var qsbProbe = newProbe.gameObject.AddComponent<QSBProbe>();
player.Probe = qsbProbe;
qsbProbe.SetOwner(player);
// Probe_Body
Object.Destroy(newProbe.GetComponent<ProbeAnchor>());
Object.Destroy(newProbe.GetComponent<AlignWithFluid>());
Object.Destroy(newProbe.GetComponent<MapMarker>());
Object.Destroy(newProbe.GetComponent<ProbeSeeking>());
Object.Destroy(newProbe.GetComponent<SurveyorProbe>());
Object.Destroy(newProbe.GetComponent<ProbeHUDMarker>());
Object.Destroy(newProbe.GetComponent<LightFlickerController>());
Object.Destroy(newProbe.GetComponent<OWRigidbody>());
Object.Destroy(newProbe.GetComponent<Rigidbody>());
Object.Destroy(newProbe.GetComponent<CenterOfTheUniverseOffsetApplier>());
// ProbeDetector
//Object.Destroy(newProbe.Find("ProbeDetector").gameObject);
var probeDetector = newProbe.Find("ProbeDetector").gameObject;
Object.Destroy(probeDetector.GetComponent<ForceApplier>());
Object.Destroy(probeDetector.GetComponent<ProbeFluidDetector>());
Object.Destroy(probeDetector.GetComponent<AlignmentForceDetector>());
// CameraPivot
var cameraPivot = newProbe.Find("CameraPivot");
Object.Destroy(cameraPivot.GetComponent<ProbeHorizonTracker>());
// TODO : Sync probe animations
// CameraPivot/Geometry/Props_HEA_Probe_ANIM
var animRoot = cameraPivot.Find("Geometry").Find("Props_HEA_Probe_ANIM");
Object.Destroy(animRoot.GetComponent<ProbeAnimatorController>());
Object.Destroy(animRoot.GetComponent<Animator>());
// TODO : Set up QSB cameras for these two cameras - that's why im not just destroying the GOs here
// CameraPivot/ForwardCamera
var forwardCamera = cameraPivot.Find("ForwardCamera");
Object.Destroy(forwardCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(forwardCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(forwardCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(forwardCamera.GetComponent<ProbeCamera>());
Object.Destroy(forwardCamera.GetComponent<OWCamera>());
Object.Destroy(forwardCamera.GetComponent<Camera>());
var oldForwardSpotlight = forwardCamera.GetComponent<ProbeSpotlight>();
var newForwardSpotlight = forwardCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newForwardSpotlight._id = oldForwardSpotlight._id;
newForwardSpotlight._fadeInLength = oldForwardSpotlight._fadeInLength;
newForwardSpotlight._intensity = 0.8f;
Object.Destroy(oldForwardSpotlight);
// CameraPivot/RotatingCameraPivot/RotatingCamera
var rotatingCamera = cameraPivot.Find("RotatingCameraPivot").Find("RotatingCamera");
Object.Destroy(rotatingCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(rotatingCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(rotatingCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(rotatingCamera.GetComponent<ProbeCamera>());
Object.Destroy(rotatingCamera.GetComponent<OWCamera>());
Object.Destroy(rotatingCamera.GetComponent<Camera>());
// ProbeEffects
var probeEffects = newProbe.Find("ProbeEffects");
var oldEffects = probeEffects.GetComponent<ProbeEffects>();
var newEffects = probeEffects.gameObject.AddComponent<QSBProbeEffects>();
newEffects._flightLoopAudio = oldEffects._flightLoopAudio;
newEffects._anchorAudio = oldEffects._anchorAudio;
newEffects._anchorParticles = oldEffects._anchorParticles;
Object.Destroy(oldEffects);
Object.Destroy(probeEffects.Find("CloudsEffectBubble").gameObject);
Object.Destroy(probeEffects.Find("SandEffectBubble").gameObject);
Object.Destroy(probeEffects.Find("ProbeElectricityEffect").gameObject);
// AmbientLight_Probe
var ambientLight = newProbe.Find("AmbientLight_Probe");
var oldAmbLantern = ambientLight.GetComponent<ProbeLantern>();
var newAmbLantern = ambientLight.gameObject.AddComponent<QSBProbeLantern>();
newAmbLantern._fadeInDuration = oldAmbLantern._fadeInDuration;
newAmbLantern._fadeInCurve = oldAmbLantern._fadeInCurve;
newAmbLantern._fadeOutCurve = oldAmbLantern._fadeOutCurve;
newAmbLantern._emissiveRenderer = oldAmbLantern._emissiveRenderer;
newAmbLantern._originalRange = 60f;
Object.Destroy(oldAmbLantern);
// Lantern
var lantern = newProbe.Find("Lantern");
var oldLantern = lantern.GetComponent<ProbeLantern>();
var newLantern = lantern.gameObject.AddComponent<QSBProbeLantern>();
newLantern._fadeInDuration = oldLantern._fadeInDuration;
newLantern._fadeInCurve = oldLantern._fadeInCurve;
newLantern._fadeOutCurve = oldLantern._fadeOutCurve;
newLantern._emissiveRenderer = oldLantern._emissiveRenderer;
newLantern._originalRange = 35f;
Object.Destroy(oldLantern);
// RearCamera
var rearCamera = newProbe.Find("RearCamera");
Object.Destroy(rearCamera.GetComponent<PostProcessingBehaviour>());
Object.Destroy(rearCamera.GetComponent<NoiseImageEffect>());
Object.Destroy(rearCamera.GetComponent<PlanetaryFogImageEffect>());
Object.Destroy(rearCamera.GetComponent<ProbeCamera>());
Object.Destroy(rearCamera.GetComponent<OWCamera>());
Object.Destroy(rearCamera.GetComponent<Camera>());
var oldRearSpotlight = rearCamera.GetComponent<ProbeSpotlight>();
var newRearSpotlight = rearCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newRearSpotlight._id = oldRearSpotlight._id;
newRearSpotlight._fadeInLength = oldRearSpotlight._fadeInLength;
newRearSpotlight._intensity = 0.8f;
Object.Destroy(oldRearSpotlight);
// PlaneOffsetMarker_Probe
Object.Destroy(newProbe.Find("PlaneOffsetMarker_Probe").gameObject);
newProbe.Find("RecallEffect").gameObject.GetComponent<SingularityController>().enabled = true;
newProbe.Find("RecallEffect").gameObject.GetComponent<SingularityWarpEffect>().enabled = true;
newProbe.Find("RecallEffect").name = "RemoteProbeRecallEffect";
newProbe.gameObject.SetActive(true);
}
}
}

View File

@ -1,4 +1,4 @@
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
public enum ProbeEvent
{

View File

@ -1,7 +1,7 @@
using QSB.Events;
using UnityEngine;
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
internal class ProbeListener : MonoBehaviour
{

View File

@ -2,7 +2,7 @@
using QSB.Utility;
using UnityEngine;
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
public class QSBProbe : MonoBehaviour
{

View File

@ -2,7 +2,7 @@
using System.Linq;
using UnityEngine;
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
internal class QSBProbeEffects : MonoBehaviour
{

View File

@ -2,7 +2,7 @@
using System.Linq;
using UnityEngine;
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
internal class QSBProbeLantern : MonoBehaviour
{

View File

@ -2,7 +2,7 @@
using System.Linq;
using UnityEngine;
namespace QSB.ProbeSync
namespace QSB.Tools.ProbeTool
{
internal class QSBProbeSpotlight : MonoBehaviour
{

View File

@ -4,11 +4,12 @@ using QSB.SectorSync;
using QSB.Syncs.Sectored.Transforms;
using QSB.Tools;
using QSB.Tools.ProbeLauncherTool;
using QSB.Tools.ProbeTool;
using QSB.Utility;
using QSB.WorldSync;
using UnityEngine;
namespace QSB.ProbeSync.TransformSync
namespace QSB.Tools.ProbeTool.TransformSync
{
public class PlayerProbeSync : SectoredTransformSync
{
@ -58,7 +59,7 @@ namespace QSB.ProbeSync.TransformSync
body.name = "RemoteProbeTransform";
PlayerToolsManager.CreateProbe(body, Player);
ProbeCreator.CreateProbe(body, Player);
Player.ProbeBody = body.gameObject;

View File

@ -2,7 +2,7 @@
using QSB.Messaging;
using QSB.Player;
namespace QSB.Tools.Events
namespace QSB.Tools.SignalscopeTool.Events
{
public class PlayerSignalscopeEvent : QSBEvent<ToggleMessage>
{

View File

@ -0,0 +1,40 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace QSB.Tools.SignalscopeTool
{
static class SignalscopeCreator
{
private static readonly Vector3 SignalscopeScale = new Vector3(1.5f, 1.5f, 1.5f);
internal static void CreateSignalscope(Transform cameraBody)
{
var signalscopeRoot = Object.Instantiate(GameObject.Find("Signalscope"));
signalscopeRoot.name = "REMOTE_Signalscope";
signalscopeRoot.SetActive(false);
Object.Destroy(signalscopeRoot.GetComponent<SignalscopePromptController>());
Object.Destroy(signalscopeRoot.transform.Find("Props_HEA_Signalscope")
.Find("Props_HEA_Signalscope_Prepass").gameObject);
var oldSignalscope = signalscopeRoot.GetComponent<Signalscope>();
var tool = signalscopeRoot.AddComponent<QSBTool>();
tool.MoveSpring = oldSignalscope._moveSpring;
tool.StowTransform = PlayerToolsManager.StowTransform;
tool.HoldTransform = PlayerToolsManager.HoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.Signalscope;
tool.ToolGameObject = signalscopeRoot.transform.Find("Props_HEA_Signalscope").gameObject;
oldSignalscope.enabled = false;
PlayerToolsManager.GetRenderer(signalscopeRoot, "Props_HEA_Signalscope").material = PlayerToolsManager.Props_HEA_PlayerTool_mat;
signalscopeRoot.transform.parent = cameraBody;
signalscopeRoot.transform.localPosition = Vector3.zero;
signalscopeRoot.transform.localScale = SignalscopeScale;
signalscopeRoot.SetActive(true);
}
}
}

View File

@ -0,0 +1,50 @@
using QSB.Utility;
using UnityEngine;
namespace QSB.Tools.TranslatorTool
{
static class TranslatorCreator
{
private static readonly Vector3 TranslatorScale = new Vector3(0.75f, 0.75f, 0.75f);
internal static void CreateTranslator(Transform cameraBody)
{
var original = GameObject.Find("NomaiTranslatorProp");
var translatorRoot = original.InstantiateInactive();
translatorRoot.name = "REMOTE_NomaiTranslatorProp";
var group = translatorRoot.transform.Find("TranslatorGroup");
var model = group.Find("Props_HEA_Translator");
Object.Destroy(translatorRoot.GetComponent<NomaiTranslatorProp>());
Object.Destroy(group.Find("Canvas").gameObject);
Object.Destroy(group.Find("Lighting").gameObject);
Object.Destroy(group.Find("TranslatorBeams").gameObject);
Object.Destroy(model.Find("Props_HEA_Translator_Pivot_RotatingPart")
.Find("Props_HEA_Translator_RotatingPart")
.Find("Props_HEA_Translator_RotatingPart_Prepass").gameObject);
Object.Destroy(model.Find("Props_HEA_Translator_Prepass").gameObject);
var oldTranslator = translatorRoot.GetComponent<NomaiTranslator>();
var tool = translatorRoot.AddComponent<QSBTool>();
tool.MoveSpring = oldTranslator._moveSpring;
tool.StowTransform = PlayerToolsManager.StowTransform;
tool.HoldTransform = PlayerToolsManager.HoldTransform;
tool.ArrivalDegrees = 5f;
tool.Type = ToolType.Translator;
tool.ToolGameObject = group.gameObject;
Object.Destroy(oldTranslator);
PlayerToolsManager.GetRenderer(translatorRoot, "Props_HEA_Translator_Geo").material = PlayerToolsManager.Props_HEA_PlayerTool_mat;
PlayerToolsManager.GetRenderer(translatorRoot, "Props_HEA_Translator_RotatingPart").material = PlayerToolsManager.Props_HEA_PlayerTool_mat;
PlayerToolsManager.GetRenderer(translatorRoot, "Props_HEA_Translator_Button_L").material = PlayerToolsManager.Props_HEA_Lightbulb_mat;
PlayerToolsManager.GetRenderer(translatorRoot, "Props_HEA_Translator_Button_R").material = PlayerToolsManager.Props_HEA_Lightbulb_mat;
translatorRoot.transform.parent = cameraBody;
translatorRoot.transform.localPosition = Vector3.zero;
translatorRoot.transform.localScale = TranslatorScale;
QSBCore.UnityEvents.FireOnNextUpdate(() => translatorRoot.SetActive(true));
}
}
}