Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector types and number improvements #2094

Merged

Conversation

Invertex
Copy link
Contributor

@Invertex Invertex commented Feb 17, 2024

Added Vector3 and Vector4 types, unified under a common base, so people making custom nodes have a unified way to write that data. Often people will want to use nodes that manipulate 3D space data, like the Camera or 3D character positions for example, so Vector3 is important.

Updated some of the code for the Number field as well to support more display customization.

Main changes:

  • Vector3/4 types for custom events to use
  • Value adjustment arrows split vertically to allow independent events and highlighting.
  • Integrated dedicated Affix/Suffix labels into the Input field that are separate from the actual value and static
  • Integrated the value adjustment arrows into the input field visuals as well, keeping everything tied together.
  • Value box and arrows respond to arrow keys to adjust value accordingly
  • Key or mouse can be held to start a continuous adjustment of value
  • Adjustment arrow direction will disable itself when hitting a Min or Max value to visually indicate that limit was hit.
  • "hide_step_button" extras_option to hide the Adjustment arrows
  • "affix" & "suffix" extras_option inputs for an event to define those labels

Added Vector3 and Vector4 types, unified under a common base, so people making custom nodes have a unified way to write that data. Often people will want to use nodes that manipulate 3D space data, like the Camera or 3D character positions for example, so Vector3 is important.

Updated some of the code for the Number field as well to support more display customization, partly to clean up Vector display.  The increment/decrement button can be optionally disabled through an extras flag, as well as a left side label tied to the number field itself.

Split off the icon resource into a dedicated resource that can be shared among elements, and also split it in half so up and down can be visually distinct and clear on which you're clicking.
@CakeVR
Copy link
Collaborator

CakeVR commented Feb 20, 2024

Hello, thanks for the PR.

I would prefer if we keep the arrows as they are for now and discuss the styling in an issue or the Discord.

@Invertex
Copy link
Contributor Author

No problem, removed the changes to the arrows.

-Added back vertically split value change arrows with independent events and highlighting
-Value box and arrows respond to arrow keys to adjust value accordingly
-Key or mouse can be held to start a continuous adjustment of value
-Suffix and Affix added as integrated Labels to the side of input field, keeping things tied together while not being a part of the actual value.
-Adjustment arrows also encapsulated by the input field in the same manner.
-Adjustment arrows will disable themselves when hitting a Min or Max value to visually indicate a limit was hit.
@Invertex Invertex force-pushed the vector-types-and-number-improvements branch from cfc6804 to 04e8279 Compare February 23, 2024 14:42
Didn't realize len() didn't work on the Vectors, but the section I used it is rarely called so didn't notice.

Refined the Vector classes to organize the logic flow better.

Got rid of a bug with the Number class that was resulting in max precision long numbers showing up in the fields upon restart despite "enforce_snap" being on.
Invertex and others added 5 commits February 26, 2024 11:46
- Fixed number fields causing line they are on to expand extra vertically
- Fixed number fields pushing elements to the right of them to the far end
- Touched up some code styling
The small delay before activation of the auto-incrementing allowed for situations where click was released during the delay, but pressed down again before the delay was finished, resulting in auto-increment triggering when it shouldn't, resulting in inconsistent number changing behavior.
Not a style that was going to be reasonably used by other things, so integrated it into the scene file to reduce file clutter
- on focus select all
- extend field box to full number field
- pad decimal numbers based on step
@Jowan-Spooner Jowan-Spooner merged commit 6d9dc1e into dialogic-godot:main Feb 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants