mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-01-26 13:48:03 +03:00
added never display exit option to newmenus
This commit is contained in:
parent
53c029471f
commit
506a6e0465
@ -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:
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user