NewGraph icon indicating copy to clipboard operation
NewGraph copied to clipboard

Unable to load the icon: 'd_winbtn_win_close' on Mac

Open noio opened this issue 1 year ago • 4 comments

First off, I love this package and its philosophy, I've only just begun using it but having a generic visualization/editor for graph based data is just amazing. Unity should have this built in. Thanks so much for sharing this with your fellow game devs 🙏

This is just a tiny bug that I'm seeing, it's also not affecting the workflow in any way, I think:

When opening a graph, an error is thrown because Unity can't find the icon d_winbtn_win_close. Which makes sense, as I assume that's a windows only icon.

I normally wouldn't open an issue for mac specific issues, that just might not be a target platform for this package.

But I see you're beautifully handling some Mac specific stuff already! (e.g. showing the char for the Command key) 💕

Below is the full stack trace: (again, this occurs when opening a graph)

[Error] Unable to load the icon: 'd_winbtn_win_close'.
Note that either full project path should be used (with extension) or just the icon name if the icon is located in the following location: 'Assets/Editor Default Resources/Icons/' (without extension, since png is assumed)
EditorGUIUtility.IconContent()

NewGraph.EditableLabelElement..ctor() at ./Library/PackageCache/com.gentlymad.newgraph@d41b4e6e29/Editor/Views/Elements/EditableLabelElement.cs:32

NewGraph.ScriptableInspectorControllerGeneric`1<NewGraph.ScriptableGraphModel>.CreateRenameGraphUI() at ./Library/PackageCache/com.gentlymad.newgraph@d41b4e6e29/Editor/Controllers/ScriptableInspectorControllerGeneric.cs:113

InspectorControllerBase.Draw() at ./Library/PackageCache/com.gentlymad.newgraph@d41b4e6e29/Editor/Controllers/InspectorControllerBase.cs:218

GraphController.Draw() at ./Library/PackageCache/com.gentlymad.newgraph@d41b4e6e29/Editor/Controllers/GraphController.cs:534

GraphWindow.OnGUI() at ./Library/PackageCache/com.gentlymad.newgraph@d41b4e6e29/Editor/Views/GraphWindow.cs:123

GUIUtility.ProcessEvent() at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:206

noio avatar May 02 '24 08:05 noio

Update: I think a fix could be as simple as the following line in EditableLabelElement.cs :

Screenshot 2024-05-02 at 10 23 10

noio avatar May 02 '24 08:05 noio

Hm okay another update:

I am actually not sure which "OS button icons" are still available in Unity 2023.

Maybe the issue is not Win vs Mac but more that Unity is no longer including any OS-specific icons in 2023?

This list contains winbtn_win and winbtn_mac variants, but when I examine the icons in my (2023) Unity, using Internal Icon Browser, then I'm actually not seeing any winbtn icons.

Perhaps if you're looking to just show a simple cross, it's safer to just use d_clear ?

Screenshot 2024-05-02 at 10 28 29

noio avatar May 02 '24 08:05 noio

Also getting this issue in Unity Pro 2023.2.20f1 on Windows.

image

atellio avatar Jun 25 '24 04:06 atellio

Im using this to fix the problem in Unity 6

#if UNITY_6000_0_OR_NEWER
        private const string closeIcon = "CrossIcon";
#else
        private const string closeIcon = "d_winbtn_win_close";
#endif

Consalv0 avatar Aug 30 '24 10:08 Consalv0