Pass menu ID in MPROP_PAGE_CALLBACK function (#885)
Co-authored-by: shel <2@shelru.ru>
This commit is contained in:
parent
ff2fc19b08
commit
2e3c105c7d
@ -1145,12 +1145,12 @@ void C_ClientCommand(edict_t *pEntity)
|
||||
if (item == MENU_BACK)
|
||||
{
|
||||
if (pMenu->pageCallback >= 0)
|
||||
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_BACK));
|
||||
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_BACK), static_cast<cell>(menu));
|
||||
|
||||
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));
|
||||
executeForwards(pMenu->pageCallback, static_cast<cell>(pPlayer->index), static_cast<cell>(MENU_MORE), static_cast<cell>(menu));
|
||||
|
||||
pMenu->Display(pPlayer->index, pPlayer->page + 1);
|
||||
} else {
|
||||
|
@ -1083,7 +1083,7 @@ static cell AMX_NATIVE_CALL menu_setprop(AMX *amx, cell *params)
|
||||
break;
|
||||
}
|
||||
|
||||
int callback = registerSPForwardByName(amx, str, FP_CELL, FP_CELL, FP_DONE);
|
||||
int callback = registerSPForwardByName(amx, str, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
||||
if (callback < 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Function %s not present", str);
|
||||
|
@ -76,7 +76,7 @@
|
||||
|
||||
/**
|
||||
* Function to be called on Back and Next (param1 = string)
|
||||
* public function(id, status); where status is either MENU_BACK or MENU_MORE
|
||||
* public function(id, status, menu); where status is either MENU_BACK or MENU_MORE
|
||||
* Pass NULL_STRING to disable the callback
|
||||
*/
|
||||
#define MPROP_PAGE_CALLBACK 11
|
||||
|
Loading…
Reference in New Issue
Block a user