-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from misternebula/dev
0.25.0
- Loading branch information
Showing
47 changed files
with
1,070 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ public enum EnterLeaveType | |
ExitPlatform, | ||
EnterShip, | ||
ExitShip, | ||
EnterCloak, | ||
ExitCloak | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using QSB.Messaging; | ||
using QSB.Utility; | ||
|
||
namespace QSB.Player.Messages; | ||
|
||
internal class UpdateFOVMessage : QSBMessage<float> | ||
{ | ||
static UpdateFOVMessage() | ||
=> GlobalMessenger<GraphicSettings>.AddListener( | ||
"GraphicSettingsUpdated", | ||
(GraphicSettings settings) => new UpdateFOVMessage(settings.fieldOfView).Send()); | ||
|
||
private UpdateFOVMessage(float fov) : base(fov) { } | ||
|
||
public override void OnReceiveRemote() | ||
{ | ||
var player = QSBPlayerManager.GetPlayer(From); | ||
player.Camera.fieldOfView = Data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
QSB/QuantumSync/Patches/Client/ClientEyeProxyQuantumMoonPatches.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using HarmonyLib; | ||
using QSB.Patches; | ||
|
||
namespace QSB.QuantumSync.Patches.Client; | ||
|
||
[HarmonyPatch(typeof(EyeProxyQuantumMoon))] | ||
internal class ClientEyeProxyQuantumMoonPatches : QSBPatch | ||
{ | ||
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect; | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(nameof(EyeProxyQuantumMoon.ChangeQuantumState))] | ||
public static bool ChangeQuantumState() | ||
=> false; | ||
} |
20 changes: 20 additions & 0 deletions
20
QSB/QuantumSync/Patches/Client/ClientQuantumMoonPatches.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using HarmonyLib; | ||
using QSB.Patches; | ||
|
||
namespace QSB.QuantumSync.Patches.Client; | ||
|
||
[HarmonyPatch(typeof(QuantumMoon))] | ||
internal class ClientQuantumMoonPatches : QSBPatch | ||
{ | ||
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect; | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(QuantumMoon.Start))] | ||
public static void Start(QuantumMoon __instance) | ||
=> __instance.SetSurfaceState(-1); | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(nameof(QuantumMoon.ChangeQuantumState))] | ||
public static bool ChangeQuantumState() | ||
=> false; | ||
} |
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
QSB/QuantumSync/Patches/Common/MultiStateQuantumObjectPatches.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using HarmonyLib; | ||
using QSB.Patches; | ||
using QSB.Player; | ||
using QSB.QuantumSync.WorldObjects; | ||
using QSB.WorldSync; | ||
|
||
namespace QSB.QuantumSync.Patches.Common; | ||
|
||
[HarmonyPatch(typeof(MultiStateQuantumObject))] | ||
public class MultiStateQuantumObjectPatches : QSBPatch | ||
{ | ||
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect; | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(nameof(MultiStateQuantumObject.Start))] | ||
public static bool Start(MultiStateQuantumObject __instance) | ||
{ | ||
if (!QSBWorldSync.AllObjectsReady) | ||
{ | ||
return true; | ||
} | ||
|
||
var qsbObj = __instance.GetWorldObject<QSBMultiStateQuantumObject>(); | ||
if (qsbObj.ControllingPlayer == 0) | ||
{ | ||
return true; | ||
} | ||
|
||
foreach (var state in qsbObj.QuantumStates) | ||
{ | ||
if (!state.IsMeantToBeEnabled) | ||
{ | ||
state.SetVisible(false); | ||
} | ||
} | ||
|
||
if (__instance._sector == null) | ||
{ | ||
__instance.CheckEnabled(); | ||
} | ||
|
||
if (__instance._collapseOnStart) | ||
{ | ||
__instance.Collapse(true); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(nameof(MultiStateQuantumObject.ChangeQuantumState))] | ||
public static bool ChangeQuantumState(MultiStateQuantumObject __instance) | ||
{ | ||
if (!QSBWorldSync.AllObjectsReady) | ||
{ | ||
return true; | ||
} | ||
|
||
var qsbObj = __instance.GetWorldObject<QSBMultiStateQuantumObject>(); | ||
if (qsbObj.ControllingPlayer == 0 && qsbObj.CurrentState == -1) | ||
{ | ||
return true; | ||
} | ||
|
||
var isInControl = qsbObj.ControllingPlayer == QSBPlayerManager.LocalPlayerId; | ||
return isInControl; | ||
} | ||
} |
Oops, something went wrong.