Made possible to specify where to dump the contents when loading a ".pck" file

(cherry picked from commit 3c261e0dfa)
This commit is contained in:
Michael Alexsander
2020-01-17 22:26:44 -03:00
committed by Rémi Verschelde
parent 008e0748c1
commit ffcfd9c8ea
7 changed files with 55 additions and 15 deletions

View File

@ -268,12 +268,12 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
}
}
bool ProjectSettings::_load_resource_pack(const String &p_pack, bool p_replace_files) {
bool ProjectSettings::_load_resource_pack(const String &p_pack, bool p_replace_files, const String &p_destination) {
if (PackedData::get_singleton()->is_disabled())
return false;
bool ok = PackedData::get_singleton()->add_pack(p_pack, p_replace_files) == OK;
bool ok = PackedData::get_singleton()->add_pack(p_pack, p_replace_files, p_destination) == OK;
if (!ok)
return false;
@ -990,7 +990,7 @@ void ProjectSettings::_bind_methods() {
ClassDB::bind_method(D_METHOD("localize_path", "path"), &ProjectSettings::localize_path);
ClassDB::bind_method(D_METHOD("globalize_path", "path"), &ProjectSettings::globalize_path);
ClassDB::bind_method(D_METHOD("save"), &ProjectSettings::save);
ClassDB::bind_method(D_METHOD("load_resource_pack", "pack", "replace_files"), &ProjectSettings::_load_resource_pack, DEFVAL(true));
ClassDB::bind_method(D_METHOD("load_resource_pack", "pack", "replace_files", "destination"), &ProjectSettings::_load_resource_pack, DEFVAL(true), DEFVAL(""));
ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &ProjectSettings::property_can_revert);
ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &ProjectSettings::property_get_revert);