Exemplo n.º 1
0
void HandleIMPDisabilityTraitAnswers( UINT32 uiSkillPressed )
{
	UINT8 ubCnt;

	//if we are DONE and are just reviewing
	if( iCurrentProfileMode == IMP__FINISH )
	{
		return;
	}

	//reset all other buttons
	for( ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
	{
		gfDisabilityTraitQuestions[ ubCnt ] = FALSE;
	}

	//make sure its a valid disability trait
	if( uiSkillPressed >= IMP_DISABILITIES_NUMBER )
	{
		Assert( 0 );
		return;
	}

	//if its allready set
	if( gfDisabilityTraitQuestions[ uiSkillPressed ] )
	{
		//dont need to do anything
		return;
	}

	//Set the skill
	gfDisabilityTraitQuestions[ uiSkillPressed ] = TRUE;

	//Play the button sound
	if( gfDisabilityTraitQuestions[ uiSkillPressed ] )
	{
		PlayButtonSound( giIMPDisabilityTraitAnswerButton[ uiSkillPressed ], BUTTON_SOUND_CLICKED_ON );
	}
	else
	{
		PlayButtonSound( giIMPDisabilityTraitAnswerButton[ uiSkillPressed ], BUTTON_SOUND_CLICKED_OFF );
	}

	//update buttons
	HandleDisabilityTraitButtonStates( );

	//redraw the screen
	gfIST_Redraw3 = TRUE;
}
Exemplo n.º 2
0
void HandleIMPMinorTraitAnswers( UINT32 uiSkillPressed )
{
	UINT32 uiCnt;

	//if we are DONE and are just reviewing
	if( iCurrentProfileMode == IMP__FINISH )
	{
		return;
	}

	//make sure its a valid skill
	if( uiSkillPressed >= IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS )
	{
		Assert( 0 );
		return;
	}

	//if its allready set
	if( gfMinorTraitQuestions[ uiSkillPressed ] && uiSkillPressed != IMP_SKILL_TRAITS_NEW_MINOR_NONE )
	{
		gfMinorTraitQuestions[ uiSkillPressed ] = FALSE;

		BOOLEAN fNoSkillSelected = TRUE;
		for ( uiCnt=0; uiCnt<(IMP_SKILL_TRAITS_NEW_MINOR_NONE); uiCnt++ )
		{
			if ( gfMinorTraitQuestions[ uiCnt ] == TRUE )
				fNoSkillSelected = FALSE;
		}
		if ( fNoSkillSelected )
		{
			// select NONE button
			gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_MINOR_NONE ] = TRUE;
		}
	}
	else
	{
		//if we are to reset all the buttons
		if( CountNumMinorTraitsSelected( FALSE ) >= NumAvailableMinorTraits() )
		{
			// try to remove the last selected minor trait
			if ( gfMinorTraitQuestions[ GetLastSelectedMinorTrait() ] > 0 )
			{
				gfMinorTraitQuestions[ GetLastSelectedMinorTrait() ] = FALSE;

				// remove this one from list
				HandleLastSelectedMinorTrait( -1 );
			}
			// if there is none, remove all for sure
			else
			{
				//loop through all the skill and reset them
				for( uiCnt=0; uiCnt<IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS; uiCnt++ )
				{
					gfMinorTraitQuestions[ uiCnt ] = FALSE;
				}
			}
		}
		//Set the skill
		gfMinorTraitQuestions[ uiSkillPressed ] = TRUE;

		HandleLastSelectedMinorTrait( uiSkillPressed );

		//if the NONE trait was selected, clear the rest of the buttons
		if( uiSkillPressed == IMP_SKILL_TRAITS_NEW_MINOR_NONE )
		{
			//reset all the traits
			for( uiCnt=0; uiCnt<IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS; uiCnt++ )
			{
				gfMinorTraitQuestions[ uiCnt ] = FALSE;
			}
			gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_MINOR_NONE ] = TRUE;
		}

		//make sure the none skill is NOT selected if we select anything else
		if( uiSkillPressed != IMP_SKILL_TRAITS_NEW_MINOR_NONE )
		{
			gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_MINOR_NONE ] = FALSE;
		}
	}

	//Play the button sound
	if( gfMinorTraitQuestions[ uiSkillPressed ] )
	{
		PlayButtonSound( giIMPMinorTraitAnswerButton[ uiSkillPressed ], BUTTON_SOUND_CLICKED_ON );
	}
	else
	{
		PlayButtonSound( giIMPMinorTraitAnswerButton[ uiSkillPressed ], BUTTON_SOUND_CLICKED_OFF );
	}

	//update buttons
	HandleMinorTraitButtonStates( );

	//redraw the screen
	gfIMT_Redraw = TRUE;
}