Browse Source

Merge pull request #37541 from neikeq/fix-csharp-bindings-april

Fix C# bindings after recent breaking changes
Rémi Verschelde 5 years ago
parent
commit
3182b1a53c

+ 1 - 0
core/register_core_types.cpp

@@ -138,6 +138,7 @@ void register_core_types() {
 
 	ClassDB::register_virtual_class<InputEvent>();
 	ClassDB::register_virtual_class<InputEventWithModifiers>();
+	ClassDB::register_virtual_class<InputEventFromWindow>();
 	ClassDB::register_class<InputEventKey>();
 	ClassDB::register_virtual_class<InputEventMouse>();
 	ClassDB::register_class<InputEventMouseButton>();

+ 6 - 6
modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs

@@ -205,9 +205,9 @@ namespace GodotTools
             if (what == EditorSettings.NotificationEditorSettingsChanged)
             {
                 var editorBaseControl = editorInterface.GetBaseControl();
-                panelTabs.AddStyleboxOverride("panel", editorBaseControl.GetStylebox("DebuggerPanel", "EditorStyles"));
-                panelTabs.AddStyleboxOverride("tab_fg", editorBaseControl.GetStylebox("DebuggerTabFG", "EditorStyles"));
-                panelTabs.AddStyleboxOverride("tab_bg", editorBaseControl.GetStylebox("DebuggerTabBG", "EditorStyles"));
+                panelTabs.AddThemeStyleboxOverride("panel", editorBaseControl.GetThemeStylebox("DebuggerPanel", "EditorStyles"));
+                panelTabs.AddThemeStyleboxOverride("tab_fg", editorBaseControl.GetThemeStylebox("DebuggerTabFG", "EditorStyles"));
+                panelTabs.AddThemeStyleboxOverride("tab_bg", editorBaseControl.GetThemeStylebox("DebuggerTabBG", "EditorStyles"));
             }
         }
 
@@ -258,9 +258,9 @@ namespace GodotTools
                 RectMinSize = new Vector2(0, 228) * EditorScale,
                 SizeFlagsVertical = (int)SizeFlags.ExpandFill
             };
-            panelTabs.AddStyleboxOverride("panel", editorBaseControl.GetStylebox("DebuggerPanel", "EditorStyles"));
-            panelTabs.AddStyleboxOverride("tab_fg", editorBaseControl.GetStylebox("DebuggerTabFG", "EditorStyles"));
-            panelTabs.AddStyleboxOverride("tab_bg", editorBaseControl.GetStylebox("DebuggerTabBG", "EditorStyles"));
+            panelTabs.AddThemeStyleboxOverride("panel", editorBaseControl.GetThemeStylebox("DebuggerPanel", "EditorStyles"));
+            panelTabs.AddThemeStyleboxOverride("tab_fg", editorBaseControl.GetThemeStylebox("DebuggerTabFG", "EditorStyles"));
+            panelTabs.AddThemeStyleboxOverride("tab_bg", editorBaseControl.GetThemeStylebox("DebuggerTabBG", "EditorStyles"));
             AddChild(panelTabs);
 
             {

+ 5 - 5
modules/mono/editor/GodotTools/GodotTools/BuildTab.cs

@@ -46,12 +46,12 @@ namespace GodotTools
             get
             {
                 if (!BuildExited)
-                    return GetIcon("Stop", "EditorIcons");
+                    return GetThemeIcon("Stop", "EditorIcons");
 
                 if (BuildResult == BuildResults.Error)
-                    return GetIcon("StatusError", "EditorIcons");
+                    return GetThemeIcon("StatusError", "EditorIcons");
 
-                return GetIcon("StatusSuccess", "EditorIcons");
+                return GetThemeIcon("StatusSuccess", "EditorIcons");
             }
         }
 
@@ -145,8 +145,8 @@ namespace GodotTools
         {
             issuesList.Clear();
 
-            using (var warningIcon = GetIcon("Warning", "EditorIcons"))
-            using (var errorIcon = GetIcon("Error", "EditorIcons"))
+            using (var warningIcon = GetThemeIcon("Warning", "EditorIcons"))
+            using (var errorIcon = GetThemeIcon("Error", "EditorIcons"))
             {
                 for (int i = 0; i < issues.Count; i++)
                 {

+ 7 - 8
modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs

@@ -128,7 +128,7 @@ namespace GodotTools
         {
             bool showOnStart = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");
             aboutDialogCheckBox.Pressed = showOnStart;
-            aboutDialog.PopupCenteredMinsize();
+            aboutDialog.PopupCentered();
         }
 
         private void _MenuOptionPressed(int id)
@@ -166,10 +166,10 @@ namespace GodotTools
                 bool showInfoDialog = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");
                 if (showInfoDialog)
                 {
-                    aboutDialog.PopupExclusive = true;
+                    aboutDialog.Exclusive = true;
                     _ShowAboutDialog();
                     // Once shown a first time, it can be seen again via the Mono menu - it doesn't have to be exclusive from that time on.
-                    aboutDialog.PopupExclusive = false;
+                    aboutDialog.Exclusive = false;
                 }
 
                 var fileSystemDock = GetEditorInterface().GetFileSystemDock();
@@ -212,9 +212,9 @@ namespace GodotTools
 
         public void ShowErrorDialog(string message, string title = "Error")
         {
-            errorDialog.WindowTitle = title;
+            errorDialog.Title = title;
             errorDialog.DialogText = message;
-            errorDialog.PopupCenteredMinsize();
+            errorDialog.PopupCentered();
         }
 
         private static string _vsCodePath = string.Empty;
@@ -383,7 +383,6 @@ namespace GodotTools
 
             menuPopup = new PopupMenu();
             menuPopup.Hide();
-            menuPopup.SetAsToplevel(true);
 
             AddToolSubmenuItem("Mono", menuPopup);
 
@@ -392,7 +391,7 @@ namespace GodotTools
                 menuPopup.AddItem("About C# support".TTR(), (int)MenuOptions.AboutCSharp);
                 aboutDialog = new AcceptDialog();
                 editorBaseControl.AddChild(aboutDialog);
-                aboutDialog.WindowTitle = "Important: C# support is not feature-complete";
+                aboutDialog.Title = "Important: C# support is not feature-complete";
 
                 // We don't use DialogText as the default AcceptDialog Label doesn't play well with the TextureRect and CheckBox
                 // we'll add. Instead we add containers and a new autowrapped Label inside.
@@ -406,7 +405,7 @@ namespace GodotTools
                 aboutVBox.AddChild(aboutHBox);
 
                 var aboutIcon = new TextureRect();
-                aboutIcon.Texture = aboutIcon.GetIcon("NodeWarning", "EditorIcons");
+                aboutIcon.Texture = aboutIcon.GetThemeIcon("NodeWarning", "EditorIcons");
                 aboutHBox.AddChild(aboutIcon);
 
                 var aboutLabel = new Label();

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs

@@ -10,7 +10,7 @@ namespace GodotTools
 
         public override void _Notification(int what)
         {
-            if (what == MainLoop.NotificationWmFocusIn)
+            if (what == Node.NotificationWmFocusIn)
             {
                 RestartTimer();
 

+ 3 - 3
modules/mono/editor/bindings_generator.cpp

@@ -1406,7 +1406,7 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte
 	const TypeInterface *current_type = &p_itype;
 	while (!setter && current_type->base_name != StringName()) {
 		OrderedHashMap<StringName, TypeInterface>::Element base_match = obj_types.find(current_type->base_name);
-		ERR_FAIL_COND_V(!base_match, ERR_BUG);
+		ERR_FAIL_COND_V_MSG(!base_match, ERR_BUG, "Type not found '" + current_type->base_name + "'. Inherited by '" + current_type->name + "'.");
 		current_type = &base_match.get();
 		setter = current_type->find_method_by_name(p_iprop.setter);
 	}
@@ -1417,7 +1417,7 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte
 	current_type = &p_itype;
 	while (!getter && current_type->base_name != StringName()) {
 		OrderedHashMap<StringName, TypeInterface>::Element base_match = obj_types.find(current_type->base_name);
-		ERR_FAIL_COND_V(!base_match, ERR_BUG);
+		ERR_FAIL_COND_V_MSG(!base_match, ERR_BUG, "Type not found '" + current_type->base_name + "'. Inherited by '" + current_type->name + "'.");
 		current_type = &base_match.get();
 		getter = current_type->find_method_by_name(p_iprop.getter);
 	}
@@ -1631,7 +1631,7 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
 	// Generate method
 	{
 		if (!p_imethod.is_virtual && !p_imethod.requires_object_call) {
-			p_output.append(MEMBER_BEGIN "[DebuggerBrowsable(DebuggerBrowsableState.Never)]" MEMBER_BEGIN "private static IntPtr ");
+			p_output.append(MEMBER_BEGIN "[DebuggerBrowsable(DebuggerBrowsableState.Never)]" MEMBER_BEGIN "private static readonly IntPtr ");
 			p_output.append(method_bind_field);
 			p_output.append(" = Object." ICALL_GET_METHODBIND "(" BINDINGS_NATIVE_NAME_FIELD ", \"");
 			p_output.append(p_imethod.name);

+ 1 - 1
modules/mono/mono_gd/gd_mono_cache.cpp

@@ -251,7 +251,7 @@ void update_godot_api_cache() {
 	CACHE_CLASS_AND_CHECK(GodotResource, GODOT_API_CLASS(Resource));
 	CACHE_CLASS_AND_CHECK(Node, GODOT_API_CLASS(Node));
 	CACHE_CLASS_AND_CHECK(Control, GODOT_API_CLASS(Control));
-	CACHE_CLASS_AND_CHECK(Node3D, GODOT_API_CLASS(Node3Dshou));
+	CACHE_CLASS_AND_CHECK(Node3D, GODOT_API_CLASS(Node3D));
 	CACHE_CLASS_AND_CHECK(WeakRef, GODOT_API_CLASS(WeakRef));
 	CACHE_CLASS_AND_CHECK(Callable, GODOT_API_CLASS(Callable));
 	CACHE_CLASS_AND_CHECK(SignalInfo, GODOT_API_CLASS(SignalInfo));

+ 1 - 1
servers/rendering_server.cpp

@@ -1805,7 +1805,7 @@ void RenderingServer::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("environment_set_glow", "env", "enable", "level_flags", "intensity", "strength", "mix", "bloom_threshold", "blend_mode", "hdr_bleed_threshold", "hdr_bleed_scale", "hdr_luminance_cap"), &RenderingServer::environment_set_glow);
 	ClassDB::bind_method(D_METHOD("environment_set_tonemap", "env", "tone_mapper", "exposure", "white", "auto_exposure", "min_luminance", "max_luminance", "auto_exp_speed", "auto_exp_grey"), &RenderingServer::environment_set_tonemap);
 	ClassDB::bind_method(D_METHOD("environment_set_adjustment", "env", "enable", "brightness", "contrast", "saturation", "ramp"), &RenderingServer::environment_set_adjustment);
-	ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance", "roughness"), &RenderingServer::environment_set_ssr);
+	ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance"), &RenderingServer::environment_set_ssr);
 	ClassDB::bind_method(D_METHOD("environment_set_ssao", "env", "enable", "radius", "intensity", "bias", "light_affect", "ao_channel_affect", "blur", "bilateral_sharpness"), &RenderingServer::environment_set_ssao);
 	ClassDB::bind_method(D_METHOD("environment_set_fog", "env", "enable", "color", "sun_color", "sun_amount"), &RenderingServer::environment_set_fog);