destroy debug actions/gui if we're not debugging

This commit is contained in:
JohnCorby 2021-12-28 21:25:25 -08:00
parent 74a1c3cb46
commit 292b49deb5
9 changed files with 34 additions and 25 deletions

View File

@ -93,10 +93,10 @@ namespace QSB.Anglerfish.TransformSync
protected override void OnRenderObject()
{
if (!WorldObjectManager.AllObjectsReady
|| !QSBCore.ShowLinesInDebug
if (!QSBCore.ShowLinesInDebug
|| !WorldObjectManager.AllObjectsReady
|| !IsReady
|| ReferenceTransform == null
|| AttachedObject == null
|| AttachedObject.IsSuspended())
{
return;

View File

@ -86,7 +86,7 @@ namespace QSB.Animation.Player.Thrusters
private void OnRenderObject()
{
if (!WorldObjectManager.AllObjectsReady || !QSBCore.ShowLinesInDebug)
if (!QSBCore.ShowLinesInDebug || !WorldObjectManager.AllObjectsReady)
{
return;
}

View File

@ -141,9 +141,10 @@ namespace QSB.JellyfishSync.TransformSync
protected override void OnRenderObject()
{
if (!WorldObjectManager.AllObjectsReady
|| !QSBCore.ShowLinesInDebug
if (!QSBCore.ShowLinesInDebug
|| !WorldObjectManager.AllObjectsReady
|| !IsReady
|| AttachedObject == null
|| ReferenceTransform == null
|| AttachedObject.IsSuspended())
{

View File

@ -262,8 +262,8 @@ namespace QSB.Player.TransformSync
{
base.OnRenderObject();
if (!WorldObjectManager.AllObjectsReady
|| !QSBCore.ShowLinesInDebug
if (!QSBCore.ShowLinesInDebug
|| !WorldObjectManager.AllObjectsReady
|| !IsReady
|| ReferenceTransform == null)
{

View File

@ -64,7 +64,7 @@ namespace QSB.QuantumSync
public void OnRenderObject()
{
if (!AllObjectsReady || !QSBCore.ShowLinesInDebug)
if (!QSBCore.ShowLinesInDebug || !AllObjectsReady)
{
return;
}

View File

@ -273,9 +273,10 @@ namespace QSB.Syncs
protected virtual void OnRenderObject()
{
if (!WorldObjectManager.AllObjectsReady
|| !QSBCore.ShowLinesInDebug
if (!QSBCore.ShowLinesInDebug
|| !WorldObjectManager.AllObjectsReady
|| !IsReady
|| AttachedObject == null
|| ReferenceTransform == null)
{
return;
@ -297,6 +298,11 @@ namespace QSB.Syncs
private void OnGUI()
{
if (!QSBCore.ShowDebugLabels)
{
return;
}
if (AttachedObject != null)
{
DebugGUI.DrawLabel(AttachedObject.transform, LogName);

View File

@ -77,7 +77,7 @@ namespace QSB.Tools.TranslatorTool
private void OnRenderObject()
{
if (!WorldObjectManager.AllObjectsReady || !QSBCore.ShowLinesInDebug)
if (!QSBCore.ShowLinesInDebug || !WorldObjectManager.AllObjectsReady)
{
return;
}

View File

@ -31,13 +31,16 @@ namespace QSB.Utility
private void DamageShipElectricalSystem() => ShipManager.Instance.ShipElectricalComponent.SetDamaged(true);
public void Update()
private void Awake()
{
if (!QSBCore.DebugMode)
{
return;
Destroy(this);
}
}
public void Update()
{
/*
* 1 - Warp to first player
* 2 - Set time flowing

View File

@ -30,7 +30,16 @@ namespace QSB.Utility
private readonly GUIStyle guiGUIStyle = new();
private static readonly GUIStyle labelGUIStyle = new();
private void Awake() => guiGUIStyle.fontSize = 9;
private void Awake()
{
if (!QSBCore.DebugMode)
{
Destroy(this);
return;
}
guiGUIStyle.fontSize = 9;
}
private void WriteLine(int columnID, string text)
{
@ -72,11 +81,6 @@ namespace QSB.Utility
public void OnGUI()
{
if (!QSBCore.DebugMode)
{
return;
}
guiGUIStyle.normal.textColor = Color.white;
GUI.contentColor = Color.white;
@ -247,11 +251,6 @@ namespace QSB.Utility
public static void DrawLabel(Transform obj, string label)
{
if (!QSBCore.ShowDebugLabels)
{
return;
}
var camera = Locator.GetPlayerCamera();
if (camera == null)