MCPcopy Create free account
hub / github.com/NetHack/NetHack / RecoverMenuEvent

Function RecoverMenuEvent

outdated/sys/mac/mrecover.c:683–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683static void
684RecoverMenuEvent(long menuEntry)
685{
686 short menuID = HiWord(menuEntry);
687 short menuItem = LoWord(menuEntry);
688
689 switch (menuID) {
690 case muidApple:
691 switch (menuItem) {
692 case mitmAbout:
693 if (wnEvt.modifiers & optionKey)
694 optionMemStats();
695 /* fall thru */
696 case mitmHelp:
697 note(noErr, (alertAppleMenu + menuItem), aboutBuf);
698 break;
699
700 default: /* DA's or apple menu items */
701 {
702 unsigned char daName[32];
703
704 GetItem(mHnd[menuApple], menuItem, *(Str255 *) &daName);
705 (void) OpenDeskAcc(daName);
706
707 memActivity++;
708 } break;
709 }
710 break;
711
712 case muidFile:
713 switch (menuItem) {
714 case mitmOpen:
715 beginRecover();
716 break;
717
718 case mitmClose_DA: {
719 WindowPeek frontWindow;
720 short refNum;
721
722 if (frontWindow = (WindowPeek) FrontWindow())
723 if ((refNum = frontWindow->windowKind) < 0)
724 CloseDeskAcc(refNum);
725
726 memActivity++;
727 } break;
728
729 case mitmQuit:
730 cooldown();
731 break;
732 }
733 break;
734
735 case muidEdit:
736 (void) SystemEdit(menuItem - 1);
737 break;
738 }
739
740 HiliteMenu(0);

Callers 1

eventLoopFunction · 0.85

Calls 4

optionMemStatsFunction · 0.85
noteFunction · 0.85
beginRecoverFunction · 0.85
cooldownFunction · 0.85

Tested by

no test coverage detected