static VOID PAL_InventoryMenu( VOID ) /*++ Purpose: Show the inventory menu. Parameters: None. Return value: None. --*/ { static WORD w = 0; const SDL_Rect rect = {30, 60, 75, 60}; MENUITEM rgMenuItem[2] = { // value label enabled pos { 1, INVMENU_LABEL_USE, TRUE, PAL_XY(43, 73) }, { 2, INVMENU_LABEL_EQUIP, TRUE, PAL_XY(43, 73 + 18) }, }; PAL_CreateBox(PAL_XY(30, 60), 1, 1, 0, FALSE); VIDEO_UpdateScreen(&rect); w = PAL_ReadMenu(NULL, rgMenuItem, 2, w - 1, MENUITEM_COLOR); switch (w) { case 1: PAL_GameUseItem(); break; case 2: PAL_GameEquipItem(); break; } }
VOID PAL_StartFrame( VOID ) /*++ Purpose: Starts a video frame. Called once per video frame. Parameters: None. Return value: None. --*/ { // // Run the game logic of one frame // PAL_GameUpdate(TRUE); if (gpGlobals->fEnteringScene) { return; } // // Update the positions and gestures of party members // PAL_UpdateParty(); // // Update the scene // PAL_MakeScene(); VIDEO_UpdateScreen(NULL); if (g_InputState.dwKeyPress & kKeyMenu) { // // Show the in-game menu // PAL_InGameMenu(); } else if (g_InputState.dwKeyPress & kKeyUseItem) { // // Show the use item menu // PAL_GameUseItem(); } else if (g_InputState.dwKeyPress & kKeyThrowItem) { // // Show the equipment menu // PAL_GameEquipItem(); } else if (g_InputState.dwKeyPress & kKeyForce) { // // Show the magic menu // PAL_InGameMagicMenu(); } else if (g_InputState.dwKeyPress & kKeyStatus) { // // Show the player status // PAL_PlayerStatus(); } else if (g_InputState.dwKeyPress & kKeySearch) { // // Process search events // PAL_Search(); } else if (g_InputState.dwKeyPress & kKeyFlee) { // // Quit Game // if (PAL_ConfirmMenu()) { PAL_PlayMUS(0, FALSE, 2); PAL_FadeOut(2); PAL_Shutdown(); exit(0); } } if (--gpGlobals->wChasespeedChangeCycles == 0) { gpGlobals->wChaseRange = 1; } }