move host button eye check

This commit is contained in:
JohnCorby 2021-12-30 18:00:05 -08:00
parent 0ee1222d3e
commit 61ff7b71e0
2 changed files with 10 additions and 3 deletions

View File

@ -12,8 +12,6 @@ namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages
private static void Handler(EyeState state)
{
MenuManager.Instance.OnEyeStateChange(state);
if (PlayerTransformSync.LocalInstance)
{
new EyeStateMessage(state).Send();

View File

@ -49,6 +49,15 @@ namespace QSB.Menus
private void OnSceneLoaded(OWScene oldScene, OWScene newScene, bool isUniverse)
{
if (newScene == OWScene.EyeOfTheUniverse)
{
GlobalMessenger<EyeState>.AddListener(OWEvents.EyeStateChanged, OnEyeStateChanged);
}
else
{
GlobalMessenger<EyeState>.RemoveListener(OWEvents.EyeStateChanged, OnEyeStateChanged);
}
if (isUniverse)
{
InitPauseMenus();
@ -199,7 +208,7 @@ namespace QSB.Menus
DisconnectPopup._labelText.text = popupText;
}
public void OnEyeStateChange(EyeState state)
private void OnEyeStateChanged(EyeState state)
{
if (state >= EyeState.IntoTheVortex)
{