CSharpRedotTools / Template

A template used for quickly setting up new Redot 4 C# games.
MIT License
111 stars 8 forks source link

Improving the Visualize attribute #91

Open valkyrienyanko opened 1 month ago

valkyrienyanko commented 1 month ago

Visualize cannot visualize Dictionaries in realtime

Steps to Reproduce

  1. Add following code

    [Visualize(nameof(SomeDict))]
    public partial class Node2D // position this node in the world somewhere where you will see it
    {
    public Dictionary<int, string> SomeDict { get; set; } = new();
    
    // Update SomeDict somewhere in _Process or something
    }

Side note that is unrelated to this issue: There is no way to tell visualize to position a visual panel that does not extend from Node2D or Control to a manual position while at the same time visualizing a member in realtime.

Visualize messages are not all colorized

There should be a public static util method(s) specifically made for handling visualize messages. As an added bonus this could be hooked into the thread safe logger class.

Visualize cannot see values of private members from inherited classes

Have a look at this commit 706e60d67584822daa54d49e14db6d198b27ab2f

Steps to Reproduce Issue:

  1. Set _curState access modifier from protected to private
  2. Remove [Visualize] attribute from EnemyComponent
  3. Run the game
  4. Notice how you cannot see _curState for EnemyComponents even though EntityComponent has the visualize attribute listening to the _curState field
  5. You will get the following message in console: "[Visualize] Tracking 'EntityComponent' to see if '_curState' value changes"

Where would one define settings for Visualize that can easily be edited by the developer?

For example I want to add a setting to disable visualization of underscores in private fields.

Should the underscores in private fields be visible in-game?

Control Elements are not all perfectely aligned

Untitled

Add support for Godot.Collections.Array and Godot.Collections.Dictionary

valkyrienyanko commented 1 month ago

Visualize code is so poorly written I'm thinking it should be remade from scratch.