From 0565100f2da0ed5407036002d116c1c99f3f1818 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 26 Jul 2018 05:51:43 -0400 Subject: [PATCH] fix pack size display for large bundles --- Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua | 2 +- .../Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua | 2 +- src/DownloadManager.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua b/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua index 372f681b61..69fb618b54 100644 --- a/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua @@ -207,7 +207,7 @@ local function makedoots(i) end, OnCommand=function(self) local bundle = DLMAN:GetCoreBundle(minidoots[i]:lower()) - self:settextf("(%dmb)", bundle["TotalSize"]) + self:settextf("(%dMB)", bundle["TotalSize"]) end, } } diff --git a/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua b/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua index 62afe4dd12..d40de371a5 100644 --- a/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua @@ -131,7 +131,7 @@ local function makedoots(i) end, OnCommand=function(self) local bundle = DLMAN:GetCoreBundle(minidoots[i]:lower()) - self:settextf("(%dmb)", bundle["TotalSize"]) + self:settextf("(%dMB)", bundle["TotalSize"]) end } } diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index 4bc3c7e3a4..0efa5c5c64 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -1704,13 +1704,12 @@ class LunaDownloadManager : public Luna float avgpackdiff = 0.f; for (auto p : bundle) { - totalsize += p->size; + totalsize += p->size / 1024 / 1024; avgpackdiff += p->avgDifficulty; } if(!bundle.empty()) avgpackdiff /= bundle.size(); - totalsize = totalsize / 1024 / 1024; // this may be kind of unintuitive but lets roll with it for now -mina lua_pushnumber(L, totalsize);