summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/mono/editor/bindings_generator.cpp2
-rw-r--r--modules/mono/editor/bindings_generator.h2
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp3
-rw-r--r--modules/mono/mono_gd/gd_mono.h4
-rw-r--r--modules/visual_script/visual_script_editor.cpp43
-rw-r--r--modules/visual_script/visual_script_editor.h2
6 files changed, 25 insertions, 31 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 28f098d323..28cab2ab61 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -30,7 +30,7 @@
#include "bindings_generator.h"
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
#include "core/engine.h"
#include "core/global_constants.h"
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index 26718f1d11..8f3676940b 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -36,7 +36,7 @@
#include "editor/doc/doc_data.h"
#include "editor/editor_help.h"
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
#include "core/ustring.h"
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index b2e1deca01..544bfc4615 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -430,8 +430,8 @@ void GDMono::_register_internal_calls() {
}
void GDMono::_initialize_and_check_api_hashes() {
-
#ifdef MONO_GLUE_ENABLED
+#ifdef DEBUG_METHODS_ENABLED
if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) {
ERR_PRINT("Mono: Core API hash mismatch.");
}
@@ -441,6 +441,7 @@ void GDMono::_initialize_and_check_api_hashes() {
ERR_PRINT("Mono: Editor API hash mismatch.");
}
#endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
#endif // MONO_GLUE_ENABLED
}
diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h
index 4f7d3791f7..343d68bc2d 100644
--- a/modules/mono/mono_gd/gd_mono.h
+++ b/modules/mono/mono_gd/gd_mono.h
@@ -151,6 +151,7 @@ protected:
static GDMono *singleton;
public:
+#ifdef DEBUG_METHODS_ENABLED
uint64_t get_api_core_hash() {
if (api_core_hash == 0)
api_core_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
@@ -162,7 +163,8 @@ public:
api_editor_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
return api_editor_hash;
}
-#endif
+#endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
#ifdef TOOLS_ENABLED
bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config);
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 29b42b1673..0399dbc87c 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -1350,7 +1350,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt
return; //or crash because it will become invalid
}
} else if (ti->get_parent() == root->get_children()) {
- selected = ti->get_metadata(0);
+ selected = ti->get_text(0);
function_name_edit->set_position(Input::get_singleton()->get_mouse_position() - Vector2(60, -10));
function_name_edit->popup();
}
@@ -2672,7 +2672,7 @@ void VisualScriptEditor::_toggle_tool_script() {
void VisualScriptEditor::clear_edit_menu() {
memdelete(edit_menu);
- memdelete(left_vsplit);
+ memdelete(members_section);
}
void VisualScriptEditor::_change_base_type_callback() {
@@ -3951,7 +3951,7 @@ void VisualScriptEditor::_notification(int p_what) {
_update_graph();
}
} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
- left_vsplit->set_visible(is_visible_in_tree());
+ members_section->set_visible(is_visible_in_tree());
}
}
@@ -4691,26 +4691,21 @@ VisualScriptEditor::VisualScriptEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/refresh_nodes"), REFRESH_GRAPH);
edit_menu->get_popup()->connect("id_pressed", this, "_menu_option");
- left_vsplit = memnew(VSplitContainer);
- ScriptEditor::get_singleton()->get_left_list_split()->call_deferred("add_child", left_vsplit); //add but wait until done settig up this
- left_vsplit->set_v_size_flags(SIZE_EXPAND_FILL);
- left_vsplit->set_stretch_ratio(2);
- left_vsplit->hide();
-
- VBoxContainer *left_vb = memnew(VBoxContainer);
- left_vsplit->add_child(left_vb);
- left_vb->set_v_size_flags(SIZE_EXPAND_FILL);
- //left_vb->set_custom_minimum_size(Size2(230, 1) * EDSCALE);
+ members_section = memnew(VBoxContainer);
+ // Add but wait until done setting up this.
+ ScriptEditor::get_singleton()->get_left_list_split()->call_deferred("add_child", members_section);
+ members_section->set_v_size_flags(SIZE_EXPAND_FILL);
CheckButton *tool_script_check = memnew(CheckButton);
tool_script_check->set_text(TTR("Make Tool:"));
- left_vb->add_child(tool_script_check);
+ members_section->add_child(tool_script_check);
tool_script_check->connect("pressed", this, "_toggle_tool_script");
/// Members ///
members = memnew(Tree);
- left_vb->add_margin_child(TTR("Members:"), members, true);
+ members_section->add_margin_child(TTR("Members:"), members, true);
+ members->set_custom_minimum_size(Size2(0, 50 * EDSCALE));
members->set_hide_root(true);
members->connect("button_pressed", this, "_member_button");
members->connect("item_edited", this, "_member_edited");
@@ -4734,10 +4729,6 @@ VisualScriptEditor::VisualScriptEditor() {
function_name_box->set_expand_to_text_length(true);
add_child(function_name_edit);
- VBoxContainer *left_vb2 = memnew(VBoxContainer);
- left_vsplit->add_child(left_vb2);
- left_vb2->set_v_size_flags(SIZE_EXPAND_FILL);
-
/// Actual Graph ///
graph = memnew(GraphEdit);
@@ -4754,7 +4745,7 @@ VisualScriptEditor::VisualScriptEditor() {
graph->hide();
graph->connect("scroll_offset_changed", this, "_graph_ofs_changed");
- /// Add Buttons to Top Bar / Zoom bar
+ /// Add Buttons to Top Bar/Zoom bar.
HBoxContainer *graph_hbc = graph->get_zoom_hbox();
Label *base_lbl = memnew(Label);
@@ -4775,7 +4766,7 @@ VisualScriptEditor::VisualScriptEditor() {
graph_hbc->add_child(fn_btn);
fn_btn->connect("pressed", this, "_create_function_dialog");
- // Add Function Dialog
+ // Add Function Dialog.
VBoxContainer *function_vb = memnew(VBoxContainer);
function_vb->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -4793,7 +4784,7 @@ VisualScriptEditor::VisualScriptEditor() {
func_name_box->connect("focus_entered", this, "_deselect_input_names");
func_name_hbox->add_child(func_name_box);
- // add minor setting for function if needed, here!
+ // Add minor setting for function if needed, here!
function_vb->add_child(memnew(HSeparator));
@@ -4837,7 +4828,7 @@ VisualScriptEditor::VisualScriptEditor() {
hint_text_timer->connect("timeout", this, "_hide_timer");
add_child(hint_text_timer);
- //allowed casts (connections)
+ // Allowed casts (connections).
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
graph->add_valid_connection_type(Variant::NIL, i);
graph->add_valid_connection_type(i, Variant::NIL);
@@ -4877,7 +4868,7 @@ VisualScriptEditor::VisualScriptEditor() {
edit_variable_edit->edit(variable_editor);
select_base_type = memnew(CreateDialog);
- select_base_type->set_base_type("Object"); //anything goes
+ select_base_type->set_base_type("Object"); // Anything goes.
select_base_type->connect("create", this, "_change_base_type_callback");
add_child(select_base_type);
@@ -4910,7 +4901,7 @@ VisualScriptEditor::VisualScriptEditor() {
VisualScriptEditor::~VisualScriptEditor() {
- undo_redo->clear_history(); //avoid crashes
+ undo_redo->clear_history(); // Avoid crashes.
memdelete(signal_editor);
memdelete(variable_editor);
}
@@ -4948,7 +4939,7 @@ static void register_editor_callback() {
void VisualScriptEditor::register_editor() {
- //too early to register stuff here, request a callback
+ // Too early to register stuff here, request a callback.
EditorNode::add_plugin_init_callback(register_editor_callback);
}
diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h
index fe27598d16..0e7783214b 100644
--- a/modules/visual_script/visual_script_editor.h
+++ b/modules/visual_script/visual_script_editor.h
@@ -81,7 +81,7 @@ class VisualScriptEditor : public ScriptEditorBase {
MEMBER_SIGNAL
};
- VSplitContainer *left_vsplit;
+ VBoxContainer *members_section;
MenuButton *edit_menu;
Ref<VisualScript> script;