godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.19k stars 21.03k forks source link

Back icon showing in resource selection menu #82624

Open RubenHooijer opened 1 year ago

RubenHooijer commented 1 year ago

Godot version

v4.2.dev5.mono.official [e3e2528ba]

System information

Godot v4.2.dev5.mono - Windows 10.0.22621 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)

Issue description

I have created a resource with the class name Back. image

The icon of this resource shows a different icon than any other custom resource is showing. (Where the red arrow is pointing) image

I expect it to work like this Untitled

Steps to reproduce

  1. Create a new script that inherits from Resource
  2. Set the class name to Back (either C# or class_name)
  3. When creating a resource, you'll see "new Back" with the back icon

Minimal reproduction project

project.zip

YuriSizov commented 12 months ago

Icon lookup works based on the class name in the entire set of editor icons. Your name happens to match a very generic word used for the back icon. So I would say it's an expected behavior. We could add checks that the class name refers to a known built-in class, but that can limit the usability of class icons.

I guess one way to address this could be to create a second set of icons specifically for type icon lookups.