Merge branch 'dev' into nh-stuff

This commit is contained in:
JohnCorby 2022-10-06 18:51:51 -07:00
commit af64e1518c
11 changed files with 18 additions and 78 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

@ -60,19 +60,26 @@ public class DreamRaftPatches : QSBPatch
/// this is to suspend the raft so it doesn't fall endlessly.
/// however, it's okay if it does that,
/// and we don't want it to extinguish with other players on it.
///
/// BUG: this breaks when going thru the volume as a non auth player sometimes. oh well.
/// TODO: use in-raft-volume trigger volume instead. just copy from the ringworld rafts. use this for fake sectors as well
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(DreamRaftProjector), nameof(DreamRaftProjector.ExtinguishImmediately))]
private static bool ExtinguishImmediately(DreamRaftProjector __instance)
[HarmonyPatch(typeof(DreamWorldController), nameof(DreamWorldController.ExtinguishDreamRaft))]
private static bool ExtinguishDreamRaft(DreamWorldController __instance)
{
if (!QSBWorldSync.AllObjectsReady)
{
return true;
}
// still release authority over the raft tho
__instance._dreamRaftProjection.GetComponent<DreamRaftController>().GetWorldObject<QSBDreamRaft>()
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove);
if (__instance._lastUsedRaftProjector)
{
// still release authority over the raft tho
__instance._lastUsedRaftProjector
._dreamRaftProjection.GetComponent<DreamRaftController>().GetWorldObject<QSBDreamRaft>()
.NetworkBehaviour.netIdentity.UpdateAuthQueue(AuthQueueAction.Remove);
}
return false;
}

View File

@ -512,25 +512,6 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart
Delay.RunWhen(PlayerData.IsLoaded, () => SetButtonActive(ResumeGameButton, PlayerData.LoadLoopCount() > 1));
SetButtonActive(NewGameButton, true);
if (QSBCore.DebugSettings.SkipTitleScreen)
{
Application.runInBackground = true;
var titleScreenManager = FindObjectOfType<TitleScreenManager>();
var titleScreenAnimation = titleScreenManager._cameraController;
const float small = 1 / 1000f;
titleScreenAnimation._gamepadSplash = false;
titleScreenAnimation._introPan = false;
titleScreenAnimation._fadeDuration = small;
titleScreenAnimation.Start();
var titleAnimationController = titleScreenManager._gfxController;
titleAnimationController._logoFadeDelay = small;
titleAnimationController._logoFadeDuration = small;
titleAnimationController._echoesFadeDelay = small;
titleAnimationController._optionsFadeDelay = small;
titleAnimationController._optionsFadeDuration = small;
titleAnimationController._optionsFadeSpacing = small;
}
var mainMenuFontController = GameObject.Find("MainMenu").GetComponent<FontAndLanguageController>();
mainMenuFontController.AddTextElement(HostButton.transform.GetChild(0).GetChild(1).GetComponent<Text>());
mainMenuFontController.AddTextElement(ConnectButton.transform.GetChild(0).GetChild(1).GetComponent<Text>());

View File

@ -53,6 +53,6 @@ internal class VolumePatches : QSBPatch
// which would actually apply the shock affects to the entire planet / sector
//
// TODO: also do this with remote probes
return hitObj.name != "REMOTE_PlayerDetector";
return hitObj.name is not ("REMOTE_PlayerDetector" or "REMOTE_CameraDetector");
}
}

View File

@ -147,7 +147,6 @@ public class QSBCore : ModBehaviour
if (DebugSettings.AutoStart)
{
DebugSettings.UseKcpTransport = true;
DebugSettings.SkipTitleScreen = true;
DebugSettings.DebugMode = true;
}

View File

@ -37,10 +37,10 @@ internal class TimePatches : QSBPatch
or OWTime.PauseType.Streaming
or OWTime.PauseType.Loading;
[HarmonyPrefix]
[HarmonyPostfix]
[HarmonyPatch(typeof(SubmitActionSkipToNextLoop), nameof(SubmitActionSkipToNextLoop.AdvanceToNewTimeLoop))]
public static bool StopMeditation()
=> false;
public static void PreventMeditationSoftlock()
=> OWInput.ChangeInputMode(InputMode.Character);
}
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();

View File

@ -23,9 +23,6 @@ public class DebugSettings
[JsonProperty("autoStart")]
public bool AutoStart;
[JsonProperty("skipTitleScreen")]
public bool SkipTitleScreen;
[JsonProperty("kickEveryone")]
public bool KickEveryone;

View File

@ -5,7 +5,6 @@
"hookDebugLogs": false,
"avoidTimeSync": false,
"autoStart": false,
"skipTitleScreen": false,
"kickEveryone": false,
"debugMode": false,
"drawGui": false,

View File

@ -138,7 +138,6 @@ The template for this file is this :
"hookDebugLogs": false,
"avoidTimeSync": false,
"autoStart": false,
"skipTitleScreen": false,
"debugMode": false,
"drawGui": false,
"drawLines": false,
@ -155,7 +154,6 @@ The template for this file is this :
- hookDebugLogs - Print Unity logs and warnings.
- avoidTimeSync - Disables the syncing of time.
- autoStart - Host/connect automatically for faster testing.
- skipTitleScreen - Auto-skips the splash screen.
- debugMode - Enables debug mode. If this is set to `false`, none of the following settings do anything.
- drawGui - Draws a GUI at the top of the screen that gives information on many things.
- drawLines - Draws gizmo-esque lines around things. Indicates reference sectors/transforms, triggers, etc. LAGGY.