Browse Source

Change: Customization for status screen.

louyihua 8 years ago
parent
commit
8b01585662
9 changed files with 328 additions and 229 deletions
  1. 14 3
      global.c
  2. 39 15
      global.h
  3. 99 17
      makemessage.py
  4. 17 41
      text.c
  5. 0 4
      text.h
  6. 2 2
      ui.c
  7. 15 14
      ui.h
  8. 1 1
      uibattle.c
  9. 141 132
      uigame.c

+ 14 - 3
global.c

@@ -89,12 +89,23 @@ PAL_InitGlobals(
    MUSICTYPE eMusicType = MUSIC_RIX;
    MUSICTYPE eCDType = PAL_HAS_SDLCD ? MUSIC_SDLCD : MUSIC_OGG;
    OPLTYPE   eOPLType = OPL_DOSBOX;
-   MENULAYOUT layout_equip = {
+   SCREENLAYOUT screen_layout = {
+	   // Equipment Screen
 	   PAL_XY(8, 8), PAL_XY(2, 95), PAL_XY(5, 70), PAL_XY(51, 57),
 	   { PAL_XY(92, 11), PAL_XY(92, 33), PAL_XY(92, 55), PAL_XY(92, 77), PAL_XY(92, 99), PAL_XY(92, 121) },
 	   { PAL_XY(130, 11), PAL_XY(130, 33), PAL_XY(130, 55), PAL_XY(130, 77), PAL_XY(130, 99), PAL_XY(130, 121) },
 	   { PAL_XY(226, 10), PAL_XY(226, 32), PAL_XY(226, 54), PAL_XY(226, 76), PAL_XY(226, 98)  },
-	   { PAL_XY(260, 14), PAL_XY(260, 36), PAL_XY(260, 58), PAL_XY(260, 80), PAL_XY(260, 102) }
+	   { PAL_XY(260, 14), PAL_XY(260, 36), PAL_XY(260, 58), PAL_XY(260, 80), PAL_XY(260, 102) },
+
+	   // Status Screen
+	   PAL_XY(110, 8), PAL_XY(110, 30), PAL_XY(6, 6),  PAL_XY(6, 32),  PAL_XY(6, 54),  PAL_XY(6, 76),
+	   { PAL_XY(6, 98),   PAL_XY(6, 118),  PAL_XY(6, 138),  PAL_XY(6, 158),  PAL_XY(6, 178) },
+	   PAL_XY(58, 6), PAL_XY(58, 15), PAL_XY(0, 0), PAL_XY(54, 35), PAL_XY(42, 56),
+	   PAL_XY(63, 61), PAL_XY(65, 58), PAL_XY(42, 78), PAL_XY(63, 83), PAL_XY(65, 80),
+	   { PAL_XY(42, 102), PAL_XY(42, 122), PAL_XY(42, 142), PAL_XY(42, 162), PAL_XY(42, 182) },
+	   { PAL_XY(189, -1), PAL_XY(247, 39), PAL_XY(251, 101), PAL_XY(201, 133), PAL_XY(141, 141), PAL_XY(81, 125) },
+	   { PAL_XY(195, 38), PAL_XY(253, 78), PAL_XY(257, 140), PAL_XY(207, 172), PAL_XY(147, 180), PAL_XY(87, 164) },
+	   { PAL_XY(185, 58), PAL_XY(185, 76), PAL_XY(185, 94), PAL_XY(185, 112), PAL_XY(185, 130), PAL_XY(185, 148), PAL_XY(185, 166), PAL_XY(185, 184), PAL_XY(185, 184), PAL_XY(185, 184) },
    };
 
    if (fp = UTIL_OpenFileForMode("sdlpal.cfg", "r"))
@@ -349,7 +360,7 @@ PAL_InitGlobals(
 #else
    gConfig.fFullScreen = dwFullScreen ? TRUE : FALSE;
 #endif
-   gConfig.MenuLayout = layout_equip;
+   gConfig.ScreenLayout = screen_layout;
 
    //
    // Set decompress function

+ 39 - 15
global.h

@@ -91,6 +91,8 @@ extern "C"
 #define     OBJECT_MAGIC_START           0x127
 #define     OBJECT_MAGIC_END             0x18D
 
+#define     MINIMAL_WORD_COUNT           (MAX_OBJECTS + 12)
+
 // status of characters
 typedef enum tagSTATUS
 {
@@ -617,28 +619,50 @@ typedef struct tagGLOBALVARS
 
 extern GLOBALVARS * const gpGlobals;
 
-typedef struct tagMENULAYOUT
-{
-	PAL_POS          ImageBox;
-	PAL_POS          RoleListBox;
-	PAL_POS          ItemName;
-	PAL_POS          ItemAmount;
-	PAL_POS          EquipLabels[6];
-	PAL_POS          EquipNames[6];
-	PAL_POS          StatusLabels[5];
-	PAL_POS          StatusValues[5];
-} MENULAYOUT;
+typedef struct tagSCREENLAYOUT
+{
+	PAL_POS          EquipImageBox;
+	PAL_POS          EquipRoleListBox;
+	PAL_POS          EquipItemName;
+	PAL_POS          EquipItemAmount;
+	PAL_POS          EquipLabels[MAX_PLAYER_EQUIPMENTS];
+	PAL_POS          EquipNames[MAX_PLAYER_EQUIPMENTS];
+	PAL_POS          EquipStatusLabels[5];
+	PAL_POS          EquipStatusValues[5];
+
+	PAL_POS          RoleName;
+	PAL_POS          RoleImage;
+	PAL_POS          RoleExpLabel;
+	PAL_POS          RoleLevelLabel;
+	PAL_POS          RoleHPLabel;
+	PAL_POS          RoleMPLabel;
+	PAL_POS          RoleStatusLabels[5];
+	PAL_POS          RoleCurrExp;
+	PAL_POS          RoleNextExp;
+	PAL_POS          RoleExpSlash;
+	PAL_POS          RoleLevel;
+	PAL_POS          RoleCurHP;
+	PAL_POS          RoleMaxHP;
+	PAL_POS          RoleHPSlash;
+	PAL_POS          RoleCurMP;
+	PAL_POS          RoleMaxMP;
+	PAL_POS          RoleMPSlash;
+	PAL_POS          RoleStatusValues[5];
+	PAL_POS          RoleEquipImageBoxes[MAX_PLAYER_EQUIPMENTS];
+	PAL_POS          RoleEquipNames[MAX_PLAYER_EQUIPMENTS];
+	PAL_POS          RolePoisonNames[MAX_POISONS];
+} SCREENLAYOUT;
 
 typedef struct tagCONFIGURATION
 {
 	union {
-	MENULAYOUT       MenuLayout;
-	PAL_POS          MenuLayoutArray[sizeof(MENULAYOUT) / sizeof(PAL_POS)];
+	SCREENLAYOUT     ScreenLayout;
+	PAL_POS          ScreenLayoutArray[sizeof(SCREENLAYOUT) / sizeof(PAL_POS)];
 	};
 	enum {
 		USE_8x8_FONT = 1,
 		DISABLE_SHADOW = 2,
-	}                MenuLayoutFlag[sizeof(MENULAYOUT) / sizeof(PAL_POS)];
+	}                ScreenLayoutFlag[sizeof(SCREENLAYOUT) / sizeof(PAL_POS)];
 
 	/* Configurable options */
 	char            *pszMsgName;
@@ -672,7 +696,7 @@ typedef struct tagCONFIGURATION
 	BOOL             fFullScreen;
 #endif
 	BOOL             fEnableJoyStick;
-	BOOL             fUseCustomMenuLayout;
+	BOOL             fUseCustomScreenLayout;
 } CONFIGURATION, *LPCONFIGURATION;
 
 extern CONFIGURATION gConfig;

+ 99 - 17
makemessage.py

@@ -80,44 +80,120 @@ def main():
     output += "11=    ...Press Enter to continue\n"
     output += "[END CREDITS]\n\n"
 
-    output += "# Each line controls one position value, lines from 1 to 26 is for the equipment menu.\n"
+    output += "# Each line controls one position value.\n"
     output += "# For each line, the format is 'idx=x,y,flag', while the flag is optional\n"
     output += "# If bit 0 of flag is 1, then use 8x8 font; and while bit 1 of flag is 1, then disable shadow\n"
+    output += "# Lines from 1 to 26 are for equipping screen, lines from 27 to 80 are for status screen.\n"
     output += "[BEGIN LAYOUT]\n"
-    output += "# 1 is the position of image box in equip menu\n"
+    output += "# 1 is the position of image box in equipping screen\n"
     output += "1=8,8\n"
-    output += "# 2 is the position of role list box in equip menu\n"
+    output += "# 2 is the position of role list box in equipping screen\n"
     output += "2=2,95\n"
-    output += "# 3 is the position of current equipment's name in equip menu\n"
+    output += "# 3 is the position of current equipment's name in equipping screen\n"
     output += "3=5,70\n"
-    output += "# 4 is the position of current equipment's amount in equip menu\n"
+    output += "# 4 is the position of current equipment's amount in equipping screen\n"
     output += "4=51,57\n"
-    output += "# 5 .. 10 are the positions of words 566 ... 571 in equip menu\n"
+    output += "# 5 .. 10 are the positions of words 600 ... 605 in equipping screen\n"
     output += "5=92,11\n"
     output += "6=92,33\n"
     output += "7=92,55\n"
     output += "8=92,77\n"
     output += "9=92,99\n"
     output += "10=92,121\n"
-    output += "# 11 .. 16 are the positions of equipped equipments in equip menu\n"
+    output += "# 11 .. 16 are the positions of equipped equipments in equipping screen\n"
     output += "11=130,11\n"
     output += "12=130,33\n"
     output += "13=130,55\n"
     output += "14=130,77\n"
     output += "15=130,99\n"
     output += "16=130,121\n"
-    output += "# 17 .. 21 are the positions of words 51 ... 55 in equip menu\n"
+    output += "# 17 .. 21 are the positions of words 51 ... 55 in equipping screen\n"
     output += "17=226,10\n"
     output += "18=226,32\n"
     output += "19=226,54\n"
     output += "20=226,76\n"
     output += "21=226,98\n"
-    output += "# 22 .. 26 are the positions of status values in equip menu\n"
+    output += "# 22 .. 26 are the positions of status values in equipping screen\n"
     output += "22=260,14\n"
     output += "23=260,36\n"
     output += "24=260,58\n"
     output += "25=260,80\n"
     output += "26=260,102\n"
+    output += "# 27 is the position of role name in status screen\n"
+    output += "27=110,8\n"
+    output += "# 28 is the position of role image in status screen\n"
+    output += "28=110,30\n"
+    output += "# 29 is the position of EXP label in status screen\n"
+    output += "29=6,6\n"
+    output += "# 30 is the position of LEVEL label in status screen\n"
+    output += "30=6,32\n"
+    output += "# 31 is the position of HP label in status screen\n"
+    output += "31=6,54\n"
+    output += "# 32 is the position of MP label in status screen\n"
+    output += "32=6,76\n"
+    output += "# 33 .. 37 are the positions of words 51 ... 55 in equipping screen\n"
+    output += "33=6,98\n"
+    output += "34=6,118\n"
+    output += "35=6,138\n"
+    output += "36=6,158\n"
+    output += "37=6,178\n"
+    output += "# 38 is the position of current EXP in status screen\n"
+    output += "38=58,6\n"
+    output += "# 39 is the position of required EXP to level up in status screen\n"
+    output += "39=58,15\n"
+    output += "# 40 is the position of slash between EXPs in status screen, if set to (0,0), then do not show the slash\n"
+    output += "40=0,0\n"
+    output += "# 41 is the position of LEVEL in status screen\n"
+    output += "41=54,35\n"
+    output += "# 42 is the position of current HP in status screen\n"
+    output += "42=42,56\n"
+    output += "# 43 is the position of max HP in status screen\n"
+    output += "43=63,61\n"
+    output += "# 44 is the position of slash between cur & max HPs in status screen, if set to (0,0), then do not show the slash\n"
+    output += "44=65,58\n"
+    output += "# 45 is the position of current MP in status screen\n"
+    output += "45=42,78\n"
+    output += "# 46 is the position of max MP in status screen\n"
+    output += "46=63,83\n"
+    output += "# 47 is the position of slash between cur & max MPs in status screen, if set to (0,0), then do not show the slash\n"
+    output += "47=65,80\n"
+    output += "# 48 .. 52 are the positions of status values in status screen\n"
+    output += "48=42,102\n"
+    output += "49=42,122\n"
+    output += "50=42,142\n"
+    output += "51=42,162\n"
+    output += "52=42,182\n"
+    output += "# 53 .. 58 are the positions of image boxes for equipped equipments in status screen\n"
+    output += "53=189,-1\n"
+    output += "54=247,39\n"
+    output += "55=251,101\n"
+    output += "56=201,133\n"
+    output += "57=141,141\n"
+    output += "58=81,125\n"
+    output += "# 59 .. 64 are the positions of names for equipped equipments in status screen\n"
+    output += "59=195,38\n"
+    output += "60=253,78\n"
+    output += "61=257,140\n"
+    output += "62=207,172\n"
+    output += "63=147,180\n"
+    output += "64=87,164\n"
+    output += "# 65 .. 80 are the positions of poison names in status screen, note that currently there are no more than 8 poisons can be simulatenously displayed\n"
+    output += "65=185,58\n"
+    output += "66=185,76\n"
+    output += "67=185,94\n"
+    output += "68=185,112\n"
+    output += "69=185,130\n"
+    output += "70=185,148\n"
+    output += "71=185,166\n"
+    output += "72=185,184\n"
+    output += "73=185,184\n"
+    output += "74=185,184\n"
+    output += "75=185,184\n"
+    output += "76=185,184\n"
+    output += "77=185,184\n"
+    output += "78=185,184\n"
+    output += "79=185,184\n"
+    output += "80=185,184\n"
     output += "[END LAYOUT]\n\n"
 
     output += "# This section contains the words used by the game.\n"
@@ -127,14 +203,20 @@ def main():
         temp = data_bytes[i * options.wordwidth: (i + 1) * options.wordwidth].rstrip('\x20\x00').decode(options.encoding).encode('utf-8')
         if options.comment: output += "# Original word: %d=%s\n" % (i, temp)
         output += "%d=%s\n" % (i, temp)
-    output += "566=Headgear\n"
-    output += "567=Body Gear\n"
-    output += "568=Clothing\n"
-    output += "569=Weapon\n"
-    output += "570=Footwear\n"
-    output += "571=Accessory\n"
-    output += "# This is the only addtional word for ATB in SDLPAL. It is not used in classical mode.\n"
-    output += "65530=Battle Speed\n"
+    output += "600=Headgear\n"
+    output += "601=Body Gear\n"
+    output += "602=Clothing\n"
+    output += "603=Weapon\n"
+    output += "604=Footwear\n"
+    output += "605=Accessory\n"
+    output += "# The following six words are for ATB only. It is not used in classical mode.\n"
+    output += "606=Battle Speed\n"
+    output += "# The following five words are for ATB battle speed. It is not used in classical mode.\n"
+    output += "607=1\n"
+    output += "608=2\n"
+    output += "609=3\n"
+    output += "610=4\n"
+    output += "611=5\n"
     output += "[END WORDS]\n\n"
 
     output += "# The following sections contain dialog/description texts used by the game.\n\n"

+ 17 - 41
text.c

@@ -40,12 +40,13 @@ BOOL      g_fUpdatedInBattle      = FALSE;
 #include "codepage.h"
 
 #ifndef PAL_CLASSIC
-static LPWSTR gc_rgszAdditionalWords[CP_MAX][PAL_ADDITIONAL_WORD_COUNT] = {
+# define ATB_WORD_COUNT             6
+static LPWSTR gc_rgszAdditionalWords[CP_MAX][ATB_WORD_COUNT] = {
    { L"\x6230\x9B25\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
    { L"\x6218\x6597\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
    //{ L"\x6226\x95D8\x901F\x5EA6", L"\x4E00", L"\x4E8C", L"\x4E09", L"\x56DB", L"\x4E94" },
 };
-static LPWSTR gc_rgszDefaultAdditionalWords[PAL_ADDITIONAL_WORD_COUNT] = { NULL, L"1", L"2", L"3", L"4", L"5" };
+static LPWSTR gc_rgszDefaultAdditionalWords[ATB_WORD_COUNT] = { NULL, L"\xFF11", L"\xFF12", L"\xFF13", L"\xFF14", L"\xFF15" };
 #endif
 
 LPWSTR g_rcCredits[12];
@@ -54,9 +55,6 @@ typedef struct tagTEXTLIB
 {
    LPWSTR         *lpWordBuf;
    LPWSTR         *lpMsgBuf;
-#ifndef PAL_CLASSIC
-   LPWSTR         *lpExtraWordBuf;
-#endif
    int           **lpIndexBuf;
 
    int             nWords;
@@ -201,9 +199,6 @@ PAL_ReadMessageFile(
 		ST_LAYOUT
 	} state = ST_OUTSIDE;
 	int idx_cnt = 0, msg_cnt = 0, word_cnt = 0, sid, eid = -1;
-#ifndef PAL_CLASSIC
-	int extra_word_cnt = 0;
-#endif
 
 	while (!feof(fp))
 	{
@@ -254,7 +249,7 @@ PAL_ReadMessageFile(
 					else if (strncmp(buffer, "[BEGIN LAYOUT]", 14) == 0 && !witem)
 					{
 						state = ST_LAYOUT;
-						gConfig.fUseCustomMenuLayout = TRUE;
+						gConfig.fUseCustomScreenLayout = TRUE;
 					}
 					else
 					{
@@ -312,7 +307,7 @@ PAL_ReadMessageFile(
 				{
 					char *v;
 					int l, i = PAL_ParseLine(buffer, &v, &l, TRUE);
-					if (i > 0 && i <= PAL_ADDITIONAL_WORD_LAST)
+					if (i > 0)
 					{
 						int len = PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, NULL, 0);
 						struct _word_list_entry *val = (struct _word_list_entry *)UTIL_malloc(sizeof(struct _word_list_entry));
@@ -320,10 +315,7 @@ PAL_ReadMessageFile(
 						PAL_MultiByteToWideCharCP(CP_UTF_8, v, -1, val->value, len);
 						val->index = i; val->next = NULL;
 						witem->next = val; witem = witem->next;
-						if (i < PAL_ADDITIONAL_WORD_FIRST && word_cnt < i) word_cnt = i;
-#ifndef PAL_CLASSIC
-						if (i >= PAL_ADDITIONAL_WORD_FIRST && extra_word_cnt < i) extra_word_cnt = i;
-#endif
+						if (word_cnt < i) word_cnt = i;
 					}
 				}
 				break;
@@ -400,14 +392,13 @@ PAL_ReadMessageFile(
 				{
 					char *v;
 					int x, y, f, n, l, i = PAL_ParseLine(buffer, &v, &l, FALSE);
-					if (i >= 1 && i <= 26)
+					if (i >= 1 && i <= 80)
 					{
-						PAL_POS *poses = &gConfig.MenuLayout.ImageBox;
-						if ((n = sscanf(v, "%d,%d,%d", &x, &y, &f)) >= 2 &&
-							x >= 0 && y >= 0 && x < 320 && y < 200)
+						PAL_POS *poses = (PAL_POS *)&gConfig.ScreenLayout;
+						if ((n = sscanf(v, "%d,%d,%d", &x, &y, &f)) >= 2 && x < 320 && y < 200)
 						{
 							poses[i - 1] = PAL_XY(x, y);
-							if (n == 3) gConfig.MenuLayoutFlag[i - 1] = f;
+							if (n == 3) gConfig.ScreenLayoutFlag[i - 1] = f;
 						}
 					}
 				}
@@ -454,38 +445,27 @@ PAL_ReadMessageFile(
 		}
 	}
 
-#ifndef PAL_CLASSIC
-	if (word_cnt > 0 && extra_word_cnt >= PAL_ADDITIONAL_WORD_FIRST && extra_word_cnt <= PAL_ADDITIONAL_WORD_LAST)
-#else
 	if (word_cnt > 0)
-#endif
 	{
 		//
 		// Move values from linked list to array
 		//
 #ifndef PAL_CLASSIC
 		int i;
-		g_TextLib.lpExtraWordBuf = (LPWSTR *)calloc(PAL_ADDITIONAL_WORD_COUNT, sizeof(LPWSTR));
 #endif
+		if (word_cnt < MINIMAL_WORD_COUNT - 1) word_cnt = MINIMAL_WORD_COUNT - 1;
 		g_TextLib.nWords = (word_cnt += 1);
 		g_TextLib.lpWordBuf = (LPWSTR *)UTIL_calloc(word_cnt, sizeof(LPWSTR));
 		for (witem = whead.next; witem; )
 		{
 			struct _word_list_entry *temp = witem->next;
-			if (witem->index < PAL_ADDITIONAL_WORD_FIRST)
-				g_TextLib.lpWordBuf[witem->index] = witem->value;
-			else
-#ifndef PAL_CLASSIC
-				g_TextLib.lpExtraWordBuf[witem->index - PAL_ADDITIONAL_WORD_FIRST] = witem->value;
-#else
-				free(witem->value);
-#endif
+			g_TextLib.lpWordBuf[witem->index] = witem->value;
 			free(witem); witem = temp;
 		}
 #ifndef PAL_CLASSIC
-		for (i = 1; i < PAL_ADDITIONAL_WORD_COUNT; i++)
-			if (!g_TextLib.lpExtraWordBuf[i])
-				g_TextLib.lpExtraWordBuf[i] = gc_rgszDefaultAdditionalWords[i];
+		for (i = 1; i < ATB_WORD_COUNT; i++)
+			if (!g_TextLib.lpWordBuf[i + SYSMENU_LABEL_BATTLEMODE])
+				g_TextLib.lpWordBuf[i + SYSMENU_LABEL_BATTLEMODE] = gc_rgszDefaultAdditionalWords[i];
 #endif
 	}
 
@@ -574,6 +554,7 @@ PAL_InitText(
 	   // Each word has 10 bytes
 	   //
 	   g_TextLib.nWords = (i + (gConfig.dwWordLength - 1)) / gConfig.dwWordLength;
+	   if (g_TextLib.nWords < MINIMAL_WORD_COUNT) g_TextLib.nWords = MINIMAL_WORD_COUNT;
 
 	   //
 	   // Read the words
@@ -701,7 +682,7 @@ PAL_InitText(
 	   g_TextLib.lpIndexBuf = NULL;
 
 #ifndef PAL_CLASSIC
-	   g_TextLib.lpExtraWordBuf = gc_rgszAdditionalWords[gpGlobals->iCodePage];
+	   memcpy(g_TextLib.lpWordBuf + SYSMENU_LABEL_BATTLEMODE, gc_rgszAdditionalWords[gConfig.iCodePage], ATB_WORD_COUNT * sizeof(LPCWSTR));
 #endif
    }
 
@@ -788,11 +769,6 @@ PAL_GetWord(
 
 --*/
 {
-#ifndef PAL_CLASSIC
-   if (wNumWord >= PAL_ADDITIONAL_WORD_FIRST)
-      return g_TextLib.lpExtraWordBuf[wNumWord];
-   else
-#endif
    return (iNumWord >= g_TextLib.nWords || !g_TextLib.lpWordBuf[iNumWord]) ? L"" : g_TextLib.lpWordBuf[iNumWord];
 }
 

+ 0 - 4
text.h

@@ -32,10 +32,6 @@ typedef enum tagDIALOGPOSITION
    kDialogCenterWindow
 } DIALOGLOCATION;
 
-#define PAL_ADDITIONAL_WORD_FIRST           65530
-#define PAL_ADDITIONAL_WORD_LAST            65535
-#define PAL_ADDITIONAL_WORD_COUNT           (PAL_ADDITIONAL_WORD_LAST - PAL_ADDITIONAL_WORD_FIRST + 1)
-
 extern LPWSTR g_rcCredits[12];
 
 INT

+ 2 - 2
ui.c

@@ -380,7 +380,7 @@ PAL_DeleteBox(
 WORD
 PAL_ReadMenu(
    LPITEMCHANGED_CALLBACK    lpfnMenuItemChanged,
-   LPMENUITEM                rgMenuItem,
+   LPCMENUITEM               rgMenuItem,
    INT                       nMenuItem,
    WORD                      wDefaultItem,
    BYTE                      bLabelColor
@@ -684,7 +684,7 @@ PAL_DrawNumber(
 
 INT
 PAL_MenuTextMaxWidth(
-   LPMENUITEM     rgMenuItem,
+   LPCMENUITEM    rgMenuItem,
    INT            nMenuItem
 )
 /*++

+ 15 - 14
ui.h

@@ -75,13 +75,13 @@ extern "C"
 #define SYSMENU_LABEL_MUSIC                13
 #define SYSMENU_LABEL_SOUND                14
 #define SYSMENU_LABEL_QUIT                 15
-#define SYSMENU_LABEL_BATTLEMODE           (PAL_ADDITIONAL_WORD_LAST)
+#define SYSMENU_LABEL_BATTLEMODE           606
 
-#define BATTLESPEEDMENU_LABEL_1            (PAL_ADDITIONAL_WORD_FIRST + 1)
-#define BATTLESPEEDMENU_LABEL_2            (PAL_ADDITIONAL_WORD_FIRST + 2)
-#define BATTLESPEEDMENU_LABEL_3            (PAL_ADDITIONAL_WORD_FIRST + 3)
-#define BATTLESPEEDMENU_LABEL_4            (PAL_ADDITIONAL_WORD_FIRST + 4)
-#define BATTLESPEEDMENU_LABEL_5            (PAL_ADDITIONAL_WORD_FIRST + 5)
+#define BATTLESPEEDMENU_LABEL_1            (SYSMENU_LABEL_BATTLEMODE + 1)
+#define BATTLESPEEDMENU_LABEL_2            (SYSMENU_LABEL_BATTLEMODE + 2)
+#define BATTLESPEEDMENU_LABEL_3            (SYSMENU_LABEL_BATTLEMODE + 3)
+#define BATTLESPEEDMENU_LABEL_4            (SYSMENU_LABEL_BATTLEMODE + 4)
+#define BATTLESPEEDMENU_LABEL_5            (SYSMENU_LABEL_BATTLEMODE + 5)
 
 #define INVMENU_LABEL_USE                  23
 #define INVMENU_LABEL_EQUIP                22
@@ -98,12 +98,12 @@ extern "C"
 #define STATUS_LABEL_FLEERATE              55
 #define STATUS_COLOR_EQUIPMENT             0xBE
 
-#define EQUIP_LABEL_HEAD                   566
-#define EQUIP_LABEL_SHOULDER               567
-#define EQUIP_LABEL_BODY                   568
-#define EQUIP_LABEL_HAND                   569
-#define EQUIP_LABEL_FOOT                   570
-#define EQUIP_LABEL_NECK                   571
+#define EQUIP_LABEL_HEAD                   600
+#define EQUIP_LABEL_SHOULDER               601
+#define EQUIP_LABEL_BODY                   602
+#define EQUIP_LABEL_HAND                   603
+#define EQUIP_LABEL_FOOT                   604
+#define EQUIP_LABEL_NECK                   605
 
 #define BUYMENU_LABEL_CURRENT              35
 #define SELLMENU_LABEL_PRICE               25
@@ -143,6 +143,7 @@ typedef struct tagMENUITEM
    BOOL          fEnabled;
    PAL_POS       pos;
 } MENUITEM, *LPMENUITEM;
+typedef const MENUITEM* LPCMENUITEM;
 
 typedef struct tagOBJECTDESC
 {
@@ -203,7 +204,7 @@ PAL_DeleteBox(
 WORD
 PAL_ReadMenu(
    LPITEMCHANGED_CALLBACK    lpfnMenuItemChanged,
-   LPMENUITEM                rgMenuItem,
+   LPCMENUITEM               rgMenuItem,
    INT                       nMenuItem,
    WORD                      wDefaultItem,
    BYTE                      bLabelColor
@@ -220,7 +221,7 @@ PAL_DrawNumber(
 
 INT
 PAL_MenuTextMaxWidth(
-   LPMENUITEM     rgMenuItem,
+   LPCMENUITEM    rgMenuItem,
    INT            nMenuItem
 );
 

+ 1 - 1
uibattle.c

@@ -1706,7 +1706,7 @@ end:
       // Show the text on the screen
       //
       pos = PAL_XY(PAL_X(pos) + 8 + ((len & 1) << 2), PAL_Y(pos) + 10);
-      PAL_DrawText(g_Battle.UI.szMsg, pos, 0, FALSE, FALSE);
+      PAL_DrawText(g_Battle.UI.szMsg, pos, 0, FALSE, FALSE, FALSE);
    }
    else if (g_Battle.UI.szNextMsg[0] != '\0')
    {

+ 141 - 132
uigame.c

@@ -526,8 +526,7 @@ PAL_SystemMenu(
    //
    // Create menu items
    //
-#ifdef PAL_CLASSIC
-   MENUITEM        rgSystemMenuItem[5] =
+   const MENUITEM      rgSystemMenuItem[] =
    {
       // value  label                      enabled   pos
       { 1,      SYSMENU_LABEL_SAVE,        TRUE,     PAL_XY(53, 72) },
@@ -535,40 +534,22 @@ PAL_SystemMenu(
       { 3,      SYSMENU_LABEL_MUSIC,       TRUE,     PAL_XY(53, 72 + 36) },
       { 4,      SYSMENU_LABEL_SOUND,       TRUE,     PAL_XY(53, 72 + 54) },
       { 5,      SYSMENU_LABEL_QUIT,        TRUE,     PAL_XY(53, 72 + 72) },
-   };
-#else
-   MENUITEM        rgSystemMenuItem[6] =
-   {
-      // value  label                      enabled   pos
-      { 1,      SYSMENU_LABEL_SAVE,        TRUE,     PAL_XY(53, 72) },
-      { 2,      SYSMENU_LABEL_LOAD,        TRUE,     PAL_XY(53, 72 + 18) },
-      { 3,      SYSMENU_LABEL_MUSIC,       TRUE,     PAL_XY(53, 72 + 36) },
-      { 4,      SYSMENU_LABEL_SOUND,       TRUE,     PAL_XY(53, 72 + 54) },
-      { 5,      SYSMENU_LABEL_BATTLEMODE,  TRUE,     PAL_XY(53, 72 + 72) },
-      { 6,      SYSMENU_LABEL_QUIT,        TRUE,     PAL_XY(53, 72 + 90) },
-   };
+#if !defined(PAL_CLASSIC)
+      { 6,      SYSMENU_LABEL_BATTLEMODE,  TRUE,     PAL_XY(53, 72 + 90) },
 #endif
+   };
+   const int           nSystemMenuItem = sizeof(rgSystemMenuItem) / sizeof(MENUITEM);
 
    //
    // Create the menu box.
    //
-#ifdef PAL_CLASSIC
-   lpMenuBox = PAL_CreateBox(PAL_XY(40, 60), 4, PAL_MenuTextMaxWidth(rgSystemMenuItem, 5) - 1, 0, TRUE);
-#else
-   lpMenuBox = PAL_CreateBox(PAL_XY(40, 60), 5, PAL_MenuTextMaxWidth(rgSystemMenuItem, 6) - 1, 0, TRUE);
-#endif
+   lpMenuBox = PAL_CreateBox(PAL_XY(40, 60), nSystemMenuItem - 1, PAL_MenuTextMaxWidth(rgSystemMenuItem, nSystemMenuItem) - 1, 0, TRUE);
    VIDEO_UpdateScreen(&rect);
 
    //
    // Perform the menu.
    //
-#ifdef PAL_CLASSIC
-   wReturnValue = PAL_ReadMenu(PAL_SystemMenu_OnItemChange, rgSystemMenuItem, 5,
-      gpGlobals->iCurSystemMenuItem, MENUITEM_COLOR);
-#else
-   wReturnValue = PAL_ReadMenu(PAL_SystemMenu_OnItemChange, rgSystemMenuItem, 6,
-      gpGlobals->iCurSystemMenuItem, MENUITEM_COLOR);
-#endif
+   wReturnValue = PAL_ReadMenu(PAL_SystemMenu_OnItemChange, rgSystemMenuItem, nSystemMenuItem, gpGlobals->iCurSystemMenuItem, MENUITEM_COLOR);
 
    if (wReturnValue == MENUITEM_VALUE_CANCELLED)
    {
@@ -650,18 +631,7 @@ PAL_SystemMenu(
       g_fNoSound = !PAL_SwitchMenu(!g_fNoSound);
       break;
 
-#ifndef PAL_CLASSIC
    case 5:
-      //
-      // Battle Mode
-      //
-      PAL_BattleSpeedMenu();
-      break;
-
-   case 6:
-#else
-   case 5:
-#endif
       //
       // Quit
       //
@@ -673,6 +643,15 @@ PAL_SystemMenu(
          exit(0);
       }
       break;
+
+#if !defined(PAL_CLASSIC)
+   case 6:
+      //
+      // Battle Mode
+      //
+      PAL_BattleSpeedMenu();
+      break;
+#endif
    }
 
    PAL_DeleteBox(lpMenuBox);
@@ -1085,19 +1064,47 @@ PAL_PlayerStatus(
 {
    PAL_LARGE BYTE   bufBackground[320 * 200];
    PAL_LARGE BYTE   bufImage[16384];
+   PAL_LARGE BYTE   bufImageBox[50 * 49];
+   int              labels[] = {
+      STATUS_LABEL_ATTACKPOWER, STATUS_LABEL_MAGICPOWER, STATUS_LABEL_RESISTANCE,
+      STATUS_LABEL_DEXTERITY, STATUS_LABEL_FLEERATE
+   };
    int              iCurrent;
    int              iPlayerRole;
-   int              i, y;
+   int              i, j;
    WORD             w;
 
-   const int        rgEquipPos[MAX_PLAYER_EQUIPMENTS][2] = {
-      {190, 0}, {248, 40}, {252, 102}, {202, 134}, {142, 142}, {82, 126}
-   };
-
-   PAL_MKFDecompressChunk(bufBackground, 320 * 200, STATUS_BACKGROUND_FBPNUM,
-      gpGlobals->f.fpFBP);
+   PAL_MKFDecompressChunk(bufBackground, 320 * 200, STATUS_BACKGROUND_FBPNUM, gpGlobals->f.fpFBP);
    iCurrent = 0;
 
+   if (gConfig.fUseCustomScreenLayout)
+   {
+      for (i = 0; i < 49; i++)
+      {
+         memcpy(&bufImageBox[i * 50], &bufBackground[(i + 39) * 320 + 247], 50);
+      }
+      for (i = 0; i < 49; i++)
+      {
+         memcpy(&bufBackground[(i + 125) * 320 + 81], &bufBackground[(i + 125) * 320 + 81 - 50], 50);
+         memcpy(&bufBackground[(i + 141) * 320 + 141], &bufBackground[(i + 141) * 320 + 81 - 50], 50);
+         memcpy(&bufBackground[(i + 133) * 320 + 201], &bufBackground[(i + 133) * 320 + 81 - 50], 50);
+         memcpy(&bufBackground[(i + 101) * 320 + 251], &bufBackground[(i + 101) * 320 + 81 - 50], 50);
+         memcpy(&bufBackground[(i + 39) * 320 + 247], &bufBackground[(i + 39) * 320 + 189 - 50], 50);
+         if (i > 0) memcpy(&bufBackground[(i - 1) * 320 + 189], &bufBackground[(i - 1) * 320 + 189 - 50], 50);
+      }
+      for(i = 0; i < MAX_PLAYER_EQUIPMENTS; i++)
+      {
+         short x = PAL_X(gConfig.ScreenLayout.RoleEquipImageBoxes[i]);
+         short y = PAL_Y(gConfig.ScreenLayout.RoleEquipImageBoxes[i]);
+         short sx = (x < 0) ? -x : 0, sy = (y < 0) ? -y : 0, d = (x > 270) ? x - 270 : 0;
+         if (sx >= 50 || sy >= 49 || x >= 320 || y >= 200) continue;
+         for (; sy < 49 && y + sy < 200; sy++)
+         {
+            memcpy(&bufBackground[(y + sy) * 320 + x + sx], &bufImageBox[sy * 50 + sx], 50 - sx - d);
+         }
+      }
+   }
+
    while (iCurrent >= 0 && iCurrent <= gpGlobals->wMaxPartyMemberIndex)
    {
       iPlayerRole = gpGlobals->rgParty[iCurrent].wPlayerRole;
@@ -1108,60 +1115,19 @@ PAL_PlayerStatus(
       PAL_FBPBlitToSurface(bufBackground, gpScreen);
 
       //
-      // Draw the text labels
-      //
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_EXP), PAL_XY(6, 6), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_LEVEL), PAL_XY(6, 32), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_HP), PAL_XY(6, 54), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_MP), PAL_XY(6, 76), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_ATTACKPOWER), PAL_XY(6, 98), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_MAGICPOWER), PAL_XY(6, 118), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_RESISTANCE), PAL_XY(6, 138), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_DEXTERITY), PAL_XY(6, 158), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-      PAL_DrawText(PAL_GetWord(STATUS_LABEL_FLEERATE), PAL_XY(6, 178), MENUITEM_COLOR, TRUE, FALSE, FALSE);
-
-      PAL_DrawText(PAL_GetWord(gpGlobals->g.PlayerRoles.rgwName[iPlayerRole]),
-         PAL_XY(110, 8), MENUITEM_COLOR_CONFIRMED, TRUE, FALSE, FALSE);
-
-      //
-      // Draw the stats
+      // Draw the image of player role
       //
-      PAL_DrawNumber(gpGlobals->Exp.rgPrimaryExp[iPlayerRole].wExp, 5,
-         PAL_XY(58, 6), kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(gpGlobals->g.rgLevelUpExp[gpGlobals->g.PlayerRoles.rgwLevel[iPlayerRole]],
-         5, PAL_XY(58, 15), kNumColorCyan, kNumAlignRight);
-      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwLevel[iPlayerRole], 2,
-         PAL_XY(54, 35), kNumColorYellow, kNumAlignRight);
-      PAL_RLEBlitToSurface(PAL_SpriteGetFrame(gpSpriteUI, SPRITENUM_SLASH), gpScreen,
-         PAL_XY(65, 58));
-      PAL_RLEBlitToSurface(PAL_SpriteGetFrame(gpSpriteUI, SPRITENUM_SLASH), gpScreen,
-         PAL_XY(65, 80));
-      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwHP[iPlayerRole], 4, PAL_XY(42, 56),
-         kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMaxHP[iPlayerRole], 4, PAL_XY(63, 61),
-         kNumColorBlue, kNumAlignRight);
-      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMP[iPlayerRole], 4, PAL_XY(42, 78),
-         kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMaxMP[iPlayerRole], 4, PAL_XY(63, 83),
-         kNumColorBlue, kNumAlignRight);
-
-      PAL_DrawNumber(PAL_GetPlayerAttackStrength(iPlayerRole), 4,
-         PAL_XY(42, 102), kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerMagicStrength(iPlayerRole), 4,
-         PAL_XY(42, 122), kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerDefense(iPlayerRole), 4,
-         PAL_XY(42, 142), kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerDexterity(iPlayerRole), 4,
-         PAL_XY(42, 162), kNumColorYellow, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerFleeRate(iPlayerRole), 4,
-         PAL_XY(42, 182), kNumColorYellow, kNumAlignRight);
+      if (PAL_MKFReadChunk(bufImage, 16384, gpGlobals->g.PlayerRoles.rgwAvatar[iPlayerRole], gpGlobals->f.fpRGM) > 0)
+      {
+         PAL_RLEBlitToSurface(bufImage, gpScreen, gConfig.ScreenLayout.RoleImage);
+      }
 
       //
       // Draw the equipments
       //
       for (i = 0; i < MAX_PLAYER_EQUIPMENTS; i++)
       {
-         int offset = 0;
+         int offset;
 
          w = gpGlobals->g.PlayerRoles.rgwEquipment[i][iPlayerRole];
 
@@ -1177,48 +1143,91 @@ PAL_PlayerStatus(
             gpGlobals->g.rgObject[w].item.wBitmap, gpGlobals->f.fpBALL) > 0)
          {
             PAL_RLEBlitToSurface(bufImage, gpScreen,
-               PAL_XY(rgEquipPos[i][0], rgEquipPos[i][1]));
+               PAL_XY_OFFSET(gConfig.ScreenLayout.RoleEquipImageBoxes[i], 1, 1));
          }
 
          //
          // Draw the text label
          //
          offset = PAL_WordWidth(w) * 16;
-         if (rgEquipPos[i][0] + offset + 5 > 320)
+         if (PAL_X(gConfig.ScreenLayout.RoleEquipNames[i]) + offset > 320)
          {
-            offset = 314 - rgEquipPos[i][0] - offset;
+            offset = 320 - PAL_X(gConfig.ScreenLayout.RoleEquipNames[i]) - offset;
          }
          else
          {
             offset = 0;
          }
-         PAL_DrawText(PAL_GetWord(w), PAL_XY(rgEquipPos[i][0] + offset + 5, rgEquipPos[i][1] + 38), STATUS_COLOR_EQUIPMENT, TRUE, FALSE, FALSE);
+         PAL_DrawText(PAL_GetWord(w), PAL_XY_OFFSET(gConfig.ScreenLayout.RoleEquipNames[i], offset, 0), STATUS_COLOR_EQUIPMENT, TRUE, FALSE, FALSE);
       }
 
       //
-      // Draw the image of player role
+      // Draw the text labels
       //
-      if (PAL_MKFReadChunk(bufImage, 16384,
-         gpGlobals->g.PlayerRoles.rgwAvatar[iPlayerRole], gpGlobals->f.fpRGM) > 0)
-      {
-         PAL_RLEBlitToSurface(bufImage, gpScreen, PAL_XY(110, 30));
+	  PAL_DrawText(PAL_GetWord(STATUS_LABEL_EXP), gConfig.ScreenLayout.RoleExpLabel, MENUITEM_COLOR, TRUE, FALSE, FALSE);
+      PAL_DrawText(PAL_GetWord(STATUS_LABEL_LEVEL), gConfig.ScreenLayout.RoleLevelLabel, MENUITEM_COLOR, TRUE, FALSE, FALSE);
+      PAL_DrawText(PAL_GetWord(STATUS_LABEL_HP), gConfig.ScreenLayout.RoleHPLabel, MENUITEM_COLOR, TRUE, FALSE, FALSE);
+      PAL_DrawText(PAL_GetWord(STATUS_LABEL_MP), gConfig.ScreenLayout.RoleMPLabel, MENUITEM_COLOR, TRUE, FALSE, FALSE);
+      for (i = 0; i < sizeof(labels) / sizeof(int); i++)
+	  {
+         PAL_DrawText(PAL_GetWord(labels[i]), gConfig.ScreenLayout.RoleStatusLabels[i], MENUITEM_COLOR, TRUE, FALSE, FALSE);
       }
 
+      PAL_DrawText(PAL_GetWord(gpGlobals->g.PlayerRoles.rgwName[iPlayerRole]),
+         gConfig.ScreenLayout.RoleName, MENUITEM_COLOR_CONFIRMED, TRUE, FALSE, FALSE);
+
       //
-      // Draw all poisons
+      // Draw the stats
       //
-      y = 58;
+      if (gConfig.ScreenLayout.RoleExpSlash != 0)
+	  {
+         PAL_RLEBlitToSurface(PAL_SpriteGetFrame(gpSpriteUI, SPRITENUM_SLASH), gpScreen, gConfig.ScreenLayout.RoleExpSlash);
+      }
+      if (gConfig.ScreenLayout.RoleHPSlash != 0)
+	  {
+         PAL_RLEBlitToSurface(PAL_SpriteGetFrame(gpSpriteUI, SPRITENUM_SLASH), gpScreen, gConfig.ScreenLayout.RoleHPSlash);
+      }
+      if (gConfig.ScreenLayout.RoleMPSlash != 0)
+	  {
+         PAL_RLEBlitToSurface(PAL_SpriteGetFrame(gpSpriteUI, SPRITENUM_SLASH), gpScreen, gConfig.ScreenLayout.RoleMPSlash);
+      }
+
+      PAL_DrawNumber(gpGlobals->Exp.rgPrimaryExp[iPlayerRole].wExp, 5,
+         gConfig.ScreenLayout.RoleCurrExp, kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.rgLevelUpExp[gpGlobals->g.PlayerRoles.rgwLevel[iPlayerRole]], 5,
+         gConfig.ScreenLayout.RoleNextExp, kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwLevel[iPlayerRole], 2,
+         gConfig.ScreenLayout.RoleLevel, kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwHP[iPlayerRole], 4,
+         gConfig.ScreenLayout.RoleCurHP, kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMaxHP[iPlayerRole], 4,
+         gConfig.ScreenLayout.RoleMaxHP, kNumColorBlue, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMP[iPlayerRole], 4,
+         gConfig.ScreenLayout.RoleCurMP, kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(gpGlobals->g.PlayerRoles.rgwMaxMP[iPlayerRole], 4,
+         gConfig.ScreenLayout.RoleMaxMP, kNumColorBlue, kNumAlignRight);
 
-      for (i = 0; i < MAX_POISONS; i++)
+      PAL_DrawNumber(PAL_GetPlayerAttackStrength(iPlayerRole), 4,
+         gConfig.ScreenLayout.RoleStatusValues[0], kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerMagicStrength(iPlayerRole), 4,
+         gConfig.ScreenLayout.RoleStatusValues[1], kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerDefense(iPlayerRole), 4,
+         gConfig.ScreenLayout.RoleStatusValues[2], kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerDexterity(iPlayerRole), 4,
+         gConfig.ScreenLayout.RoleStatusValues[3], kNumColorYellow, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerFleeRate(iPlayerRole), 4,
+         gConfig.ScreenLayout.RoleStatusValues[4], kNumColorYellow, kNumAlignRight);
+
+      //
+      // Draw all poisons
+      //
+      for (i = j = 0; i < MAX_POISONS; i++)
       {
          w = gpGlobals->rgPoisonStatus[i][iCurrent].wPoisonID;
 
-         if (w != 0 &&
-            gpGlobals->g.rgObject[w].poison.wPoisonLevel <= 3)
+         if (w != 0 && gpGlobals->g.rgObject[w].poison.wPoisonLevel <= 3)
          {
-            PAL_DrawText(PAL_GetWord(w), PAL_XY(185, y), (BYTE)(gpGlobals->g.rgObject[w].poison.wColor + 10), TRUE, FALSE, FALSE);
-
-            y += 18;
+            PAL_DrawText(PAL_GetWord(w), gConfig.ScreenLayout.RolePoisonNames[j++], (BYTE)(gpGlobals->g.rgObject[w].poison.wColor + 10), TRUE, FALSE, FALSE);
          }
       }
 
@@ -1745,10 +1754,10 @@ PAL_EquipItemMenu(
    PAL_MKFDecompressChunk(bufBackground, 320 * 200, EQUIPMENU_BACKGROUND_FBPNUM,
       gpGlobals->f.fpFBP);
 
-   if (gConfig.fUseCustomMenuLayout)
+   if (gConfig.fUseCustomScreenLayout)
    {
-      int x = PAL_X(gConfig.MenuLayout.ImageBox);
-      int y = PAL_Y(gConfig.MenuLayout.ImageBox);
+      int x = PAL_X(gConfig.ScreenLayout.EquipImageBox);
+      int y = PAL_Y(gConfig.ScreenLayout.EquipImageBox);
       for (i = 8; i < 72; i++)
       {
          memcpy(&bufBackground[i * 320 + 92], &bufBackground[(i + 128) * 320 + 92], 32);
@@ -1792,26 +1801,26 @@ PAL_EquipItemMenu(
       if (PAL_MKFReadChunk(bufImage, 2048,
          gpGlobals->g.rgObject[wItem].item.wBitmap, gpGlobals->f.fpBALL) > 0)
       {
-         PAL_RLEBlitToSurface(bufImage, gpScreen, PAL_XY_OFFSET(gConfig.MenuLayout.ImageBox, 8, 8));
+         PAL_RLEBlitToSurface(bufImage, gpScreen, PAL_XY_OFFSET(gConfig.ScreenLayout.EquipImageBox, 8, 8));
       }
 
-      if (gConfig.fUseCustomMenuLayout)
+      if (gConfig.fUseCustomScreenLayout)
       {
          int labels1[] = { STATUS_LABEL_ATTACKPOWER, STATUS_LABEL_MAGICPOWER, STATUS_LABEL_RESISTANCE, STATUS_LABEL_DEXTERITY, STATUS_LABEL_FLEERATE };
          int labels2[] = { EQUIP_LABEL_HEAD, EQUIP_LABEL_SHOULDER, EQUIP_LABEL_BODY, EQUIP_LABEL_HAND, EQUIP_LABEL_FOOT, EQUIP_LABEL_NECK };
 		 for (i = 0; i < sizeof(labels1) / sizeof(int); i++)
          {
-            int index = &gConfig.MenuLayout.StatusLabels[i] - gConfig.MenuLayoutArray;
-            BOOL fShadow = (gConfig.MenuLayoutFlag[index] & DISABLE_SHADOW) ? FALSE : TRUE;
-            BOOL fUse8x8Font = (gConfig.MenuLayoutFlag[index] & USE_8x8_FONT) ? TRUE : FALSE;
-            PAL_DrawText(PAL_GetWord(labels1[i]), gConfig.MenuLayoutArray[index], MENUITEM_COLOR, fShadow, FALSE, fUse8x8Font);
+            int index = &gConfig.ScreenLayout.EquipStatusLabels[i] - gConfig.ScreenLayoutArray;
+            BOOL fShadow = (gConfig.ScreenLayoutFlag[index] & DISABLE_SHADOW) ? FALSE : TRUE;
+            BOOL fUse8x8Font = (gConfig.ScreenLayoutFlag[index] & USE_8x8_FONT) ? TRUE : FALSE;
+            PAL_DrawText(PAL_GetWord(labels1[i]), gConfig.ScreenLayoutArray[index], MENUITEM_COLOR, fShadow, FALSE, fUse8x8Font);
          }
 		 for (i = 0; i < sizeof(labels2) / sizeof(int); i++)
          {
-            int index = &gConfig.MenuLayout.EquipLabels[i] - gConfig.MenuLayoutArray;
-            BOOL fShadow = (gConfig.MenuLayoutFlag[index] & DISABLE_SHADOW) ? FALSE : TRUE;
-            BOOL fUse8x8Font = (gConfig.MenuLayoutFlag[index] & USE_8x8_FONT) ? TRUE : FALSE;
-            PAL_DrawText(PAL_GetWord(labels2[i]), gConfig.MenuLayoutArray[index], MENUITEM_COLOR, fShadow, FALSE, fUse8x8Font);
+            int index = &gConfig.ScreenLayout.EquipLabels[i] - gConfig.ScreenLayoutArray;
+            BOOL fShadow = (gConfig.ScreenLayoutFlag[index] & DISABLE_SHADOW) ? FALSE : TRUE;
+            BOOL fUse8x8Font = (gConfig.ScreenLayoutFlag[index] & USE_8x8_FONT) ? TRUE : FALSE;
+            PAL_DrawText(PAL_GetWord(labels2[i]), gConfig.ScreenLayoutArray[index], MENUITEM_COLOR, fShadow, FALSE, fUse8x8Font);
          }
       }
 
@@ -1824,23 +1833,23 @@ PAL_EquipItemMenu(
          if (gpGlobals->g.PlayerRoles.rgwEquipment[i][w] != 0)
          {
             PAL_DrawText(PAL_GetWord(gpGlobals->g.PlayerRoles.rgwEquipment[i][w]),
-				gConfig.MenuLayout.EquipNames[i], MENUITEM_COLOR, TRUE, FALSE, FALSE);
+				gConfig.ScreenLayout.EquipNames[i], MENUITEM_COLOR, TRUE, FALSE, FALSE);
          }
       }
 
       //
       // Draw the stats of the currently selected player
       //
-      PAL_DrawNumber(PAL_GetPlayerAttackStrength(w), 4, gConfig.MenuLayout.StatusValues[0], kNumColorCyan, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerMagicStrength(w), 4, gConfig.MenuLayout.StatusValues[1], kNumColorCyan, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerDefense(w), 4, gConfig.MenuLayout.StatusValues[2], kNumColorCyan, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerDexterity(w), 4, gConfig.MenuLayout.StatusValues[3], kNumColorCyan, kNumAlignRight);
-      PAL_DrawNumber(PAL_GetPlayerFleeRate(w), 4, gConfig.MenuLayout.StatusValues[4], kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerAttackStrength(w), 4, gConfig.ScreenLayout.EquipStatusValues[0], kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerMagicStrength(w), 4, gConfig.ScreenLayout.EquipStatusValues[1], kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerDefense(w), 4, gConfig.ScreenLayout.EquipStatusValues[2], kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerDexterity(w), 4, gConfig.ScreenLayout.EquipStatusValues[3], kNumColorCyan, kNumAlignRight);
+      PAL_DrawNumber(PAL_GetPlayerFleeRate(w), 4, gConfig.ScreenLayout.EquipStatusValues[4], kNumColorCyan, kNumAlignRight);
 
       //
       // Draw a box for player selection
       //
-      PAL_CreateBox(gConfig.MenuLayout.RoleListBox, gpGlobals->wMaxPartyMemberIndex, PAL_WordMaxWidth(36, 4) - 1, 0, FALSE);
+      PAL_CreateBox(gConfig.ScreenLayout.EquipRoleListBox, gpGlobals->wMaxPartyMemberIndex, PAL_WordMaxWidth(36, 4) - 1, 0, FALSE);
 
       //
       // Draw the label of players
@@ -1873,7 +1882,7 @@ PAL_EquipItemMenu(
          }
 
          PAL_DrawText(PAL_GetWord(gpGlobals->g.PlayerRoles.rgwName[w]),
-            PAL_XY_OFFSET(gConfig.MenuLayout.RoleListBox, 13, 13 + 18 * i), bColor, TRUE, FALSE, FALSE);
+            PAL_XY_OFFSET(gConfig.ScreenLayout.EquipRoleListBox, 13, 13 + 18 * i), bColor, TRUE, FALSE, FALSE);
       }
 
       //
@@ -1881,8 +1890,8 @@ PAL_EquipItemMenu(
       //
       if (wItem != 0)
       {
-         PAL_DrawText(PAL_GetWord(wItem), gConfig.MenuLayout.ItemName, MENUITEM_COLOR_CONFIRMED, TRUE, FALSE, FALSE);
-         PAL_DrawNumber(PAL_GetItemAmount(wItem), 2, gConfig.MenuLayout.ItemAmount, kNumColorCyan, kNumAlignRight);
+         PAL_DrawText(PAL_GetWord(wItem), gConfig.ScreenLayout.EquipItemName, MENUITEM_COLOR_CONFIRMED, TRUE, FALSE, FALSE);
+         PAL_DrawNumber(PAL_GetItemAmount(wItem), 2, gConfig.ScreenLayout.EquipItemAmount, kNumColorCyan, kNumAlignRight);
       }
 
       //
@@ -1924,7 +1933,7 @@ PAL_EquipItemMenu(
             if (gpGlobals->g.rgObject[wItem].item.wFlags & (kItemFlagEquipableByPlayerRole_First << w))
             {
                PAL_DrawText(PAL_GetWord(gpGlobals->g.PlayerRoles.rgwName[w]),
-                  PAL_XY_OFFSET(gConfig.MenuLayout.RoleListBox, 13, 13 + 18 * iCurrentPlayer), bSelectedColor, TRUE, TRUE, FALSE);
+                  PAL_XY_OFFSET(gConfig.ScreenLayout.EquipRoleListBox, 13, 13 + 18 * iCurrentPlayer), bSelectedColor, TRUE, TRUE, FALSE);
             }
          }