hiding the meditation button (for server and clients) (#34)

This commit is contained in:
AmazingAlek 2020-02-29 09:39:15 +01:00 committed by GitHub
parent 11f5d7de23
commit 3f80846988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -1,12 +1,20 @@
using OWML.ModHelper.Events;
using UnityEngine;
using UnityEngine.Networking;
namespace QSB.TimeSync
{
public class PreserveTimeScale : MonoBehaviour
public class PreserveTimeScale : NetworkBehaviour
{
private void Start()
{
QSB.Helper.Menus.PauseMenu.GetButton("Button-EndCurrentLoop").Hide();
if (isServer)
{
return;
}
GlobalMessenger.AddListener("GamePaused", OnPause);
var campfires = GameObject.FindObjectsOfType<Campfire>();

View File

@ -47,13 +47,13 @@ namespace QSB.TimeSync
private void OnWakeUp()
{
_state = State.Awake;
gameObject.AddComponent<PreserveTimeScale>();
if (isServer)
{
SendServerTime();
}
else
{
gameObject.AddComponent<PreserveTimeScale>();
WakeUpOrSleep();
}
}