mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Fix relative paths for global class icons in C#
This commit is contained in:
parent
da5f39889f
commit
3c0eaec39f
@ -241,11 +241,17 @@ namespace Godot.Bridge
|
||||
|
||||
if (outIconPath != null)
|
||||
{
|
||||
var iconAttr = scriptType.GetCustomAttributes(inherit: false)
|
||||
IconAttribute? iconAttr = scriptType.GetCustomAttributes(inherit: false)
|
||||
.OfType<IconAttribute>()
|
||||
.FirstOrDefault();
|
||||
|
||||
*outIconPath = Marshaling.ConvertStringToNative(iconAttr?.Path);
|
||||
if (!string.IsNullOrEmpty(iconAttr?.Path))
|
||||
{
|
||||
string iconPath = iconAttr.Path.IsAbsolutePath()
|
||||
? iconAttr.Path.SimplifyPath()
|
||||
: scriptPathStr.GetBaseDir().PathJoin(iconAttr.Path).SimplifyPath();
|
||||
*outIconPath = Marshaling.ConvertStringToNative(iconPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (outBaseType != null)
|
||||
|
Loading…
Reference in New Issue
Block a user