mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+100
-100
@@ -40,7 +40,7 @@ BOOLEAN fVoiceAVisited = FALSE, fVoiceBVisited = FALSE, fVoiceCVisited = FALSE;
|
||||
BOOLEAN fReDrawVoicesScreenFlag = FALSE;
|
||||
|
||||
// the portrait region, for player to click on and re-hear voice
|
||||
MOUSE_REGION gVoicePortraitRegion;
|
||||
MOUSE_REGION gVoicePortraitRegion;
|
||||
|
||||
// function definitions
|
||||
void IncrementVoice( void );
|
||||
@@ -60,12 +60,12 @@ void IMPPortraitRegionButtonCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
void EnterIMPVoices( void )
|
||||
{
|
||||
fVoiceAVisited = FALSE;
|
||||
fVoiceAVisited = FALSE;
|
||||
fVoiceBVisited = FALSE;
|
||||
fVoiceCVisited = FALSE;
|
||||
|
||||
// Set the initial voice
|
||||
if (fCharacterIsMale == TRUE)
|
||||
if (fCharacterIsMale == TRUE)
|
||||
{
|
||||
iCurrentVoice = GetFirstFreeSlot(MALE);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void EnterIMPVoices( void )
|
||||
|
||||
// create buttons
|
||||
CreateIMPVoicesButtons( );
|
||||
|
||||
|
||||
// create mouse regions
|
||||
CreateIMPVoiceMouseRegions( );
|
||||
|
||||
@@ -92,19 +92,19 @@ void EnterIMPVoices( void )
|
||||
|
||||
void RenderIMPVoices( void )
|
||||
{
|
||||
|
||||
|
||||
// render background
|
||||
|
||||
// render background
|
||||
RenderProfileBackGround( );
|
||||
|
||||
// the Voices frame
|
||||
RenderPortraitFrame( 191, 167 );
|
||||
|
||||
|
||||
// the sillouette
|
||||
RenderLargeSilhouette( 200, 176 );
|
||||
|
||||
// indent for the text
|
||||
RenderAttrib1IndentFrame( 128, 65);
|
||||
RenderAttrib1IndentFrame( 128, 65);
|
||||
|
||||
// render voice index value
|
||||
RenderVoiceIndex( );
|
||||
@@ -119,9 +119,9 @@ void RenderIMPVoices( void )
|
||||
void ExitIMPVoices( void )
|
||||
{
|
||||
// destroy buttons for IMP Voices page
|
||||
DestroyIMPVoicesButtons( );
|
||||
DestroyIMPVoicesButtons( );
|
||||
|
||||
// destroy mouse regions for this screen
|
||||
// destroy mouse regions for this screen
|
||||
DestroyIMPVoiceMouseRegions( );
|
||||
|
||||
|
||||
@@ -132,10 +132,10 @@ void HandleIMPVoices( void )
|
||||
{
|
||||
|
||||
// do we need to re write screen
|
||||
if ( fReDrawVoicesScreenFlag == TRUE )
|
||||
if ( fReDrawVoicesScreenFlag == TRUE )
|
||||
{
|
||||
RenderIMPVoices( );
|
||||
|
||||
RenderIMPVoices( );
|
||||
|
||||
// reset redraw flag
|
||||
fReDrawVoicesScreenFlag = FALSE;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void HandleIMPVoices( void )
|
||||
|
||||
// WDS: Allow flexible numbers of IMPs of each sex
|
||||
// Ensure the voice is within the valid range
|
||||
void FixVoiceRange()
|
||||
void FixVoiceRange()
|
||||
{
|
||||
if (fCharacterIsMale == TRUE)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ void IncrementVoice( void )
|
||||
|
||||
void DecrementVoice( void )
|
||||
{
|
||||
INT32 iIMPIndex = -1;
|
||||
INT32 iIMPIndex = -1;
|
||||
INT32 i;
|
||||
|
||||
iCurrentVoice--;
|
||||
@@ -215,54 +215,54 @@ void DecrementVoice( void )
|
||||
|
||||
void CreateIMPVoicesButtons( void )
|
||||
{
|
||||
// will create buttons need for the IMP Voices screen
|
||||
// will create buttons need for the IMP Voices screen
|
||||
|
||||
// next button
|
||||
giIMPVoicesButtonImage[0]= LoadButtonImage( "LAPTOP\\voicearrows.sti" ,-1,1,-1,3,-1 );
|
||||
/*giIMPVoicesButton[0] = QuickCreateButton( giIMPVoicesButtonImage[0], LAPTOP_SCREEN_UL_X + ( 18 ), LAPTOP_SCREEN_WEB_UL_Y + ( 184 ),
|
||||
giIMPVoicesButtonImage[0]= LoadButtonImage( "LAPTOP\\voicearrows.sti" ,-1,1,-1,3,-1 );
|
||||
/*giIMPVoicesButton[0] = QuickCreateButton( giIMPVoicesButtonImage[0], LAPTOP_SCREEN_UL_X + ( 18 ), LAPTOP_SCREEN_WEB_UL_Y + ( 184 ),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesNextCallback );
|
||||
*/
|
||||
giIMPVoicesButton[0] = CreateIconAndTextButton( giIMPVoicesButtonImage[0], pImpButtonText[ 13 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 343 ), LAPTOP_SCREEN_WEB_UL_Y + ( 205 ),BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesNextCallback);
|
||||
*/
|
||||
giIMPVoicesButton[0] = CreateIconAndTextButton( giIMPVoicesButtonImage[0], pImpButtonText[ 13 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 343 ), LAPTOP_SCREEN_WEB_UL_Y + ( 205 ),BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesNextCallback);
|
||||
|
||||
|
||||
// previous button
|
||||
giIMPVoicesButtonImage[ 1 ]= LoadButtonImage( "LAPTOP\\voicearrows.sti" ,-1,0,-1,2,-1 );
|
||||
/* giIMPVoicesButton[ 1 ] = QuickCreateButton( giIMPVoicesButtonImage[ 1 ], LAPTOP_SCREEN_UL_X + ( 18 ), LAPTOP_SCREEN_WEB_UL_Y + ( 254 ),
|
||||
giIMPVoicesButtonImage[ 1 ]= LoadButtonImage( "LAPTOP\\voicearrows.sti" ,-1,0,-1,2,-1 );
|
||||
/* giIMPVoicesButton[ 1 ] = QuickCreateButton( giIMPVoicesButtonImage[ 1 ], LAPTOP_SCREEN_UL_X + ( 18 ), LAPTOP_SCREEN_WEB_UL_Y + ( 254 ),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesPreviousCallback );
|
||||
*/
|
||||
giIMPVoicesButton[ 1 ] = CreateIconAndTextButton( giIMPVoicesButtonImage[ 1 ], pImpButtonText[ 12 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 93), LAPTOP_SCREEN_WEB_UL_Y + ( 205 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesPreviousCallback);
|
||||
*/
|
||||
giIMPVoicesButton[ 1 ] = CreateIconAndTextButton( giIMPVoicesButtonImage[ 1 ], pImpButtonText[ 12 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 93), LAPTOP_SCREEN_WEB_UL_Y + ( 205 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesPreviousCallback);
|
||||
|
||||
|
||||
// done button
|
||||
giIMPVoicesButtonImage[ 2 ]= LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 );
|
||||
/* giIMPVoicesButton[ 2 ] = QuickCreateButton( giIMPVoicesButtonImage[ 1 ], LAPTOP_SCREEN_UL_X + ( 349 ), LAPTOP_SCREEN_WEB_UL_Y + ( 220 ),
|
||||
giIMPVoicesButtonImage[ 2 ]= LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 );
|
||||
/* giIMPVoicesButton[ 2 ] = QuickCreateButton( giIMPVoicesButtonImage[ 1 ], LAPTOP_SCREEN_UL_X + ( 349 ), LAPTOP_SCREEN_WEB_UL_Y + ( 220 ),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesDoneCallback );
|
||||
*/
|
||||
giIMPVoicesButton[ 2 ] = CreateIconAndTextButton( giIMPVoicesButtonImage[ 2 ], pImpButtonText[ 11 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 187 ), LAPTOP_SCREEN_WEB_UL_Y + ( 330 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesDoneCallback);
|
||||
*/
|
||||
giIMPVoicesButton[ 2 ] = CreateIconAndTextButton( giIMPVoicesButtonImage[ 2 ], pImpButtonText[ 11 ], FONT12ARIAL,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
FONT_WHITE, DEFAULT_SHADOW,
|
||||
TEXT_CJUSTIFIED,
|
||||
LAPTOP_SCREEN_UL_X + ( 187 ), LAPTOP_SCREEN_WEB_UL_Y + ( 330 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPVoicesDoneCallback);
|
||||
|
||||
|
||||
|
||||
SetButtonCursor(giIMPVoicesButton[0], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPVoicesButton[1], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPVoicesButton[2], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPVoicesButton[0], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPVoicesButton[1], CURSOR_WWW);
|
||||
SetButtonCursor(giIMPVoicesButton[2], CURSOR_WWW);
|
||||
}
|
||||
|
||||
|
||||
@@ -272,18 +272,18 @@ void DestroyIMPVoicesButtons( void )
|
||||
{
|
||||
|
||||
// will destroy buttons created for IMP Voices screen
|
||||
|
||||
|
||||
// the next button
|
||||
RemoveButton(giIMPVoicesButton[ 0 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 0 ] );
|
||||
|
||||
RemoveButton(giIMPVoicesButton[ 0 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 0 ] );
|
||||
|
||||
// the previous button
|
||||
RemoveButton(giIMPVoicesButton[ 1 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 1 ] );
|
||||
|
||||
RemoveButton(giIMPVoicesButton[ 1 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 1 ] );
|
||||
|
||||
// the done button
|
||||
RemoveButton(giIMPVoicesButton[ 2 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 2 ] );
|
||||
RemoveButton(giIMPVoicesButton[ 2 ] );
|
||||
UnloadButtonImage(giIMPVoicesButtonImage[ 2 ] );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -298,32 +298,32 @@ void BtnIMPVoicesNextCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
}
|
||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// next voice!!
|
||||
IncrementVoice( );
|
||||
// play voice
|
||||
if( ! SoundIsPlaying( uiVocVoiceSound ) )
|
||||
{
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundStop( uiVocVoiceSound );
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
|
||||
|
||||
|
||||
fReDrawVoicesScreenFlag = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BtnIMPVoicesPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -334,21 +334,21 @@ void BtnIMPVoicesPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
}
|
||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// previous voice, please!!!
|
||||
DecrementVoice( );
|
||||
// play voice
|
||||
if( ! SoundIsPlaying( uiVocVoiceSound ) )
|
||||
{
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundStop( uiVocVoiceSound );
|
||||
@@ -357,8 +357,8 @@ void BtnIMPVoicesPreviousCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
fReDrawVoicesScreenFlag = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BtnIMPVoicesDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -369,22 +369,22 @@ void BtnIMPVoicesDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
}
|
||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
// go to main page
|
||||
iCurrentImpPage = IMP_MAIN_PAGE;
|
||||
|
||||
// if we are already done, leave
|
||||
if( iCurrentProfileMode == IMP__FINISH )
|
||||
if( iCurrentProfileMode == IMP__FINISH )
|
||||
{
|
||||
iCurrentImpPage = IMP_FINISH;
|
||||
}
|
||||
iCurrentImpPage = IMP_FINISH;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( CameBackToVoicePageButNotFinished() )
|
||||
@@ -398,7 +398,7 @@ void BtnIMPVoicesDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
}
|
||||
/*
|
||||
// current mode now is voice
|
||||
else if( iCurrentProfileMode < IMP__PORTRAIT )
|
||||
else if( iCurrentProfileMode < IMP__PORTRAIT )
|
||||
{
|
||||
iCurrentProfileMode = IMP__PORTRAIT;
|
||||
}
|
||||
@@ -411,15 +411,15 @@ void BtnIMPVoicesDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
}
|
||||
*/
|
||||
// set voice id, to grab character slot
|
||||
|
||||
|
||||
// WDS: Allow flexible numbers of IMPs of each sex
|
||||
LaptopSaveInfo.iIMPIndex = gGameExternalOptions.iaIMPSlots[iCurrentVoice];
|
||||
|
||||
// set button up image pending
|
||||
// set button up image pending
|
||||
fButtonPendingFlag = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN CameBackToVoicePageButNotFinished()
|
||||
{
|
||||
@@ -444,17 +444,17 @@ UINT32 PlayVoice( void )
|
||||
Assert((iSlot >= 0) && (iSlot <= 999));
|
||||
sprintf(caVoiceSample, caVoiceSample, iSlot);
|
||||
|
||||
return( PlayJA2SampleFromFile( caVoiceSample, RATE_11025, MIDVOLUME, 1 , MIDDLEPAN ) );
|
||||
return( PlayJA2SampleFromFile( caVoiceSample, RATE_11025, MIDVOLUME, 1 , MIDDLEPAN ) );
|
||||
}
|
||||
|
||||
|
||||
void CreateIMPVoiceMouseRegions( void )
|
||||
{
|
||||
// will create mouse regions needed for the IMP voices page
|
||||
// will create mouse regions needed for the IMP voices page
|
||||
MSYS_DefineRegion( &gVoicePortraitRegion, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 176 ,LAPTOP_SCREEN_UL_X + 200 + 100, LAPTOP_SCREEN_WEB_UL_Y + 176 + 100,MSYS_PRIORITY_HIGH,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, IMPPortraitRegionButtonCallback );
|
||||
|
||||
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, IMPPortraitRegionButtonCallback );
|
||||
|
||||
|
||||
MSYS_AddRegion( &gVoicePortraitRegion );
|
||||
|
||||
return;
|
||||
@@ -462,29 +462,29 @@ void CreateIMPVoiceMouseRegions( void )
|
||||
|
||||
void DestroyIMPVoiceMouseRegions( void )
|
||||
{
|
||||
// will destroy already created mouse reiogns for IMP voices page
|
||||
MSYS_RemoveRegion( &gVoicePortraitRegion );
|
||||
// will destroy already created mouse reiogns for IMP voices page
|
||||
MSYS_RemoveRegion( &gVoicePortraitRegion );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void IMPPortraitRegionButtonCallback(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
{
|
||||
// callback handler for imp portrait region button events
|
||||
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
if( ! SoundIsPlaying( uiVocVoiceSound ) )
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
if( ! SoundIsPlaying( uiVocVoiceSound ) )
|
||||
{
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
uiVocVoiceSound = PlayVoice( );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -508,4 +508,4 @@ void RenderVoiceIndex( void )
|
||||
mprintf( sX, iScreenHeightOffset + 320, sString );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user