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

GDScript subresources do not save correctly when owner is custom resource #88894

Closed
Benpaste opened this issue Feb 27, 2024 · 3 comments · Fixed by #86705
Closed

GDScript subresources do not save correctly when owner is custom resource #88894

Benpaste opened this issue Feb 27, 2024 · 3 comments · Fixed by #86705

Comments

@Benpaste
Copy link

Benpaste commented Feb 27, 2024

Tested versions

  • Reproducible in 4.2.1.stable

System information

Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 (Advanced Micro Devices, Inc.; 31.0.24002.92) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

Issue description

When a custom Resource contains an exported GDScript, many of the ordinary methods for saving edits to that script file stop working.

WHAT DOES NOT WORK:

  • Ctrl + S
  • Ctrl + Alt + S (save script)
  • Shift + Alt + S (save all)
  • right-clicking on the script in the Scripts Panel and clicking "Save"
  • clicking "Save" on the dropdown for the exported GDScript, in the parent resource's Inspector window.
  • Running the project
  • Quitting the project - this results in a "Save changes before quitting?" dialogue that reappears every time you press "Save & Quit"

WHAT DOES WORK:

  • Closing the script from the Scripts Panel (prompts a "Close and save changes?" dialogue). Works ONCE and will not save further edits.
  • Clicking "Save" on the parent resource in the Inspector.

Steps to reproduce

  1. Create a new GDScript file, resource_class.gd.

extends Resource
class_name CustomResource
@export var custom_script: GDScript

  1. Create a new instance of this resource, resource_instance.tres.
  2. Navigate to resource_instance.tres's Inspector tab, click on Custom Script and click New GDScript.
  3. Type "Hello World" in the new Custom Script. Press Ctrl+S to save.
  4. Observe that the exported script's name in the Scripts Panel changes from [unsaved](*) to new_resource.tres::GDScript_xxxxx(*).
  5. Observe that pressing Ctrl+S does not save any changes to the Custom Script. Opening resource_instance.tres in a text editor will confirm that no changes are being saved.

Minimal reproduction project (MRP)

Export Script Saving MRP.zip

@KoBeWi
Copy link
Member

KoBeWi commented Feb 27, 2024

Looks like duplicate of #86696?

@Benpaste
Copy link
Author

It is, thank you. Wasn't able to find it via search but that describes my problem exactly

@akien-mga
Copy link
Member

Consolidating in #86696.

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

Successfully merging a pull request may close this issue.

4 participants