From ff2fc19b086d801fec3ae01e06ef713988f34e42 Mon Sep 17 00:00:00 2001 From: shel <9306996+afwn90cj93201nixr2e1re@users.noreply.github.com> Date: Fri, 17 Jul 2020 03:57:29 +0400 Subject: [PATCH] Update newmenus.cpp (#884) Fixes: #881 Co-authored-by: shel <2@shelru.ru> --- amxmodx/newmenus.cpp | 80 +++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index 6f2e0c24..216602fb 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -418,27 +418,27 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) { flags &= ~Display_Back; } - + menuitem *pItem = NULL; - + int option = 0; keys = 0; bool enabled = true; int ret = 0; int slots = 0; int option_display = 0; - + for (item_t i = start; i < end; i++) { // reset enabled enabled = true; pItem = m_Items[i]; - + if (pItem->access && !(pItem->access & g_players[player].flags[0])) { enabled = false; } - + if (pItem->handler != -1) { ret = executeForwards(pItem->handler, static_cast(player), static_cast(thisId), static_cast(i)); @@ -470,7 +470,7 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) { keys |= (1< 1) { + + auto tempItemName = m_OptNames[abs(MENU_BACK)].chars(); + + if (this->useMultilingual) + { + const auto language = playerlang(player); + const auto definition = translate(this->amx, language, tempItemName); + + if (definition) + { + tempItemName = definition; + } + } + if (flags & Display_Back) { keys |= (1<useMultilingual) + { + const auto language = playerlang(player); + const auto definition = translate(this->amx, language, tempItemName); + + if (definition) + { + tempItemName = definition; + } + } + if (flags & Display_Next) { keys |= (1<useMultilingual) + { + const auto language = playerlang(player); + const auto definition = translate(this->amx, language, exitName); + + if (definition) + { + exitName = definition; + } + } + /* Visual pad has not been added yet */ if (!items_per_page) m_Text = m_Text + "\n"; - + keys |= (1<