Archive compression (#1018)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user