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

Custom type default values not exported #3581

Closed
DanielPower opened this issue Feb 19, 2023 · 2 comments
Closed

Custom type default values not exported #3581

DanielPower opened this issue Feb 19, 2023 · 2 comments
Labels
bug Broken behavior.

Comments

@DanielPower
Copy link

Describe the bug

When using custom types, if a value is not modified, it will not be included in exports.
If you modify the value, then set it back to the default, it will be included in the export.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom type
    a. View -> Custom Types Editor
    b. Add Class
    c. Add Member
    d. Select 'float' as the type
    e. set 3.0 as the default value
    f. close the custom type editor
  2. Select an object
  3. Add a property to the object, selecting the newly created custom type
    a. Do not modify the value, it should default to 3.0
  4. Export the map as lua

Note that when inspecting the lua file, the custom property will have an empty table as its value.

  1. Change the value of the custom property to antother value, then back to 3.0
  2. Export the map as lua

Note that when inspecting the lua file, the custom property will appropriately have a field with the value 3.0

Expected behavior
Default values should be included in the export.

Specifications:

  • OS: Archlinux
  • Tiled Version: 1.9.2
@DanielPower DanielPower added the bug Broken behavior. label Feb 19, 2023
@eishiya
Copy link
Contributor

eishiya commented Feb 19, 2023

Default values are never included by default, but should be included if the "resolve object types and properties" export option is checked. However, that option currently doesn't currently apply to class members, which is #3411.

@DanielPower
Copy link
Author

That checks out. I'll close this issue in favor of #3411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

2 participants