mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
allow meditation
This commit is contained in:
parent
534de44d33
commit
dcc51c3da6
@ -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) =>
|
||||
|
@ -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
|
||||
|
@ -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 { }
|
||||
|
@ -120,7 +120,6 @@ public class WakeUpSync : NetworkBehaviour
|
||||
{
|
||||
new RequestStateResyncMessage().Send();
|
||||
CurrentState = State.Loaded;
|
||||
gameObject.GetRequiredComponent<StopMeditation>().Init();
|
||||
if (isServer)
|
||||
{
|
||||
SendServerTime();
|
||||
|
Loading…
Reference in New Issue
Block a user