Skip to content

Commit

Permalink
1.2.0 - Console Action Override
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraWebdev committed Oct 25, 2023
1 parent 78358d8 commit e0f0e58
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ An easy to use in-game dev console for Godot 4 (C#)

### How to use
- Press `F3` in-game to open the console
- You can create an input action named "toggle_console" to define a custom key/button

## Commands
### How to add commands
Expand All @@ -37,8 +38,6 @@ There are a few helper methods your command can call.
### Built in commands
We have created a few default commands that are always available.

- `noclip`
- Allows you to move the player without physics
- `clear`
- Clears the console history
- `devcam`
Expand All @@ -58,4 +57,7 @@ We have created a few default commands that are always available.
- `timescale`
- Sets the timescale
- `toggleconsole`
- Toggles the console
- Toggles the console

### Demo Project
This repository contains a demo project that implements a `noclip` console command to showcase the usage of this addon.
2 changes: 1 addition & 1 deletion demo/addons/sofiaconsole/Commands/InfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private void DebugPrintInfo()
{
Console.Instance.Print("Versioning:");
Console.Instance.Print($"Godot Version: {Engine.GetVersionInfo()["string"]}", Console.PrintType.Hint);
Console.Instance.Print("SofiaConsole Version: 1.0.0", Console.PrintType.Hint);
Console.Instance.Print("SofiaConsole Version: 1.2.0", Console.PrintType.Hint);
Console.Instance.Print($"CPU Architecture: {Engine.GetArchitectureName()}", Console.PrintType.Hint);
Console.Instance.Space();
Console.Instance.Print("Operating System:");
Expand Down
5 changes: 2 additions & 3 deletions demo/addons/sofiaconsole/Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace media.Laura.SofiaConsole;

Expand Down Expand Up @@ -41,7 +40,7 @@ public override void _EnterTree()

LoadCommands();

Print("[SofiaConsole] Version 1.0.0", PrintType.Success);
Print("[SofiaConsole] Version 1.2.0", PrintType.Success);
Space();

GD.Print("[SofiaConsole] Done");
Expand All @@ -60,7 +59,7 @@ public override void _Input(InputEvent @event)
}

// Open Console
if (eventKey.Keycode == Key.F3)
if (InputMap.HasAction("toggle_console") && Input.IsActionPressed("toggle_console") || eventKey.Keycode == Key.F3)
{
ToggleConsole();
}
Expand Down
2 changes: 1 addition & 1 deletion demo/addons/sofiaconsole/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name="SofiaConsole"
description="A lightweight developer console with CSharp support."
author="Laura Sofia Heimann"
version="1.0.1"
version="1.2.0"
script="SofiaConsole.cs"
language="C#"

0 comments on commit e0f0e58

Please sign in to comment.