From 89c58265aa061e891c62df6d1f18f11cfc07c823 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 29 Mar 2006 22:48:45 +0000 Subject: [PATCH] page numbering does not appear with no pages --- amxmodx/newmenus.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index 4aa8e4e3..6faf1dbf 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -221,10 +221,18 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) m_Text.clear(); char buffer[255]; - if (m_AutoColors) - _snprintf(buffer, sizeof(buffer)-1, "\\y%s %d/%d\n\\w\n", m_Title.c_str(), page + 1, pages); - else - _snprintf(buffer, sizeof(buffer)-1, "%s %d/%d\n\n", m_Title.c_str(), page + 1, pages); + if (items_per_page && (pages != 1)) + { + if (m_AutoColors) + _snprintf(buffer, sizeof(buffer)-1, "\\y%s %d/%d\n\\w\n", m_Title.c_str(), page + 1, pages); + else + _snprintf(buffer, sizeof(buffer)-1, "%s %d/%d\n\n", m_Title.c_str(), page + 1, pages); + } else { + if (m_AutoColors) + _snprintf(buffer, sizeof(buffer)-1, "\\y%s\n\\w\n", m_Title.c_str()); + else + _snprintf(buffer, sizeof(buffer)-1, "%s\n\n", m_Title.c_str()); + } m_Text.append(buffer);