summaryrefslogtreecommitdiff
path: root/editor/editor_audio_buses.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_audio_buses.cpp')
-rw-r--r--editor/editor_audio_buses.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index b331a39535..3f773c646a 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 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 */
@@ -34,6 +34,7 @@
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "editor_node.h"
+#include "editor_scale.h"
#include "filesystem_dock.h"
#include "scene/resources/font.h"
#include "servers/audio_server.h"
@@ -1248,7 +1249,7 @@ void EditorAudioBuses::_load_default_layout() {
String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout");
- Ref<AudioBusLayout> state = ResourceLoader::load(layout_path);
+ Ref<AudioBusLayout> state = ResourceLoader::load(layout_path, "", true);
if (state.is_null()) {
EditorNode::get_singleton()->show_warning(vformat(TTR("There is no '%s' file."), layout_path));
return;
@@ -1265,7 +1266,7 @@ void EditorAudioBuses::_load_default_layout() {
void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
if (file_dialog->get_mode() == EditorFileDialog::MODE_OPEN_FILE) {
- Ref<AudioBusLayout> state = ResourceLoader::load(p_string);
+ Ref<AudioBusLayout> state = ResourceLoader::load(p_string, "", true);
if (state.is_null()) {
EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout."));
return;
@@ -1289,7 +1290,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
Error err = ResourceSaver::save(p_string, AudioServer::get_singleton()->generate_bus_layout());
if (err != OK) {
- EditorNode::get_singleton()->show_warning("Error saving file: " + p_string);
+ EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving file: %s"), p_string));
return;
}
@@ -1329,7 +1330,8 @@ EditorAudioBuses::EditorAudioBuses() {
add_child(top_hb);
file = memnew(Label);
- file->set_text(String(TTR("Layout")) + ": " + "default_bus_layout.tres");
+ String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout");
+ file->set_text(String(TTR("Layout")) + ": " + layout_path.get_file());
file->set_clip_text(true);
file->set_h_size_flags(SIZE_EXPAND_FILL);
top_hb->add_child(file);
@@ -1402,7 +1404,7 @@ void EditorAudioBuses::open_layout(const String &p_path) {
EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
- Ref<AudioBusLayout> state = ResourceLoader::load(p_path);
+ Ref<AudioBusLayout> state = ResourceLoader::load(p_path, "", true);
if (state.is_null()) {
EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout."));
return;