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:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+234 -236
View File
@@ -75,7 +75,7 @@ BOOLEAN CheckIfFinishedCharacterGeneration( void );
// this is the current state of profiling the player is in.
/*
0 - Beginning
0 - Beginning
1 - Personnality
2 - Attributes and Skills
3 - Portrait
@@ -88,7 +88,7 @@ INT32 iCurrentProfileMode = IMP__REGISTRY;
extern INT32 iCurrentVoice;
// Return a count of how many IMP slots there are in total
INT32 CountIMPSlots()
INT32 CountIMPSlots()
{
INT32 idx;
// Keep a static count so we only count once
@@ -176,7 +176,7 @@ INT32 GetLastMaleSlot() {
idx = 0;
// Skip the males
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
{
++idx;
}
@@ -211,7 +211,7 @@ INT32 GetFirstFemaleSlot() {
idx = 0;
// Skip the males
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
{
++idx;
}
@@ -228,13 +228,13 @@ INT32 GetLastFemaleSlot() {
idx = 0;
// Skip the males
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
{
++idx;
}
++idx;
// Skip the females
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
{
++idx;
}
@@ -256,7 +256,7 @@ BOOLEAN IsIMPSlotFree(INT32 iIMPId)
{
if ((iIMPId >= 0) && (iIMPId < NUM_PROFILES) &&
((wcscmp(gMercProfiles[iIMPId].zName, L"") == 0) ||
(gMercProfiles[iIMPId].bMercStatus == MERC_IS_DEAD)))
(gMercProfiles[iIMPId].bMercStatus == MERC_IS_DEAD)))
{
return TRUE;
}
@@ -269,12 +269,12 @@ BOOLEAN IsIMPSlotFree(INT32 iIMPId)
void EnterIMPMainPage( void )
{
// turn off review mode
fReviewStats = FALSE;
// create buttons
// create buttons
CreateIMPMainPageButtons( );
// load portrait for face button, if applicable
@@ -286,19 +286,19 @@ void EnterIMPMainPage( void )
// alter states
UpDateIMPMainPageButtons( );
// entry into IMP about us page
// entry into IMP about us page
RenderIMPMainPage( );
return;
}
void ExitIMPMainPage( void )
{
// exit from IMP About us page
// exit from IMP About us page
// delete Buttons
DeleteIMPMainPageButtons( );
DeleteIMPMainPageButtons( );
DestoryMouseRegionsForIMPMainPageBasedOnCharGenStatus( );
return;
@@ -307,27 +307,27 @@ void ExitIMPMainPage( void )
void RenderIMPMainPage( void )
{
// rneders the IMP about us page
// rneders the IMP about us page
// the background
RenderProfileBackGround( );
// the IMP symbol
//RenderIMPSymbol( 106, 1 );
// indent
// indent
RenderMainIndentFrame( 164, 74 );
return;
}
void HandleIMPMainPage( void )
{
// handles the IMP about main page
// handles the IMP about main page
if ( CheckIfFinishedCharacterGeneration( ) )
{
iCurrentImpPage = IMP_FINISH;
iCurrentImpPage = IMP_FINISH;
}
// shade out buttons that should be shaded/unselectable
//ShadeUnSelectableButtons( );
@@ -339,34 +339,32 @@ void HandleIMPMainPage( void )
//
void CreateIMPMainPageButtons( void )
{
UINT16 usPosX=0;
CHAR16 sString[ 128 ];
CHAR16 sString[ 128 ];
// the back button button
giIMPMainPageButtonImage[0]= LoadButtonImage( "LAPTOP\\button_3.sti" ,-1,0,-1,1,-1 );
giIMPMainPageButtonImage[0]= LoadButtonImage( "LAPTOP\\button_3.sti" ,-1,0,-1,1,-1 );
/* giIMPMainPageButton[0] = QuickCreateButton( giIMPMainPageButtonImage[0], LAPTOP_SCREEN_UL_X + 10 , LAPTOP_SCREEN_WEB_UL_Y + ( 360 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBackCallback);
*/
//Cancel/back button
giIMPMainPageButton[0] = CreateIconAndTextButton( giIMPMainPageButtonImage[0], pImpButtonText[ 19 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + 15, LAPTOP_SCREEN_WEB_UL_Y + ( 360 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBackCallback);
giIMPMainPageButton[0] = CreateIconAndTextButton( giIMPMainPageButtonImage[0], pImpButtonText[ 19 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + 15, LAPTOP_SCREEN_WEB_UL_Y + ( 360 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBackCallback);
SpecifyButtonTextSubOffsets( giIMPMainPageButton[0], 0, -1, FALSE );
SpecifyButtonTextSubOffsets( giIMPMainPageButton[0], 0, -1, FALSE );
// the begin profiling button
giIMPMainPageButtonImage[1]= LoadButtonImage( "LAPTOP\\button_2.sti" ,-1,0,-1,1,-1 );
giIMPMainPageButtonImage[1]= LoadButtonImage( "LAPTOP\\button_2.sti" ,-1,0,-1,1,-1 );
/*giIMPMainPageButton[1] = QuickCreateButton( giIMPMainPageButtonImage[1], LAPTOP_SCREEN_UL_X + 136 , LAPTOP_SCREEN_WEB_UL_Y + ( 174 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBeginCallback);
@@ -375,40 +373,40 @@ void CreateIMPMainPageButtons( void )
//Registry/Begin button
if(( iCurrentProfileMode == IMP__REGISTRY )||( iCurrentProfileMode > IMP__ATTRIBUTES) )
{
giIMPMainPageButton[1] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 1 ], pImpButtonText[ 1 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + 136 , LAPTOP_SCREEN_WEB_UL_Y + ( 174 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBeginCallback);
}
giIMPMainPageButton[1] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 1 ], pImpButtonText[ 1 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + 136 , LAPTOP_SCREEN_WEB_UL_Y + ( 174 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBeginCallback);
}
else
{
giIMPMainPageButton[1] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 1 ], pImpButtonText[ 22 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
giIMPMainPageButton[1] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 1 ], pImpButtonText[ 22 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
LAPTOP_SCREEN_UL_X + 136 , LAPTOP_SCREEN_WEB_UL_Y + ( 174 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBeginCallback);
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageBeginCallback);
}
// the personality button
giIMPMainPageButtonImage[2]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
giIMPMainPageButtonImage[2]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
/*
giIMPMainPageButton[2] = QuickCreateButton( giIMPMainPageButtonImage[2], LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePersonalityCallback);
*/
//Personality
giIMPMainPageButton[2] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 2 ], pImpButtonText[ 2 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__THIRD_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePersonalityCallback);
giIMPMainPageButton[2] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 2 ], pImpButtonText[ 2 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__THIRD_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePersonalityCallback);
if( IMP_CanWeDisplaySpecialtiesGraph( ) )
@@ -419,51 +417,51 @@ void CreateIMPMainPageButtons( void )
// the attribs button
giIMPMainPageButtonImage[3]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
giIMPMainPageButtonImage[3]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
/*
giIMPMainPageButton[3] = QuickCreateButton( giIMPMainPageButtonImage[3], LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageAttributesCallback);
*/
//Attributes
giIMPMainPageButton[3] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 3 ], pImpButtonText[ 3 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__FOURTH_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageAttributesCallback);
giIMPMainPageButton[3] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 3 ], pImpButtonText[ 3 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__FOURTH_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageAttributesCallback);
if( IMP_CanWeDisplayAttributeGraph( ) )
{
SpecifyButtonIcon( giIMPMainPageButton[3], guiATTRIBUTEGRAPH, 0, 25, 25, FALSE );
SpecifyButtonIcon( giIMPMainPageButton[3], guiATTRIBUTEGRAPH, 0, 25, 25, FALSE );
}
// the portrait button
giIMPMainPageButtonImage[4]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
// the portrait button
giIMPMainPageButtonImage[4]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
/*giIMPMainPageButton[4] = QuickCreateButton( giIMPMainPageButtonImage[4], LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePortraitCallback);
*/
*/
//Portrait
giIMPMainPageButton[4] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 4 ], pImpButtonText[ 4 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__FIRST_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePortraitCallback);
giIMPMainPageButton[4] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 4 ], pImpButtonText[ 4 ], FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__FIRST_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPagePortraitCallback);
// the voice button
giIMPMainPageButtonImage[5]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
giIMPMainPageButtonImage[5]= LoadButtonImage( "LAPTOP\\button_8.sti" ,-1,0,-1,1,-1 );
/*giIMPMainPageButton[5] = QuickCreateButton( giIMPMainPageButtonImage[5], LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageVoiceCallback);
*/
*/
if( iCurrentProfileMode != IMP__VOICE && iCurrentProfileMode != IMP__PORTRAIT )
{
@@ -475,29 +473,29 @@ void CreateIMPMainPageButtons( void )
}
//Voice
giIMPMainPageButton[5] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 5 ], sString, FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__SECOND_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageVoiceCallback);
giIMPMainPageButton[5] = CreateIconAndTextButton( giIMPMainPageButtonImage[ 5 ], sString, FONT12ARIAL,
FONT_WHITE, DEFAULT_SHADOW,
FONT_WHITE, DEFAULT_SHADOW,
TEXT_CJUSTIFIED,
MAIN_PAGE__SECOND_BUTTON_POS_X, LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMainPageVoiceCallback);
if( IMP_CanWeDisplayVoiceGraph( ) )
{
SpecifyButtonIcon( giIMPMainPageButton[5], guiSMALLSILHOUETTE, 0, 33, 23, FALSE );
SpecifyButtonIcon( giIMPMainPageButton[5], guiSMALLSILHOUETTE, 0, 33, 23, FALSE );
}
SetButtonCursor(giIMPMainPageButton[ 0 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 0 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 1 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 2 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 3 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 4 ], CURSOR_WWW);
SetButtonCursor(giIMPMainPageButton[ 5 ], CURSOR_WWW);
SpecifyButtonTextOffsets( giIMPMainPageButton[ 2 ], 10, 40, TRUE );
SpecifyButtonTextOffsets( giIMPMainPageButton[ 3 ], 10, 40, TRUE );
SpecifyButtonTextOffsets( giIMPMainPageButton[ 4 ], 10, 40, TRUE );
@@ -514,31 +512,31 @@ void CreateIMPMainPageButtons( void )
void DeleteIMPMainPageButtons( void )
{
// this function destroys the buttons needed for the IMP about Us Page
// this function destroys the buttons needed for the IMP about Us Page
// the back button
RemoveButton(giIMPMainPageButton[0] );
UnloadButtonImage(giIMPMainPageButtonImage[0] );
// the back button
RemoveButton(giIMPMainPageButton[0] );
UnloadButtonImage(giIMPMainPageButtonImage[0] );
// begin profiling button
RemoveButton(giIMPMainPageButton[1] );
UnloadButtonImage(giIMPMainPageButtonImage[1] );
UnloadButtonImage(giIMPMainPageButtonImage[1] );
// begin personna button
RemoveButton(giIMPMainPageButton[2] );
UnloadButtonImage(giIMPMainPageButtonImage[2] );
UnloadButtonImage(giIMPMainPageButtonImage[2] );
// begin attribs button
RemoveButton(giIMPMainPageButton[3] );
UnloadButtonImage(giIMPMainPageButtonImage[3] );
UnloadButtonImage(giIMPMainPageButtonImage[3] );
// begin portrait button
RemoveButton(giIMPMainPageButton[4] );
UnloadButtonImage(giIMPMainPageButtonImage[4] );
UnloadButtonImage(giIMPMainPageButtonImage[4] );
// begin voice button
RemoveButton(giIMPMainPageButton[5] );
UnloadButtonImage(giIMPMainPageButtonImage[5] );
UnloadButtonImage(giIMPMainPageButtonImage[5] );
return;
@@ -553,56 +551,56 @@ void BtnIMPMainPageBackCallback(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);
iCurrentImpPage = IMP_HOME_PAGE;
btn->uiFlags&=~(BUTTON_CLICKED_ON);
iCurrentImpPage = IMP_HOME_PAGE;
fButtonPendingFlag = TRUE;
iCurrentProfileMode = IMP__REGISTRY;
fFinishedCharGeneration = FALSE;
ResetCharacterStats( );
ResetCharacterStats( );
}
}
}
}
}
void BtnIMPMainPageBeginCallback(GUI_BUTTON *btn,INT32 reason)
{
// btn callback for Main Page Begin Profiling
if (!(btn->uiFlags & BUTTON_ENABLED))
return;
// too far along to change gender
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);
// are we going to change name, or do we have to start over from scratch
if( iCurrentProfileMode > IMP__ATTRIBUTES )
{
// too far along, restart
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 1 ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, BeginMessageBoxCallBack);
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 1 ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, BeginMessageBoxCallBack);
}
else
{
if( LaptopSaveInfo.iCurrentBalance < COST_OF_PROFILE )
{
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 3 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack);
}
else if( NumberOfMercsOnPlayerTeam() >= 18 )
{
@@ -610,15 +608,15 @@ void BtnIMPMainPageBeginCallback(GUI_BUTTON *btn,INT32 reason)
}
else
{
// change name
iCurrentImpPage = IMP_BEGIN;
fButtonPendingFlag = TRUE;
}
}
// change name
iCurrentImpPage = IMP_BEGIN;
fButtonPendingFlag = TRUE;
}
}
}
}
}
}
}
void BtnIMPMainPagePersonalityCallback(GUI_BUTTON *btn,INT32 reason)
@@ -629,8 +627,8 @@ void BtnIMPMainPagePersonalityCallback(GUI_BUTTON *btn,INT32 reason)
if (!(btn->uiFlags & BUTTON_ENABLED))
return;
/*
// if not this far in char generation, don't alot ANY action
/*
// if not this far in char generation, don't alot ANY action
if( iCurrentProfileMode != IMP__PERSONALITY )
{
btn->uiFlags&=~(BUTTON_CLICKED_ON);
@@ -640,18 +638,18 @@ void BtnIMPMainPagePersonalityCallback(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);
iCurrentImpPage = IMP_PERSONALITY;
btn->uiFlags&=~(BUTTON_CLICKED_ON);
iCurrentImpPage = IMP_PERSONALITY;
fButtonPendingFlag = TRUE;
}
}
}
}
}
void BtnIMPMainPageAttributesCallback(GUI_BUTTON *btn,INT32 reason)
{
@@ -660,7 +658,7 @@ void BtnIMPMainPageAttributesCallback(GUI_BUTTON *btn,INT32 reason)
if (!(btn->uiFlags & BUTTON_ENABLED))
return;
// if not this far in char generation, don't alot ANY action
// if not this far in char generation, don't alot ANY action
if( iCurrentProfileMode < IMP__ATTRIBUTES )
{
btn->uiFlags&=~(BUTTON_CLICKED_ON);
@@ -671,18 +669,18 @@ void BtnIMPMainPageAttributesCallback(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);
iCurrentImpPage = IMP_ATTRIBUTE_ENTRANCE;
btn->uiFlags&=~(BUTTON_CLICKED_ON);
iCurrentImpPage = IMP_ATTRIBUTE_ENTRANCE;
fButtonPendingFlag = TRUE;
}
}
}
}
}
void BtnIMPMainPagePortraitCallback(GUI_BUTTON *btn,INT32 reason)
{
@@ -691,7 +689,7 @@ void BtnIMPMainPagePortraitCallback(GUI_BUTTON *btn,INT32 reason)
if (!(btn->uiFlags & BUTTON_ENABLED))
return;
// if not this far in char generation, don't alot ANY action
// if not this far in char generation, don't alot ANY action
if( ( iCurrentProfileMode != IMP__PORTRAIT )&&( iCurrentProfileMode != IMP__VOICE ) && ( iCurrentProfileMode > IMP__FINISH ) )
{
btn->uiFlags&=~(BUTTON_CLICKED_ON);
@@ -702,18 +700,18 @@ void BtnIMPMainPagePortraitCallback(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);
iCurrentImpPage = IMP_PORTRAIT;
btn->uiFlags&=~(BUTTON_CLICKED_ON);
iCurrentImpPage = IMP_PORTRAIT;
fButtonPendingFlag = TRUE;
}
}
}
}
}
void BtnIMPMainPageVoiceCallback(GUI_BUTTON *btn,INT32 reason)
@@ -723,7 +721,7 @@ void BtnIMPMainPageVoiceCallback(GUI_BUTTON *btn,INT32 reason)
if (!(btn->uiFlags & BUTTON_ENABLED))
return;
// if not this far in char generation, don't alot ANY action
// if not this far in char generation, don't alot ANY action
if( ( iCurrentProfileMode != IMP__PORTRAIT ) && ( iCurrentProfileMode > IMP__FINISH ) )
{
btn->uiFlags&=~(BUTTON_CLICKED_ON);
@@ -734,40 +732,40 @@ void BtnIMPMainPageVoiceCallback(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);
iCurrentImpPage = IMP_VOICE;
btn->uiFlags&=~(BUTTON_CLICKED_ON);
iCurrentImpPage = IMP_VOICE;
fButtonPendingFlag = TRUE;
}
}
}
}
}
void NextProfilingMode( void )
{
// this function will change to mode the player is in for profiling
// this function will change to mode the player is in for profiling
// if less than done
if(iCurrentProfileMode < IMP__VOICE)
iCurrentProfileMode++;
if(iCurrentProfileMode < IMP__VOICE)
iCurrentProfileMode++;
return;
}
BOOLEAN CheckIfFinishedCharacterGeneration( void )
{
// this function checks to see if character is done character generation
// this function checks to see if character is done character generation
// are we done character generation
if( iCurrentProfileMode == IMP__FINISH )
{
// yes
return ( TRUE );
return ( TRUE );
}
else
{
@@ -775,32 +773,32 @@ BOOLEAN CheckIfFinishedCharacterGeneration( void )
return ( FALSE );
}
}
void ShadeUnSelectableButtons( void )
{
INT32 iCounter =0;
// this function looks at the status ofiCurrentProfileMode and decides which buttons
// this function looks at the status ofiCurrentProfileMode and decides which buttons
// should be shaded ( unselectable )
for( iCounter = iCurrentProfileMode; iCounter < 5; iCounter++ )
{
ShadowVideoSurfaceRect( FRAME_BUFFER, 13 + (iCounter ) * 120 + 114, 245, 13 + ( iCounter + 1 ) * 120 + 90, 245 + 92 );
InvalidateRegion(13 + (iCounter ) * 120 + 114, 245, 13 + (iCounter ) * 120 + 114, 245 + 92 );
ShadowVideoSurfaceRect( FRAME_BUFFER, 13 + (iCounter ) * 120 + 114, 245, 13 + ( iCounter + 1 ) * 120 + 90, 245 + 92 );
InvalidateRegion(13 + (iCounter ) * 120 + 114, 245, 13 + (iCounter ) * 120 + 114, 245 + 92 );
}
fMarkButtonsDirtyFlag = FALSE;
return;
return;
}
void UpDateIMPMainPageButtons( void )
{
// update mainpage button states
INT32 iCount = 0;
INT32 iCount = 0;
// disable all
for( iCount = 2; iCount < 6; iCount++)
for( iCount = 2; iCount < 6; iCount++)
{
DisableButton( giIMPMainPageButton[ iCount ] );
}
@@ -809,15 +807,15 @@ void UpDateIMPMainPageButtons( void )
{
MSYS_DisableRegion( &pIMPMainPageMouseRegions[ iCount ]);
}
// enable
switch( iCurrentProfileMode )
// enable
switch( iCurrentProfileMode )
{
//begin
case IMP__REGISTRY:
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
break;
//Personality ( 3RD BUTTON )
@@ -830,10 +828,10 @@ void UpDateIMPMainPageButtons( void )
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
/*
EnableButton( giIMPMainPageButton[2] );
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
EnableButton( giIMPMainPageButton[2] );
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
*/
break;
@@ -842,32 +840,32 @@ void UpDateIMPMainPageButtons( void )
EnableButton( giIMPMainPageButton[2] );
EnableButton( giIMPMainPageButton[4] );
EnableButton( giIMPMainPageButton[5] );
EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[3] );
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
// MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
/*
EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[3] );
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
*/
break;
//Portrait ( ist button
case IMP__PORTRAIT:
// EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[4] );
EnableButton( giIMPMainPageButton[4] );
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
/*
EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[4] );
EnableButton( giIMPMainPageButton[4] );
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
//MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
//MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
*/
break;
@@ -880,11 +878,11 @@ void UpDateIMPMainPageButtons( void )
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 3 ]);
/*
//MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[4] );
EnableButton( giIMPMainPageButton[5] );
//MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_EnableRegion( &pIMPMainPageMouseRegions[ 0 ]);
EnableButton( giIMPMainPageButton[3] );
EnableButton( giIMPMainPageButton[4] );
EnableButton( giIMPMainPageButton[5] );
*/
break;
}
@@ -895,12 +893,12 @@ void UpDateIMPMainPageButtons( void )
void BeginMessageBoxCallBack( UINT8 bExitValue )
{
// yes, so start over, else stay here and do nothing for now
if( bExitValue == MSG_BOX_RETURN_YES )
if( bExitValue == MSG_BOX_RETURN_YES )
{
iCurrentImpPage = IMP_BEGIN;
iCurrentProfileMode = IMP__REGISTRY;
iCurrentProfileMode = IMP__REGISTRY;
}
else if( bExitValue == MSG_BOX_RETURN_OK )
{
// if ok, then we are coming from financial warning, allow continue
@@ -911,29 +909,29 @@ void BeginMessageBoxCallBack( UINT8 bExitValue )
void CreateMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
{
// this procedure will create masks for the char generation main page
// this procedure will create masks for the char generation main page
// mask for personality page button
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 0 ],LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 13 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 0 ],LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 13 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
// mask for attrib page button
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 1 ],LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 133 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 1 ],LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 133 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
// mask for portrait page button
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 2 ],LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 253 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 2 ],LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 253 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
// mask for voice page button
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 3 ],LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 373 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 3 ],LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 373 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
@@ -950,32 +948,32 @@ void DestoryMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
// will destroy button masks for the char gen pages
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 0 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 0 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 1 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 2 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 3 ]);
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 3 ]);
return;
}
void IMPMainPageNotSelectableBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
{
return;
}
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack);
}
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
return;
}
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack);
}
return;
}
@@ -995,7 +993,7 @@ INT32 CountFilledIMPSlots( INT8 iSex )
for (i = iStart; i <= iEnd; ++i)
{
if ((gGameExternalOptions.iaIMPSlots[i] != -1) &&
(!IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i])))
(!IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i])))
{
++iCount;
}
@@ -1019,7 +1017,7 @@ INT32 CountEmptyIMPSlots( INT8 iSex )
// Count the free slots
for (i = iStart; i <= iEnd; ++i)
{
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
{
++iCount;
}
@@ -1061,7 +1059,7 @@ INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId)
// We have a default imp id (90210 or nickname)
if (iDefaultIMPId != -1)
{
if (IsIMPSlotFree(iDefaultIMPId))
if (IsIMPSlotFree(iDefaultIMPId))
{
return iDefaultIMPId;
}
@@ -1089,7 +1087,7 @@ INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId)
for (i = iStart; i <= iEnd; ++i)
{
// Found a free imp slot
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
{
return gGameExternalOptions.iaIMPSlots[i];
}
@@ -1103,8 +1101,8 @@ INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId)
BOOLEAN LoadCharacterPortraitForMainPage( void )
{
// this function will load the character's portrait, to be used on portrait button
VOBJECT_DESC VObjectDesc;
// this function will load the character's portrait, to be used on portrait button
VOBJECT_DESC VObjectDesc;
if( IMP_CanWeDisplayPortrait( ) )
{
@@ -1113,10 +1111,10 @@ BOOLEAN LoadCharacterPortraitForMainPage( void )
FilenameForBPP( pPlayerSelectedFaceFileNames[ iPortraitNumber ] , VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCHARACTERPORTRAITFORMAINPAGE));
// now specify
SpecifyButtonIcon( giIMPMainPageButton[4], guiCHARACTERPORTRAITFORMAINPAGE, 0,
33, 23, FALSE );
SpecifyButtonIcon( giIMPMainPageButton[4], guiCHARACTERPORTRAITFORMAINPAGE, 0,
33, 23, FALSE );
}
return( TRUE );
@@ -1126,9 +1124,9 @@ BOOLEAN LoadCharacterPortraitForMainPage( void )
BOOLEAN IMP_CanWeDisplayPortrait( )
{
if( iCurrentProfileMode == IMP__VOICE ||
iCurrentProfileMode == IMP__ATTRIBUTES ||
iCurrentProfileMode == IMP__PERSONALITY ||
if( iCurrentProfileMode == IMP__VOICE ||
iCurrentProfileMode == IMP__ATTRIBUTES ||
iCurrentProfileMode == IMP__PERSONALITY ||
iCurrentProfileMode == IMP__FINISH )
{
return( TRUE );
@@ -1155,7 +1153,7 @@ BOOLEAN IMP_CanWeDisplayAttributeGraph( )
BOOLEAN IMP_CanWeDisplaySpecialtiesGraph( )
{
if( iCurrentProfileMode == IMP__ATTRIBUTES ||
if( iCurrentProfileMode == IMP__ATTRIBUTES ||
iCurrentProfileMode == IMP__FINISH )
{
return( TRUE );
@@ -1169,9 +1167,9 @@ BOOLEAN IMP_CanWeDisplaySpecialtiesGraph( )
BOOLEAN IMP_CanWeDisplayVoiceGraph( )
{
if( iCurrentProfileMode == IMP__ATTRIBUTES ||
// iCurrentProfileMode == IMP__VOICE ||
iCurrentProfileMode == IMP__PERSONALITY ||
if( iCurrentProfileMode == IMP__ATTRIBUTES ||
// iCurrentProfileMode == IMP__VOICE ||
iCurrentProfileMode == IMP__PERSONALITY ||
iCurrentProfileMode == IMP__FINISH )
{
return( TRUE );