disable host button when we progress far enough in the eye

This commit is contained in:
JohnCorby 2021-12-30 15:53:10 -08:00
parent 2ecc3a4529
commit a3f9f1391e
2 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,5 @@
using QSB.Messaging;
using QSB.Menus;
using QSB.Messaging;
using QSB.Player;
using QSB.Player.TransformSync;
using QSB.WorldSync;
@ -25,12 +26,14 @@ namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages
public override void OnReceiveLocal()
{
QSBPlayerManager.LocalPlayer.EyeState = Value;
MenuManager.Instance.OnEyeStateChange(Value);
}
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
player.EyeState = Value;
MenuManager.Instance.OnEyeStateChange(Value);
}
}
}

View File

@ -199,6 +199,14 @@ namespace QSB.Menus
DisconnectPopup._labelText.text = popupText;
}
public void OnEyeStateChange(EyeState state)
{
if (state >= EyeState.IntoTheVortex)
{
SetButtonActive(HostButton, false);
}
}
private void MakeTitleMenus()
{
CreateCommonPopups();