mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged from revision: 7397
Externalized History Log texts (by Jazz) - see TableData\History.xml - added support for language specific history (German.History.xml, French.History.xml, ...) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7399 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1113,6 +1113,21 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
GetFileClose(&FileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//History by Jazz
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, HISTORYNAMEFILENAME);
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,FALSE), HISTORYNAMEFILENAME);
|
||||
|
||||
#ifndef ENGLISH
|
||||
AddLanguagePrefix(fileName);
|
||||
if ( FileExists(fileName) )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||
SGP_THROW_IFFALSE(ReadInHistorys(fileName,TRUE), fileName);
|
||||
}
|
||||
#endif
|
||||
|
||||
// IMP Portraits List by Jazz
|
||||
strcpy(fileName, directoryName);
|
||||
|
||||
@@ -417,7 +417,11 @@
|
||||
<File
|
||||
RelativePath=".\BrokenLink.h"
|
||||
>
|
||||
</File>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignHistory_Summary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignHistoryData.h"
|
||||
>
|
||||
@@ -426,14 +430,10 @@
|
||||
RelativePath=".\CampaignHistoryMain.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignHistory_Summary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignStats.h"
|
||||
>
|
||||
</File>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CharProfile.h"
|
||||
>
|
||||
@@ -757,11 +757,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignHistoryMain.cpp"
|
||||
RelativePath=".\CampaignHistory_Summary.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CampaignHistory_Summary.cpp"
|
||||
RelativePath=".\CampaignHistoryMain.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1016,6 +1016,10 @@
|
||||
RelativePath=".\XML_EmailMercLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_History.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_IMPPortraits.cpp"
|
||||
>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="Laptop"
|
||||
ProjectGUID="{4D6F7570-9A1E-4DB0-8FD7-B9D14DD4E821}"
|
||||
RootNamespace="Laptop"
|
||||
@@ -418,6 +418,10 @@
|
||||
RelativePath="BrokenLink.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignHistory_Summary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignHistoryData.h"
|
||||
>
|
||||
@@ -426,10 +430,6 @@
|
||||
RelativePath="CampaignHistoryMain.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignHistory_Summary.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignStats.h"
|
||||
>
|
||||
@@ -747,11 +747,11 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignHistoryMain.cpp"
|
||||
RelativePath="CampaignHistory_Summary.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CampaignHistory_Summary.cpp"
|
||||
RelativePath="CampaignHistoryMain.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@@ -1002,6 +1002,10 @@
|
||||
RelativePath=".\XML_EmailMercLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_History.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_IMPPortraits.cpp"
|
||||
>
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
<ClCompile Include="XML_Email.cpp" />
|
||||
<ClCompile Include="XML_EmailMercAvailable.cpp" />
|
||||
<ClCompile Include="XML_EmailMercLevelUp.cpp" />
|
||||
<ClCompile Include="XML_History.cpp" />
|
||||
<ClCompile Include="XML_IMPPortraits.cpp" />
|
||||
<ClCompile Include="XML_OldAIMArchive.cpp" />
|
||||
<ClCompile Include="XML_ShippingDestinations.cpp" />
|
||||
|
||||
@@ -527,5 +527,8 @@
|
||||
<ClCompile Include="merccompare.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_History.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -194,6 +194,7 @@
|
||||
<ClCompile Include="XML_Email.cpp" />
|
||||
<ClCompile Include="XML_EmailMercAvailable.cpp" />
|
||||
<ClCompile Include="XML_EmailMercLevelUp.cpp" />
|
||||
<ClCompile Include="XML_History.cpp" />
|
||||
<ClCompile Include="XML_IMPPortraits.cpp" />
|
||||
<ClCompile Include="XML_OldAIMArchive.cpp" />
|
||||
<ClCompile Include="XML_ShippingDestinations.cpp" />
|
||||
|
||||
@@ -526,6 +526,9 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="WHO.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_History.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,188 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Interface.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Text.h"
|
||||
#include "history.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||
HISTORY_VALUES curMercHistorys;
|
||||
HISTORY_VALUES * curArray;
|
||||
|
||||
UINT32 maxArraySize;
|
||||
UINT32 curIndex;
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
//CHAR16 gzMercNames[MAX_ENEMY_NAMES_CHARS];
|
||||
}
|
||||
typedef mercHistoryParseData;
|
||||
|
||||
BOOLEAN MercHistory_TextOnly;
|
||||
|
||||
static void XMLCALL
|
||||
mercHistoryStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
mercHistoryParseData * pData = (mercHistoryParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
if(strcmp(name, "STRINGS") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "TEXT") == 0 && pData->curElement == ELEMENT_LIST)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "uiIndex") == 0 ||
|
||||
strcmp(name, "sHistory") == 0
|
||||
))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
pData->szCharData[0] = '\0';
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
mercHistoryCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
mercHistoryParseData * pData = (mercHistoryParseData *)userData;
|
||||
|
||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
||||
){
|
||||
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void XMLCALL
|
||||
mercHistoryEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
mercHistoryParseData * pData = (mercHistoryParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth)
|
||||
{
|
||||
if(strcmp(name, "STRINGS") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "TEXT") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if (!MercHistory_TextOnly)
|
||||
{
|
||||
wcscpy(HistoryName[pData->curMercHistorys.uiIndex].sHistory, pData->curMercHistorys.sHistory);
|
||||
//wcscpy(pHistoryStrings[pData->curMercHistorys.uiIndex], pData->curMercHistorys.sHistory);
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(HistoryName[pData->curMercHistorys.uiIndex].sHistory, pData->curMercHistorys.sHistory);
|
||||
//wcscpy(pHistoryStrings[pData->curMercHistorys.uiIndex], pData->curMercHistorys.sHistory);
|
||||
}
|
||||
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curMercHistorys.uiIndex = (UINT16) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "sHistory") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curMercHistorys.sHistory, sizeof(pData->curMercHistorys.sHistory)/sizeof(pData->curMercHistorys.sHistory[0]) );
|
||||
pData->curMercHistorys.sHistory[sizeof(pData->curMercHistorys.sHistory)/sizeof(pData->curMercHistorys.sHistory[0]) - 1] = '\0';
|
||||
}
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOLEAN ReadInHistorys(STR fileName, BOOLEAN localizedVersion)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
mercHistoryParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading History.xml" );
|
||||
|
||||
MercHistory_TextOnly = localizedVersion;
|
||||
|
||||
// Open file
|
||||
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
||||
if ( !hFile )
|
||||
return( localizedVersion );
|
||||
|
||||
uiFSize = FileGetSize(hFile);
|
||||
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
|
||||
|
||||
//Read in block
|
||||
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
|
||||
{
|
||||
MemFree(lpcBuffer);
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
lpcBuffer[uiFSize] = 0; //add a null terminator
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
|
||||
XML_SetElementHandler(parser, mercHistoryStartElementHandle, mercHistoryEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, mercHistoryCharacterDataHandle);
|
||||
|
||||
|
||||
memset(&pData,0,sizeof(pData));
|
||||
XML_SetUserData(parser, &pData);
|
||||
|
||||
|
||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||
{
|
||||
CHAR8 errorBuf[511];
|
||||
|
||||
sprintf(errorBuf, "XML Parser Error in History.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
|
||||
LiveMessage(errorBuf);
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MemFree(lpcBuffer);
|
||||
|
||||
|
||||
XML_ParserFree(parser);
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
+55
-28
@@ -81,7 +81,7 @@ enum{
|
||||
LAST_PAGE_BUTTON,
|
||||
};
|
||||
|
||||
|
||||
HISTORY_VALUES HistoryName[500];
|
||||
|
||||
// the page flipping buttons
|
||||
INT32 giHistoryButton[4];
|
||||
@@ -1082,65 +1082,81 @@ void ProcessHistoryTransactionString(STR16 pString, HistoryUnitPtr pHistory)
|
||||
switch( pHistory->ubCode)
|
||||
{
|
||||
case HISTORY_ENTERED_HISTORY_MODE:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_ENTERED_HISTORY_MODE ]);
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_ENTERED_HISTORY_MODE ]);
|
||||
swprintf(pString, HistoryName[ HISTORY_ENTERED_HISTORY_MODE ].sHistory);
|
||||
break;
|
||||
|
||||
case HISTORY_HIRED_MERC_FROM_AIM:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_HIRED_MERC_FROM_AIM ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_HIRED_MERC_FROM_AIM ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
swprintf(pString, HistoryName[ HISTORY_HIRED_MERC_FROM_AIM ].sHistory, gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
break;
|
||||
|
||||
case HISTORY_MERC_KILLED:
|
||||
if( pHistory->ubSecondCode != NO_PROFILE )
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_MERC_KILLED ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_MERC_KILLED ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
swprintf(pString, HistoryName[ HISTORY_MERC_KILLED ].sHistory, gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
#ifdef JA2BETAVERSION
|
||||
else
|
||||
{
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_MERC_KILLED ], L"ERROR!!! NO_PROFILE" );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_MERC_KILLED ], L"ERROR!!! NO_PROFILE" );
|
||||
swprintf(pString, HistoryName[ HISTORY_MERC_KILLED ].sHistory, L"ERROR!!! NO_PROFILE" );
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case HISTORY_HIRED_MERC_FROM_MERC:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_HIRED_MERC_FROM_MERC ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_HIRED_MERC_FROM_MERC ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
swprintf(pString, HistoryName[ HISTORY_HIRED_MERC_FROM_MERC ].sHistory, gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
break;
|
||||
|
||||
case HISTORY_SETTLED_ACCOUNTS_AT_MERC:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_SETTLED_ACCOUNTS_AT_MERC ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_SETTLED_ACCOUNTS_AT_MERC ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_SETTLED_ACCOUNTS_AT_MERC ].sHistory );
|
||||
break;
|
||||
case HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO ].sHistory);
|
||||
break;
|
||||
case( HISTORY_CHARACTER_GENERATED ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_CHARACTER_GENERATED ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_CHARACTER_GENERATED ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_CHARACTER_GENERATED ].sHistory );
|
||||
break;
|
||||
case( HISTORY_PURCHASED_INSURANCE ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_PURCHASED_INSURANCE ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_PURCHASED_INSURANCE ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_PURCHASED_INSURANCE ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
case( HISTORY_CANCELLED_INSURANCE ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_CANCELLED_INSURANCE ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_CANCELLED_INSURANCE ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_CANCELLED_INSURANCE ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
case( HISTORY_INSURANCE_CLAIM_PAYOUT ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_INSURANCE_CLAIM_PAYOUT ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_INSURANCE_CLAIM_PAYOUT ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_INSURANCE_CLAIM_PAYOUT ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case HISTORY_EXTENDED_CONTRACT_1_DAY:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_1_DAY ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_1_DAY ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_EXTENDED_CONTRACT_1_DAY ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case HISTORY_EXTENDED_CONTRACT_1_WEEK:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_1_WEEK ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_1_WEEK ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_EXTENDED_CONTRACT_1_WEEK ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case HISTORY_EXTENDED_CONTRACT_2_WEEK:
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_2_WEEK ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_EXTENDED_CONTRACT_2_WEEK ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_EXTENDED_CONTRACT_2_WEEK ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case( HISTORY_MERC_FIRED ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_MERC_FIRED ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_MERC_FIRED ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_MERC_FIRED ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case( HISTORY_MERC_QUIT ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_MERC_QUIT ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_MERC_QUIT ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf(pString, HistoryName[ HISTORY_MERC_QUIT ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
case( HISTORY_QUEST_STARTED ):
|
||||
@@ -1154,42 +1170,52 @@ void ProcessHistoryTransactionString(STR16 pString, HistoryUnitPtr pHistory)
|
||||
|
||||
break;
|
||||
case( HISTORY_TALKED_TO_MINER ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_TALKED_TO_MINER ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_TALKED_TO_MINER ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_TALKED_TO_MINER ].sHistory, pTownNames[ pHistory->ubSecondCode ] );
|
||||
break;
|
||||
case( HISTORY_LIBERATED_TOWN ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_LIBERATED_TOWN ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_LIBERATED_TOWN ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_LIBERATED_TOWN ].sHistory, pTownNames[ pHistory->ubSecondCode ] );
|
||||
break;
|
||||
case( HISTORY_CHEAT_ENABLED ):
|
||||
swprintf(pString, pHistoryStrings[ HISTORY_CHEAT_ENABLED ] );
|
||||
//swprintf(pString, pHistoryStrings[ HISTORY_CHEAT_ENABLED ] );
|
||||
swprintf(pString, HistoryName[ HISTORY_CHEAT_ENABLED ].sHistory );
|
||||
break;
|
||||
case HISTORY_TALKED_TO_FATHER_WALKER:
|
||||
swprintf( pString, pHistoryStrings[ HISTORY_TALKED_TO_FATHER_WALKER ] );
|
||||
//swprintf( pString, pHistoryStrings[ HISTORY_TALKED_TO_FATHER_WALKER ] );
|
||||
swprintf( pString, HistoryName[ HISTORY_TALKED_TO_FATHER_WALKER ].sHistory );
|
||||
break;
|
||||
case HISTORY_MERC_MARRIED_OFF:
|
||||
swprintf( pString, pHistoryStrings[ HISTORY_MERC_MARRIED_OFF ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf( pString, pHistoryStrings[ HISTORY_MERC_MARRIED_OFF ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf( pString, HistoryName[ HISTORY_MERC_MARRIED_OFF ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
case HISTORY_MERC_CONTRACT_EXPIRED:
|
||||
swprintf( pString, pHistoryStrings[ HISTORY_MERC_CONTRACT_EXPIRED ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
//swprintf( pString, pHistoryStrings[ HISTORY_MERC_CONTRACT_EXPIRED ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
swprintf( pString, HistoryName[ HISTORY_MERC_CONTRACT_EXPIRED ].sHistory, gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
break;
|
||||
case HISTORY_RPC_JOINED_TEAM:
|
||||
swprintf( pString, pHistoryStrings[ HISTORY_RPC_JOINED_TEAM ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
//swprintf( pString, pHistoryStrings[ HISTORY_RPC_JOINED_TEAM ], gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
swprintf( pString, HistoryName[ HISTORY_RPC_JOINED_TEAM ].sHistory, gMercProfiles[pHistory->ubSecondCode].zName );
|
||||
break;
|
||||
case HISTORY_ENRICO_COMPLAINED:
|
||||
swprintf( pString, pHistoryStrings[ HISTORY_ENRICO_COMPLAINED ] );
|
||||
//swprintf( pString, pHistoryStrings[ HISTORY_ENRICO_COMPLAINED ] );
|
||||
swprintf( pString, HistoryName[ HISTORY_ENRICO_COMPLAINED ].sHistory );
|
||||
break;
|
||||
case HISTORY_MINE_RUNNING_OUT:
|
||||
case HISTORY_MINE_RAN_OUT:
|
||||
case HISTORY_MINE_SHUTDOWN:
|
||||
case HISTORY_MINE_REOPENED:
|
||||
// all the same format
|
||||
swprintf(pString, pHistoryStrings[ pHistory->ubCode ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
//swprintf(pString, pHistoryStrings[ pHistory->ubCode ], pTownNames[ pHistory->ubSecondCode ] );
|
||||
swprintf(pString, HistoryName[ pHistory->ubCode ].sHistory, pTownNames[ pHistory->ubSecondCode ] );
|
||||
break;
|
||||
case HISTORY_LOST_BOXING:
|
||||
case HISTORY_WON_BOXING:
|
||||
case HISTORY_DISQUALIFIED_BOXING:
|
||||
case HISTORY_NPC_KILLED:
|
||||
case HISTORY_MERC_KILLED_CHARACTER:
|
||||
swprintf( pString, pHistoryStrings[ pHistory->ubCode ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
//swprintf( pString, pHistoryStrings[ pHistory->ubCode ], gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
swprintf( pString, HistoryName[ pHistory->ubCode ].sHistory, gMercProfiles[pHistory->ubSecondCode].zNickname );
|
||||
break;
|
||||
|
||||
// ALL SIMPLE HISTORY LOG MSGS, NO PARAMS
|
||||
@@ -1240,7 +1266,8 @@ void ProcessHistoryTransactionString(STR16 pString, HistoryUnitPtr pHistory)
|
||||
case HISTORY_SLAY_MYSTERIOUSLY_LEFT:
|
||||
case HISTORY_WALDO:
|
||||
case HISTORY_HELICOPTER_REPAIR_STARTED:
|
||||
swprintf( pString, pHistoryStrings[ pHistory->ubCode ], pHistory->ubSecondCode );
|
||||
//swprintf( pString, pHistoryStrings[ pHistory->ubCode ], pHistory->ubSecondCode );
|
||||
swprintf( pString, HistoryName[ pHistory->ubCode ].sHistory, pHistory->ubSecondCode );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,14 @@ struct history{
|
||||
struct history *Next; // next unit in the list
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
CHAR16 sHistory[128];
|
||||
|
||||
} HISTORY_VALUES;
|
||||
|
||||
extern HISTORY_VALUES HistoryName[500];
|
||||
|
||||
enum{
|
||||
HISTORY_ENTERED_HISTORY_MODE=0,
|
||||
|
||||
@@ -255,6 +255,8 @@ typedef PARSE_STAGE;
|
||||
#define MILITIA_REGULAR_PROFILE_FILENAME "Profiles\\SoldierProfileMilitiaRegular.xml"
|
||||
#define MILITIA_VETERAN_PROFILE_FILENAME "Profiles\\SoldierProfileMilitiaVeteran.xml"
|
||||
|
||||
#define HISTORYNAMEFILENAME "History.xml"
|
||||
|
||||
extern BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion);
|
||||
extern BOOLEAN WriteItemStats();
|
||||
|
||||
@@ -549,4 +551,6 @@ extern void InitNewVehicles ();
|
||||
extern BOOLEAN ReadInLanguageLocation(STR fileName, BOOLEAN localizedVersion, LANGUAGE_LOCATION *Lang, UINT32 FileType2 );
|
||||
|
||||
extern BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion);
|
||||
|
||||
extern BOOLEAN ReadInHistorys(STR fileName, BOOLEAN localizedVersion );
|
||||
#endif
|
||||
|
||||
@@ -240,7 +240,7 @@ bool Loc::ExportStrings()
|
||||
ExportSection(props, L"FilesSender", Loc::pFilesSenderList, 0, 7);
|
||||
ExportSection(props, L"HistoryTitle", Loc::pHistoryTitle, 0, 1);
|
||||
ExportSection(props, L"HistoryHeader", Loc::pHistoryHeaders, 0, 5);
|
||||
ExportSection(props, L"History", Loc::pHistoryStrings, 0, TEXT_NUM_HISTORY);
|
||||
//ExportSection(props, L"History", Loc::pHistoryStrings, 0, TEXT_NUM_HISTORY);
|
||||
ExportSection(props, L"HistoryLocation", Loc::pHistoryLocations, 0, 1);
|
||||
ExportSection(props, L"LaptopIcon", Loc::pLaptopIcons, 0, 8);
|
||||
|
||||
|
||||
+1
-1
@@ -273,7 +273,7 @@ extern STR16 pFilesTitle[];
|
||||
extern STR16 pFilesSenderList[];
|
||||
extern STR16 pHistoryLocations[];
|
||||
//extern STR16 pHistoryAlternateStrings[];
|
||||
extern STR16 pHistoryStrings[];
|
||||
//extern STR16 pHistoryStrings[]; // Externalized to "TableData\History.xml"
|
||||
extern STR16 pHistoryHeaders[];
|
||||
extern STR16 pHistoryTitle[];
|
||||
extern STR16 pShowBookmarkString[];
|
||||
|
||||
@@ -4196,6 +4196,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"事件", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4301,6 +4303,7 @@ STR16 pHistoryStrings[] =
|
||||
L"碰到了 Waldo - 飞机机械师。",//L"Met Waldo - aircraft mechanic.",
|
||||
L"直升机维修开始. 预计时间: %d 小时(s)。",//L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4198,6 +4198,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Geb.", // the event label
|
||||
};
|
||||
|
||||
/*
|
||||
// Externalized to "TableData\History.xml"
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4303,6 +4305,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Met Waldo - aircraft mechanic.",
|
||||
L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4195,6 +4195,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Event", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4300,6 +4302,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Met Waldo - aircraft mechanic.",
|
||||
L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4208,6 +4208,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Événement", // the event label
|
||||
};
|
||||
|
||||
/*
|
||||
// Externalized to "TableData\History.xml"
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4313,6 +4315,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Rencontre avec Waldo, mécanicien aéronautique.",
|
||||
L"Réparations de l'hélico ont débuté, temps estimé : %d h.",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4151,6 +4151,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Ereignis", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4256,6 +4258,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Met Waldo - aircraft mechanic.",
|
||||
L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4189,6 +4189,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Evento", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4294,6 +4296,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Met Waldo - aircraft mechanic.",
|
||||
L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4205,6 +4205,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Zdarzenie", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4310,6 +4312,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Spotkanie z Waldo - mechanikiem lotniczym.",
|
||||
L"Rozpoczęto naprawę helikoptera. Szacowany czas: %d godzin(y).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
@@ -4196,6 +4196,8 @@ STR16 pHistoryHeaders[] =
|
||||
L"Событие", // the event label
|
||||
};
|
||||
|
||||
// Externalized to "TableData\History.xml"
|
||||
/*
|
||||
// various history events
|
||||
// THESE STRINGS ARE "HISTORY LOG" STRINGS AND THEIR LENGTH IS VERY LIMITED.
|
||||
// PLEASE BE MINDFUL OF THE LENGTH OF THESE STRINGS. ONE WAY TO "TEST" THIS
|
||||
@@ -4301,6 +4303,7 @@ STR16 pHistoryStrings[] =
|
||||
L"Met Waldo - aircraft mechanic.",
|
||||
L"Helicopter repairs started. Estimated time: %d hour(s).",
|
||||
};
|
||||
*/
|
||||
|
||||
STR16 pHistoryLocations[] =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user