mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Demo map length in MiB and KiB instead of B
This commit is contained in:
parent
15ff17d8f8
commit
cf89fcd7a6
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue