mirror of
https://github.com/geode-sdk/geode.git
synced 2024-12-03 12:46:51 -05:00
Fix unzip modify date & add verifying text
This commit is contained in:
parent
5c765c6798
commit
0ed1a41426
2 changed files with 21 additions and 15 deletions
|
@ -70,20 +70,24 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
|||
}
|
||||
|
||||
void setupLoaderResources() {
|
||||
log::debug("Verifying Loader Resources");
|
||||
this->setSmallText("Verifying Loader Resources");
|
||||
// verify loader resources
|
||||
if (!LoaderImpl::get()->verifyLoaderResources()) {
|
||||
log::debug("Downloading Loader Resources");
|
||||
this->setSmallText("Downloading Loader Resources");
|
||||
this->addChild(EventListenerNode<ResourceDownloadFilter>::create(
|
||||
this, &CustomLoadingLayer::updateResourcesProgress
|
||||
));
|
||||
}
|
||||
else {
|
||||
log::debug("Loading Loader Resources");
|
||||
this->setSmallText("Loading Loader Resources");
|
||||
LoaderImpl::get()->updateSpecialFiles();
|
||||
this->continueLoadAssets();
|
||||
}
|
||||
Loader::get()->queueInMainThread([&]() {
|
||||
if (!LoaderImpl::get()->verifyLoaderResources()) {
|
||||
log::debug("Downloading Loader Resources");
|
||||
this->setSmallText("Downloading Loader Resources");
|
||||
this->addChild(EventListenerNode<ResourceDownloadFilter>::create(
|
||||
this, &CustomLoadingLayer::updateResourcesProgress
|
||||
));
|
||||
}
|
||||
else {
|
||||
log::debug("Loading Loader Resources");
|
||||
this->setSmallText("Loading Loader Resources");
|
||||
LoaderImpl::get()->updateSpecialFiles();
|
||||
this->continueLoadAssets();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void updateResourcesProgress(ResourceDownloadEvent* event) {
|
||||
|
|
|
@ -597,11 +597,13 @@ Result<> Mod::Impl::unzipGeodeFile(ModMetadata metadata) {
|
|||
return Err("Unable to delete temp dir: " + ec.message());
|
||||
}
|
||||
|
||||
(void)utils::file::createDirectoryAll(tempDir);
|
||||
auto res = file::writeString(datePath, modifiedHash);
|
||||
if (!res) {
|
||||
log::warn("Failed to write modified date of geode zip");
|
||||
log::warn("Failed to write modified date of geode zip: {}", res.unwrapErr());
|
||||
}
|
||||
|
||||
|
||||
GEODE_UNWRAP_INTO(auto unzip, file::Unzip::create(metadata.getPath()));
|
||||
if (!unzip.hasEntry(metadata.getBinaryName())) {
|
||||
return Err(
|
||||
|
|
Loading…
Reference in a new issue