From: Pasi Kallinen Date: Mon, 11 Apr 2022 11:54:12 +0000 (+0300) Subject: Add spell casting to mouse menu X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=503b85b1cfc924cd29bd4dff685a4f7781f17338;p=nethack Add spell casting to mouse menu --- diff --git a/src/cmd.c b/src/cmd.c index 2762f5883..75593ef71 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -4515,6 +4515,7 @@ enum menucmd { MCMD_UNTRAP_HERE, MCMD_OFFER, MCMD_INVENTORY, + MCMD_CAST_SPELL, MCMD_THROW_OBJ, MCMD_TRAVEL, @@ -4606,6 +4607,9 @@ there_cmd_menu_self(winid win, int x, int y, int *act UNUSED) mcmd_addmenu(win, MCMD_SEARCH, "Search around you"), ++K; mcmd_addmenu(win, MCMD_LOOK_HERE, "Look at what is here"), ++K; + if (num_spells() > 0) + mcmd_addmenu(win, MCMD_CAST_SPELL, "Cast a spell"), ++K; + if ((ttmp = t_at(x, y)) != 0 && ttmp->tseen) { if (ttmp->ttyp != VIBRATING_SQUARE) mcmd_addmenu(win, MCMD_UNTRAP_HERE, @@ -4924,6 +4928,9 @@ there_cmd_menu(int x, int y, int mod) cmdq_add_ec(dosacrifice); cmdq_add_userinput(); break; + case MCMD_CAST_SPELL: + cmdq_add_ec(docast); + break; default: break; } return '\0';