mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
*********************************************************
* 2006/04/26 * * Little Alien * * Developed in VS 2003 * ********************************************************* Source: - Soundmanager v1.1 added - Some changes for international versions git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@39 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+7
-43
@@ -651,40 +651,13 @@ INT32 FirstFreeBigEnoughPocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem)
|
||||
|
||||
|
||||
void WriteOutCurrentImpCharacter( INT32 iProfileId )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: IMP.dat"));
|
||||
char zImpFileName[12];
|
||||
strcat(zImpFileName,IMP_MERC_FILENAME);
|
||||
strcat(zImpFileName,IMP_FILENAME_SUFFIX);
|
||||
WriteOutCurrentImpCharacter ( iProfileId, zImpFileName);
|
||||
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat"));
|
||||
|
||||
char zFileName[12];
|
||||
char temp;
|
||||
|
||||
for(int i=0;i < 8;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead
|
||||
{
|
||||
temp = (char) gMercProfiles[iProfileId].zNickname[i];
|
||||
zFileName[i] = temp;
|
||||
}
|
||||
|
||||
strcat(zFileName,IMP_FILENAME_SUFFIX);
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", zFileName));
|
||||
WriteOutCurrentImpCharacter ( iProfileId, zFileName);
|
||||
}
|
||||
|
||||
void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName )
|
||||
{
|
||||
// grab the profile number and write out what is contained there in
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesWritten = 0;
|
||||
|
||||
// open the file for writing
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", fileName));
|
||||
hFile = FileOpen(fileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
|
||||
hFile = FileOpen(strcat((STR)(&gMercProfiles[iProfileId].zNickname),IMP_FILENAME_SUFFIX), FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
|
||||
|
||||
// write out the profile id
|
||||
if (!FileWrite(hFile, &iProfileId, sizeof( INT32 ), &uiBytesWritten))
|
||||
@@ -712,15 +685,11 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName )
|
||||
|
||||
BOOLEAN ImpExists ( STR nickName )
|
||||
{
|
||||
char zFileName[12];
|
||||
|
||||
strcpy(zFileName,nickName);
|
||||
strcat(zFileName,IMP_FILENAME_SUFFIX);
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %s", (STR) zFileName));
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %d", FileExistsNoDB(zFileName) ));
|
||||
|
||||
return FileExistsNoDB(zFileName);
|
||||
DWORD attribs = GetFileAttributes(strcat(nickName,IMP_FILENAME_SUFFIX));
|
||||
if ( attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY) )
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LoadImpCharacter( STR nickName )
|
||||
@@ -729,13 +698,8 @@ void LoadImpCharacter( STR nickName )
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead = 0;
|
||||
|
||||
char zFileName[12];
|
||||
|
||||
strcpy(zFileName,nickName);
|
||||
strcat(zFileName,IMP_FILENAME_SUFFIX);
|
||||
|
||||
// open the file for writing
|
||||
hFile = FileOpen(zFileName, FILE_ACCESS_READ, FALSE);
|
||||
hFile = FileOpen(strcat(nickName,IMP_FILENAME_SUFFIX), FILE_ACCESS_READ, FALSE);
|
||||
|
||||
// valid file?
|
||||
if( hFile == -1 )
|
||||
|
||||
@@ -9,7 +9,6 @@ void HandleIMPConfirm( void );
|
||||
BOOLEAN AddCharacterToPlayersTeam( void );
|
||||
void LoadImpCharacter( STR fileName );
|
||||
void WriteOutCurrentImpCharacter( INT32 iProfileId );
|
||||
void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName );
|
||||
|
||||
void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID );
|
||||
|
||||
|
||||
+4
-11
@@ -342,7 +342,7 @@ void HandleTextEvent( UINT32 uiKey )
|
||||
uiKey == '_' || uiKey == '.' )
|
||||
{
|
||||
// if the current string position is at max or great, do nothing
|
||||
if( iStringPos >= 8 )
|
||||
if( iStringPos >= 6 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -387,9 +387,6 @@ void ProcessPlayerInputActivationString( void )
|
||||
if( NumberOfMercsOnPlayerTeam() >= 18 )
|
||||
return;
|
||||
|
||||
char charPlayerActivationString[32];
|
||||
wcstombs(charPlayerActivationString,pPlayerActivationString,32);
|
||||
|
||||
//Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
{
|
||||
@@ -400,14 +397,10 @@ void ProcessPlayerInputActivationString( void )
|
||||
|
||||
}
|
||||
//Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) )
|
||||
else if( wcscmp(pPlayerActivationString, L"90210") == 0 )
|
||||
// Madd: load characters by name:
|
||||
else if ( ImpExists( (STR)pPlayerActivationString ) )
|
||||
{
|
||||
LoadImpCharacter( IMP_MERC_FILENAME );
|
||||
}
|
||||
// Madd: load characters by name
|
||||
else if ( ImpExists( charPlayerActivationString ) )
|
||||
{
|
||||
LoadImpCharacter( charPlayerActivationString );
|
||||
LoadImpCharacter( (STR)pPlayerActivationString );
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
@@ -12,7 +12,5 @@ void HandleImpHomePage( void );
|
||||
#define MIN_GLOW_DELTA 100
|
||||
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
|
||||
|
||||
#define IMP_MERC_FILENAME "IMP"
|
||||
|
||||
extern INT32 GlowColorsList[][3];
|
||||
#endif
|
||||
+2
-2
@@ -4519,8 +4519,8 @@ BOOLEAN DisplayTitleBarMaximizeGraphic(BOOLEAN fForward, BOOLEAN fInit, UINT16 u
|
||||
|
||||
sPosBottomY = LAPTOP_TITLE_BAR_HEIGHT;
|
||||
|
||||
SrcRect.iLeft = 0;
|
||||
SrcRect.iTop = 0;
|
||||
SrcRect.iLeft = iScreenWidthOffset;
|
||||
SrcRect.iTop = iScreenHeightOffset;
|
||||
SrcRect.iRight = LAPTOP_TITLE_BAR_WIDTH;
|
||||
SrcRect.iBottom = LAPTOP_TITLE_BAR_HEIGHT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user