Skip to content

Commit

Permalink
Merge pull request #540 from misternebula/dev
Browse files Browse the repository at this point in the history
0.20.2
  • Loading branch information
misternebula authored Jul 21, 2022
2 parents 324df63 + d3a890c commit b3024e7
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 22 deletions.
2 changes: 1 addition & 1 deletion EpicRerouter/EpicRerouter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" IncludeAssets="compile" />
<PackageReference Include="HarmonyX" Version="2.9.0" IncludeAssets="compile" />
<PackageReference Include="HarmonyX" Version="2.10.0" IncludeAssets="compile" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions MirrorWeaver/MirrorWeaver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" />
<PackageReference Include="OWML" Version="2.3.2" />
<PackageReference Include="HarmonyX" Version="2.9.0" />
<PackageReference Include="OWML" Version="2.5.2" />
<PackageReference Include="HarmonyX" Version="2.10.0" />
<Reference Include="../Mirror/*.dll" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion QSB/Menus/MenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart
private const int _titleButtonIndex = 2;
private float _connectPopupOpenTime;

private const string UpdateChangelog = $"QSB Version 0.20.1\r\nFixed a velocity calculation bug with some fish.";
private const string UpdateChangelog = $"QSB Version 0.20.2\r\nFixed issues with the Little Scout and attaching/detaching from the ship.";

private Action<bool> PopupClose;

Expand Down
15 changes: 8 additions & 7 deletions QSB/ShipSync/ShipCustomAttach.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ private void Update()
{
_attachPrompt.SetVisibility(false);
_detachPrompt.SetVisibility(false);
if (!PlayerState.IsInsideShip())
{
return;
}

var attachedToUs = _playerAttachPoint.enabled;
_detachPrompt.SetVisibility(attachedToUs);
Expand All @@ -46,6 +42,11 @@ private void Update()
ShipManager.Instance.CockpitController._shipAudioController.PlayUnbuckle();
}

if (!PlayerState.IsInsideShip())
{
return;
}

if (!attachedToUs)
{
if (PlayerState.IsAttached())
Expand All @@ -61,12 +62,12 @@ private void Update()

_attachPrompt.SetVisibility(!attachedToUs);
if (!attachedToUs &&
OWInput.IsPressed(InputLibrary.interactSecondary, InputMode.Character) &&
OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Character))
OWInput.IsPressed(InputLibrary.interactSecondary, InputMode.Character) &&
OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Character))
{
transform.position = Locator.GetPlayerTransform().position;
_playerAttachPoint.AttachPlayer();
ShipManager.Instance.CockpitController._shipAudioController.PlayBuckle();
}
}
}
}
26 changes: 21 additions & 5 deletions QSB/Tools/ProbeTool/ProbeListener.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using QSB.Messaging;
using QSB.Player;
using QSB.Tools.ProbeTool.Messages;
using UnityEngine;

Expand Down Expand Up @@ -35,19 +36,34 @@ private void OnDestroy()
}

private static void OnLaunchProbe()
=> new PlayerProbeEventMessage(ProbeEvent.Launch).Send();
{
QSBPlayerManager.LocalPlayer.ProbeActive = true;
new PlayerProbeEventMessage(ProbeEvent.Launch).Send();
}

private static void OnAnchorProbe()
=> new PlayerProbeEventMessage(ProbeEvent.Anchor).Send();
{
QSBPlayerManager.LocalPlayer.ProbeActive = true;
new PlayerProbeEventMessage(ProbeEvent.Anchor).Send();
}

private static void OnUnanchorProbe()
=> new PlayerProbeEventMessage(ProbeEvent.Unanchor).Send();
{
QSBPlayerManager.LocalPlayer.ProbeActive = true;
new PlayerProbeEventMessage(ProbeEvent.Unanchor).Send();
}

private static void OnRetrieveProbe()
=> new PlayerProbeEventMessage(ProbeEvent.Retrieve).Send();
{
QSBPlayerManager.LocalPlayer.ProbeActive = false;
new PlayerProbeEventMessage(ProbeEvent.Retrieve).Send();
}

private static void OnProbeDestroyed()
=> new PlayerProbeEventMessage(ProbeEvent.Destroy).Send();
{
QSBPlayerManager.LocalPlayer.ProbeActive = false;
new PlayerProbeEventMessage(ProbeEvent.Destroy).Send();
}

private static void OnStartRetrieveProbe(float length)
=> new ProbeStartRetrieveMessage(length).Send();
Expand Down
32 changes: 27 additions & 5 deletions QSB/Tools/ProbeTool/QSBProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,25 @@ private void Start()
{
_lightSourceVol = this.GetRequiredComponentInChildren<LightSourceVolume>();
_lightSourceVol.LinkLightSource(this);
_lightSourceVol.SetVolumeActivation(false);

gameObject.SetActive(false);
if (_owner == null)
{
// i dont *think* this is possible, but honestly i dont fucking know anymore
DebugLog.DebugWrite($"Warning - QSBProbe ran Start() without an assigned owner!", OWML.Common.MessageType.Warning);
_lightSourceVol.SetVolumeActivation(false);
gameObject.SetActive(false);
}

if (_owner.ProbeActive)
{
_lightSourceVol.SetVolumeActivation(true);
gameObject.SetActive(true);
}
else
{
_lightSourceVol.SetVolumeActivation(false);
gameObject.SetActive(false);
}
}

protected void OnDestroy() => _warpEffect.OnWarpComplete -= OnWarpComplete;
Expand Down Expand Up @@ -83,7 +99,7 @@ public void HandleEvent(ProbeEvent probeEvent)
{
case ProbeEvent.Launch:
_anchored = false;

_owner.ProbeActive = true;
gameObject.SetActive(true);
_lightSourceVol.SetVolumeActivation(true);
transform.position = _owner.ProbeLauncherTool.transform.position;
Expand All @@ -99,7 +115,7 @@ public void HandleEvent(ProbeEvent probeEvent)
break;
case ProbeEvent.Anchor:
_anchored = true;

_owner.ProbeActive = true; // just in case it was missed
if (OnAnchorProbe == null)
{
DebugLog.ToConsole($"Warning - OnAnchorProbe is null!", OWML.Common.MessageType.Warning);
Expand All @@ -110,10 +126,12 @@ public void HandleEvent(ProbeEvent probeEvent)
break;
case ProbeEvent.Unanchor:
_anchored = false;
_owner.ProbeActive = true; // just in case it was missed
OnUnanchorProbe();
break;
case ProbeEvent.Retrieve:
_anchored = false;
_owner.ProbeActive = false;
if (OnRetrieveProbe == null)
{
DebugLog.ToConsole($"Warning - OnRetrieveProbe is null!", OWML.Common.MessageType.Warning);
Expand All @@ -125,7 +143,7 @@ public void HandleEvent(ProbeEvent probeEvent)
case ProbeEvent.Destroy:
_anchored = false;
Destroy(gameObject);

_owner.ProbeActive = false;
if (OnProbeDestroyed == null)
{
DebugLog.ToConsole($"Warning - OnProbeDestroyed is null!", OWML.Common.MessageType.Warning);
Expand Down Expand Up @@ -164,6 +182,10 @@ public void OnStartRetrieve(float duration)

OnStartRetrieveProbe(duration);
}
else
{
DebugLog.DebugWrite($"Warning - Tried to retrieve probe (owner: {_owner}) that was already retrieving?", OWML.Common.MessageType.Warning);
}
}

public bool CheckIlluminationAtPoint(Vector3 point, float buffer = 0f, float maxDistance = float.PositiveInfinity)
Expand Down
2 changes: 2 additions & 0 deletions QSB/WorldSync/QSBOWRigidbody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
internal class QSBOWRigidbody : WorldObject<OWRigidbody>
{
public override void SendInitialState(uint to) { }

public override bool ShouldDisplayDebug() => false;
}
2 changes: 1 addition & 1 deletion QSB/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications."
},
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
"version": "0.20.1",
"version": "0.20.2",
"owmlVersion": "2.5.2",
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
"pathsToPreserve": [ "debugsettings.json", "storage.json" ]
Expand Down

0 comments on commit b3024e7

Please sign in to comment.