diff options
55 files changed, 312 insertions, 259 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index a5ec9c1afc..694e077f48 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1038,7 +1038,7 @@ void _OS::_bind_methods() { &_OS::get_unix_time_from_datetime); ClassDB::bind_method(D_METHOD("get_system_time_secs"), &_OS::get_system_time_secs); - ClassDB::bind_method(D_METHOD("set_icon", "icon"), &_OS::set_icon); + ClassDB::bind_method(D_METHOD("set_icon", "icon:Image"), &_OS::set_icon); ClassDB::bind_method(D_METHOD("get_exit_code"), &_OS::get_exit_code); ClassDB::bind_method(D_METHOD("set_exit_code", "code"), &_OS::set_exit_code); diff --git a/core/global_config.cpp b/core/global_config.cpp index 95f4ec5e22..76572df2a7 100644 --- a/core/global_config.cpp +++ b/core/global_config.cpp @@ -945,7 +945,7 @@ GlobalConfig::GlobalConfig() { GLOBAL_DEF("input/ui_page_down", va); input_presets.push_back("input/ui_page_down"); - //GLOBAL_DEF("display/handheld/orientation", "landscape"); + //GLOBAL_DEF("display/window/handheld/orientation", "landscape"); custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::STRING, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor"); custom_prop_info["rendering/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded"); diff --git a/core/image.cpp b/core/image.cpp index 6ab8bb6d46..50dc9c109d 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -2245,7 +2245,7 @@ void Image::_bind_methods() { ClassDB::bind_method(D_METHOD("detect_alpha"), &Image::detect_alpha); ClassDB::bind_method(D_METHOD("is_invisible"), &Image::is_invisible); - ClassDB::bind_method(D_METHOD("compress", "mode"), &Image::compress); + ClassDB::bind_method(D_METHOD("compress", "mode", "source", "lossy_quality"), &Image::compress); ClassDB::bind_method(D_METHOD("decompress"), &Image::decompress); ClassDB::bind_method(D_METHOD("is_compressed"), &Image::is_compressed); diff --git a/core/input_map.cpp b/core/input_map.cpp index 1307c467e6..422ebd2956 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -41,11 +41,11 @@ void InputMap::_bind_methods() { ClassDB::bind_method(D_METHOD("add_action", "action"), &InputMap::add_action); ClassDB::bind_method(D_METHOD("erase_action", "action"), &InputMap::erase_action); - ClassDB::bind_method(D_METHOD("action_add_event", "action", "event"), &InputMap::action_add_event); - ClassDB::bind_method(D_METHOD("action_has_event", "action", "event"), &InputMap::action_has_event); - ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event"), &InputMap::action_erase_event); + ClassDB::bind_method(D_METHOD("action_add_event", "action", "event:InputEvent"), &InputMap::action_add_event); + ClassDB::bind_method(D_METHOD("action_has_event", "action", "event:InputEvent"), &InputMap::action_has_event); + ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event:InputEvent"), &InputMap::action_erase_event); ClassDB::bind_method(D_METHOD("get_action_list", "action"), &InputMap::_get_action_list); - ClassDB::bind_method(D_METHOD("event_is_action", "event", "action"), &InputMap::event_is_action); + ClassDB::bind_method(D_METHOD("event_is_action", "event:InputEvent", "action"), &InputMap::event_is_action); ClassDB::bind_method(D_METHOD("load_from_globals"), &InputMap::load_from_globals); } @@ -281,7 +281,7 @@ void InputMap::load_default() { key->set_scancode(KEY_PAGEDOWN); action_add_event("ui_page_down", key); - //set("display/handheld/orientation", "landscape"); + //set("display/window/handheld/orientation", "landscape"); } InputMap::InputMap() { diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 6c463b983c..c869bdad9b 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -240,7 +240,7 @@ void IP::_bind_methods() { ClassDB::bind_method(D_METHOD("get_resolve_item_address", "id"), &IP::get_resolve_item_address); ClassDB::bind_method(D_METHOD("erase_resolve_item", "id"), &IP::erase_resolve_item); ClassDB::bind_method(D_METHOD("get_local_addresses"), &IP::_get_local_addresses); - ClassDB::bind_method(D_METHOD("clear_cache"), &IP::clear_cache, DEFVAL("")); + ClassDB::bind_method(D_METHOD("clear_cache", "hostname"), &IP::clear_cache, DEFVAL("")); BIND_CONSTANT(RESOLVER_STATUS_NONE); BIND_CONSTANT(RESOLVER_STATUS_WAITING); diff --git a/core/os/input.cpp b/core/os/input.cpp index bc388d0bca..587340fe91 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -84,7 +84,7 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("action_press", "action"), &Input::action_press); ClassDB::bind_method(D_METHOD("action_release", "action"), &Input::action_release); ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image:Texture", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(Vector2())); - ClassDB::bind_method(D_METHOD("parse_input_event", "event"), &Input::parse_input_event); + ClassDB::bind_method(D_METHOD("parse_input_event", "event:InputEvent"), &Input::parse_input_event); BIND_CONSTANT(MOUSE_MODE_VISIBLE); BIND_CONSTANT(MOUSE_MODE_HIDDEN); diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 248f5537c6..93658c07c2 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -32,7 +32,7 @@ void MainLoop::_bind_methods() { - ClassDB::bind_method(D_METHOD("input_event", "ev"), &MainLoop::input_event); + ClassDB::bind_method(D_METHOD("input_event", "ev:InputEvent"), &MainLoop::input_event); ClassDB::bind_method(D_METHOD("input_text", "text"), &MainLoop::input_text); ClassDB::bind_method(D_METHOD("init"), &MainLoop::init); ClassDB::bind_method(D_METHOD("iteration", "delta"), &MainLoop::iteration); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index e0255c279e..a137f9be7d 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -44923,6 +44923,15 @@ <description> </description> </method> + <method name="get_tab_rect"> + <return type="Rect2"> + </return> + <argument index="0" name="tab_idx" type="int"> + </argument> + <description> + Returns tab [Rect2] with local position and size. + </description> + </method> <method name="get_tab_title" qualifiers="const"> <return type="String"> </return> @@ -44931,6 +44940,15 @@ <description> </description> </method> + <method name="move_tab"> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + Rearrange tab. + </description> + </method> <method name="remove_tab"> <argument index="0" name="tab_idx" type="int"> </argument> diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 58ffa223fb..11b900f45c 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -353,6 +353,7 @@ void EditorData::notify_edited_scene_changed() { for (int i = 0; i < editor_plugins.size(); i++) { editor_plugins[i]->edited_scene_changed(); + editor_plugins[i]->notify_scene_changed(get_edited_scene_root()); } } @@ -488,8 +489,14 @@ void EditorData::move_edited_scene_index(int p_idx, int p_to_idx) { } void EditorData::remove_scene(int p_idx) { ERR_FAIL_INDEX(p_idx, edited_scene.size()); - if (edited_scene[p_idx].root) + if (edited_scene[p_idx].root) { + + for (int i = 0; i < editor_plugins.size(); i++) { + editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_filename()); + } + memdelete(edited_scene[p_idx].root); + } if (current_edited_scene > p_idx) current_edited_scene--; @@ -615,6 +622,17 @@ int EditorData::get_edited_scene_count() const { return edited_scene.size(); } +Vector<EditorData::EditedScene> EditorData::get_edited_scenes() const { + + Vector<EditedScene> out_edited_scenes_list = Vector<EditedScene>(); + + for (int i = 0; i < edited_scene.size(); i++) { + out_edited_scenes_list.push_back(edited_scene[i]); + } + + return out_edited_scenes_list; +} + void EditorData::set_edited_scene_version(uint64_t version, int scene_idx) { ERR_FAIL_INDEX(current_edited_scene, edited_scene.size()); if (scene_idx < 0) { diff --git a/editor/editor_data.h b/editor/editor_data.h index 50f0d5fd41..a601b5019d 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -31,6 +31,7 @@ #define EDITOR_DATA_H #include "editor/editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" #include "list.h" #include "pair.h" #include "scene/resources/texture.h" @@ -109,6 +110,17 @@ public: Ref<Texture> icon; }; + struct EditedScene { + Node *root; + Dictionary editor_states; + List<Node *> selection; + Vector<EditorHistory::History> history_stored; + int history_current; + Dictionary custom_state; + uint64_t version; + NodePath live_edit_root; + }; + private: Vector<EditorPlugin *> editor_plugins; @@ -124,17 +136,6 @@ private: void _cleanup_history(); - struct EditedScene { - Node *root; - Dictionary editor_states; - List<Node *> selection; - Vector<EditorHistory::History> history_stored; - int history_current; - Dictionary custom_state; - uint64_t version; - NodePath live_edit_root; - }; - Vector<EditedScene> edited_scene; int current_edited_scene; @@ -180,6 +181,7 @@ public: int get_edited_scene() const; Node *get_edited_scene_root(int p_idx = -1); int get_edited_scene_count() const; + Vector<EditedScene> get_edited_scenes() const; String get_scene_title(int p_idx) const; String get_scene_path(int p_idx) const; String get_scene_type(int p_idx) const; diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index f314f772d1..c8fa86ed73 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -137,7 +137,7 @@ EditorFileSystemDirectory *EditorFileSystemDirectory::get_parent() { void EditorFileSystemDirectory::_bind_methods() { ClassDB::bind_method(D_METHOD("get_subdir_count"), &EditorFileSystemDirectory::get_subdir_count); - ClassDB::bind_method(D_METHOD("get_subdir", "idx"), &EditorFileSystemDirectory::get_subdir); + ClassDB::bind_method(D_METHOD("get_subdir:EditorFileSystemDirectory", "idx"), &EditorFileSystemDirectory::get_subdir); ClassDB::bind_method(D_METHOD("get_file_count"), &EditorFileSystemDirectory::get_file_count); ClassDB::bind_method(D_METHOD("get_file", "idx"), &EditorFileSystemDirectory::get_file); ClassDB::bind_method(D_METHOD("get_file_path", "idx"), &EditorFileSystemDirectory::get_file_path); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8912467b72..79c7aa044c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1575,6 +1575,11 @@ void EditorNode::_edit_current() { editor_plugin_screen->make_visible(true); + int plugin_count = editor_data.get_editor_plugin_count(); + for (int i = 0; i < plugin_count; i++) { + editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name()); + } + for (int i = 0; i < editor_table.size(); i++) { main_editor_buttons[i]->set_pressed(editor_table[i] == main_plugin); @@ -2865,6 +2870,11 @@ void EditorNode::_editor_select(int p_which) { editor_plugin_screen->make_visible(true); editor_plugin_screen->selected_notify(); + int plugin_count = editor_data.get_editor_plugin_count(); + for (int i = 0; i < plugin_count; i++) { + editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name()); + } + if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) { if (p_which == EDITOR_SCRIPT) { set_distraction_free_mode(script_distraction); @@ -2913,7 +2923,6 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) { } } - //singleton->main_editor_tabs->add_tab(p_editor->get_name()); singleton->editor_table.erase(p_editor); } p_editor->make_visible(false); @@ -3589,15 +3598,6 @@ void EditorNode::_open_recent_scene(int p_idx) { ERR_FAIL_INDEX(p_idx, rc.size()); String path = "res://" + rc[p_idx]; - - /*if (unsaved_cache) { - _recent_scene=rc[p_idx]; - open_recent_confirmation->set_text("Discard current scene and open:\n'"+rc[p_idx]+"'"); - open_recent_confirmation->get_label()->set_align(Label::ALIGN_CENTER); - open_recent_confirmation->popup_centered(Size2(400,100)); - return; - }*/ - load_scene(path); } @@ -3756,6 +3756,7 @@ void EditorNode::register_editor_types() { ClassDB::register_class<EditorResourcePreviewGenerator>(); ClassDB::register_class<EditorFileSystem>(); ClassDB::register_class<EditorFileSystemDirectory>(); + ClassDB::register_virtual_class<ScriptEditor>(); //ClassDB::register_type<EditorImporter>(); //ClassDB::register_type<EditorPostImport>(); @@ -5222,28 +5223,9 @@ EditorNode::EditorNode() { main_vbox->set_area_as_parent_rect(8); main_vbox->set_margin(MARGIN_TOP, 5); -#if 0 - PanelContainer *top_dark_panel = memnew( PanelContainer ); - Ref<StyleBoxTexture> top_dark_sb; - top_dark_sb.instance(); - top_dark_sb->set_texture(theme->get_icon("PanelTop","EditorIcons")); - for(int i=0;i<4;i++) { - top_dark_sb->set_margin_size(Margin(i),3); - top_dark_sb->set_default_margin(Margin(i),0); - } - top_dark_sb->set_expand_margin_size(MARGIN_LEFT,20); - top_dark_sb->set_expand_margin_size(MARGIN_RIGHT,20); - - top_dark_panel->add_style_override("panel",top_dark_sb); - VBoxContainer *top_dark_vb = memnew( VBoxContainer ); - main_vbox->add_child(top_dark_panel); - top_dark_panel->add_child(top_dark_vb); -#endif - menu_hb = memnew(HBoxContainer); main_vbox->add_child(menu_hb); - //top_dark_vb->add_child(scene_tabs); //left left_l_hsplit = memnew(HSplitContainer); main_vbox->add_child(left_l_hsplit); @@ -5318,10 +5300,10 @@ EditorNode::EditorNode() { main_hsplit->connect("dragged", this, "_dock_split_dragged"); right_hsplit->connect("dragged", this, "_dock_split_dragged"); - dock_select_popoup = memnew(PopupPanel); - gui_base->add_child(dock_select_popoup); + dock_select_popup = memnew(PopupPanel); + gui_base->add_child(dock_select_popup); VBoxContainer *dock_vb = memnew(VBoxContainer); - dock_select_popoup->add_child(dock_vb); + dock_select_popup->add_child(dock_vb); HBoxContainer *dock_hb = memnew(HBoxContainer); dock_tab_move_left = memnew(ToolButton); @@ -5348,14 +5330,13 @@ EditorNode::EditorNode() { dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_vb->add_child(dock_select); - dock_select_popoup->set_as_minsize(); + dock_select_popup->set_as_minsize(); dock_select_rect_over = -1; dock_popup_selected = -1; - //dock_select_popoup->set_(Size2(20,20)); for (int i = 0; i < DOCK_SLOT_MAX; i++) { dock_slot[i]->set_custom_minimum_size(Size2(230, 220) * EDSCALE); dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL); - dock_slot[i]->set_popup(dock_select_popoup); + dock_slot[i]->set_popup(dock_select_popup); dock_slot[i]->connect("pre_popup_pressed", this, "_dock_pre_popup", varray(i)); dock_slot[i]->set_tab_align(TabContainer::ALIGN_LEFT); } @@ -5376,10 +5357,6 @@ EditorNode::EditorNode() { top_split->add_child(srt); srt->add_constant_override("separation", 0); - /* main_editor_tabs = memnew( Tabs ); - main_editor_tabs->connect("tab_changed",this,"_editor_select"); - main_editor_tabs->set_tab_close_display_policy(Tabs::SHOW_NEVER); -*/ tab_preview_panel = memnew(Panel); tab_preview_panel->set_size(Size2(100, 100) * EDSCALE); tab_preview_panel->hide(); @@ -5493,7 +5470,6 @@ EditorNode::EditorNode() { p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/close_scene", TTR("Close Scene"), KEY_MASK_SHIFT + KEY_MASK_CTRL + KEY_W), FILE_CLOSE); p->add_separator(); - //p->add_shortcut(ED_SHORTCUT("editor/save_scene",TTR("Close Goto Prev. Scene")),FILE_OPEN_PREV,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_P); p->add_submenu_item(TTR("Open Recent"), "RecentScenes", FILE_OPEN_RECENT); p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/quick_open_scene", TTR("Quick Open Scene.."), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_O), FILE_QUICK_OPEN_SCENE); @@ -5561,35 +5537,6 @@ EditorNode::EditorNode() { menu_hb->add_spacer(); menu_hb->add_child(editor_region); -//menu_hb->add_spacer(); -#if 0 - node_menu = memnew( MenuButton ); - node_menu->set_text("Node"); - node_menu->set_position( Point2( 50,0) ); - menu_panel->add_child( node_menu ); - - p=node_menu->get_popup(); - p->add_item("Create",NODE_CREATE); - p->add_item("Instance",NODE_INSTANCE); - p->add_separator(); - p->add_item("Reparent",NODE_REPARENT); - p->add_item("Move Up",NODE_MOVE_UP); - p->add_item("Move Down",NODE_MOVE_DOWN); - p->add_separator(); - p->add_item("Duplicate",NODE_DUPLICATE); - p->add_separator(); - p->add_item("Remove (Branch)",NODE_REMOVE_BRANCH); - p->add_item("Remove (Element)",NODE_REMOVE_ELEMENT); - p->add_separator(); - p->add_item("Edit Subscriptions..",NODE_CONNECTIONS); - p->add_item("Edit Groups..",NODE_GROUPS); - - resource_menu = memnew( MenuButton ); - resource_menu->set_text("Resource"); - resource_menu->set_position( Point2( 90,0) ); - menu_panel->add_child( resource_menu ); -#endif - debug_menu = memnew(MenuButton); debug_menu->set_text(TTR("Debug")); debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); @@ -5651,11 +5598,6 @@ EditorNode::EditorNode() { p->add_separator(); p->add_icon_item(gui_base->get_icon("GodotDocs", "EditorIcons"), TTR("About"), HELP_ABOUT); - //Separator *s1 = memnew( VSeparator ); - //menu_panel->add_child(s1); - //s1->set_position(Point2(210,4)); - //s1->set_size(Point2(10,15)); - play_cc = memnew(CenterContainer); play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); menu_hb->add_child(play_cc); @@ -5680,7 +5622,6 @@ EditorNode::EditorNode() { play_button->set_shortcut(ED_SHORTCUT("editor/play", TTR("Play"), KEY_F5)); pause_button = memnew(ToolButton); - //menu_panel->add_child(pause_button); - not needed for now? pause_button->set_toggle_mode(true); pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); pause_button->set_focus_mode(Control::FOCUS_NONE); @@ -5708,9 +5649,6 @@ EditorNode::EditorNode() { native_play_button->get_popup()->connect("id_pressed", this, "_run_in_device"); run_native->connect("native_run", this, "_menu_option", varray(RUN_PLAY_NATIVE)); - //VSeparator *s1 = memnew( VSeparator ); - //play_hb->add_child(s1); - play_scene_button = memnew(ToolButton); play_hb->add_child(play_scene_button); play_scene_button->set_toggle_mode(true); @@ -5729,24 +5667,6 @@ EditorNode::EditorNode() { play_custom_scene_button->set_tooltip(TTR("Play custom scene")); play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5)); - /* - run_settings_button = memnew( ToolButton ); - //menu_hb->add_child(run_settings_button); - //run_settings_button->set_toggle_mode(true); - run_settings_button->set_focus_mode(Control::FOCUS_NONE); - run_settings_button->set_icon(gui_base->get_icon("Run","EditorIcons")); - run_settings_button->connect("pressed", this,"_menu_option",make_binds(RUN_SCENE_SETTINGS)); -*/ - - /* - run_settings_button = memnew( ToolButton ); - menu_panel->add_child(run_settings_button); - run_settings_button->set_position(Point2(305,0)); - run_settings_button->set_focus_mode(Control::FOCUS_NONE); - run_settings_button->set_icon(gui_base->get_icon("Run","EditorIcons")); - run_settings_button->connect("pressed", this,"_menu_option",make_binds(RUN_SETTINGS)); -*/ - progress_hb = memnew(BackgroundProgress); //menu_hb->add_child(progress_hb); @@ -5785,52 +5705,15 @@ EditorNode::EditorNode() { p->add_check_item(TTR("Disable Update Spinner"), SETTINGS_UPDATE_SPINNER_HIDE); p->set_item_checked(1, true); - //sources_button->connect(); - - /* - Separator *s2 = memnew( VSeparator ); - menu_panel->add_child(s2); - s2->set_position(Point2(338,4)); - s2->set_size(Point2(10,15)); -*/ - - //editor_hsplit = memnew( HSplitContainer ); - //main_split->add_child(editor_hsplit); - //editor_hsplit->set_v_size_flags(Control::SIZE_EXPAND_FILL); - - //editor_vsplit = memnew( VSplitContainer ); - //editor_hsplit->add_child(editor_vsplit); - - //top_pallete = memnew( TabContainer ); scene_tree_dock = memnew(SceneTreeDock(this, scene_root, editor_selection, editor_data)); scene_tree_dock->set_name(TTR("Scene")); - //top_pallete->add_child(scene_tree_dock); dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(scene_tree_dock); #if 0 resources_dock = memnew( ResourcesDock(this) ); resources_dock->set_name("Resources"); - //top_pallete->add_child(resources_dock); dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(resources_dock); - //top_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL); #endif dock_slot[DOCK_SLOT_LEFT_BR]->hide(); - /*Control *editor_spacer = memnew( Control ); - editor_spacer->set_custom_minimum_size(Size2(260,200)); - editor_spacer->set_v_size_flags(Control::SIZE_EXPAND_FILL); - editor_vsplit->add_child( editor_spacer ); - editor_spacer->add_child( top_pallete ); - top_pallete->set_area_as_parent_rect();*/ - - //prop_pallete = memnew( TabContainer ); - - //prop_pallete->set_v_size_flags(Control::SIZE_EXPAND_FILL); - - /*editor_spacer = memnew( Control ); - editor_spacer->set_custom_minimum_size(Size2(260,200)); - editor_spacer->set_v_size_flags(Control::SIZE_EXPAND_FILL); - editor_vsplit->add_child( editor_spacer ); - editor_spacer->add_child( prop_pallete ); - prop_pallete->set_area_as_parent_rect();*/ VBoxContainer *prop_editor_base = memnew(VBoxContainer); prop_editor_base->set_name(TTR("Inspector")); // Properties? @@ -5972,7 +5855,6 @@ EditorNode::EditorNode() { } else { dock_slot[DOCK_SLOT_LEFT_UR]->add_child(filesystem_dock); } - //prop_pallete->add_child(filesystem_dock); filesystem_dock->connect("open", this, "open_request"); filesystem_dock->connect("instance", this, "_instance_request"); @@ -6023,17 +5905,6 @@ EditorNode::EditorNode() { //progress_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); - /* - animation_menu = memnew( ToolButton ); - animation_menu->set_position(Point2(500,0)); - animation_menu->set_size(Size2(20,20)); - animation_menu->set_toggle_mode(true); - animation_menu->set_focus_mode(Control::FOCUS_NONE); - menu_panel->add_child(animation_menu); - animation_menu->set_icon(gui_base->get_icon("Animation","EditorIcons")); - animation_menu->connect("pressed",this,"_animation_visibility_toggle"); -*/ - orphan_resources = memnew(OrphanResourcesDialog); gui_base->add_child(orphan_resources); @@ -6088,10 +5959,6 @@ EditorNode::EditorNode() { import_confirmation->connect("custom_action", this, "_import_action"); gui_base->add_child(import_confirmation); - open_recent_confirmation = memnew(ConfirmationDialog); - add_child(open_recent_confirmation); - open_recent_confirmation->connect("confirmed", this, "_open_recent_scene_confirm"); - run_settings_dialog = memnew(RunSettingsDialog); gui_base->add_child(run_settings_dialog); diff --git a/editor/editor_node.h b/editor/editor_node.h index 991cf1df71..228fbe7196 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -247,10 +247,7 @@ private: Control *vp_base; PaneDrag *pd; //PaneDrag *pd_anim; - Panel *menu_panel; - //HSplitContainer *editor_hsplit; - //VSplitContainer *editor_vsplit; CenterContainer *play_cc; HBoxContainer *menu_hb; Control *viewport; @@ -300,7 +297,6 @@ private: ConfirmationDialog *confirmation; ConfirmationDialog *save_confirmation; ConfirmationDialog *import_confirmation; - ConfirmationDialog *open_recent_confirmation; ConfirmationDialog *pick_main_scene; AcceptDialog *accept; AcceptDialog *about; @@ -326,8 +322,6 @@ private: String current_path; MenuButton *update_menu; - //TabContainer *prop_pallete; - //TabContainer *top_pallete; String defer_load_scene; String defer_export; String defer_export_platform; @@ -363,7 +357,7 @@ private: TabContainer *dock_slot[DOCK_SLOT_MAX]; Rect2 dock_select_rect[DOCK_SLOT_MAX]; int dock_select_rect_over; - PopupPanel *dock_select_popoup; + PopupPanel *dock_select_popup; Control *dock_select; ToolButton *dock_tab_move_left; ToolButton *dock_tab_move_right; diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 606fd8ee5e..968be43946 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -171,6 +171,46 @@ void EditorPlugin::set_input_event_forwarding_always_enabled() { always_input_forwarding_list->add_plugin(this); } +Node *EditorPlugin::get_edited_scene_root() { + return EditorNode::get_singleton()->get_edited_scene(); +} + +Array EditorPlugin::get_opened_scenes_list() const { + + Array ret; + Vector<EditorData::EditedScene> scenes = EditorNode::get_singleton()->get_editor_data().get_edited_scenes(); + + int scns_amount = scenes.size(); + for (int idx_scn = 0; idx_scn < scns_amount; idx_scn++) { + if (scenes[idx_scn].root == NULL) + continue; + ret.push_back(scenes[idx_scn].root->get_filename()); + } + return ret; +} + +ScriptEditor *EditorPlugin::get_script_editor() { + return ScriptEditor::get_singleton(); +} + +void EditorPlugin::notify_scene_changed(const Node *scn_root) { + if (scn_root == NULL) return; + emit_signal("scene_changed", scn_root); +} + +void EditorPlugin::notify_main_screen_changed(const String &screen_name) { + + if (screen_name == last_main_screen_name) + return; + + emit_signal("main_screen_changed", screen_name); + last_main_screen_name = screen_name; +} + +void EditorPlugin::notify_scene_closed(const String &scene_filepath) { + emit_signal("scene_closed", scene_filepath); +} + Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) { //?? if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) { @@ -392,13 +432,17 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("get_undo_redo:UndoRedo"), &EditorPlugin::_get_undo_redo); ClassDB::bind_method(D_METHOD("get_selection:EditorSelection"), &EditorPlugin::get_selection); ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"), &EditorPlugin::get_editor_settings); + ClassDB::bind_method(D_METHOD("get_script_editor:ScriptEditor"), &EditorPlugin::get_script_editor); ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout); - ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource); + ClassDB::bind_method(D_METHOD("edit_resource", "resource:Resource"), &EditorPlugin::edit_resource); ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorPlugin::open_scene_from_path); ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorPlugin::reload_scene_from_path); - ClassDB::bind_method(D_METHOD("add_import_plugin"), &EditorPlugin::add_import_plugin); - ClassDB::bind_method(D_METHOD("remove_import_plugin"), &EditorPlugin::remove_import_plugin); + ClassDB::bind_method(D_METHOD("add_import_plugin", "importer:EditorImportPlugin"), &EditorPlugin::add_import_plugin); + ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer:EditorImportPlugin"), &EditorPlugin::remove_import_plugin); ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled); + ClassDB::bind_method(D_METHOD("get_opened_scenes_list"), &EditorPlugin::get_opened_scenes_list); + ClassDB::bind_method(D_METHOD("get_edited_scene_root:Node"), &EditorPlugin::get_edited_scene_root); + ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); @@ -420,6 +464,10 @@ void EditorPlugin::_bind_methods() { ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_window_layout", PropertyInfo(Variant::OBJECT, "layout", PROPERTY_HINT_RESOURCE_TYPE, "ConfigFile"))); + ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root:Node"))); + ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath:String"))); + ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name:String"))); + BIND_CONSTANT(CONTAINER_TOOLBAR); BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU); BIND_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE); @@ -442,6 +490,7 @@ void EditorPlugin::_bind_methods() { EditorPlugin::EditorPlugin() { undo_redo = NULL; input_event_forwarding_always_enabled = false; + last_main_screen_name = ""; } EditorPlugin::~EditorPlugin() { diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 3653851d5a..2c920323a1 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -52,6 +52,8 @@ class EditorImportPlugin; class EditorExportPlugin; class EditorResourcePreview; class EditorFileSystem; +class EditorToolAddons; +class ScriptEditor; class EditorPlugin : public Node { @@ -63,6 +65,8 @@ class EditorPlugin : public Node { bool input_event_forwarding_always_enabled; + String last_main_screen_name; + protected: static void _bind_methods(); UndoRedo &get_undo_redo() { return *undo_redo; } @@ -113,6 +117,14 @@ public: void set_input_event_forwarding_always_enabled(); bool is_input_event_forwarding_always_enabled() { return input_event_forwarding_always_enabled; } + Node *get_edited_scene_root(); + Array get_opened_scenes_list() const; + ScriptEditor *get_script_editor(); + + void notify_main_screen_changed(const String &screen_name); + void notify_scene_changed(const Node *scn_root); + void notify_scene_closed(const String &scene_filepath); + virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial); virtual bool forward_canvas_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event); virtual void forward_draw_over_canvas(const Transform2D &p_canvas_xform, Control *p_canvas); diff --git a/editor/editor_run_script.cpp b/editor/editor_run_script.cpp index 8bd1b8f4fd..0e980b040e 100644 --- a/editor/editor_run_script.cpp +++ b/editor/editor_run_script.cpp @@ -81,8 +81,8 @@ void EditorScript::set_editor(EditorNode *p_editor) { void EditorScript::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_root_node", "node"), &EditorScript::add_root_node); - ClassDB::bind_method(D_METHOD("get_scene"), &EditorScript::get_scene); + ClassDB::bind_method(D_METHOD("add_root_node", "node:Node"), &EditorScript::add_root_node); + ClassDB::bind_method(D_METHOD("get_scene:Node"), &EditorScript::get_scene); BIND_VMETHOD(MethodInfo("_run")); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index b059e63467..c8936c8c35 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3386,6 +3386,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_loc_button = memnew(Button("loc")); key_loc_button->set_toggle_mode(true); + key_loc_button->set_flat(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); key_loc_button->add_color_override("font_color", Color(1, 0.6, 0.6)); @@ -3394,6 +3395,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_hb->add_child(key_loc_button); key_rot_button = memnew(Button("rot")); key_rot_button->set_toggle_mode(true); + key_rot_button->set_flat(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); key_rot_button->add_color_override("font_color", Color(1, 0.6, 0.6)); @@ -3402,12 +3404,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_hb->add_child(key_rot_button); key_scale_button = memnew(Button("scl")); key_scale_button->set_toggle_mode(true); + key_scale_button->set_flat(true); key_scale_button->set_focus_mode(FOCUS_NONE); key_scale_button->add_color_override("font_color", Color(1, 0.6, 0.6)); key_scale_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6)); key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); animation_hb->add_child(key_scale_button); key_insert_button = memnew(Button); + key_insert_button->set_flat(true); key_insert_button->set_focus_mode(FOCUS_NONE); key_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); key_insert_button->set_tooltip(TTR("Insert Keys")); diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 3524c34d62..c32ed1064f 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -204,7 +204,7 @@ void PathSpatialGizmo::redraw() { if (c.is_null()) return; - PoolVector<Vector3> v3a = c->tesselate(); + PoolVector<Vector3> v3a = c->tessellate(); //PoolVector<Vector3> v3a=c->get_baked_points(); int v3s = v3a.size(); @@ -289,7 +289,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && (curve_create->is_pressed() || (curve_edit->is_pressed() && mb->get_control()))) { //click into curve, break it down - PoolVector<Vector3> v3a = c->tesselate(); + PoolVector<Vector3> v3a = c->tessellate(); int idx = 0; int rc = v3a.size(); int closest_seg = -1; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index d10831eea1..f7952e77f2 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -405,6 +405,8 @@ void ScriptEditor::_go_to_tab(int p_idx) { script_icon->set_texture(c->cast_to<ScriptEditorBase>()->get_icon()); if (is_visible_in_tree()) c->cast_to<ScriptEditorBase>()->ensure_focus(); + + notify_script_changed(c->cast_to<ScriptEditorBase>()->get_edited_script()); } if (c->cast_to<EditorHelp>()) { @@ -510,7 +512,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { apply_scripts(); } current->clear_edit_menu(); - + notify_script_close(current->get_edited_script()); } else { EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>(); _add_recent_script(help->get_class()); @@ -777,6 +779,31 @@ void ScriptEditor::_file_dialog_action(String p_file) { file_dialog_option = -1; } +Ref<Script> ScriptEditor::_get_current_script() { + + int selected = tab_container->get_current_tab(); + if (selected < 0 || selected >= tab_container->get_child_count()) + return NULL; + + ScriptEditorBase *current = tab_container->get_child(selected)->cast_to<ScriptEditorBase>(); + if (current) { + return current->get_edited_script(); + } else { + return NULL; + } +} + +Array ScriptEditor::_get_opened_script_list() const { + + Array ret; + Vector<Ref<Script> > scripts = get_opened_scripts(); + int scrits_amount = scripts.size(); + for (int idx_script = 0; idx_script < scrits_amount; idx_script++) { + ret.push_back(scripts[idx_script]); + } + return ret; +} + void ScriptEditor::_menu_option(int p_option) { switch (p_option) { @@ -1127,6 +1154,14 @@ void ScriptEditor::edited_scene_changed() { _update_modified_scripts_for_external_editor(); } +void ScriptEditor::notify_script_close(const Ref<Script> &p_script) { + emit_signal("script_close", p_script); +} + +void ScriptEditor::notify_script_changed(const Ref<Script> &p_script) { + emit_signal("script_changed", p_script); +} + static const Node *_find_node_with_script(const Node *p_node, const RefPtr &p_script) { if (p_node->get_script() == p_script) @@ -1662,6 +1697,7 @@ bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool if (p_line >= 0) se->goto_line(p_line - 1); + notify_script_changed(p_script); return true; } @@ -2038,6 +2074,8 @@ void ScriptEditor::_update_history_pos(int p_new_pos) { n->cast_to<ScriptEditorBase>()->set_edit_state(history[history_pos].state); n->cast_to<ScriptEditorBase>()->ensure_focus(); + + notify_script_changed(n->cast_to<ScriptEditorBase>()->get_edited_script()); } if (n->cast_to<EditorHelp>()) { @@ -2065,6 +2103,21 @@ void ScriptEditor::_history_back() { _update_history_pos(history_pos - 1); } } + +Vector<Ref<Script> > ScriptEditor::get_opened_scripts() const { + + Vector<Ref<Script> > out_scripts = Vector<Ref<Script> >(); + + for (int i = 0; i < tab_container->get_child_count(); i++) { + ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>(); + if (!se) + continue; + out_scripts.push_back(se->get_edited_script()); + } + + return out_scripts; +} + void ScriptEditor::set_scene_root_script(Ref<Script> p_script) { bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change"); @@ -2158,6 +2211,12 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_history_back", &ScriptEditor::_history_back); ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts); ClassDB::bind_method("_unhandled_input", &ScriptEditor::_unhandled_input); + + ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script); + ClassDB::bind_method(D_METHOD("get_opened_scripts_list"), &ScriptEditor::_get_opened_script_list); + + ADD_SIGNAL(MethodInfo("script_changed", PropertyInfo(Variant::OBJECT, "script:Script"))); + ADD_SIGNAL(MethodInfo("script_close", PropertyInfo(Variant::STRING, "script:String"))); } ScriptEditor::ScriptEditor(EditorNode *p_editor) { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 010a5604ec..3d03eb0f49 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -321,6 +321,9 @@ class ScriptEditor : public PanelContainer { int file_dialog_option; void _file_dialog_action(String p_file); + Ref<Script> _get_current_script(); + Array _get_opened_script_list() const; + static void _open_script_request(const String &p_path); static ScriptEditor *script_editor; @@ -354,11 +357,15 @@ public: void get_window_layout(Ref<ConfigFile> p_layout); void set_scene_root_script(Ref<Script> p_script); + Vector<Ref<Script> > get_opened_scripts() const; bool script_goto_method(Ref<Script> p_script, const String &p_method); virtual void edited_scene_changed(); + void notify_script_close(const Ref<Script> &p_script); + void notify_script_changed(const Ref<Script> &p_script); + void close_builtin_scripts_from_scene(const String &p_scene); void goto_help(const String &p_desc) { _help_class_goto(p_desc); } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 4b3ebf5643..c2e54ebd69 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1625,24 +1625,24 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { hbc->add_child(memnew(VSeparator)); - step = memnew(Button); + step = memnew(ToolButton); hbc->add_child(step); step->set_tooltip(TTR("Step Into")); step->connect("pressed", this, "debug_step"); - next = memnew(Button); + next = memnew(ToolButton); hbc->add_child(next); next->set_tooltip(TTR("Step Over")); next->connect("pressed", this, "debug_next"); hbc->add_child(memnew(VSeparator)); - dobreak = memnew(Button); + dobreak = memnew(ToolButton); hbc->add_child(dobreak); dobreak->set_tooltip(TTR("Break")); dobreak->connect("pressed", this, "debug_break"); - docontinue = memnew(Button); + docontinue = memnew(ToolButton); hbc->add_child(docontinue); docontinue->set_tooltip(TTR("Continue")); docontinue->connect("pressed", this, "debug_continue"); @@ -1816,7 +1816,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { vmem_total->set_editable(false); vmem_total->set_custom_minimum_size(Size2(100, 1) * EDSCALE); vmem_hb->add_child(vmem_total); - vmem_refresh = memnew(Button); + vmem_refresh = memnew(ToolButton); vmem_hb->add_child(vmem_refresh); vmem_vb->add_child(vmem_hb); vmem_refresh->connect("pressed", this, "_video_mem_request"); diff --git a/main/main.cpp b/main/main.cpp index ece54e7427..94544a0cde 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -679,7 +679,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #ifdef TOOLS_ENABLED - if (main_args.size() == 0 && (!GlobalConfig::get_singleton()->has("application/run/main_loop_type")) && (!GlobalConfig::get_singleton()->has("application/main_scene") || String(GlobalConfig::get_singleton()->get("application/main_scene")) == "")) + if (main_args.size() == 0 && (!GlobalConfig::get_singleton()->has("application/run/main_loop_type")) && (!GlobalConfig::get_singleton()->has("application/run/main_scene") || String(GlobalConfig::get_singleton()->get("application/run/main_scene")) == "")) use_custom_res = false; //project manager (run without arguments) #endif diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 0558bb5113..348d8533ad 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -481,8 +481,8 @@ void GDNativeScript::set_script_name(StringName p_script_name) { } void GDNativeScript::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_library"), &GDNativeScript::get_library); - ClassDB::bind_method(D_METHOD("set_library", "library"), &GDNativeScript::set_library); + ClassDB::bind_method(D_METHOD("get_library:GDNativeLibrary"), &GDNativeScript::get_library); + ClassDB::bind_method(D_METHOD("set_library", "library:GDNativeLibrary"), &GDNativeScript::set_library); ClassDB::bind_method(D_METHOD("get_script_name"), &GDNativeScript::get_script_name); ClassDB::bind_method(D_METHOD("set_script_name", "script_name"), &GDNativeScript::set_script_name); diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index a361971ef4..8bc3b24a5e 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -1587,13 +1587,13 @@ MethodInfo GDFunctions::get_info(Function p_func) { } break; case TO_JSON: { - MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var:Variant")); + MethodInfo mi("to_json", PropertyInfo(Variant::NIL, "var")); mi.return_val.type = Variant::STRING; return mi; } break; case HASH: { - MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var:Variant")); + MethodInfo mi("hash", PropertyInfo(Variant::NIL, "var")); mi.return_val.type = Variant::INT; return mi; } break; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 0960ec8791..9cd3ec64cf 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -175,8 +175,8 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p String pkg_name; if (p_preset->get("application/name") != "") pkg_name = p_preset->get("application/name"); // app_name - else if (String(GlobalConfig::get_singleton()->get("application/name")) != "") - pkg_name = String(GlobalConfig::get_singleton()->get("application/name")); + else if (String(GlobalConfig::get_singleton()->get("application/config/name")) != "") + pkg_name = String(GlobalConfig::get_singleton()->get("application/config/name")); else pkg_name = "Unnamed"; diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index ca5535f771..f0a7e3772e 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -275,8 +275,8 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p String pkg_name; if (p_preset->get("application/name") != "") pkg_name = p_preset->get("application/name"); // app_name - else if (String(GlobalConfig::get_singleton()->get("application/name")) != "") - pkg_name = String(GlobalConfig::get_singleton()->get("application/name")); + else if (String(GlobalConfig::get_singleton()->get("application/config/name")) != "") + pkg_name = String(GlobalConfig::get_singleton()->get("application/config/name")); else pkg_name = "Unnamed"; @@ -438,7 +438,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p /** When exporting for OSX from any other platform we don't have access to code signing or creating DMGs so we'll wrap the bundle into a zip file. - Should probably find a nicer way to have just one export method instead of duplicating the method like this but I would the code got very + Should probably find a nicer way to have just one export method instead of duplicating the method like this but I would the code got very messy with switches inside of it. **/ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 92a7b2c112..bc41d98968 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -774,7 +774,7 @@ class EditorExportUWP : public EditorExportPlatform { String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64"; result = result.replace("$architecture$", architecture); - result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)GlobalConfig::get_singleton()->get("application/name") : String(p_preset->get("package/display_name"))); + result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)GlobalConfig::get_singleton()->get("application/config/name") : String(p_preset->get("package/display_name"))); result = result.replace("$publisher_display_name$", p_preset->get("package/publisher_display_name")); result = result.replace("$app_description$", p_preset->get("package/description")); result = result.replace("$bg_color$", p_preset->get("images/background_color")); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 68a3166aa7..40c25c8bf6 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -949,7 +949,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("get_canvas_item"), &CanvasItem::get_canvas_item); - ClassDB::bind_method(D_METHOD("set_visible"), &CanvasItem::set_visible); + ClassDB::bind_method(D_METHOD("set_visible", "visible"), &CanvasItem::set_visible); ClassDB::bind_method(D_METHOD("is_visible"), &CanvasItem::is_visible); ClassDB::bind_method(D_METHOD("is_visible_in_tree"), &CanvasItem::is_visible_in_tree); ClassDB::bind_method(D_METHOD("show"), &CanvasItem::show); @@ -1001,7 +1001,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("get_local_mouse_pos"), &CanvasItem::get_local_mouse_pos); ClassDB::bind_method(D_METHOD("get_global_mouse_position"), &CanvasItem::get_global_mouse_position); ClassDB::bind_method(D_METHOD("get_canvas"), &CanvasItem::get_canvas); - ClassDB::bind_method(D_METHOD("get_world_2d"), &CanvasItem::get_world_2d); + ClassDB::bind_method(D_METHOD("get_world_2d:World2D"), &CanvasItem::get_world_2d); //ClassDB::bind_method(D_METHOD("get_viewport"),&CanvasItem::get_viewport); ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &CanvasItem::set_material); @@ -1018,7 +1018,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("make_canvas_pos_local", "screen_point"), &CanvasItem::make_canvas_pos_local); - ClassDB::bind_method(D_METHOD("make_input_local", "event"), &CanvasItem::make_input_local); + ClassDB::bind_method(D_METHOD("make_input_local:InputEvent", "event:InputEvent"), &CanvasItem::make_input_local); BIND_VMETHOD(MethodInfo("_draw")); diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index ff4aa245ec..890ac0c1f3 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -201,8 +201,8 @@ bool CollisionShape2D::is_one_way_collision_enabled() const { void CollisionShape2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape2D::set_shape); - ClassDB::bind_method(D_METHOD("get_shape"), &CollisionShape2D::get_shape); + ClassDB::bind_method(D_METHOD("set_shape", "shape:Shape2D"), &CollisionShape2D::set_shape); + ClassDB::bind_method(D_METHOD("get_shape:Shape2D"), &CollisionShape2D::get_shape); ClassDB::bind_method(D_METHOD("set_disabled", "disabled"), &CollisionShape2D::set_disabled); ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape2D::is_disabled); ClassDB::bind_method(D_METHOD("set_one_way_collision", "enabled"), &CollisionShape2D::set_one_way_collision); diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index e8c2122bd1..044cb06c02 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -355,8 +355,8 @@ void Light2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_editor_only", "editor_only"), &Light2D::set_editor_only); ClassDB::bind_method(D_METHOD("is_editor_only"), &Light2D::is_editor_only); - ClassDB::bind_method(D_METHOD("set_texture", "texture"), &Light2D::set_texture); - ClassDB::bind_method(D_METHOD("get_texture"), &Light2D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture", "texture:Texture"), &Light2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"), &Light2D::get_texture); ClassDB::bind_method(D_METHOD("set_texture_offset", "texture_offset"), &Light2D::set_texture_offset); ClassDB::bind_method(D_METHOD("get_texture_offset"), &Light2D::get_texture_offset); diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 5438557d0b..22e54cfb54 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -283,11 +283,11 @@ void Line2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_default_color", "color"), &Line2D::set_default_color); ClassDB::bind_method(D_METHOD("get_default_color"), &Line2D::get_default_color); - ClassDB::bind_method(D_METHOD("set_gradient", "color"), &Line2D::set_gradient); - ClassDB::bind_method(D_METHOD("get_gradient"), &Line2D::get_gradient); + ClassDB::bind_method(D_METHOD("set_gradient", "color:Gradient"), &Line2D::set_gradient); + ClassDB::bind_method(D_METHOD("get_gradient:Gradient"), &Line2D::get_gradient); - ClassDB::bind_method(D_METHOD("set_texture", "texture"), &Line2D::set_texture); - ClassDB::bind_method(D_METHOD("get_texture"), &Line2D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture", "texture:Texture"), &Line2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"), &Line2D::get_texture); ClassDB::bind_method(D_METHOD("set_texture_mode", "mode"), &Line2D::set_texture_mode); ClassDB::bind_method(D_METHOD("get_texture_mode"), &Line2D::get_texture_mode); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index bd6ab99801..9de46fd937 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -444,7 +444,7 @@ void Node2D::_bind_methods() { ClassDB::bind_method(D_METHOD("edit_set_pivot", "pivot"), &Node2D::edit_set_pivot); - ClassDB::bind_method(D_METHOD("get_relative_transform_to_parent", "parent"), &Node2D::get_relative_transform_to_parent); + ClassDB::bind_method(D_METHOD("get_relative_transform_to_parent", "parent:Node2D"), &Node2D::get_relative_transform_to_parent); ADD_GROUP("Transform", ""); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position"); diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 4fd215bd1a..a7cfc6fef2 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -127,9 +127,9 @@ String CollisionShape::get_configuration_warning() const { void CollisionShape::_bind_methods() { //not sure if this should do anything - ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape::resource_changed); - ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape::set_shape); - ClassDB::bind_method(D_METHOD("get_shape"), &CollisionShape::get_shape); + ClassDB::bind_method(D_METHOD("resource_changed", "resource:Resource"), &CollisionShape::resource_changed); + ClassDB::bind_method(D_METHOD("set_shape", "shape:Shape"), &CollisionShape::set_shape); + ClassDB::bind_method(D_METHOD("get_shape:Shape"), &CollisionShape::get_shape); ClassDB::bind_method(D_METHOD("set_disabled", "enable"), &CollisionShape::set_disabled); ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape::is_disabled); ClassDB::bind_method(D_METHOD("make_convex_from_brothers"), &CollisionShape::make_convex_from_brothers); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 581dfb32c8..0c31282a6c 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1443,8 +1443,8 @@ PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { void GIProbe::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_probe_data", "data"), &GIProbe::set_probe_data); - ClassDB::bind_method(D_METHOD("get_probe_data"), &GIProbe::get_probe_data); + ClassDB::bind_method(D_METHOD("set_probe_data", "data:GIProbeData"), &GIProbe::set_probe_data); + ClassDB::bind_method(D_METHOD("get_probe_data:GIProbeData"), &GIProbe::get_probe_data); ClassDB::bind_method(D_METHOD("set_subdiv", "subdiv"), &GIProbe::set_subdiv); ClassDB::bind_method(D_METHOD("get_subdiv"), &GIProbe::get_subdiv); @@ -1473,7 +1473,7 @@ void GIProbe::_bind_methods() { ClassDB::bind_method(D_METHOD("set_compress", "enable"), &GIProbe::set_compress); ClassDB::bind_method(D_METHOD("is_compressed"), &GIProbe::is_compressed); - ClassDB::bind_method(D_METHOD("bake", "from_node", "create_visual_debug"), &GIProbe::bake, DEFVAL(Variant()), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("bake", "from_node:Node", "create_visual_debug"), &GIProbe::bake, DEFVAL(Variant()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("debug_bake"), &GIProbe::_debug_bake); ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index b51953f27c..b4558698cc 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -31,8 +31,8 @@ void MultiMeshInstance::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_multimesh", "multimesh"), &MultiMeshInstance::set_multimesh); - ClassDB::bind_method(D_METHOD("get_multimesh"), &MultiMeshInstance::get_multimesh); + ClassDB::bind_method(D_METHOD("set_multimesh", "multimesh:MultiMesh"), &MultiMeshInstance::set_multimesh); + ClassDB::bind_method(D_METHOD("get_multimesh:MultiMesh"), &MultiMeshInstance::get_multimesh); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multimesh", PROPERTY_HINT_RESOURCE_TYPE, "MultiMesh"), "set_multimesh", "get_multimesh"); } diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 4c93bcfb5e..7392998d57 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -374,8 +374,8 @@ String NavigationMeshInstance::get_configuration_warning() const { void NavigationMeshInstance::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationMeshInstance::set_navigation_mesh); - ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationMeshInstance::get_navigation_mesh); + ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh:NavigationMesh"), &NavigationMeshInstance::set_navigation_mesh); + ClassDB::bind_method(D_METHOD("get_navigation_mesh:NavigationMesh"), &NavigationMeshInstance::get_navigation_mesh); ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationMeshInstance::set_enabled); ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationMeshInstance::is_enabled); diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index bcca834642..fdf61c40d8 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -263,7 +263,7 @@ void AudioStreamPlayer::_bus_layout_changed() { void AudioStreamPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_stream", "stream:AudioStream"), &AudioStreamPlayer::set_stream); - ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer::get_stream); + ClassDB::bind_method(D_METHOD("get_stream:AudioStream"), &AudioStreamPlayer::get_stream); ClassDB::bind_method(D_METHOD("set_volume_db", "volume_db"), &AudioStreamPlayer::set_volume_db); ClassDB::bind_method(D_METHOD("get_volume_db"), &AudioStreamPlayer::get_volume_db); diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index c1dbc82f3c..9a5f55698e 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -493,11 +493,11 @@ void BaseButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_enabled_focus_mode", "mode"), &BaseButton::set_enabled_focus_mode); ClassDB::bind_method(D_METHOD("get_enabled_focus_mode"), &BaseButton::get_enabled_focus_mode); - ClassDB::bind_method(D_METHOD("set_shortcut", "shortcut"), &BaseButton::set_shortcut); - ClassDB::bind_method(D_METHOD("get_shortcut"), &BaseButton::get_shortcut); + ClassDB::bind_method(D_METHOD("set_shortcut", "shortcut:ShortCut"), &BaseButton::set_shortcut); + ClassDB::bind_method(D_METHOD("get_shortcut:ShortCut"), &BaseButton::get_shortcut); - ClassDB::bind_method(D_METHOD("set_button_group", "button_group"), &BaseButton::set_button_group); - ClassDB::bind_method(D_METHOD("get_button_group"), &BaseButton::get_button_group); + ClassDB::bind_method(D_METHOD("set_button_group", "button_group:ButtonGroup"), &BaseButton::set_button_group); + ClassDB::bind_method(D_METHOD("get_button_group:ButtonGroup"), &BaseButton::get_button_group); BIND_VMETHOD(MethodInfo("_pressed")); BIND_VMETHOD(MethodInfo("_toggled", PropertyInfo(Variant::BOOL, "pressed"))); diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index a456759281..03798c01a2 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -89,7 +89,8 @@ void Button::_notification(int p_what) { case DRAW_PRESSED: { style = get_stylebox("pressed"); - style->draw(ci, Rect2(Point2(0, 0), size)); + if (!flat) + style->draw(ci, Rect2(Point2(0, 0), size)); if (has_color("font_color_pressed")) color = get_color("font_color_pressed"); else @@ -101,7 +102,8 @@ void Button::_notification(int p_what) { case DRAW_HOVER: { style = get_stylebox("hover"); - style->draw(ci, Rect2(Point2(0, 0), size)); + if (!flat) + style->draw(ci, Rect2(Point2(0, 0), size)); color = get_color("font_color_hover"); if (has_color("icon_color_hover")) color_icon = get_color("icon_color_hover"); @@ -110,7 +112,8 @@ void Button::_notification(int p_what) { case DRAW_DISABLED: { style = get_stylebox("disabled"); - style->draw(ci, Rect2(Point2(0, 0), size)); + if (!flat) + style->draw(ci, Rect2(Point2(0, 0), size)); color = get_color("font_color_disabled"); if (has_color("icon_color_disabled")) color_icon = get_color("icon_color_disabled"); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index faaf761598..48cac69956 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -478,7 +478,7 @@ void ColorPicker::_bind_methods() { ClassDB::bind_method(D_METHOD("is_raw_mode"), &ColorPicker::is_raw_mode); ClassDB::bind_method(D_METHOD("set_edit_alpha", "show"), &ColorPicker::set_edit_alpha); ClassDB::bind_method(D_METHOD("is_editing_alpha"), &ColorPicker::is_editing_alpha); - ClassDB::bind_method(D_METHOD("add_preset"), &ColorPicker::add_preset); + ClassDB::bind_method(D_METHOD("add_preset", "color"), &ColorPicker::add_preset); ClassDB::bind_method(D_METHOD("_value_changed"), &ColorPicker::_value_changed); ClassDB::bind_method(D_METHOD("_html_entered"), &ColorPicker::_html_entered); ClassDB::bind_method(D_METHOD("_text_type_toggled"), &ColorPicker::_text_type_toggled); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index a9034b738b..819ac633a7 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2469,7 +2469,7 @@ void Control::_bind_methods() { ClassDB::bind_method(D_METHOD("set_focus_neighbour", "margin", "neighbour"), &Control::set_focus_neighbour); ClassDB::bind_method(D_METHOD("get_focus_neighbour", "margin"), &Control::get_focus_neighbour); - ClassDB::bind_method(D_METHOD("force_drag", "data", "preview"), &Control::force_drag); + ClassDB::bind_method(D_METHOD("force_drag", "data", "preview:Control"), &Control::force_drag); ClassDB::bind_method(D_METHOD("set_mouse_filter", "filter"), &Control::set_mouse_filter); ClassDB::bind_method(D_METHOD("get_mouse_filter"), &Control::get_mouse_filter); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 9d45b6e70a..1d37529a87 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1193,7 +1193,7 @@ void GraphEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_scroll_offset"), &GraphEdit::_update_scroll_offset); ClassDB::bind_method(D_METHOD("_connections_layer_draw"), &GraphEdit::_connections_layer_draw); - ClassDB::bind_method(D_METHOD("set_selected", "node"), &GraphEdit::set_selected); + ClassDB::bind_method(D_METHOD("set_selected", "node:Node"), &GraphEdit::set_selected); ADD_SIGNAL(MethodInfo("connection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"))); ADD_SIGNAL(MethodInfo("disconnection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"))); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 19768d344a..2c6db7d0bf 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1327,7 +1327,7 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("ensure_current_is_visible"), &ItemList::ensure_current_is_visible); - ClassDB::bind_method(D_METHOD("get_v_scroll"), &ItemList::get_v_scroll); + ClassDB::bind_method(D_METHOD("get_v_scroll:VScrollBar"), &ItemList::get_v_scroll); ClassDB::bind_method(D_METHOD("_scroll_changed"), &ItemList::_scroll_changed); ClassDB::bind_method(D_METHOD("_gui_input"), &ItemList::_gui_input); diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp index 735f36b55d..16f2bb6b6f 100644 --- a/scene/gui/patch_9_rect.cpp +++ b/scene/gui/patch_9_rect.cpp @@ -54,8 +54,8 @@ Size2 NinePatchRect::get_minimum_size() const { } void NinePatchRect::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_texture", "texture"), &NinePatchRect::set_texture); - ClassDB::bind_method(D_METHOD("get_texture"), &NinePatchRect::get_texture); + ClassDB::bind_method(D_METHOD("set_texture", "texture:Texture"), &NinePatchRect::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"), &NinePatchRect::get_texture); ClassDB::bind_method(D_METHOD("set_patch_margin", "margin", "value"), &NinePatchRect::set_patch_margin); ClassDB::bind_method(D_METHOD("get_patch_margin", "margin"), &NinePatchRect::get_patch_margin); ClassDB::bind_method(D_METHOD("set_region_rect", "rect"), &NinePatchRect::set_region_rect); diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 4316f06a53..ee0ae1fb41 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -639,6 +639,22 @@ Tabs::TabAlign Tabs::get_tab_align() const { return tab_align; } +void Tabs::move_tab(int from, int to) { + + if (from == to) + return; + + ERR_FAIL_INDEX(from, tabs.size()); + ERR_FAIL_INDEX(to, tabs.size()); + + Tab tab_from = tabs[from]; + tabs.remove(from); + tabs.insert(to, tab_from); + + _update_cache(); + update(); +} + int Tabs::get_tab_width(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, tabs.size(), 0); @@ -773,6 +789,8 @@ void Tabs::_bind_methods() { ClassDB::bind_method(D_METHOD("set_tab_align", "align"), &Tabs::set_tab_align); ClassDB::bind_method(D_METHOD("get_tab_align"), &Tabs::get_tab_align); ClassDB::bind_method(D_METHOD("ensure_tab_visible", "idx"), &Tabs::ensure_tab_visible); + ClassDB::bind_method(D_METHOD("get_tab_rect", "tab_idx"), &Tabs::get_tab_rect); + ClassDB::bind_method(D_METHOD("move_tab", "from", "to"), &Tabs::move_tab); ADD_SIGNAL(MethodInfo("tab_changed", PropertyInfo(Variant::INT, "tab"))); ADD_SIGNAL(MethodInfo("right_button_pressed", PropertyInfo(Variant::INT, "tab"))); diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 613c604b12..a9dd6bddd7 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -119,6 +119,8 @@ public: void set_tab_align(TabAlign p_align); TabAlign get_tab_align() const; + void move_tab(int from, int to); + void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy); int get_tab_count() const; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 61e563143c..c5d466eed1 100755 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2786,7 +2786,7 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("set_scene_instance_load_placeholder", "load_placeholder"), &Node::set_scene_instance_load_placeholder); ClassDB::bind_method(D_METHOD("get_scene_instance_load_placeholder"), &Node::get_scene_instance_load_placeholder); - ClassDB::bind_method(D_METHOD("get_viewport"), &Node::get_viewport); + ClassDB::bind_method(D_METHOD("get_viewport:Viewport"), &Node::get_viewport); ClassDB::bind_method(D_METHOD("queue_free"), &Node::queue_delete); diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index a473067937..73a759278b 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -170,7 +170,7 @@ Dictionary BitMap::_get_data() const { void BitMap::_bind_methods() { ClassDB::bind_method(D_METHOD("create", "size"), &BitMap::create); - ClassDB::bind_method(D_METHOD("create_from_image_alpha", "image"), &BitMap::create_from_image_alpha); + ClassDB::bind_method(D_METHOD("create_from_image_alpha", "image:Image"), &BitMap::create_from_image_alpha); ClassDB::bind_method(D_METHOD("set_bit", "pos", "bit"), &BitMap::set_bit); ClassDB::bind_method(D_METHOD("get_bit", "pos"), &BitMap::get_bit); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 338311b87b..fe0759fcba 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -1188,7 +1188,7 @@ void Curve2D::_set_data(const Dictionary &p_data) { baked_cache_dirty = true; } -PoolVector2Array Curve2D::tesselate(int p_max_stages, float p_tolerance) const { +PoolVector2Array Curve2D::tessellate(int p_max_stages, float p_tolerance) const { PoolVector2Array tess; @@ -1250,7 +1250,7 @@ void Curve2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_baked_length"), &Curve2D::get_baked_length); ClassDB::bind_method(D_METHOD("interpolate_baked", "offset", "cubic"), &Curve2D::interpolate_baked, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_baked_points"), &Curve2D::get_baked_points); - ClassDB::bind_method(D_METHOD("tesselate", "max_stages", "tolerance_degrees"), &Curve2D::tesselate, DEFVAL(5), DEFVAL(4)); + ClassDB::bind_method(D_METHOD("tessellate", "max_stages", "tolerance_degrees"), &Curve2D::tessellate, DEFVAL(5), DEFVAL(4)); ClassDB::bind_method(D_METHOD("_get_data"), &Curve2D::_get_data); ClassDB::bind_method(D_METHOD("_set_data"), &Curve2D::_set_data); @@ -1683,7 +1683,7 @@ void Curve3D::_set_data(const Dictionary &p_data) { baked_cache_dirty = true; } -PoolVector3Array Curve3D::tesselate(int p_max_stages, float p_tolerance) const { +PoolVector3Array Curve3D::tessellate(int p_max_stages, float p_tolerance) const { PoolVector3Array tess; @@ -1748,7 +1748,7 @@ void Curve3D::_bind_methods() { ClassDB::bind_method(D_METHOD("interpolate_baked", "offset", "cubic"), &Curve3D::interpolate_baked, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_baked_points"), &Curve3D::get_baked_points); ClassDB::bind_method(D_METHOD("get_baked_tilts"), &Curve3D::get_baked_tilts); - ClassDB::bind_method(D_METHOD("tesselate", "max_stages", "tolerance_degrees"), &Curve3D::tesselate, DEFVAL(5), DEFVAL(4)); + ClassDB::bind_method(D_METHOD("tessellate", "max_stages", "tolerance_degrees"), &Curve3D::tessellate, DEFVAL(5), DEFVAL(4)); ClassDB::bind_method(D_METHOD("_get_data"), &Curve3D::_get_data); ClassDB::bind_method(D_METHOD("_set_data"), &Curve3D::_set_data); diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 83a4357bfb..2815c12c4b 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -249,7 +249,7 @@ public: Vector2 interpolate_baked(float p_offset, bool p_cubic = false) const; PoolVector2Array get_baked_points() const; //useful for going through - PoolVector2Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display + PoolVector2Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display Curve2D(); }; @@ -318,7 +318,7 @@ public: PoolVector3Array get_baked_points() const; //useful for going through PoolRealArray get_baked_tilts() const; //useful for going through - PoolVector3Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display + PoolVector3Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display Curve3D(); }; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 125bbd2d64..867283d3a8 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1103,8 +1103,8 @@ void Environment::_bind_methods() { ClassDB::bind_method(D_METHOD("set_adjustment_saturation", "saturation"), &Environment::set_adjustment_saturation); ClassDB::bind_method(D_METHOD("get_adjustment_saturation"), &Environment::get_adjustment_saturation); - ClassDB::bind_method(D_METHOD("set_adjustment_color_correction", "color_correction"), &Environment::set_adjustment_color_correction); - ClassDB::bind_method(D_METHOD("get_adjustment_color_correction"), &Environment::get_adjustment_color_correction); + ClassDB::bind_method(D_METHOD("set_adjustment_color_correction", "color_correction:Texture"), &Environment::set_adjustment_color_correction); + ClassDB::bind_method(D_METHOD("get_adjustment_color_correction:Texture"), &Environment::get_adjustment_color_correction); ADD_GROUP("Adjustments", "adjustment_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "adjustment_enabled"), "set_adjustment_enable", "is_adjustment_enabled"); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 225a42f651..3668dda604 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -570,8 +570,8 @@ void BitmapFont::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_textures"), &BitmapFont::_set_textures); ClassDB::bind_method(D_METHOD("_get_textures"), &BitmapFont::_get_textures); - ClassDB::bind_method(D_METHOD("set_fallback", "fallback"), &BitmapFont::set_fallback); - ClassDB::bind_method(D_METHOD("get_fallback"), &BitmapFont::get_fallback); + ClassDB::bind_method(D_METHOD("set_fallback", "fallback:BitmapFont"), &BitmapFont::set_fallback); + ClassDB::bind_method(D_METHOD("get_fallback:BitmapFont"), &BitmapFont::get_fallback); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "textures", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_textures", "_get_textures"); ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_chars", "_get_chars"); diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index bf1b3d40be..5dc596abff 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -520,8 +520,8 @@ void MeshDataTool::set_material(const Ref<Material> &p_material) { void MeshDataTool::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &MeshDataTool::clear); - ClassDB::bind_method(D_METHOD("create_from_surface", "mesh", "surface"), &MeshDataTool::create_from_surface); - ClassDB::bind_method(D_METHOD("commit_to_surface", "mesh"), &MeshDataTool::commit_to_surface); + ClassDB::bind_method(D_METHOD("create_from_surface", "mesh:ArrayMesh", "surface"), &MeshDataTool::create_from_surface); + ClassDB::bind_method(D_METHOD("commit_to_surface", "mesh:ArrayMesh"), &MeshDataTool::commit_to_surface); ClassDB::bind_method(D_METHOD("get_format"), &MeshDataTool::get_format); @@ -574,7 +574,7 @@ void MeshDataTool::_bind_methods() { ClassDB::bind_method(D_METHOD("get_face_normal", "idx"), &MeshDataTool::get_face_normal); ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &MeshDataTool::set_material); - ClassDB::bind_method(D_METHOD("get_material", "material"), &MeshDataTool::get_material); + ClassDB::bind_method(D_METHOD("get_material:Material", "material"), &MeshDataTool::get_material); } MeshDataTool::MeshDataTool() { diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 171826cb2f..5cd75b5a69 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1323,8 +1323,8 @@ void CubeMap::_bind_methods() { ClassDB::bind_method(D_METHOD("set_flags", "flags"), &CubeMap::set_flags); ClassDB::bind_method(D_METHOD("get_flags"), &CubeMap::get_flags); - ClassDB::bind_method(D_METHOD("set_side", "side", "image"), &CubeMap::set_side); - ClassDB::bind_method(D_METHOD("get_side", "side"), &CubeMap::get_side); + ClassDB::bind_method(D_METHOD("set_side", "side", "image:Image"), &CubeMap::set_side); + ClassDB::bind_method(D_METHOD("get_side:Image", "side"), &CubeMap::get_side); ClassDB::bind_method(D_METHOD("set_storage", "mode"), &CubeMap::set_storage); ClassDB::bind_method(D_METHOD("get_storage"), &CubeMap::get_storage); ClassDB::bind_method(D_METHOD("set_lossy_storage_quality", "quality"), &CubeMap::set_lossy_storage_quality); diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 43f1175c79..195c02e22d 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -984,10 +984,10 @@ void AudioServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bus_bypass_effects", "bus_idx", "enable"), &AudioServer::set_bus_bypass_effects); ClassDB::bind_method(D_METHOD("is_bus_bypassing_effects", "bus_idx"), &AudioServer::is_bus_bypassing_effects); - ClassDB::bind_method(D_METHOD("add_bus_effect", "bus_idx", "effect:AudioEffect"), &AudioServer::add_bus_effect, DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("add_bus_effect", "bus_idx", "effect:AudioEffect", "at_pos"), &AudioServer::add_bus_effect, DEFVAL(-1)); ClassDB::bind_method(D_METHOD("remove_bus_effect", "bus_idx", "effect_idx"), &AudioServer::remove_bus_effect); - ClassDB::bind_method(D_METHOD("get_bus_effect_count", "bus_idx"), &AudioServer::add_bus_effect); + ClassDB::bind_method(D_METHOD("get_bus_effect_count", "bus_idx"), &AudioServer::get_bus_effect_count); ClassDB::bind_method(D_METHOD("get_bus_effect:AudioEffect", "bus_idx", "effect_idx"), &AudioServer::get_bus_effect); ClassDB::bind_method(D_METHOD("swap_bus_effects", "bus_idx", "effect_idx", "by_effect_idx"), &AudioServer::swap_bus_effects); |