From 6c8433a0e0a9de788e57bfe1af3f683c0036dc08 Mon Sep 17 00:00:00 2001 From: cmod31 Date: Thu, 23 Feb 2023 09:50:41 +0100 Subject: [PATCH] new visiblecollision command --- src/scene-scripts/console/commands.json | 3 ++- src/scene-scripts/console/console.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scene-scripts/console/commands.json b/src/scene-scripts/console/commands.json index e639cbb..17a9e7b 100644 --- a/src/scene-scripts/console/commands.json +++ b/src/scene-scripts/console/commands.json @@ -5,5 +5,6 @@ "noclip": " - Toggles the player collision and lets you walk through walls and world barriers\n", "stickycamera": " - Toggles the camera mode. Stickycamera follows the player without limits and extra animation\n", "playername": " - Renames the player\n", - "reload": " - Reloads the current level (for softlocks or other issues)\n" + "reload": " - Reloads the current level (for softlocks or other issues)\n", + "visiblecollision": " - Toggles if collision shapes hitboxes and hitmarkers are visible. Use 'reload' to see changes!\n" } \ No newline at end of file diff --git a/src/scene-scripts/console/console.cs b/src/scene-scripts/console/console.cs index a0bf48a..0ddc655 100644 --- a/src/scene-scripts/console/console.cs +++ b/src/scene-scripts/console/console.cs @@ -106,4 +106,9 @@ public partial class console : PopupPanel textblock.AddText("Your new name is now: " + player_variables.PlayerName + "\n"); } public void reload() => GetTree().ReloadCurrentScene(); + public void visiblecollision() + { + GetTree().DebugCollisionsHint = !GetTree().DebugCollisionsHint; + textblock.AddText("Visible collision shapes and hitmarker now set to: " + GetTree().DebugCollisionsHint + "\nUse 'reload' to see changes!\n"); + } }