mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
************************************************************
* Merged Source Code from Development Trunk: Revision 4063 * ************************************************************ - Source Code is merged from: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - This will be the Source for the Beta 2011 Test git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4064 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "CharProfile.h"
|
||||
#include "soldier profile type.h"
|
||||
#include "IMP Compile Character.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,13 +34,6 @@
|
||||
#define IMP_CHARACTER_TRAIT__FONT FONT12ARIAL
|
||||
#define IMP_CHARACTER_TRAIT__COLOR FONT_MCOLOR_WHITE
|
||||
|
||||
enum
|
||||
{
|
||||
IMP_CHARACTER_TRAIT__TITLE_TEXT=IMP_CHARACTER_TRAITS_NUMBER,
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define IMP_CHARACTER_1ST_COLUMN_START_X ( LAPTOP_SCREEN_UL_X + 15 )
|
||||
#define IMP_CHARACTER_1ST_COLUMN_START_Y ( LAPTOP_SCREEN_WEB_UL_Y + 40 )
|
||||
|
||||
@@ -48,7 +42,7 @@ enum
|
||||
|
||||
#define IMP_CHARACTER_TRAIT__SPACE_BTN_BUTTONS 38
|
||||
|
||||
#define IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN 5
|
||||
//#define IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN 5
|
||||
|
||||
#define IMP_CHARACTER_TRAIT__TEXT_OFFSET_X 65
|
||||
#define IMP_CHARACTER_TRAIT__TEXT_OFFSET_Y 12
|
||||
@@ -69,11 +63,11 @@ enum
|
||||
|
||||
BOOLEAN gfIST_Redraw2=FALSE;
|
||||
|
||||
BOOLEAN gfCharacterTraitQuestions[ IMP_CHARACTER_TRAITS_NUMBER ];
|
||||
BOOLEAN gfCharacterTraitQuestions[ 15 ];
|
||||
|
||||
// these are the buttons for the questions
|
||||
INT32 giIMPCharacterTraitAnswerButton[ IMP_CHARACTER_TRAITS_NUMBER ];
|
||||
INT32 giIMPCharacterTraitAnswerButtonImage[ IMP_CHARACTER_TRAITS_NUMBER ];
|
||||
INT32 giIMPCharacterTraitAnswerButton[ 15 ];
|
||||
INT32 giIMPCharacterTraitAnswerButtonImage[ 15 ];
|
||||
|
||||
// this is the Done buttons
|
||||
INT32 giIMPCharacterTraitFinsihButton;
|
||||
@@ -82,6 +76,8 @@ INT32 giIMPCharacterTraitFinsihButtonImage;
|
||||
//image handle
|
||||
UINT32 guiIST_GreyGoldBox2;
|
||||
|
||||
MOUSE_REGION gMR_CharacterTraitHelpTextRegions[IMP_NUMBER_CHARACTER_TRAITS];
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// Function Prototypes
|
||||
@@ -100,6 +96,7 @@ void IMPCharacterTraitDisplayCharacterTraits();
|
||||
//void HandleLastSelectedCharacterTraits( INT8 bNewTrait );
|
||||
BOOLEAN CameBackToCharacterTraitPageButNotFinished();
|
||||
//ppp
|
||||
void AssignCharacterTraitHelpText( UINT8 ubNumber );
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
@@ -111,7 +108,7 @@ BOOLEAN CameBackToCharacterTraitPageButNotFinished();
|
||||
|
||||
void EnterIMPCharacterTrait( void )
|
||||
{
|
||||
// UINT32 uiCnt;
|
||||
// UINT32 ubCnt;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
//add the skill trait buttons
|
||||
@@ -144,11 +141,36 @@ void EnterIMPCharacterTrait( void )
|
||||
if( iCurrentProfileMode != IMP__FINISH )
|
||||
{
|
||||
//Have the NONE trait initially selected
|
||||
gfCharacterTraitQuestions[ IMP_CHARACTER_TRAIT_NORMAL ] = TRUE;
|
||||
gfCharacterTraitQuestions[ 0 ] = TRUE;
|
||||
}
|
||||
|
||||
HandleCharacterTraitButtonStates( );
|
||||
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
// add regions for help texts
|
||||
UINT16 usPosX = IMP_CHARACTER_1ST_COLUMN_START_X + 62;
|
||||
UINT16 usPosY = IMP_CHARACTER_1ST_COLUMN_START_Y + 8;
|
||||
for( UINT8 ubCnt=0; ubCnt<(gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); ubCnt++ )
|
||||
{
|
||||
MSYS_DefineRegion( &gMR_CharacterTraitHelpTextRegions[ubCnt], ( usPosX ), ( usPosY ),
|
||||
(usPosX + 156), ( usPosY + 17), MSYS_PRIORITY_HIGH,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, NULL );
|
||||
MSYS_AddRegion( &gMR_CharacterTraitHelpTextRegions[ubCnt] );
|
||||
|
||||
//Determine the next x location
|
||||
if( ubCnt < (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosX = IMP_CHARACTER_1ST_COLUMN_START_X + 62;
|
||||
else
|
||||
usPosX = IMP_CHARACTER_2ND_COLUMN_START_X + 62;
|
||||
|
||||
//Determine the next Y location
|
||||
if( ubCnt == (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosY = IMP_CHARACTER_2ND_COLUMN_START_Y + 8;
|
||||
else
|
||||
usPosY += IMP_CHARACTER_TRAIT__SPACE_BTN_BUTTONS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +180,10 @@ void RenderIMPCharacterTrait( void )
|
||||
RenderProfileBackGround();
|
||||
|
||||
//Display the title
|
||||
DrawTextToScreen( gzIMPCharacterTraitText[IMP_CHARACTER_TRAITS_NUMBER], LAPTOP_SCREEN_UL_X - 111, iScreenHeightOffset + 53, ( LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X ), FONT14ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
DrawTextToScreen( gzIMPCharacterTraitText[IMP_NUMBER_CHARACTER_TRAITS], LAPTOP_SCREEN_UL_X - 111, iScreenHeightOffset + 53, ( LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X ), FONT14ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||
else
|
||||
DrawTextToScreen( gzIMPAttitudesText[IMP_NUMBER_ATTITUDES], LAPTOP_SCREEN_UL_X - 111, iScreenHeightOffset + 53, ( LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X ), FONT14ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||
|
||||
IMPCharacterTraitDisplayCharacterTraits();
|
||||
}
|
||||
@@ -171,7 +196,7 @@ void ExitIMPCharacterTrait( void )
|
||||
DeleteVideoObjectFromIndex( guiIST_GreyGoldBox2 );
|
||||
|
||||
//remove the skill buttons
|
||||
for(iCnt = 0; iCnt < IMP_CHARACTER_TRAITS_NUMBER; iCnt++)
|
||||
for(iCnt = 0; iCnt < (gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); iCnt++)
|
||||
{
|
||||
//if there is a button allocated
|
||||
if( giIMPCharacterTraitAnswerButton[iCnt] != -1 )
|
||||
@@ -179,6 +204,9 @@ void ExitIMPCharacterTrait( void )
|
||||
RemoveButton(giIMPCharacterTraitAnswerButton[ iCnt ] );
|
||||
UnloadButtonImage(giIMPCharacterTraitAnswerButtonImage[ iCnt ] );
|
||||
}
|
||||
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
MSYS_RemoveRegion( &gMR_CharacterTraitHelpTextRegions[iCnt] );
|
||||
}
|
||||
|
||||
RemoveButton( giIMPCharacterTraitFinsihButton );
|
||||
@@ -205,7 +233,7 @@ void AddImpCharacterTraitButtons()
|
||||
usPosX = IMP_CHARACTER_1ST_COLUMN_START_X;
|
||||
usPosY = IMP_CHARACTER_1ST_COLUMN_START_Y;
|
||||
|
||||
for(iCnt = 0; iCnt < IMP_CHARACTER_TRAITS_NUMBER; iCnt++)
|
||||
for(iCnt = 0; iCnt < (gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES) ; iCnt++)
|
||||
{
|
||||
//reset
|
||||
giIMPCharacterTraitAnswerButton[iCnt] = -1;
|
||||
@@ -233,13 +261,13 @@ void AddImpCharacterTraitButtons()
|
||||
//ButtonList[ giIMPCharacterTraitAnswerButton[ iCnt ] ]->ubSoundSchemeID = 0;
|
||||
|
||||
//Determine the next x location
|
||||
if( iCnt < IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN )
|
||||
if( iCnt < (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosX = IMP_CHARACTER_1ST_COLUMN_START_X;
|
||||
else
|
||||
usPosX = IMP_CHARACTER_2ND_COLUMN_START_X;
|
||||
|
||||
//Determine the next Y location
|
||||
if( iCnt == IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN )
|
||||
if( iCnt == (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosY = IMP_CHARACTER_2ND_COLUMN_START_Y;
|
||||
else
|
||||
usPosY += IMP_CHARACTER_TRAIT__SPACE_BTN_BUTTONS;
|
||||
@@ -265,7 +293,7 @@ void BtnIMPCharacterTraitAnswerCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
void HandleIMPCharacterTraitAnswers( UINT32 uiSkillPressed )
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
INT8 bCnt;
|
||||
|
||||
//if we are DONE and are just reviewing
|
||||
if( iCurrentProfileMode == IMP__FINISH )
|
||||
@@ -274,13 +302,13 @@ void HandleIMPCharacterTraitAnswers( UINT32 uiSkillPressed )
|
||||
}
|
||||
|
||||
//reset all other buttons
|
||||
for( uiCnt=0; uiCnt<IMP_CHARACTER_TRAITS_NUMBER; uiCnt++ )
|
||||
for( bCnt=0; bCnt < (gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); bCnt++ )
|
||||
{
|
||||
gfCharacterTraitQuestions[ uiCnt ] = FALSE;
|
||||
gfCharacterTraitQuestions[ bCnt ] = FALSE;
|
||||
}
|
||||
|
||||
//make sure its a valid character trait
|
||||
if( uiSkillPressed > IMP_CHARACTER_TRAITS_NUMBER )
|
||||
if( uiSkillPressed > (UINT32)(gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES) )
|
||||
{
|
||||
Assert( 0 );
|
||||
return;
|
||||
@@ -315,26 +343,26 @@ void HandleIMPCharacterTraitAnswers( UINT32 uiSkillPressed )
|
||||
|
||||
void HandleCharacterTraitButtonStates( )
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
INT8 bCnt;
|
||||
|
||||
for( uiCnt=0; uiCnt<IMP_CHARACTER_TRAITS_NUMBER; uiCnt++ )
|
||||
for( bCnt=0; bCnt < (gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); bCnt++ )
|
||||
{
|
||||
|
||||
//if the skill is selected ( ie depressed )
|
||||
if( gfCharacterTraitQuestions[ uiCnt ] )
|
||||
if( gfCharacterTraitQuestions[ bCnt ] )
|
||||
{
|
||||
ButtonList[ giIMPCharacterTraitAnswerButton[ uiCnt ] ]->uiFlags |= BUTTON_CLICKED_ON;
|
||||
ButtonList[ giIMPCharacterTraitAnswerButton[ bCnt ] ]->uiFlags |= BUTTON_CLICKED_ON;
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonList[ giIMPCharacterTraitAnswerButton[ uiCnt ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
|
||||
ButtonList[ giIMPCharacterTraitAnswerButton[ bCnt ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IMPCharacterTraitDisplayCharacterTraits()
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
INT8 bCnt;
|
||||
UINT16 usPosX, usPosY;
|
||||
UINT16 usBoxPosX, usBoxPosY;
|
||||
HVOBJECT hImageHandle;
|
||||
@@ -345,13 +373,13 @@ void IMPCharacterTraitDisplayCharacterTraits()
|
||||
usPosX = IMP_CHARACTER_1ST_COLUMN_START_X + IMP_CHARACTER_TRAIT__TEXT_OFFSET_X;
|
||||
usPosY = IMP_CHARACTER_1ST_COLUMN_START_Y + IMP_CHARACTER_TRAIT__TEXT_OFFSET_Y;
|
||||
|
||||
for( uiCnt=0; uiCnt<IMP_CHARACTER_TRAITS_NUMBER; uiCnt++ )
|
||||
for( bCnt=0; bCnt<(gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); bCnt++ )
|
||||
{
|
||||
usBoxPosX = usPosX - IMP_CHARACTER_TRAIT__GREY_BOX_OFFSET_X;
|
||||
usBoxPosY = usPosY - IMP_CHARACTER_TRAIT__GREY_BOX_OFFSET_Y;
|
||||
|
||||
//if the trait is selected
|
||||
if( gfCharacterTraitQuestions[ uiCnt ] )
|
||||
if( gfCharacterTraitQuestions[ bCnt ] )
|
||||
{
|
||||
//Display the gold background box
|
||||
BltVideoObject(FRAME_BUFFER, hImageHandle, 1, usBoxPosX, usBoxPosY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
@@ -363,16 +391,24 @@ void IMPCharacterTraitDisplayCharacterTraits()
|
||||
}
|
||||
|
||||
//draw the text to the screenx
|
||||
DrawTextToScreen( gzIMPCharacterTraitText[ uiCnt ], usPosX, usPosY, 0, IMP_CHARACTER_TRAIT__FONT, IMP_CHARACTER_TRAIT__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
DrawTextToScreen( gzIMPCharacterTraitText[ bCnt ], usPosX, usPosY, 0, IMP_CHARACTER_TRAIT__FONT, IMP_CHARACTER_TRAIT__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
else
|
||||
DrawTextToScreen( gzIMPAttitudesText[ bCnt ], usPosX, usPosY, 0, IMP_CHARACTER_TRAIT__FONT, IMP_CHARACTER_TRAIT__COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
AssignCharacterTraitHelpText( bCnt );
|
||||
}
|
||||
|
||||
//Determine the next x location
|
||||
if( uiCnt < IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN )
|
||||
if( bCnt < (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosX = IMP_CHARACTER_1ST_COLUMN_START_X + IMP_CHARACTER_TRAIT__TEXT_OFFSET_X;
|
||||
else
|
||||
usPosX = IMP_CHARACTER_2ND_COLUMN_START_X + IMP_CHARACTER_TRAIT__TEXT_OFFSET_X;
|
||||
|
||||
//Determine the next Y location
|
||||
if( uiCnt == IMP_CHARACTER_TRAIT_NUMBER_TO_START_2ND_COLUMN )
|
||||
if( bCnt == (gGameOptions.fNewTraitSystem ? 6 : 5) )
|
||||
usPosY = IMP_CHARACTER_2ND_COLUMN_START_Y + IMP_CHARACTER_TRAIT__TEXT_OFFSET_Y;
|
||||
else
|
||||
usPosY += IMP_CHARACTER_TRAIT__SPACE_BTN_BUTTONS;
|
||||
@@ -429,18 +465,32 @@ BOOLEAN CameBackToCharacterTraitPageButNotFinished()
|
||||
|
||||
INT8 iChosenCharacterTrait()
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
INT8 bCnt;
|
||||
INT8 iCharacterTraitNumber = 0;
|
||||
|
||||
//loop through all the buttons and reset them
|
||||
for( uiCnt=0; uiCnt<IMP_CHARACTER_TRAITS_NUMBER; uiCnt++ )
|
||||
for( bCnt=0; bCnt<(gGameOptions.fNewTraitSystem ? IMP_NUMBER_CHARACTER_TRAITS : IMP_NUMBER_ATTITUDES); bCnt++ )
|
||||
{
|
||||
//if the trait is selected
|
||||
if( gfCharacterTraitQuestions[ uiCnt ] )
|
||||
if( gfCharacterTraitQuestions[ bCnt ] )
|
||||
{
|
||||
iCharacterTraitNumber = uiCnt;
|
||||
iCharacterTraitNumber = bCnt;
|
||||
}
|
||||
}
|
||||
return( iCharacterTraitNumber );
|
||||
}
|
||||
|
||||
|
||||
void AssignCharacterTraitHelpText( UINT8 ubNumber )
|
||||
{
|
||||
CHAR16 apStr[ 2000 ];
|
||||
|
||||
swprintf( apStr, L"" );
|
||||
swprintf( apStr, gzIMPNewCharacterTraitsHelpTexts[ubNumber] );
|
||||
|
||||
// Set region help text
|
||||
SetRegionFastHelpText( &(gMR_CharacterTraitHelpTextRegions[ubNumber]), apStr );
|
||||
SetRegionHelpEndCallback( &gMR_CharacterTraitHelpTextRegions[ubNumber], MSYS_NO_CALLBACK );
|
||||
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user