Add framework for adding externalized emails

Emails from new GameDir file TableData/Email/Emails.xml can be added via lua scripting using calls to AddEmailFromXML & AddPreReadEmailFromXML. The order of emails in Emails.xml acts as the index to be referenced and provided when calling lua  functions.

An error message  will be displayed if an email is added with an out-of-scope index but game will be able to continue.

Localization is supported and was tested on Chinese localization.
This commit is contained in:
Asdow
2026-01-03 17:27:43 +02:00
parent d6b30c6f43
commit aba3688b4b
6 changed files with 363 additions and 328 deletions
+2 -1
View File
@@ -181,6 +181,7 @@ typedef PARSE_STAGE;
#define LAPTOPFUNERALLOCATIONFILENAME "Laptop\\FuneralPositions.xml"
#define LAPTOPADDITIONALFILESFILENAME "AdditionalFiles.xml"
#define EMAILSFILENAME "Email\\Emails.xml"
#define EMAILSENDERNAMELIST "Email\\EmailSenderNameList.xml"
#define EMAILMERCAVAILABLE "Email\\EmailMercAvailable.xml"
#define EMAILMERCLEVELUP "Email\\EmailMercLevelUp.xml"
@@ -558,7 +559,7 @@ extern BOOLEAN WriteInActionItems( STR fileName);
extern BOOLEAN ReadInEmailMercAvailable(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN ReadInEmailMercLevelUp(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN ReadInExternalizedEmails(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN ReadInBriefingRoom(STR fileName, BOOLEAN localizedVersion, BRIEFINGROOM_M_DATA *Ency, UINT32 FileType2 );
extern BOOLEAN ReadInMinerals(STR fileName, BOOLEAN localizedVersion);