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

Fix variable and setting nodes not updating on type change #2068

Conversation

Atlinx
Copy link
Contributor

@Atlinx Atlinx commented Feb 3, 2024

Fixes #2067
Fixes #2062 (Uses the proposed change in the issue)
May also fix #2063 , since I suspect a null value might be the product of the visual editor not generating the correct code

Changes

  • Made _value_type reset the value and force an editor refresh on change
  • Refactor event_variable and event_settings to use enums for their different value types to make the code easier to read
  • Refactor event_block to not call set_value on fields that are not visible. This prevents invisible fields from throwing errors when they get injected with the wrong data type in event nodes that have varying value types (such as event_variable and event_settings, whose value types can be strings, numbers, expressions, etc.)

@Atlinx Atlinx changed the title Fix variable editor Fix variable and setting nodes not updating on type change Feb 3, 2024
Copy link
Collaborator

@Jowan-Spooner Jowan-Spooner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a tiny comment. Looks great otherwise. I want to take a moment to actually test this and don't have the time right now (will hopefully get to it later or tomorrow), but it looks really good. Thank you so much already.

addons/dialogic/Editor/Events/EventBlock/event_block.gd Outdated Show resolved Hide resolved
@Jowan-Spooner
Copy link
Collaborator

This seems to work perfectly. Thank you very much!

@Jowan-Spooner Jowan-Spooner merged commit 592f934 into dialogic-godot:main Feb 6, 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
2 participants