You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Add flag to control the replacement of files by ProjectSettings.load_resource_pack
This commit is contained in:
@@ -160,7 +160,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
|
||||
return pkg;
|
||||
}
|
||||
|
||||
bool ZipArchive::try_open_pack(const String &p_path) {
|
||||
bool ZipArchive::try_open_pack(const String &p_path, bool p_replace_files) {
|
||||
|
||||
//printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz"));
|
||||
if (p_path.get_extension().nocasecmp_to("zip") != 0 && p_path.get_extension().nocasecmp_to("pcz") != 0)
|
||||
@@ -210,7 +210,7 @@ bool ZipArchive::try_open_pack(const String &p_path) {
|
||||
files[fname] = f;
|
||||
|
||||
uint8_t md5[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
PackedData::get_singleton()->add_path(p_path, fname, 1, 0, md5, this);
|
||||
PackedData::get_singleton()->add_path(p_path, fname, 1, 0, md5, this, p_replace_files);
|
||||
//printf("packed data add path %ls, %ls\n", p_name.c_str(), fname.c_str());
|
||||
|
||||
if ((i + 1) < gi.number_entry) {
|
||||
|
||||
Reference in New Issue
Block a user