diff --git a/modules/mono/editor/GodotTools/GodotTools/Inspector/ExternalTypeReminder.cs b/modules/mono/editor/GodotTools/GodotTools/Inspector/ExternalTypeReminder.cs new file mode 100644 index 00000000000..71ca3d61835 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Inspector/ExternalTypeReminder.cs @@ -0,0 +1,35 @@ +using Godot; +using GodotTools.Internals; + +namespace GodotTools.Inspector; + +public partial class ExternalTypeReminder : HBoxContainer +{ + public override void _Ready() + { + SetAnchorsPreset(LayoutPreset.TopWide); + + var iconTexture = GetThemeIcon("NodeInfo", "EditorIcons"); + + var icon = new TextureRect() + { + Texture = iconTexture, + ExpandMode = TextureRect.ExpandModeEnum.FitWidthProportional, + CustomMinimumSize = iconTexture.GetSize(), + }; + + icon.SizeFlagsVertical = SizeFlags.ShrinkCenter; + + var label = new Label() + { + Text = "This inspector inherits an external type. Please build the C# project when the external type changes.".TTR(), + AutowrapMode = TextServer.AutowrapMode.WordSmart, + CustomMinimumSize = new Vector2(100f, 0f), + }; + + label.SizeFlagsHorizontal = SizeFlags.Fill | SizeFlags.Expand; + + AddChild(icon); + AddChild(label); + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools/Inspector/InspectorPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Inspector/InspectorPlugin.cs index 8aeb19e08b7..074e739b248 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Inspector/InspectorPlugin.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Inspector/InspectorPlugin.cs @@ -31,9 +31,9 @@ namespace GodotTools.Inspector if (string.IsNullOrEmpty(scriptPath)) { - // Generic types used empty paths in older versions of Godot - // so we assume your project is out of sync. - AddCustomControl(new InspectorOutOfSyncWarning()); + // Types from an external source (PackageReference or ProjectReference) + // uses empty paths, in such case we do not show out of sync warning. + AddCustomControl(new ExternalTypeReminder()); break; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs index 91d49854c73..8201d3f1343 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs @@ -217,7 +217,6 @@ namespace Godot.Bridge // not a global class. But if the script is not a global class it must return an empty // outClassName string since it should not have a name. string scriptPathStr = Marshaling.ConvertStringToManaged(*scriptPath); - Debug.Assert(!string.IsNullOrEmpty(scriptPathStr), "Script path can't be empty."); if (!_pathTypeBiMap.TryGetScriptType(scriptPathStr, out Type? scriptType)) {