diff options
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/gdnative_api.json | 16 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 18 |
2 files changed, 19 insertions, 15 deletions
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 8dcea26a7b..03258584ce 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -44,7 +44,7 @@ ["const godot_vector2 *", "p_to"], ["const godot_real", "p_delta"] ] - }, + }, { "name": "godot_string_count", "return_type": "godot_int", @@ -54,7 +54,7 @@ ["godot_int", "p_from"], ["godot_int", "p_to"] ] - }, + }, { "name": "godot_string_countn", "return_type": "godot_int", @@ -6548,24 +6548,24 @@ "name": "godot_net_bind_stream_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_stream_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_stream_peer *", "p_interface"] ] }, { "name": "godot_net_bind_packet_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_packet_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_packet_peer *", "p_interface"] ] }, { "name": "godot_net_bind_multiplayer_peer", "return_type": "void", "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_multiplayer_peer *", "p_interface"] + ["godot_object *", "p_obj"], + ["const godot_net_multiplayer_peer *", "p_interface"] ] } ] diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index e6660971a7..5d272a6cdc 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -67,12 +67,17 @@ void GDNativeLibraryEditor::_update_tree() { TreeItem *root = tree->create_item(); PopupMenu *filter_list = filter->get_popup(); + String text = ""; for (int i = 0; i < filter_list->get_item_count(); i++) { if (!filter_list->is_item_checked(i)) { continue; } Map<String, NativePlatformConfig>::Element *E = platforms.find(filter_list->get_item_metadata(i)); + if (!text.empty()) { + text += ", "; + } + text += E->get().name; TreeItem *platform = tree->create_item(root); platform->set_text(0, E->get().name); @@ -122,6 +127,7 @@ void GDNativeLibraryEditor::_update_tree() { platform->set_collapsed(collapsed_items.find(E->get().name) != NULL); } + filter->set_text(text); } void GDNativeLibraryEditor::_on_item_button(Object *item, int column, int id) { @@ -339,11 +345,11 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { label->set_text(TTR("Platform:")); hbox->add_child(label); filter = memnew(MenuButton); - filter->set_text(TTR("Choose platform")); + filter->set_h_size_flags(SIZE_EXPAND_FILL); + filter->set_text_align(filter->ALIGN_LEFT); hbox->add_child(filter); PopupMenu *filter_list = filter->get_popup(); filter_list->set_hide_on_checkable_item_selection(false); - filter_list->set_h_size_flags(SIZE_EXPAND_FILL); int idx = 0; for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { @@ -390,11 +396,9 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { void GDNativeLibraryEditorPlugin::edit(Object *p_node) { - if (Object::cast_to<GDNativeLibrary>(p_node)) { - library_editor->edit(Object::cast_to<GDNativeLibrary>(p_node)); - library_editor->show(); - } else - library_editor->hide(); + Ref<GDNativeLibrary> new_library = Object::cast_to<GDNativeLibrary>(p_node); + if (new_library.is_valid()) + library_editor->edit(new_library); } bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const { |