Special field attribute allowing for I/O tooltip overrides (or hiding the result) - #220
Open
LumosX wants to merge 2 commits into
Open
Special field attribute allowing for I/O tooltip overrides (or hiding the result)#220LumosX wants to merge 2 commits into
LumosX wants to merge 2 commits into
Conversation
the use of an attribute applied to custom classes.
Owner
|
Good feature but its usage is very specific. In order to get as much out of this feature as we can, we need to make a few changes.
I updated the contributing guidelines to include C# version backwards compatability and using concrete variable types instead of var. |
Contributor
Author
Sure. I went with a class attribute because it's simpler to check whether the type has it, but it won't be too difficult to check the respective field for it. |
Contributor
Author
[Output(dynamicPortList = true)]
[OverrideTooltip("test tooltip with value")]
public string[] baseOutputs;
[Output]
[OverrideTooltip("test tooltip, value hidden", true)]
public float floatOutput;The attribute can now be applied to fields instead of classes, permitting overriding tooltips of any types. Works on dynamic port lists. Likely doesn't work on dynamic ports without lists, as they aren't bound to a field. |
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.

When using long, nested namespaces and nested classes, you can find yourself in ridiculous situations where your tooltips go out of screen. With these changes, you can use an attribute to remedy this.
As usual, "before" is to the left, "after" is to the right:


Additionally, hiding values is not necessary -- you may only rename if you so desire:
(The attribute also supports hiding the value only.)
Usage example for the first image:
NB: This commit uses modern C# features such as null coalescing. I'm not too clear on the backwards-compatibility policy of the repo, and will edit if necessary.