summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-08-26 21:42:28 +0700
committerPoommetee Ketson <poommetee@protonmail.com>2017-08-26 21:42:28 +0700
commit03db00e6f615d8dac096738a43570b1257be1079 (patch)
treedb48f3344a2f2b7e4d93e56b1ad037d990d38d59
parent1894157c9fab05984428d83a743b0fe1d720c80c (diff)
EditorAudioBus: Rename delete_popup, disable delete for Master
Rename `delete_popup` to `bus_popup` Rename `_delete_pressed` to `_bus_popup_pressed` Disable 'Delete Bus' option for Master Bus
-rw-r--r--editor/editor_audio_buses.cpp19
-rw-r--r--editor/editor_audio_buses.h4
2 files changed, 12 insertions, 11 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 1f72a59a14..a67cdcdeed 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -403,12 +403,13 @@ void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
Vector2 pos = Vector2(mb->get_position().x, mb->get_position().y);
- delete_popup->set_position(get_global_position() + pos);
- delete_popup->popup();
+ bus_popup->set_position(get_global_position() + pos);
+ bus_popup->set_item_disabled(1, get_index() == 0);
+ bus_popup->popup();
}
}
-void EditorAudioBus::_delete_pressed(int p_option) {
+void EditorAudioBus::_bus_popup_pressed(int p_option) {
if (p_option == 1) {
emit_signal("delete_request");
@@ -604,7 +605,7 @@ void EditorAudioBus::_bind_methods() {
ClassDB::bind_method("_effect_selected", &EditorAudioBus::_effect_selected);
ClassDB::bind_method("_effect_add", &EditorAudioBus::_effect_add);
ClassDB::bind_method("_gui_input", &EditorAudioBus::_gui_input);
- ClassDB::bind_method("_delete_pressed", &EditorAudioBus::_delete_pressed);
+ ClassDB::bind_method("_bus_popup_pressed", &EditorAudioBus::_bus_popup_pressed);
ClassDB::bind_method("get_drag_data_fw", &EditorAudioBus::get_drag_data_fw);
ClassDB::bind_method("can_drop_data_fw", &EditorAudioBus::can_drop_data_fw);
ClassDB::bind_method("drop_data_fw", &EditorAudioBus::drop_data_fw);
@@ -735,11 +736,11 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effect_options->set_item_icon(effect_options->get_item_count() - 1, icon);
}
- delete_popup = bus_options->get_popup();
- delete_popup->add_item(TTR("Duplicate"));
- delete_popup->add_item(TTR("Delete"));
- add_child(delete_popup);
- delete_popup->connect("index_pressed", this, "_delete_pressed");
+ bus_popup = bus_options->get_popup();
+ bus_popup->add_item(TTR("Duplicate"));
+ bus_popup->add_item(TTR("Delete"));
+ add_child(bus_popup);
+ bus_popup->connect("index_pressed", this, "_bus_popup_pressed");
delete_effect_popup = memnew(PopupMenu);
delete_effect_popup->add_item(TTR("Delete Effect"));
diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h
index ef7f5e0adf..9d80ff67d1 100644
--- a/editor/editor_audio_buses.h
+++ b/editor/editor_audio_buses.h
@@ -66,7 +66,7 @@ class EditorAudioBus : public PanelContainer {
OptionButton *send;
PopupMenu *effect_options;
- PopupMenu *delete_popup;
+ PopupMenu *bus_popup;
PopupMenu *delete_effect_popup;
Button *solo;
@@ -78,7 +78,7 @@ class EditorAudioBus : public PanelContainer {
bool updating_bus;
void _gui_input(const Ref<InputEvent> &p_event);
- void _delete_pressed(int p_option);
+ void _bus_popup_pressed(int p_option);
void _name_changed(const String &p_new_name);
void _name_focus_exit() { _name_changed(track_name->get_text()); }