Demo map length in MiB and KiB instead of B

This commit is contained in:
def 2014-07-08 20:35:27 +02:00
parent 15ff17d8f8
commit cf89fcd7a6

View file

@ -613,7 +613,10 @@ void CMenus::RenderDemoList(CUIRect MainView)
UI()->DoLabelScaled(&Left, Localize("Size:"), 14.0f, -1);
unsigned Size = (m_lDemos[m_DemolistSelectedIndex].m_Info.m_aMapSize[0]<<24) | (m_lDemos[m_DemolistSelectedIndex].m_Info.m_aMapSize[1]<<16) |
(m_lDemos[m_DemolistSelectedIndex].m_Info.m_aMapSize[2]<<8) | (m_lDemos[m_DemolistSelectedIndex].m_Info.m_aMapSize[3]);
str_format(aBuf, sizeof(aBuf), Localize("%d Bytes"), Size);
if(Size > 1024*1024)
str_format(aBuf, sizeof(aBuf), Localize("%.2f MiB"), float(Size)/(1024*1024));
else
str_format(aBuf, sizeof(aBuf), Localize("%.2f KiB"), float(Size)/1024);
UI()->DoLabelScaled(&Right, aBuf, 14.0f, -1);
Labels.HSplitTop(5.0f, 0, &Labels);
Labels.HSplitTop(20.0f, &Left, &Labels);