Hide "Max Rate Hz" if "Max Rate" is unchecked when importing WAV sample

This commit is contained in:
Hugo Locurcio 2019-07-07 18:53:21 +02:00
parent 06a4212377
commit c9445632e1
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C

View File

@ -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));