mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[OriginShift] Moved debug to BTKUI instead of keybind
This commit is contained in:
parent
a29075d2ad
commit
69e6298281
2 changed files with 20 additions and 16 deletions
|
@ -32,6 +32,10 @@ namespace NAK.OriginShiftMod.Integrations
|
|||
|
||||
// listen for state changes
|
||||
OriginShiftManager.OnStateChanged += OnOriginShiftStateChanged;
|
||||
|
||||
// debug toggle
|
||||
ToggleButton debugToggle = _ourCategory.AddToggle("Debug Overlay", "Displays coordinate & chunk debug information on the Desktop view.", false);
|
||||
debugToggle.OnValueUpdated += OnDebugToggle;
|
||||
}
|
||||
|
||||
#region Category Actions
|
||||
|
@ -131,5 +135,14 @@ namespace NAK.OriginShiftMod.Integrations
|
|||
}
|
||||
|
||||
#endregion Toggle Actions
|
||||
|
||||
#region Debug Toggle Actions
|
||||
|
||||
private static void OnDebugToggle(bool value)
|
||||
{
|
||||
OriginShiftManager.Instance.ToggleDebugOverlay(value);
|
||||
}
|
||||
|
||||
#endregion Debug Toggle Actions
|
||||
}
|
||||
}
|
|
@ -231,24 +231,15 @@ public class OriginShiftManager : MonoBehaviour
|
|||
|
||||
#endregion Utility Methods
|
||||
|
||||
#region Unity Events
|
||||
#region Debug Methods
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.P)) // press p to print chunk
|
||||
OriginShiftMod.Logger.Msg($"Current Chunk: {ChunkOffset}");
|
||||
|
||||
// press o to toggle debug
|
||||
if (Input.GetKeyDown(KeyCode.O))
|
||||
public void ToggleDebugOverlay(bool state)
|
||||
{
|
||||
if (TryGetComponent(out DebugTextDisplay debugTextDisplay))
|
||||
Destroy(debugTextDisplay);
|
||||
else
|
||||
gameObject.AddComponent<DebugTextDisplay>();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion Unity Events
|
||||
#endregion Debug Methods
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue