From 9ad260c0819c7117bf12e32350c36dea6736054f Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Thu, 28 Oct 2021 14:28:57 +0100 Subject: [PATCH] change "enterheadzone" to "enternonnomaiheadzone" --- .../NPC/Patches/CharacterAnimationPatches.cs | 4 ++-- QSB/Events/EventNames.cs | 4 ++-- QSB/Player/EnterLeaveType.cs | 8 +++++--- QSB/Player/Events/EnterLeaveEvent.cs | 14 ++++++++++---- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs b/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs index fffa8883..57cc327d 100644 --- a/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs +++ b/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs @@ -101,7 +101,7 @@ namespace QSB.Animation.NPC.Patches public static bool HeadZoneExit(CharacterAnimController __instance) { var qsbObj = QSBWorldSync.GetWorldFromUnity(__instance); - QSBEventManager.FireEvent(EventNames.QSBExitHeadZone, qsbObj.ObjectId); + QSBEventManager.FireEvent(EventNames.QSBExitNonNomaiHeadZone, qsbObj.ObjectId); return false; } @@ -110,7 +110,7 @@ namespace QSB.Animation.NPC.Patches public static bool HeadZoneEntry(CharacterAnimController __instance) { var qsbObj = QSBWorldSync.GetWorldFromUnity(__instance); - QSBEventManager.FireEvent(EventNames.QSBEnterHeadZone, qsbObj.ObjectId); + QSBEventManager.FireEvent(EventNames.QSBEnterNonNomaiHeadZone, qsbObj.ObjectId); return false; } diff --git a/QSB/Events/EventNames.cs b/QSB/Events/EventNames.cs index 168d66c4..8bbd74a7 100644 --- a/QSB/Events/EventNames.cs +++ b/QSB/Events/EventNames.cs @@ -62,8 +62,8 @@ public static string QSBCampfireState = "QSBCampfireState"; public static string QSBMarshmallowEvent = "QSBMarshmallowEvent"; public static string QSBAnimTrigger = "QSBAnimTrigger"; - public static string QSBEnterHeadZone = "QSBEnterHeadZone"; - public static string QSBExitHeadZone = "QSBExitHeadZone"; + public static string QSBEnterNonNomaiHeadZone = "QSBEnterHeadZone"; + public static string QSBExitNonNomaiHeadZone = "QSBExitHeadZone"; public static string QSBNpcAnimEvent = "QSBNpcAnimEvent"; public static string QSBHatchState = "QSBHatchState"; public static string QSBEnableFunnel = "QSBEnableFunnel"; diff --git a/QSB/Player/EnterLeaveType.cs b/QSB/Player/EnterLeaveType.cs index ef2bbf07..bd325137 100644 --- a/QSB/Player/EnterLeaveType.cs +++ b/QSB/Player/EnterLeaveType.cs @@ -8,9 +8,11 @@ ExitShrine = 3, EnterPlatform = 4, ExitPlatform = 5, - EnterHeadZone = 6, - ExitHeadZone = 7, + EnterNonNomaiHeadZone = 6, + ExitNonNomaiHeadZone = 7, EnterShip = 8, - ExitShip = 9 + ExitShip = 9, + EnterNomaiHeadZone = 10, + ExitNomaiHeadZone = 11 } } diff --git a/QSB/Player/Events/EnterLeaveEvent.cs b/QSB/Player/Events/EnterLeaveEvent.cs index ccd7c639..3facffdc 100644 --- a/QSB/Player/Events/EnterLeaveEvent.cs +++ b/QSB/Player/Events/EnterLeaveEvent.cs @@ -20,8 +20,8 @@ namespace QSB.Player.Events GlobalMessenger.AddListener(EventNames.QSBExitShrine, () => Handler(EnterLeaveType.ExitShrine)); GlobalMessenger.AddListener(EventNames.QSBEnterPlatform, (int id) => Handler(EnterLeaveType.EnterPlatform, id)); GlobalMessenger.AddListener(EventNames.QSBExitPlatform, (int id) => Handler(EnterLeaveType.ExitPlatform, id)); - GlobalMessenger.AddListener(EventNames.QSBEnterHeadZone, (int id) => Handler(EnterLeaveType.EnterHeadZone, id)); - GlobalMessenger.AddListener(EventNames.QSBExitHeadZone, (int id) => Handler(EnterLeaveType.ExitHeadZone, id)); + GlobalMessenger.AddListener(EventNames.QSBEnterNonNomaiHeadZone, (int id) => Handler(EnterLeaveType.EnterNonNomaiHeadZone, id)); + GlobalMessenger.AddListener(EventNames.QSBExitNonNomaiHeadZone, (int id) => Handler(EnterLeaveType.ExitNonNomaiHeadZone, id)); GlobalMessenger.AddListener(EventNames.EnterShip, () => Handler(EnterLeaveType.EnterShip)); GlobalMessenger.AddListener(EventNames.ExitShip, () => Handler(EnterLeaveType.ExitShip)); } @@ -32,6 +32,12 @@ namespace QSB.Player.Events GlobalMessenger.RemoveListener(EventNames.ExitQuantumMoon, () => Handler(EnterLeaveType.ExitMoon)); GlobalMessenger.RemoveListener(EventNames.QSBEnterShrine, () => Handler(EnterLeaveType.EnterShrine)); GlobalMessenger.RemoveListener(EventNames.QSBExitShrine, () => Handler(EnterLeaveType.ExitShrine)); + GlobalMessenger.RemoveListener(EventNames.QSBEnterPlatform, (int id) => Handler(EnterLeaveType.EnterPlatform, id)); + GlobalMessenger.RemoveListener(EventNames.QSBExitPlatform, (int id) => Handler(EnterLeaveType.ExitPlatform, id)); + GlobalMessenger.RemoveListener(EventNames.QSBEnterNonNomaiHeadZone, (int id) => Handler(EnterLeaveType.EnterNonNomaiHeadZone, id)); + GlobalMessenger.RemoveListener(EventNames.QSBExitNonNomaiHeadZone, (int id) => Handler(EnterLeaveType.ExitNonNomaiHeadZone, id)); + GlobalMessenger.RemoveListener(EventNames.EnterShip, () => Handler(EnterLeaveType.EnterShip)); + GlobalMessenger.RemoveListener(EventNames.ExitShip, () => Handler(EnterLeaveType.ExitShip)); } private void Handler(EnterLeaveType type, int objectId = -1) => SendEvent(CreateMessage(type, objectId)); @@ -71,10 +77,10 @@ namespace QSB.Player.Events CustomNomaiRemoteCameraPlatform.CustomPlatformList[message.ObjectId] .OnRemotePlayerExit(message.AboutId); break; - case EnterLeaveType.EnterHeadZone: + case EnterLeaveType.EnterNonNomaiHeadZone: QSBWorldSync.GetWorldFromId(message.ObjectId).AddPlayerToHeadZone(player); break; - case EnterLeaveType.ExitHeadZone: + case EnterLeaveType.ExitNonNomaiHeadZone: QSBWorldSync.GetWorldFromId(message.ObjectId).RemovePlayerFromHeadZone(player); break; case EnterLeaveType.EnterShip: