allow meditation

This commit is contained in:
JohnCorby 2022-10-06 17:34:57 -07:00
parent 534de44d33
commit dcc51c3da6
4 changed files with 2 additions and 48 deletions

View File

@ -146,21 +146,6 @@ public class ConversationPatches : QSBPatch
public static void SetPersistentCondition(string condition, bool state) =>
new PersistentConditionMessage(condition, state).Send();
[HarmonyPrefix]
[HarmonyPatch(typeof(GameSave), nameof(GameSave.GetPersistentCondition))]
public static bool GetPersistentCondition(string condition, ref bool __result)
{
// stinky fix to meditation button appearing
if (condition == "KNOWS_MEDITATION")
{
__result = false;
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(DialogueConditionManager), nameof(DialogueConditionManager.AddCondition))]
public static void AddCondition(string conditionName, bool conditionState) =>

View File

@ -36,11 +36,6 @@ internal class TimePatches : QSBPatch
is OWTime.PauseType.Initializing
or OWTime.PauseType.Streaming
or OWTime.PauseType.Loading;
[HarmonyPrefix]
[HarmonyPatch(typeof(SubmitActionSkipToNextLoop), nameof(SubmitActionSkipToNextLoop.AdvanceToNewTimeLoop))]
public static bool StopMeditation()
=> false;
}
internal class ClientTimePatches : QSBPatch

View File

@ -3,31 +3,6 @@ using UnityEngine;
namespace QSB.TimeSync;
// TODO remove from unity project eventually
[UsedInUnityProject]
public class StopMeditation : MonoBehaviour
{
public void Init()
{
var menuManager = Locator.GetSceneMenuManager();
if (menuManager == null)
{
Delay.RunWhen(() => Locator.GetSceneMenuManager() != null, Init);
return;
}
if (menuManager._pauseMenu == null)
{
Delay.RunWhen(() => Locator.GetSceneMenuManager().pauseMenu != null, Init);
return;
}
if (menuManager.pauseMenu._skipToNextLoopButton == null)
{
Delay.RunWhen(() => Locator.GetSceneMenuManager().pauseMenu._skipToNextLoopButton != null, Init);
return;
}
menuManager.pauseMenu._skipToNextLoopButton.SetActive(false);
}
}
public class StopMeditation : MonoBehaviour { }

View File

@ -120,7 +120,6 @@ public class WakeUpSync : NetworkBehaviour
{
new RequestStateResyncMessage().Send();
CurrentState = State.Loaded;
gameObject.GetRequiredComponent<StopMeditation>().Init();
if (isServer)
{
SendServerTime();