Open
Conversation
SlejmUr
reviewed
Dec 14, 2024
| { | ||
| base._Input(@event); | ||
| if (@event is InputEventKey eKey ) { | ||
| // Key is ` |
Member
There was a problem hiding this comment.
you can simplify here.
eKey { KeyLabel = Key.QuoteLedt } && eKey.IsReleased()
SlejmUr
reviewed
Dec 14, 2024
| { | ||
| cFunc.Call(context); | ||
| } | ||
| if (command is CVar<string> cVarString) |
Member
There was a problem hiding this comment.
We can probably export this to new func with type probably HandleVar(T varType, comman
| } | ||
| public void Print(object what) | ||
| { | ||
| ConsoleManager.Contents += what; |
Member
There was a problem hiding this comment.
Can simplify here by $"{what}\n";
|
|
||
| public static Node GetConsole() | ||
| { | ||
| var console = SceneManager.GetPackedScene("DevConsole").Instantiate() as DevConsole; |
Member
There was a problem hiding this comment.
Please do additional checks if exists, if does not disable the console
| /// </summary> | ||
| /// <param name="name">The name of the command</param> | ||
| /// <param name="CFuncOrCVar">A CVar or CFunc Command</param> | ||
| public static void Register(string name, Command CFuncOrCVar) |
| Description = description; | ||
| // Check at runtime if the type is one of the allowed types | ||
| if (typeof(T) != typeof(int) && typeof(T) != typeof(float) && | ||
| typeof(T) != typeof(bool) && typeof(T) != typeof(string)) |
Member
There was a problem hiding this comment.
We should be able to use any number type. [interface exist for it]
string, bool is good
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added new DevConsole system. scenes that are allowed to spawn and use the developer console need to inherit ConsoleEnabledScene instead of Control, base._Input is required. I've made some example commands in MainMenu, but they can be registered from anywhere