Archive compression (#1018)

This commit is contained in:
Turánszki János
2025-01-14 12:57:40 +01:00
committed by GitHub
parent 602117b712
commit 73433bf842
20 changed files with 257 additions and 80 deletions
+4 -2
View File
@@ -370,7 +370,6 @@ void ContentBrowserWindow::AddItem(const std::string& filename, const std::strin
button.SetSize(siz);
button.SetLocalizationEnabled(false);
button.SetDescription(itemname);
button.SetTooltip(filename);
button.OnClick([this, filename](wi::gui::EventArgs args) {
wi::eventhandler::Subscribe_Once(wi::eventhandler::EVENT_THREAD_SAFE_POINT, [=](uint64_t userdata) {
editor->Open(filename);
@@ -380,9 +379,11 @@ void ContentBrowserWindow::AddItem(const std::string& filename, const std::strin
button.font_description.params.h_align = wi::font::WIFALIGN_CENTER;
button.font_description.params.v_align = wi::font::WIFALIGN_TOP;
button.font.params.size = 42;
button.SetTooltip(filename + "\nSize: " + wi::helper::GetMemorySizeText(wi::helper::FileSize(filename)));
if (ext.compare("WISCENE") == 0)
{
wi::graphics::Texture archiveThumbnail = wi::Archive::PeekThumbnail(filename);
wi::Archive::Header archive_header;
wi::graphics::Texture archiveThumbnail = wi::Archive::PeekThumbnail(filename, &archive_header);
if (archiveThumbnail.IsValid())
{
for (int i = 0; i < arraysize(sprites); ++i)
@@ -391,6 +392,7 @@ void ContentBrowserWindow::AddItem(const std::string& filename, const std::strin
}
button.SetText("");
}
button.SetTooltip(button.GetTooltip() + "\nVersion: " + std::to_string(archive_header.version) + (archive_header.properties.bits.compressed ? "\nCompressed : true" : "\nCompressed : false"));
}
else
{