added never display exit option to newmenus

This commit is contained in:
David Anderson 2006-02-06 13:22:33 +00:00
parent 53c029471f
commit 506a6e0465
2 changed files with 16 additions and 3 deletions

View File

@ -84,6 +84,7 @@ Menu::Menu(const char *title, int mid, int tid)
m_OptOrders[2] = MENU_EXIT; m_OptOrders[2] = MENU_EXIT;
m_AlwaysExit = false; m_AlwaysExit = false;
m_NeverExit = false;
m_AutoColors = g_coloredmenus; m_AutoColors = g_coloredmenus;
items_per_page = 7; items_per_page = 7;
@ -238,7 +239,7 @@ const char *Menu::GetTextString(int player, page_t page, int &keys)
} else { } else {
end = start + items_per_page - 1; end = start + items_per_page - 1;
} }
if (m_AlwaysExit || (page == 0 || page == pages-1)) if (!m_NeverExit && (m_AlwaysExit || (page == 0 || page == pages-1)))
flags |= Display_Exit; flags |= Display_Exit;
} else { } else {
end = numItems - 1; end = numItems - 1;
@ -617,7 +618,18 @@ static cell AMX_NATIVE_CALL menu_setprop(AMX *amx, cell *params)
} }
case MPROP_EXITALL: case MPROP_EXITALL:
{ {
pMenu->m_AlwaysExit = *get_amxaddr(amx, params[3]) ? true : false; cell ans = *get_amxaddr(amx, params[3]);
if (ans == 1)
{
pMenu->m_AlwaysExit = true;
pMenu->m_NeverExit = false;
} else if (ans == 0) {
pMenu->m_AlwaysExit = false;
pMenu->m_NeverExit = false;
} else if (ans == -1) {
pMenu->m_NeverExit = true;
pMenu->m_AlwaysExit = false;
}
break; break;
} }
case MPROP_ORDER: case MPROP_ORDER:

View File

@ -93,6 +93,7 @@ public:
int m_OptOrders[3]; int m_OptOrders[3];
bool m_AlwaysExit; bool m_AlwaysExit;
bool m_NeverExit;
bool m_AutoColors; bool m_AutoColors;
int menuId; int menuId;