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

The custom resource cannot be displayed properly in the quick load resource list #86060

Open
eventidez opened this issue Dec 12, 2023 · 6 comments

Comments

@eventidez
Copy link

eventidez commented Dec 12, 2023

Tested versions

4.2.mono, 4.1.3.stable.mono

System information

Windows10, Windows11

Issue description

Something is often missing from the list of resources.
It often happens after git push, when new resources are created
Sometimes it happens when you restart my computer.

Something in the quick load resource list will not show.
Need to delete ".godot" folder. and build project
Then it shows up in quick load resource list

Steps to reproduce

  1. Create new project

  2. Create new C# script called "Item" that inherits from Resource

  3. Build project

  4. Create a "Resource" file named "Item_1.tres"

  5. Set existing script of "Item_1.tres" to Item.cs

  6. Add [GlobalClass] attribute in Item.cs

  7. Create new C# script called "Test.cs" that inherits from Node

public partial class Test : Node
{
    [Export] private Item _item;
}
  1. Build project

  2. Create root node, and set existing script to "Text.cs"

  3. Click "Item" Property in Inspector, click "Quick Load", no item in resource list
    s_1

  4. Create a "Item" resource file named "Item_2.tres"I, and click "Item" Property in Inspector, click "Quick Load"
    s_2

  5. open "Item_1.tres" in VSCode, there is no "script_class"

[gd_resource type="Resource" load_steps=2 format=3 uid=...
  1. Add "script_class" in "Item_1.tres" resource
[gd_resource type="Resource" script_class="Item" load_steps=2 format=3 uid=...
  1. Build project or not build project,and click "Item" Property in Inspector, click "Quick Load", the result is the same as step 12. only "Item_2.cs" in resource list

  2. Reload current project, and click "Quick Load", only "Item_2.cs" in resource list

  3. Close Project

  4. Open in file Manager, and deleted ".godot" folder

  5. Open Project, build project

  6. Click "Item" Property in Inspector, click "Quick Load", "Item_1.cs" and "Item_2.cs" in resource list

Minimal reproduction project (MRP)

N/A

@eventidez eventidez changed the title The custom resource cannot be displayed properly in the resource list The custom resource cannot be displayed properly in the quick load resource list Dec 12, 2023
@eventidez
Copy link
Author

The same thing happens to me.

In addition, the creation of an built-in script for a custom resource is broken - the first time you press Ctrl+S, the script will be saved, but in the future, if you don't restart the engine, it is no longer possible to save new changes in the script. Should I make a thread for this?

Please make a new thread.

@rob-williams
Copy link

This and #85775 are workflow killers for me right now since upgrading to 4.x. Except for freshly-created resources, the quick load list is always empty, and I have to navigate to the resource file directly. #67119 is closed but still active, and it has the most information out of any of the issues. Can we consolidate under a single issue to troubleshoot, preferably the older one with all the helpful info?

I assume the code driving this dialog is here? https://github.com/godotengine/godot/blob/master/editor/editor_quick_open.cpp

My C++ is super rusty, but I'm going to start poking around.

@SirLich
Copy link
Contributor

SirLich commented Jan 29, 2024

Reproduced on v4.2.1.stable.official [b09f793]

@dfego
Copy link

dfego commented Feb 10, 2024

This and #85775 are workflow killers for me right now since upgrading to 4.x. Except for freshly-created resources, the quick load list is always empty, and I have to navigate to the resource file directly. #67119 is closed but still active, and it has the most information out of any of the issues. Can we consolidate under a single issue to troubleshoot, preferably the older one with all the helpful info?

I assume the code driving this dialog is here? https://github.com/godotengine/godot/blob/master/editor/editor_quick_open.cpp

My C++ is super rusty, but I'm going to start poking around.

I've noticed the same thing too, which is an interesting bit of information that might help get to the bottom of it. Specifically the "except for freshly-created resources". When I create a new resource, for a while (maybe the same editor session?) I can quick-load resources of that type.

@SirLich
Copy link
Contributor

SirLich commented Feb 10, 2024

A probably workaround could be a Tool script that just loads and re-saves all resources of a specific type. After editing the resources, you notice they're available in the dropdown again.

@scotdoria
Copy link

I was refactoring my code and wanted to create subclasses to make selecting of my specific custom resources easier because my resources have gotten so big that there were too much to select in my quick load which was inconvenient. Running across this bug killed that approach.

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

No branches or pull requests

6 participants