Path: blob/master/editor/scene/group_settings_editor.h
9902 views
/**************************************************************************/1/* group_settings_editor.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "scene/gui/dialogs.h"3334class CheckBox;35class EditorFileSystemDirectory;36class EditorValidationPanel;37class FileSystemDock;38class Label;39class Tree;4041class GroupSettingsEditor : public VBoxContainer {42GDCLASS(GroupSettingsEditor, VBoxContainer);4344const String GLOBAL_GROUP_PREFIX = "global_group/";45const StringName group_changed = "group_changed";4647HashMap<StringName, String> groups_cache;4849bool updating_groups = false;5051AcceptDialog *message = nullptr;52Tree *tree = nullptr;53LineEdit *group_name = nullptr;54LineEdit *group_description = nullptr;55Button *add_button = nullptr;5657ConfirmationDialog *remove_dialog = nullptr;58CheckBox *remove_check_box = nullptr;59Label *remove_label = nullptr;6061ConfirmationDialog *rename_group_dialog = nullptr;62LineEdit *rename_group = nullptr;63CheckBox *rename_check_box = nullptr;64EditorValidationPanel *rename_validation_panel = nullptr;6566void _show_remove_dialog();67void _show_rename_dialog();6869String _check_new_group_name(const String &p_name);70void _check_rename();7172void _add_group();73void _add_group(const String &p_name, const String &p_description);7475void _modify_references(const StringName &p_name, const StringName &p_new_name, bool p_is_rename);7677void _confirm_rename();78void _confirm_delete();7980void _text_submitted(const String &p_text);81void _group_name_text_changed(const String &p_name);8283void _item_edited();84void _item_button_pressed(Object *p_item, int p_column, int p_id, MouseButton p_button);8586protected:87void _notification(int p_what);88static void _bind_methods();8990public:91LineEdit *get_name_box() const;92void show_message(const String &p_message);9394void remove_references(const StringName &p_name);95void rename_references(const StringName &p_old_name, const StringName &p_new_name);9697bool remove_node_references(Node *p_node, const StringName &p_name);98bool rename_node_references(Node *p_node, const StringName &p_old_name, const StringName &p_new_name);99100void update_groups();101void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);102103GroupSettingsEditor();104};105106107