make the load/save statusbar a bit more informative

This commit is contained in:
svdijk 2013-05-08 20:01:44 +02:00
parent 9803652781
commit 1c431e14ac

View file

@ -2224,6 +2224,9 @@ Create_Savestrings(void)
static void static void
LoadSave_AdjustPage(int dir) LoadSave_AdjustPage(int dir)
{ {
int i;
char *str;
m_loadsave_page += dir; m_loadsave_page += dir;
if (m_loadsave_page >= MAX_SAVEPAGES) if (m_loadsave_page >= MAX_SAVEPAGES)
@ -2235,8 +2238,23 @@ LoadSave_AdjustPage(int dir)
m_loadsave_page = MAX_SAVEPAGES - 1; m_loadsave_page = MAX_SAVEPAGES - 1;
} }
Com_sprintf(m_loadsave_statusbar, sizeof(m_loadsave_statusbar), strcpy(m_loadsave_statusbar, "pages: ");
"page %d/%d", m_loadsave_page + 1, MAX_SAVEPAGES);
for (i = 0; i < MAX_SAVEPAGES; i++)
{
str = va("%c%d%c",
i == m_loadsave_page ? '[' : ' ',
i + 1,
i == m_loadsave_page ? ']' : ' ');
if (strlen(m_loadsave_statusbar) + strlen(str) >=
sizeof(m_loadsave_statusbar))
{
break;
}
strcat(m_loadsave_statusbar, str);
}
} }
static void static void