diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-08 08:12:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-08 08:12:47 +0200 |
commit | 17e9030e485e0b9147fa573d45ab71f606b3442b (patch) | |
tree | 350091fb16a85a9bec38876b1be70add275e530e /editor/import | |
parent | 6d4850b8b8debaee9a138b8e8c9120f00ffb8ad1 (diff) | |
parent | c9445632e111e6ee6cc435785ca7c4bd31a3621c (diff) |
Merge pull request #30413 from Calinou/wav-import-hide-max-rate-hz
Hide "Max Rate Hz" if "Max Rate" is unchecked when importing WAV sample
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 1787a3b88d..e728dbac31 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -62,6 +62,10 @@ String ResourceImporterWAV::get_resource_type() const { bool ResourceImporterWAV::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { + if (p_option == "force/max_rate_hz" && !bool(p_options["force/max_rate"])) { + return false; + } + return true; } @@ -77,7 +81,7 @@ void ResourceImporterWAV::get_import_options(List<ImportOption> *r_options, int r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/8_bit"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/mono"), false)); - r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/max_rate"), false)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force/max_rate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "force/max_rate_hz", PROPERTY_HINT_EXP_RANGE, "11025,192000,1"), 44100)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/trim"), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "edit/normalize"), true)); |