mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
Fixed a bug with callback-calling in Menu_KeyEvent
This commit is contained in:
parent
cf2f42ea6a
commit
60e99d724b
1 changed files with 8 additions and 5 deletions
|
@ -459,6 +459,8 @@ Menu_Draw (void)
|
||||||
void
|
void
|
||||||
Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
||||||
{
|
{
|
||||||
|
menu_item_t *item;
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
if (menu->keyevent) {
|
if (menu->keyevent) {
|
||||||
|
@ -470,10 +472,11 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
||||||
return;
|
return;
|
||||||
} else if (menu->items && menu->items[menu->cur_item]->func
|
} else if (menu->items && menu->items[menu->cur_item]->func
|
||||||
&& menu->items[menu->cur_item]->allkeys) {
|
&& menu->items[menu->cur_item]->allkeys) {
|
||||||
G_INT (&menu_pr_state, OFS_PARM0) = key;
|
item = menu->items[menu->cur_item];
|
||||||
G_INT (&menu_pr_state, OFS_PARM1) = unicode;
|
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||||
G_INT (&menu_pr_state, OFS_PARM2) = down;
|
PR_SetString (&menu_pr_state, item->text);
|
||||||
PR_ExecuteProgram (&menu_pr_state, menu->items[menu->cur_item]->func);
|
G_INT (&menu_pr_state, OFS_PARM1) = key;
|
||||||
|
PR_ExecuteProgram (&menu_pr_state, item->func);
|
||||||
if (G_INT (&menu_pr_state, OFS_RETURN))
|
if (G_INT (&menu_pr_state, OFS_RETURN))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +496,7 @@ Menu_KeyEvent (knum_t key, short unicode, qboolean down)
|
||||||
case QFK_RETURN:
|
case QFK_RETURN:
|
||||||
case QFM_BUTTON1:
|
case QFM_BUTTON1:
|
||||||
{
|
{
|
||||||
menu_item_t *item = menu->items[menu->cur_item];
|
item = menu->items[menu->cur_item];
|
||||||
if (item->func) {
|
if (item->func) {
|
||||||
G_INT (&menu_pr_state, OFS_PARM0) =
|
G_INT (&menu_pr_state, OFS_PARM0) =
|
||||||
PR_SetString (&menu_pr_state, item->text);
|
PR_SetString (&menu_pr_state, item->text);
|
||||||
|
|
Loading…
Reference in a new issue