diff options
Diffstat (limited to 'editor/filesystem_dock.h')
-rw-r--r-- | editor/filesystem_dock.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 7692566c0b..8b27938c8a 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,17 +65,12 @@ public: FILE_LIST_DISPLAY_LIST }; -private: - enum DisplayModeSetting { - DISPLAY_MODE_SETTING_TREE_ONLY, - DISPLAY_MODE_SETTING_SPLIT, - }; - enum DisplayMode { DISPLAY_MODE_TREE_ONLY, DISPLAY_MODE_SPLIT, }; +private: enum FileMenu { FILE_OPEN, FILE_INSTANCE, @@ -123,8 +118,7 @@ private: FileListDisplayMode file_list_display_mode; DisplayMode display_mode; - DisplayModeSetting display_mode_setting; - DisplayModeSetting old_display_mode_setting; + DisplayMode old_display_mode; PopupMenu *file_list_popup; PopupMenu *tree_popup; @@ -178,21 +172,22 @@ private: bool import_dock_needs_update; Ref<Texture> _get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx); - bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths); + bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths, bool p_select_in_favorites); Vector<String> _compute_uncollapsed_paths(); - void _update_tree(const Vector<String> p_uncollapsed_paths = Vector<String>(), bool p_uncollapse_root = false); + void _update_tree(const Vector<String> p_uncollapsed_paths = Vector<String>(), bool p_uncollapse_root = false, bool p_select_in_favorites = false); + void _navigate_to_path(const String &p_path, bool p_select_in_favorites = false); void _file_list_gui_input(Ref<InputEvent> p_event); void _tree_gui_input(Ref<InputEvent> p_event); void _update_file_list(bool p_keep_selection); - void _update_file_list_display_mode_button(); - void _change_file_display(); + void _toggle_file_display(); + void _set_file_display(bool p_active); void _fs_changed(); void _tree_toggle_collapsed(); - void _select_file(const String p_path); + void _select_file(const String p_path, bool p_select_in_favorites = false); void _tree_activate_file(); void _file_list_activate_file(int p_idx); void _file_multi_selected(int p_index, bool p_selected); @@ -242,6 +237,7 @@ private: void _tree_rmb_select(const Vector2 &p_pos); void _file_list_rmb_select(int p_item, const Vector2 &p_pos); void _file_list_rmb_pressed(const Vector2 &p_pos); + void _tree_empty_selected(); struct FileInfo { String name; @@ -273,6 +269,10 @@ private: Vector<String> _tree_get_selected(bool remove_self_inclusion = true); + bool _is_file_type_disabled_by_feature_profile(const StringName &p_class); + + void _feature_profile_changed(); + protected: void _notification(int p_what); static void _bind_methods(); @@ -286,12 +286,16 @@ public: void fix_dependencies(const String &p_for_file); - void set_file_list_display_mode(int p_mode); - int get_split_offset() { return split_box->get_split_offset(); } void set_split_offset(int p_offset) { split_box->set_split_offset(p_offset); } void select_file(const String &p_file); + void set_display_mode(DisplayMode p_display_mode); + DisplayMode get_display_mode() { return display_mode; } + + void set_file_list_display_mode(FileListDisplayMode p_mode); + FileListDisplayMode get_file_list_display_mode() { return file_list_display_mode; }; + FileSystemDock(EditorNode *p_editor); ~FileSystemDock(); }; |