Merge pull request #95808 from paulloz/bugfix/dotnet-globalclass-icon-relative-paths
Fix relative paths for global class icons in C#
This commit is contained in:
commit
73d42411f0
1 changed files with 8 additions and 2 deletions
|
@ -241,11 +241,17 @@ namespace Godot.Bridge
|
||||||
|
|
||||||
if (outIconPath != null)
|
if (outIconPath != null)
|
||||||
{
|
{
|
||||||
var iconAttr = scriptType.GetCustomAttributes(inherit: false)
|
IconAttribute? iconAttr = scriptType.GetCustomAttributes(inherit: false)
|
||||||
.OfType<IconAttribute>()
|
.OfType<IconAttribute>()
|
||||||
.FirstOrDefault();
|
.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)
|
if (outBaseType != null)
|
||||||
|
|
Loading…
Reference in a new issue