|
@@ -178,6 +178,7 @@ PAL_ReadMessageFile(
|
|
|
ST_SETTING,
|
|
|
ST_DIALOG,
|
|
|
ST_WORD,
|
|
|
+ ST_DESC,
|
|
|
ST_CREDIT,
|
|
|
ST_LAYOUT
|
|
|
} state = ST_OUTSIDE;
|
|
@@ -229,6 +230,10 @@ PAL_ReadMessageFile(
|
|
|
|
|
|
witem = &whead;
|
|
|
}
|
|
|
+ else if (strncmp(buffer, "[BEGIN DESCRIPTIONS]", 13) == 0 && !witem)
|
|
|
+ {
|
|
|
+ state = ST_DESC;
|
|
|
+ }
|
|
|
else if (strncmp(buffer, "[BEGIN CREDITS]", 15) == 0 && !witem)
|
|
|
{
|
|
|
state = ST_CREDIT;
|
|
@@ -304,6 +309,71 @@ PAL_ReadMessageFile(
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+ case ST_DESC:
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (strncmp(buffer, "[END DESCRIPTIONS]", 18) == 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ state = ST_OUTSIDE;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ char *line = buffer;
|
|
|
+ while (*buffer && iswspace(*buffer)) line++;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (*line && *line != '#')
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ LPSTR p = strchr(line, '=');
|
|
|
+ int wlen,strip_count=2;
|
|
|
+ if (p)
|
|
|
+ {
|
|
|
+ int index;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ LPSTR end = line + strlen(line);
|
|
|
+ if (end > line && end[-1] == '\n') *(--end) = 0;
|
|
|
+ if (FALSE) while (end > line && iswspace(end[-1])) *(--end) = 0;
|
|
|
+
|
|
|
+ *p++ = '\0';
|
|
|
+ while(strip_count--){
|
|
|
+ if(p[strlen(p)-1]=='\r') p[strlen(p)-1]='\0';
|
|
|
+ if(p[strlen(p)-1]=='\n') p[strlen(p)-1]='\0';
|
|
|
+ }
|
|
|
+ wlen = PAL_MultiByteToWideCharCP(CP_UTF_8, p, -1, NULL, 0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ sscanf(line, "%x", &index);
|
|
|
+ LPOBJECTDESC lpObjectDesc = gpGlobals->lpObjectDesc;
|
|
|
+ while (lpObjectDesc != NULL)
|
|
|
+ {
|
|
|
+ if (lpObjectDesc->wObjectID == index)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ lpObjectDesc = lpObjectDesc->next;
|
|
|
+ }
|
|
|
+ if( lpObjectDesc )
|
|
|
+ {
|
|
|
+ lpObjectDesc->wObjectID = index;
|
|
|
+ lpObjectDesc->lpDesc = (LPWSTR)UTIL_calloc(1, wlen * sizeof(WCHAR));
|
|
|
+ PAL_MultiByteToWideCharCP(CP_UTF_8, p, -1, lpObjectDesc->lpDesc, wlen);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
case ST_SETTING:
|
|
|
|
|
|
|