feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -130,6 +130,14 @@ void EditorAudioBus::_notification(int p_what) {
|
|||
set_process(true);
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_STATIC_TEXT);
|
||||
DisplayServer::get_singleton()->accessibility_update_set_value(ae, TTR(vformat("The %s is not accessible at this time.", "Audio bus editor")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_DRAW: {
|
||||
if (is_master) {
|
||||
draw_style_box(get_theme_stylebox(SNAME("disabled"), SNAME("Button")), Rect2(Vector2(), get_size()));
|
||||
|
|
@ -583,6 +591,15 @@ void EditorAudioBus::gui_input(const Ref<InputEvent> &p_event) {
|
|||
bus_popup->reset_size();
|
||||
bus_popup->popup();
|
||||
}
|
||||
|
||||
Ref<InputEventKey> k = p_event;
|
||||
if (k.is_valid() && k->is_pressed() && k->is_action("ui_menu", true)) {
|
||||
bus_popup->set_position(get_screen_position());
|
||||
bus_popup->reset_size();
|
||||
bus_popup->popup();
|
||||
|
||||
accept_event();
|
||||
}
|
||||
}
|
||||
|
||||
void EditorAudioBus::_effects_gui_input(Ref<InputEvent> p_event) {
|
||||
|
|
@ -619,7 +636,7 @@ Variant EditorAudioBus::get_drag_data(const Point2 &p_point) {
|
|||
p->set_modulate(Color(1, 1, 1, 0.7));
|
||||
p->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("focus"), SNAME("Button")));
|
||||
p->set_size(get_size());
|
||||
p->set_position(-p_point);
|
||||
p->set_position((p_point == Vector2(Math::INF, Math::INF)) ? Vector2() : -p_point);
|
||||
set_drag_preview(c);
|
||||
Dictionary d;
|
||||
d["type"] = "move_audio_bus";
|
||||
|
|
@ -652,7 +669,7 @@ void EditorAudioBus::drop_data(const Point2 &p_point, const Variant &p_data) {
|
|||
}
|
||||
|
||||
Variant EditorAudioBus::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
||||
TreeItem *item = effects->get_item_at_position(p_point);
|
||||
TreeItem *item = (p_point == Vector2(Math::INF, Math::INF)) ? effects->get_selected() : effects->get_item_at_position(p_point);
|
||||
if (!item) {
|
||||
return Variant();
|
||||
}
|
||||
|
|
@ -681,7 +698,7 @@ bool EditorAudioBus::can_drop_data_fw(const Point2 &p_point, const Variant &p_da
|
|||
return false;
|
||||
}
|
||||
|
||||
TreeItem *item = effects->get_item_at_position(p_point);
|
||||
TreeItem *item = (p_point == Vector2(Math::INF, Math::INF)) ? effects->get_selected() : effects->get_item_at_position(p_point);
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -694,11 +711,11 @@ bool EditorAudioBus::can_drop_data_fw(const Point2 &p_point, const Variant &p_da
|
|||
void EditorAudioBus::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
Dictionary d = p_data;
|
||||
|
||||
TreeItem *item = effects->get_item_at_position(p_point);
|
||||
TreeItem *item = (p_point == Vector2(Math::INF, Math::INF)) ? effects->get_selected() : effects->get_item_at_position(p_point);
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
int pos = effects->get_drop_section_at_position(p_point);
|
||||
int pos = (p_point == Vector2(Math::INF, Math::INF)) ? effects->get_drop_section_at_position(effects->get_item_rect(item).position) : effects->get_drop_section_at_position(p_point);
|
||||
Variant md = item->get_metadata(0);
|
||||
|
||||
int paste_at;
|
||||
|
|
@ -815,6 +832,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
|
||||
track_name = memnew(LineEdit);
|
||||
track_name->set_accessibility_name(TTRC("Track Name"));
|
||||
track_name->connect(SceneStringName(text_submitted), callable_mp(this, &EditorAudioBus::_name_changed));
|
||||
track_name->connect(SceneStringName(focus_exited), callable_mp(this, &EditorAudioBus::_name_focus_exit));
|
||||
vb->add_child(track_name);
|
||||
|
|
@ -825,6 +843,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
solo->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
solo->set_toggle_mode(true);
|
||||
solo->set_tooltip_text(TTR("Solo"));
|
||||
solo->set_accessibility_name(TTRC("Solo"));
|
||||
solo->set_focus_mode(FOCUS_NONE);
|
||||
solo->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_solo_toggled));
|
||||
hbc->add_child(solo);
|
||||
|
|
@ -832,6 +851,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
mute->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
mute->set_toggle_mode(true);
|
||||
mute->set_tooltip_text(TTR("Mute"));
|
||||
mute->set_accessibility_name(TTRC("Mute"));
|
||||
mute->set_focus_mode(FOCUS_NONE);
|
||||
mute->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_mute_toggled));
|
||||
hbc->add_child(mute);
|
||||
|
|
@ -839,6 +859,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
bypass->set_theme_type_variation(SceneStringName(FlatButton));
|
||||
bypass->set_toggle_mode(true);
|
||||
bypass->set_tooltip_text(TTR("Bypass"));
|
||||
bypass->set_accessibility_name(TTRC("Bypass"));
|
||||
bypass->set_focus_mode(FOCUS_NONE);
|
||||
bypass->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_bypass_toggled));
|
||||
hbc->add_child(bypass);
|
||||
|
|
@ -886,6 +907,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
slider->set_max(1.0);
|
||||
slider->set_step(0.0001);
|
||||
slider->set_clip_contents(false);
|
||||
slider->set_accessibility_name(TTRC("Volume"));
|
||||
|
||||
audio_value_preview_box = memnew(Panel);
|
||||
slider->add_child(audio_value_preview_box);
|
||||
|
|
@ -922,6 +944,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
channel[i].vu_l->set_min(-80);
|
||||
channel[i].vu_l->set_max(24);
|
||||
channel[i].vu_l->set_step(0.1);
|
||||
channel[i].vu_l->set_accessibility_name(vformat(TTR("Channel %d, Left VU"), i));
|
||||
|
||||
channel[i].vu_r = memnew(TextureProgressBar);
|
||||
channel[i].vu_r->set_fill_mode(TextureProgressBar::FILL_BOTTOM_TO_TOP);
|
||||
|
|
@ -929,6 +952,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
channel[i].vu_r->set_min(-80);
|
||||
channel[i].vu_r->set_max(24);
|
||||
channel[i].vu_r->set_step(0.1);
|
||||
channel[i].vu_r->set_accessibility_name(vformat(TTR("Channel %d, Right VU"), i));
|
||||
|
||||
channel[i].peak_l = 0.0f;
|
||||
channel[i].peak_r = 0.0f;
|
||||
|
|
@ -944,6 +968,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
hb->add_child(scale);
|
||||
|
||||
effects = memnew(Tree);
|
||||
effects->set_accessibility_name(TTRC("Effects"));
|
||||
effects->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
effects->set_hide_root(true);
|
||||
effects->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
|
||||
|
|
@ -963,6 +988,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
effects->connect(SceneStringName(gui_input), callable_mp(this, &EditorAudioBus::_effects_gui_input));
|
||||
|
||||
send = memnew(OptionButton);
|
||||
send->set_accessibility_name(TTRC("Send"));
|
||||
send->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
||||
send->set_clip_text(true);
|
||||
send->connect(SceneStringName(item_selected), callable_mp(this, &EditorAudioBus::_send_selected));
|
||||
|
|
@ -974,8 +1000,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
effect_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); // Don't translate class names.
|
||||
effect_options->connect("index_pressed", callable_mp(this, &EditorAudioBus::_effect_add));
|
||||
add_child(effect_options);
|
||||
List<StringName> effect_list;
|
||||
ClassDB::get_inheriters_from_class("AudioEffect", &effect_list);
|
||||
LocalVector<StringName> effect_list;
|
||||
ClassDB::get_inheriters_from_class("AudioEffect", effect_list);
|
||||
effect_list.sort_custom<StringName::AlphCompare>();
|
||||
for (const StringName &E : effect_list) {
|
||||
if (!ClassDB::can_instantiate(E) || ClassDB::is_virtual(E)) {
|
||||
|
|
@ -992,6 +1018,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|||
bus_options->set_h_size_flags(SIZE_SHRINK_END);
|
||||
bus_options->set_anchor(SIDE_RIGHT, 0.0);
|
||||
bus_options->set_tooltip_text(TTR("Bus Options"));
|
||||
bus_options->set_accessibility_name(TTRC("Bus Options"));
|
||||
hbc->add_child(bus_options);
|
||||
|
||||
bus_popup = bus_options->get_popup();
|
||||
|
|
@ -1050,9 +1077,6 @@ void EditorAudioBusDrop::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("dropped"));
|
||||
}
|
||||
|
||||
EditorAudioBusDrop::EditorAudioBusDrop() {
|
||||
}
|
||||
|
||||
void EditorAudioBuses::_rebuild_buses() {
|
||||
for (int i = bus_hb->get_child_count() - 1; i >= 0; i--) {
|
||||
EditorAudioBus *audio_bus = Object::cast_to<EditorAudioBus>(bus_hb->get_child(i));
|
||||
|
|
@ -1118,9 +1142,8 @@ void EditorAudioBuses::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
AudioServer::get_singleton()->set_edited(false);
|
||||
|
||||
if (edited) {
|
||||
AudioServer::get_singleton()->set_edited(false);
|
||||
save_timer->start();
|
||||
}
|
||||
} break;
|
||||
|
|
@ -1409,9 +1432,6 @@ AudioBusesEditorPlugin::AudioBusesEditorPlugin(EditorAudioBuses *p_node) {
|
|||
audio_bus_editor = p_node;
|
||||
}
|
||||
|
||||
AudioBusesEditorPlugin::~AudioBusesEditorPlugin() {
|
||||
}
|
||||
|
||||
void EditorAudioMeterNotches::add_notch(float p_normalized_offset, float p_db_value, bool p_render_value) {
|
||||
notches.push_back(AudioNotch(p_normalized_offset, p_db_value, p_render_value));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue