Browse Source

fix #53: sync shadow of itemselect dialog as original version, and move current item pointer when last used up

Pal Lockheart 6 years ago
parent
commit
2fab10a884
2 changed files with 6 additions and 1 deletions
  1. 5 0
      global.c
  2. 1 1
      itemmenu.c

+ 5 - 0
global.c

@@ -1031,6 +1031,11 @@ PAL_AddItemToInventory(
          }
 
          gpGlobals->rgInventory[index].nAmount -= iNum;
+         //
+         /// Need process last item
+         //
+         if(gpGlobals->rgInventory[index].nAmount == 0 && index == gpGlobals->iCurInvMenuItem)
+            gpGlobals->iCurInvMenuItem --;
          return TRUE;
       }
 

+ 1 - 1
itemmenu.c

@@ -112,7 +112,7 @@ PAL_ItemSelectMenuUpdate(
    //
    // Redraw the box
    //
-   PAL_CreateBox(PAL_XY(2, 0), iLinesPerPage - 1, 17, 1, FALSE);
+   PAL_CreateBoxWithShadow(PAL_XY(2, 0), iLinesPerPage - 1, 17, 1, FALSE, 0);
 
    //
    // Draw the texts in the current page