From 8bbfd5b68a289ddf933f78d369606f1f22dd91c6 Mon Sep 17 00:00:00 2001 From: James Haley Date: Wed, 22 Sep 2010 08:07:35 +0000 Subject: Rewrote P_GiveItemToPlayer to exactly match binary, particularly with treatment of SPR_TOKN objects, and playing proper sounds for different item types. Fixed most S_StartSound calls in the menu engine. Removed call to S_StopSound in S_StartSound, as Strife doesn't do it. Added call to P_DialogDoChoice(-1) in M_Responder when menuindialog is asserted and the menu exit key is pressed. Subversion-branch: /branches/strife-branch Subversion-revision: 2130 --- src/strife/m_menu.c | 59 ++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 28 deletions(-) (limited to 'src/strife/m_menu.c') diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c index 62a56ab2..74700c9f 100644 --- a/src/strife/m_menu.c +++ b/src/strife/m_menu.c @@ -64,6 +64,7 @@ #include "sounds.h" #include "m_menu.h" +#include "p_dialog.h" extern void M_QuitStrife(int); @@ -691,8 +692,8 @@ void M_QuickSaveResponse(int key) { if (key == key_menu_confirm) { - M_DoSave(quickSaveSlot); - S_StartSound(NULL,sfx_swish); // villsa [STRIFE] TODO - fix sounds + M_DoSave(quickSaveSlot); + S_StartSound(NULL, sfx_mtalht); // [STRIFE] sound } } @@ -700,7 +701,7 @@ void M_QuickSave(void) { if (!usergame) { - S_StartSound(NULL,sfx_oof); + S_StartSound(NULL, sfx_oof); return; } @@ -728,8 +729,8 @@ void M_QuickLoadResponse(int key) { if (key == key_menu_confirm) { - M_LoadSelect(quickSaveSlot); - S_StartSound(NULL,sfx_swish); // villsa [STRIFE] TODO - fix sounds + M_LoadSelect(quickSaveSlot); + S_StartSound(NULL, sfx_mtalht); // [STRIFE] sound } } @@ -1685,7 +1686,7 @@ boolean M_Responder (event_t* ev) messageRoutine(key); menuactive = false; - S_StartSound(NULL,sfx_swish); // villsa [STRIFE] TODO - fix sounds + S_StartSound(NULL, sfx_mtalht); // [STRIFE] sound return true; } @@ -1703,7 +1704,7 @@ boolean M_Responder (event_t* ev) if (automapactive || chat_on) return false; M_SizeDisplay(0); - S_StartSound(NULL,sfx_stnmov); + S_StartSound(NULL, sfx_stnmov); return true; } else if (key == key_menu_incscreen) // Screen size up @@ -1711,7 +1712,7 @@ boolean M_Responder (event_t* ev) if (automapactive || chat_on) return false; M_SizeDisplay(1); - S_StartSound(NULL,sfx_stnmov); + S_StartSound(NULL, sfx_stnmov); return true; } else if (key == key_menu_help) // Help key @@ -1721,20 +1722,20 @@ boolean M_Responder (event_t* ev) currentMenu = &ReadDef1; itemOn = 0; - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); return true; } else if (key == key_menu_save) // Save { M_StartControlPanel(); - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_SaveGame(0); return true; } else if (key == key_menu_load) // Load { M_StartControlPanel(); - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_LoadGame(0); return true; } @@ -1743,7 +1744,7 @@ boolean M_Responder (event_t* ev) M_StartControlPanel (); currentMenu = &SoundDef; itemOn = sfx_vol; - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); return true; } /* @@ -1756,31 +1757,31 @@ boolean M_Responder (event_t* ev) */ else if (key == key_menu_qsave) // Quicksave { - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_QuickSave(); return true; } else if (key == key_menu_endgame) // End game { - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_EndGame(0); return true; } else if (key == key_menu_messages) // Toggle messages { M_ChangeMessages(0); - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); return true; } else if (key == key_menu_qload) // Quickload { - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_QuickLoad(); return true; } else if (key == key_menu_quit) // Quit DOOM { - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); M_QuitStrife(0); return true; } @@ -1801,7 +1802,7 @@ boolean M_Responder (event_t* ev) if (key == key_menu_activate) { M_StartControlPanel (); - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); return true; } return false; @@ -1819,7 +1820,7 @@ boolean M_Responder (event_t* ev) if (itemOn+1 > currentMenu->numitems-1) itemOn = 0; else itemOn++; - S_StartSound(NULL,sfx_pstop); + S_StartSound(NULL, sfx_pstop); } while(currentMenu->menuitems[itemOn].status==-1); return true; @@ -1833,7 +1834,7 @@ boolean M_Responder (event_t* ev) if (!itemOn) itemOn = currentMenu->numitems-1; else itemOn--; - S_StartSound(NULL,sfx_pstop); + S_StartSound(NULL, sfx_pstop); } while(currentMenu->menuitems[itemOn].status==-1); return true; @@ -1845,7 +1846,7 @@ boolean M_Responder (event_t* ev) if (currentMenu->menuitems[itemOn].routine && currentMenu->menuitems[itemOn].status == 2) { - S_StartSound(NULL,sfx_stnmov); + S_StartSound(NULL, sfx_stnmov); currentMenu->menuitems[itemOn].routine(0); } return true; @@ -1857,7 +1858,7 @@ boolean M_Responder (event_t* ev) if (currentMenu->menuitems[itemOn].routine && currentMenu->menuitems[itemOn].status == 2) { - S_StartSound(NULL,sfx_stnmov); + S_StartSound(NULL, sfx_stnmov); currentMenu->menuitems[itemOn].routine(1); } return true; @@ -1873,12 +1874,12 @@ boolean M_Responder (event_t* ev) if (currentMenu->menuitems[itemOn].status == 2) { currentMenu->menuitems[itemOn].routine(1); // right arrow - S_StartSound(NULL,sfx_stnmov); + S_StartSound(NULL, sfx_stnmov); } else { currentMenu->menuitems[itemOn].routine(itemOn); - S_StartSound(NULL,sfx_swish); // villsa [STRIFE] TODO - fix sounds + //S_StartSound(NULL, sfx_swish); [STRIFE] No sound is played here. } } return true; @@ -1886,10 +1887,12 @@ boolean M_Responder (event_t* ev) else if (key == key_menu_activate) { // Deactivate menu + if(menuindialog) // [STRIFE] - Get out of dialog engine semi-gracefully + P_DialogDoChoice(-1); currentMenu->lastOn = itemOn; M_ClearMenus (0); - S_StartSound(NULL,sfx_swish); // villsa [STRIFE] TODO - fix sounds + S_StartSound(NULL, sfx_mtalht); // villsa [STRIFE] TODO - fix sounds return true; } else if (key == key_menu_back) @@ -1901,7 +1904,7 @@ boolean M_Responder (event_t* ev) { currentMenu = currentMenu->prevMenu; itemOn = currentMenu->lastOn; - S_StartSound(NULL,sfx_swtchn); + S_StartSound(NULL, sfx_swtchn); } return true; } @@ -1914,7 +1917,7 @@ boolean M_Responder (event_t* ev) if (currentMenu->menuitems[i].alphaKey == ch) { itemOn = i; - S_StartSound(NULL,sfx_pstop); + S_StartSound(NULL, sfx_pstop); return true; } } @@ -1924,7 +1927,7 @@ boolean M_Responder (event_t* ev) if (currentMenu->menuitems[i].alphaKey == ch) { itemOn = i; - S_StartSound(NULL,sfx_pstop); + S_StartSound(NULL, sfx_pstop); return true; } } -- cgit v1.2.3