Add menu pagination callback (#420)

* Add menu pagination callback

* Update test plugin
This commit is contained in:
KliPPy
2017-04-04 10:29:18 +02:00
committed by Vincent Herbet
parent ff488dd81f
commit 2863455185
6 changed files with 112 additions and 1 deletions

View File

@ -1113,8 +1113,14 @@ void C_ClientCommand(edict_t *pEntity)
int item = pMenu->PagekeyToItem(pPlayer->page, pressed_key+1);
if (item == MENU_BACK)
{
if (pMenu->pageCallback >= 0)
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_BACK));
pMenu->Display(pPlayer->index, pPlayer->page - 1);
} else if (item == MENU_MORE) {
if (pMenu->pageCallback >= 0)
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_MORE));
pMenu->Display(pPlayer->index, pPlayer->page + 1);
} else {
ret = executeForwards(pMenu->func, static_cast<cell>(pPlayer->index), static_cast<cell>(menu), static_cast<cell>(item));