コード例 #1
0
ファイル: IMP HomePage.c プロジェクト: lchsk/jaggedalliance2
void ProcessPlayerInputActivationString( void )
{
    // prcess string to see if it matches activation string
    if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
    {
        iCurrentImpPage = IMP_MAIN_PAGE;

    }
    /*
    	else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) )
    	{
    		LoadInCurrentImpCharacter( );
    	}
    */
    else
    {
        if( ( ( wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) )
        {
            DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 0 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
        }
        else if( LaptopSaveInfo.fIMPCompletedFlag == TRUE )
        {
            DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 6 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
        }


    }
    return;
}
コード例 #2
0
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);
	}
	else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
	{
		if (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);

			}
			else
			{
				//if( LaptopSaveInfo.iCurrentBalance < COST_OF_PROFILE )
				if( LaptopSaveInfo.iCurrentBalance < iGetProfileCost() ) // SANDRO - changed to find actual profile cost in IMPConfirm
				{
					DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 3 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack);

				}
				else if( NumberOfMercsOnPlayerTeam() >= OUR_TEAM_SIZE_NO_VEHICLE )
				{
					DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 5 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack);
				}
				else
				{
				// change name
			iCurrentImpPage = IMP_BEGIN;
				fButtonPendingFlag = TRUE;
		}
			}

		}
	}
}
コード例 #3
0
void SelectBriefingRoomEnterLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
{ 
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{

	}
	else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
	
		if ( gBriefingRoomData[0].Hidden == TRUE ) 
		{
			bBriefingRoomSpecialMission = FALSE;
			bBriefingRoom  = TRUE;
			
			ResetVal = FALSE;
		
			IDPageEncyData = PAGEBRIEFINGROOM; 
		
			if(!fFirstTimeInBriefingRoomEnter) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
		}
		else
		{
			DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, pSectorPageText[ 5 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
	}
	else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
	{
	} 
}
コード例 #4
0
ファイル: IMP MainPage.c プロジェクト: bowlofstew/ja2
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);
  }

	return;
}
コード例 #5
0
void BtnIMPMinorTraitAnswerCallback(GUI_BUTTON *btn,INT32 reason)
{
	// btn callback for IMP personality quiz answer button
	if (!(btn->uiFlags & BUTTON_ENABLED))
		return;

	if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
	{
//		btn->uiFlags|=(BUTTON_CLICKED_ON);

		if( NumAvailableMinorTraits() > 0 )
		{
			INT32 iMinorTrait =	MSYS_GetBtnUserData( btn, 0 );

			HandleIMPMinorTraitAnswers( iMinorTrait );
		}
		else
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 12 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
	}
}
コード例 #6
0
ファイル: IMP Finish.c プロジェクト: lchsk/jaggedalliance2
void BtnIMPFinishStartOverCallback(GUI_BUTTON *btn,INT32 reason)
{

	// btn callback for IMP Homepage About US button
	if (!(btn->uiFlags & BUTTON_ENABLED))
		return;

	if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
	{
		 btn->uiFlags|=(BUTTON_CLICKED_ON);
	}
	else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
	{
		if (btn->uiFlags & BUTTON_CLICKED_ON)
		{
      btn->uiFlags&=~(BUTTON_CLICKED_ON);
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 1 ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, FinishMessageBoxCallBack);
      
		}
	}	
} 
コード例 #7
0
void ProcessPlayerInputActivationString( void )
{
	// prcess string to see if it matches activation string
	char charPlayerActivationString[32];
	wcstombs(charPlayerActivationString,pPlayerActivationString,32);

	BOOLEAN freeMercSlot = TRUE;

	// WANNE: Check total number of hired mercs
	if( NumberOfMercsOnPlayerTeam() >= OUR_TEAM_SIZE_NO_VEHICLE )
	{
		freeMercSlot = FALSE;
	}
#ifdef JA2UB
	if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") == 0 ) || ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") == 0 ) ) && ( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
#else
	//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 ) )
#endif
	{
		// WANNE: Check total number of hired mercs
		if( freeMercSlot == FALSE )
		{
			DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_MAX_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
			return;
		}

		if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
		{
			// Kaiden: Need to reset skills, attributes and personalities with the new UB Method.
			ResetSkillsAttributesAndPersonality( );
			ClearAllSkillsList( );
			iCurrentImpPage = IMP_MAIN_PAGE;
		}
		else
		{
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 8 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
	}
	//Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) )
	else if( wcscmp(pPlayerActivationString, L"90210") == 0 )
	{
		// WANNE: Check total number of hired mercs
		if( freeMercSlot == FALSE )
		{
			DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_MAX_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
			return;
		}

		if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
		{
			if (LoadImpCharacter( IMP_MERC_FILENAME ) == TRUE)
			{
				// Reset activation text box
				ResetActivationStringTextBox();

				//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
				AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
			}
		}
		else
		{
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 8 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
	}
	// Madd: load characters by name
	else if ( ImpExists( charPlayerActivationString ) )
	{
		// WANNE: Check total number of hired mercs
		if( freeMercSlot == FALSE )
		{
			DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_MAX_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
			return;
		}

		if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
		{
			if (LoadImpCharacter( charPlayerActivationString ) == TRUE)
			{
				// Reset activation text box
				ResetActivationStringTextBox();

				//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
				AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
			}
		}
		else
		{
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 8 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
	}
	else
	{
#ifdef JA2UB
		if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") != 0 ) && ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") != 0 ) ) )
#else
		if( ( ( wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) )
#endif
		{
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 0 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
		else if( LaptopSaveInfo.fIMPCompletedFlag == TRUE )
		{
			DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 6 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
		}
	}

	return;
}
コード例 #8
0
void BtnIMPBeginScreenDoneCallback(GUI_BUTTON *btn,INT32 reason)
{

	// easter egg check
	BOOLEAN fEggOnYouFace = FALSE;

	// btn callback for IMP Begin Screen done button
	if (!(btn->uiFlags & BUTTON_ENABLED))
		return;

	if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
	{
		 btn->uiFlags|=(BUTTON_CLICKED_ON);
	}
	else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
	{
		if (btn->uiFlags & BUTTON_CLICKED_ON)
		{
      btn->uiFlags&=~(BUTTON_CLICKED_ON);

			
			if( fFinishedCharGeneration )
			{
				// simply reviewing name and gender, exit to finish page
				iCurrentImpPage = IMP_FINISH;
				fButtonPendingFlag = TRUE;
				return;
			}
			else
			{
			  if( CheckCharacterInputForEgg( ) )
				{
					fEggOnYouFace = TRUE;
				}
			}


			// back to mainpage
			

			// check to see if a name has been selected, if not, do not allow player to proceed with more char generation
			if( ( pFullNameString[ 0 ] != 0) && ( pFullNameString[ 0 ] != L' ' ) && ( bGenderFlag != -1 ) )
			{
				// valid full name, check to see if nick name
				if( ( pNickNameString[ 0 ] == 0 ) || ( pNickNameString[ 0 ] == L' '))
				{
					// no nick name
					// copy first name to nick name
          CopyFirstNameIntoNickName( );
				}
				// ok, now set back to main page, and set the fact we have completed part 1
				if ( ( iCurrentProfileMode < IMP__PERSONALITY ) &&( bGenderFlag != -1 ) )
				{
				  iCurrentProfileMode = IMP__PORTRAIT;//IMP__PERSONALITY;
				}
				else if( bGenderFlag == -1 )
				{
					iCurrentProfileMode = IMP__REGISTRY;
				}

				// no easter egg?...then proceed along
				if( fEggOnYouFace == FALSE )
				{
				  iCurrentImpPage = IMP_MAIN_PAGE;
          fButtonPendingFlag = TRUE;
				}

			}
			else
			{
				// invalid name, reset current mode
				DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 2 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
				iCurrentProfileMode = IMP__REGISTRY;				
			}
		}
	}	
}