| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "scene/gui/dialogs.h" |
| 34 |
|
| 35 |
class CheckBox; |
| 36 |
class EditorFileSystemDirectory; |
| 37 |
class EditorValidationPanel; |
| 38 |
class FileSystemDock; |
| 39 |
class Label; |
| 40 |
class Tree; |
| 41 |
|
| 42 |
class GroupSettingsEditor : public VBoxContainer { |
| 43 |
GDCLASS(GroupSettingsEditor, VBoxContainer); |
| 44 |
|
| 45 |
const String GLOBAL_GROUP_PREFIX = "global_group/"; |
| 46 |
const StringName group_changed = "group_changed"; |
| 47 |
|
| 48 |
HashMap<StringName, String> groups_cache; |
| 49 |
|
| 50 |
bool updating_groups = false; |
| 51 |
|
| 52 |
AcceptDialog *message = nullptr; |
| 53 |
Tree *tree = nullptr; |
| 54 |
LineEdit *group_name = nullptr; |
| 55 |
LineEdit *group_description = nullptr; |
| 56 |
Button *add_button = nullptr; |
| 57 |
|
| 58 |
ConfirmationDialog *remove_dialog = nullptr; |
| 59 |
CheckBox *remove_check_box = nullptr; |
| 60 |
Label *remove_label = nullptr; |
| 61 |
|
| 62 |
ConfirmationDialog *rename_group_dialog = nullptr; |
| 63 |
LineEdit *rename_group = nullptr; |
| 64 |
CheckBox *rename_check_box = nullptr; |
| 65 |
EditorValidationPanel *rename_validation_panel = nullptr; |
| 66 |
|
| 67 |
void _show_remove_dialog(); |
| 68 |
void _show_rename_dialog(); |
| 69 |
|
| 70 |
String _check_new_group_name(const String &p_name); |
| 71 |
void _check_rename(); |
| 72 |
|
| 73 |
void _add_group(); |
| 74 |
void _add_group(const String &p_name, const String &p_description); |
| 75 |
|
| 76 |
void _modify_references(const StringName &p_name, const StringName &p_new_name, bool p_is_rename); |
| 77 |
|
| 78 |
void _confirm_rename(); |
| 79 |
void _confirm_delete(); |
| 80 |
|
| 81 |
void _text_submitted(const String &p_text); |
| 82 |
void _group_name_text_changed(const String &p_name); |
| 83 |
|
| 84 |
void _item_edited(); |
| 85 |
void _item_button_pressed(Object *p_item, int p_column, int p_id, MouseButton p_button); |
| 86 |
|
| 87 |
protected: |
| 88 |
void _notification(int p_what); |
| 89 |
static void _bind_methods(); |
| 90 |
|
| 91 |
public: |
| 92 |
LineEdit *get_name_box() const; |
| 93 |
void show_message(const String &p_message); |
| 94 |
|
| 95 |
void remove_references(const StringName &p_name); |
| 96 |
void rename_references(const StringName &p_old_name, const StringName &p_new_name); |
| 97 |
|
| 98 |
bool remove_node_references(Node *p_node, const StringName &p_name); |
| 99 |
bool rename_node_references(Node *p_node, const StringName &p_old_name, const StringName &p_new_name); |
| 100 |
|
| 101 |
void update_groups(); |
| 102 |
void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock); |
| 103 |
|
| 104 |
GroupSettingsEditor(); |
| 105 |
}; |