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

This commit is contained in:
JohnCorby 2022-06-12 19:24:33 -07:00
commit 3f1bd48762
4 changed files with 1 additions and 38 deletions

View File

@ -1,13 +0,0 @@
using QSB.EchoesOfTheEye.AlarmTotemSync.WorldObjects;
using QSB.Messaging;
using QSB.Patches;
namespace QSB.EchoesOfTheEye.AlarmTotemSync.Messages;
public class TotemFaceOpenMessage : QSBWorldObjectMessage<QSBAlarmTotem, bool>
{
public TotemFaceOpenMessage(bool open) : base(open) { }
public override void OnReceiveRemote() =>
QSBPatch.RemoteCall(() => WorldObject.AttachedObject.SetFaceOpen(Data));
}

View File

@ -12,29 +12,6 @@ public class AlarmTotemPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPrefix]
[HarmonyPatch(typeof(AlarmTotem), nameof(AlarmTotem.SetFaceOpen))]
private static void SetFaceOpen(AlarmTotem __instance, bool open)
{
if (Remote)
{
return;
}
if (__instance._isFaceOpen == open)
{
return;
}
if (!QSBWorldSync.AllObjectsReady)
{
return;
}
__instance.GetWorldObject<QSBAlarmTotem>()
.SendMessage(new TotemFaceOpenMessage(open));
}
[HarmonyPrefix]
[HarmonyPatch(typeof(AlarmTotem), nameof(AlarmTotem.OnSectorOccupantAdded))]
private static void OnSectorOccupantAdded(AlarmTotem __instance, SectorDetector sectorDetector)

View File

@ -15,7 +15,6 @@ public class QSBAlarmTotem : WorldObject<AlarmTotem>
public override void SendInitialState(uint to)
{
this.SendMessage(new TotemFaceOpenMessage(AttachedObject._isFaceOpen) { To = to });
this.SendMessage(new TotemEnabledMessage(AttachedObject.enabled) { To = to });
this.SendMessage(new TotemVisibleForMessage(VisibleFor) { To = to });
}

View File

@ -60,7 +60,7 @@ public class DebugActions : MonoBehaviour, IAddComponentOnStart
{
var relativeLocation = new RelativeLocationData(Vector3.up * 2 + Vector3.forward * 2, Quaternion.identity, Vector3.zero);
var location = Keyboard.current[Key.LeftShift].isPressed ? DreamArrivalPoint.Location.Zone4 : DreamArrivalPoint.Location.Zone3;
var location = Keyboard.current[Key.LeftShift].isPressed ? DreamArrivalPoint.Location.Zone4 : DreamArrivalPoint.Location.Zone2;
var arrivalPoint = Locator.GetDreamArrivalPoint(location);
var dreamCampfire = Locator.GetDreamCampfire(location);
if (Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItemType() != ItemType.DreamLantern)