void DrawNameOfLoadedSector( void ) { CHAR16 sString[ 128 ]; INT16 sFontX, sFontY; SetFontDestBuffer( FRAME_BUFFER, 0, 0, 640, 480, FALSE ); SetFont( COMPFONT ); SetFontForeground( 183 ); SetFontBackground( FONT_BLACK ); GetSectorIDString( sSelMapX, sSelMapY, ( INT8 )( iCurrentMapSectorZ ),sString, TRUE ); ReduceStringLength( sString, 80, COMPFONT ); VarFindFontCenterCoordinates( 548, 426, 80, 16, COMPFONT, &sFontX, &sFontY, sString ); mprintf( sFontX, sFontY, L"%s", sString ); }
void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldier, BOOLEAN fAddRehireButton ) { // will tell player this character is leaving and ask where they want the equipment left CHAR16 sString[ 1024 ]; BOOLEAN fInSector = FALSE; // INT16 zTownIDString[50]; CHAR16 zShortTownIDString[ 50 ], zShortDropOffString[ 50 ], zDropOffString[ 50 ]; // use YES/NO Pop up box, settup for particular screen SGPRect pCenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT}; //GetSectorIDString( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, zTownIDString, TRUE ); GetShortSectorString( pSoldier->sSectorX ,pSoldier->sSectorY, zShortTownIDString ); // Set string for generic button swprintf( gzUserDefinedButton1, L"%s", zShortTownIDString ); pLeaveSoldier = pSoldier; if( pSoldier->flags.fSignedAnotherContract == TRUE ) { fAddRehireButton = FALSE; } if( pSoldier->flags.fSignedAnotherContract == TRUE ) { fAddRehireButton = FALSE; } if( pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) { fAddRehireButton = FALSE; } //if the character is an RPC //if( pSoldier->ubProfile >= FIRST_RPC && pSoldier->ubProfile < FIRST_NPC ) //new profiles by Jazz if ( gProfilesRPC[pSoldier->ubProfile].ProfilId == pSoldier->ubProfile ) { if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE ) { swprintf( sString, pMercHeLeaveString[ 1 ], pSoldier->GetName(), zShortTownIDString ); } else { swprintf( sString, pMercSheLeaveString[ 1 ], pSoldier->GetName(), zShortTownIDString ); } fInSector = TRUE; } // check if drassen controlled else if( StrategicMap[ ( AIRPORT_X + ( MAP_WORLD_X * AIRPORT_Y ) ) ].fEnemyControlled == FALSE ) { GetSectorIDString( AIRPORT_X, AIRPORT_Y, 0, zDropOffString, FALSE ); if( ( pSoldier->sSectorX == AIRPORT_X ) && ( pSoldier->sSectorY == AIRPORT_Y ) && ( pSoldier->bSectorZ == 0 ) ) { if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE ) { swprintf( sString, pMercHeLeaveString[ 1 ], pSoldier->GetName(), zDropOffString ); } else { swprintf( sString, pMercSheLeaveString[ 1 ], pSoldier->GetName(), zDropOffString ); } fInSector = TRUE; } else { // Set string for generic button GetShortSectorString( AIRPORT_X, AIRPORT_Y, zShortDropOffString ); swprintf( gzUserDefinedButton2, L"%s", zShortDropOffString ); //B13 if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE ) { swprintf( sString, pMercHeLeaveString[ 0 ], pSoldier->GetName(), zShortTownIDString, zDropOffString ); } else { swprintf( sString, pMercSheLeaveString[ 0 ], pSoldier->GetName(), zShortTownIDString, zDropOffString ); } } } else { GetSectorIDString( OMERTA_LEAVE_EQUIP_SECTOR_X, OMERTA_LEAVE_EQUIP_SECTOR_Y, 0, zDropOffString, FALSE ); if( ( pSoldier->sSectorX == OMERTA_LEAVE_EQUIP_SECTOR_X ) && ( pSoldier->sSectorY == OMERTA_LEAVE_EQUIP_SECTOR_Y ) && ( pSoldier->bSectorZ == 0 ) ) { if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE ) { swprintf( sString, pMercHeLeaveString[ 1 ], pSoldier->GetName(), zDropOffString ); } else { swprintf( sString, pMercSheLeaveString[ 1 ], pSoldier->GetName() , zDropOffString ); } fInSector = TRUE; } else { // Set string for generic button GetShortSectorString( OMERTA_LEAVE_EQUIP_SECTOR_X, OMERTA_LEAVE_EQUIP_SECTOR_Y, zShortDropOffString ); swprintf( gzUserDefinedButton2, L"%s", zShortDropOffString ); //A9 if( gMercProfiles[ pSoldier->ubProfile ].bSex == MALE ) { swprintf( sString, pMercHeLeaveString[ 0 ], pSoldier->GetName(), zShortTownIDString, zDropOffString ); } else { swprintf( sString, pMercSheLeaveString[ 0 ], pSoldier->GetName(), zShortTownIDString, zDropOffString ); } } } /// which screen are we in? if ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) { if( fInSector == FALSE ) { // set up for mapscreen DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_GENERICCONTRACT : MSG_BOX_FLAG_GENERIC_TWO_BUTTONS ) ), MercDepartEquipmentBoxCallBack ); } else { DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_OKCONTRACT : MSG_BOX_FLAG_OK ) ), MercDepartEquipmentBoxCallBack ); } } else { if( fInSector == FALSE ) { // set up for all otherscreens DoMessageBox( MSG_BOX_BASIC_STYLE, sString, guiCurrentScreen, ( UINT16 ) ( MSG_BOX_FLAG_USE_CENTERING_RECT | ( fAddRehireButton ? MSG_BOX_FLAG_GENERICCONTRACT : MSG_BOX_FLAG_GENERIC_TWO_BUTTONS ) ), MercDepartEquipmentBoxCallBack, &pCenteringRect ); } else { DoMessageBox( MSG_BOX_BASIC_STYLE, sString, guiCurrentScreen, ( UINT16 ) ( MSG_BOX_FLAG_USE_CENTERING_RECT | ( fAddRehireButton ? MSG_BOX_FLAG_OKCONTRACT : MSG_BOX_FLAG_OK ) ) , MercDepartEquipmentBoxCallBack, &pCenteringRect ); } } if( pSoldier->flags.fSignedAnotherContract == TRUE ) { //fCurrentMercFired = FALSE; } }
void DrawHistoryRecordsText( void ) { // draws the text of the records HistoryUnitPtr pCurHistory=pHistoryListHead; HistoryUnitPtr pTempHistory=pHistoryListHead; wchar_t sString[512]; INT32 iCounter=0; UINT16 usX, usY; INT32 iBalance=0; INT16 sX =0, sY =0; // setup the font stuff SetFont(HISTORY_TEXT_FONT); SetFontForeground(FONT_BLACK); SetFontBackground(FONT_BLACK); SetFontShadow(NO_SHADOW); // error check if( !pCurHistory) return; // loop through record list for(iCounter; iCounter <NUM_RECORDS_PER_PAGE; iCounter++) { if( pCurHistory->ubColor == 0 ) { SetFontForeground(FONT_BLACK); } else { SetFontForeground(FONT_RED); } // get and write the date swprintf(sString, L"%d", ( pCurHistory->uiDate / ( 24 * 60 ) ) ); FindFontCenterCoordinates(RECORD_DATE_X + 5, 0, RECORD_DATE_WIDTH,0, sString, HISTORY_TEXT_FONT,&usX, &usY); mprintf(usX, RECORD_Y + ( iCounter * ( BOX_HEIGHT ) ) + 3, sString); // now the actual history text //FindFontCenterCoordinates(RECORD_DATE_X + RECORD_DATE_WIDTH,0,RECORD_HISTORY_WIDTH,0, pHistoryStrings[pCurHistory->ubCode], HISTORY_TEXT_FONT,&usX, &usY); ProcessHistoryTransactionString(sString, pCurHistory); // mprintf(RECORD_DATE_X + RECORD_DATE_WIDTH + 25, RECORD_Y + ( iCounter * ( BOX_HEIGHT ) ) + 3, pHistoryStrings[pCurHistory->ubCode] ); mprintf(RECORD_DATE_X + RECORD_LOCATION_WIDTH +RECORD_DATE_WIDTH + 15, RECORD_Y + ( iCounter * ( BOX_HEIGHT ) ) + 3, sString ); // no location if( ( pCurHistory->sSectorX == -1 )||( pCurHistory->sSectorY == -1 ) ||( pCurHistory->sSectorX == 0 ) || ( pCurHistory->sSectorY == 0 ) ) { FindFontCenterCoordinates( RECORD_DATE_X + RECORD_DATE_WIDTH, 0,RECORD_LOCATION_WIDTH + 10, 0, pHistoryLocations[0] ,HISTORY_TEXT_FONT, &sX, &sY ); mprintf(sX, RECORD_Y + ( iCounter * ( BOX_HEIGHT ) ) + 3, pHistoryLocations[0] ); } else { GetSectorIDString( pCurHistory->sSectorX, pCurHistory->sSectorY, pCurHistory->bSectorZ, sString, TRUE ); FindFontCenterCoordinates( RECORD_DATE_X + RECORD_DATE_WIDTH, 0, RECORD_LOCATION_WIDTH + 10, 0, sString ,HISTORY_TEXT_FONT, &sX, &sY ); ReduceStringLength( sString, RECORD_LOCATION_WIDTH + 10, HISTORY_TEXT_FONT ); mprintf(sX, RECORD_Y + ( iCounter * ( BOX_HEIGHT ) ) + 3, sString ); } // restore font color SetFontForeground(FONT_BLACK); // next History pCurHistory = pCurHistory->Next; // last page, no Historys left, return if( ! pCurHistory ) { // restore shadow SetFontShadow(DEFAULT_SHADOW); return; } } // restore shadow SetFontShadow(DEFAULT_SHADOW); return; }
void HandleInterfaceMessageForContinuingTrainingMilitia( SOLDIERTYPE *pSoldier ) { CHAR16 sString[ 128 ]; INT16 sSectorX = 0, sSectorY = 0; CHAR16 sStringB[ 128 ]; INT8 bTownId; sSectorX = pSoldier->sSectorX; sSectorY = pSoldier->sSectorY; Assert( SectorInfo[ SECTOR( sSectorX, sSectorY ) ].fMilitiaTrainingPaid == FALSE ); pMilitiaTrainerSoldier = pSoldier; gfYesNoPromptIsForContinue = TRUE; // is there enough loyalty to continue training if( DoesSectorMercIsInHaveSufficientLoyaltyToTrainMilitia( pSoldier ) == FALSE ) { // loyalty too low to continue training swprintf( sString, pMilitiaConfirmStrings[ 9 ], pTownNames[ GetTownIdForSector( sSectorX, sSectorY )], MIN_RATING_TO_TRAIN_TOWN ); DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); return; } if ( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) ) { // we're full!!! go home! bTownId = GetTownIdForSector( sSectorX, sSectorY ); if ( bTownId == BLANK_SECTOR ) { // wilderness SAM site GetSectorIDString( sSectorX, sSectorY, 0, sStringB, TRUE ); swprintf( sString, pMilitiaConfirmStrings[ 10 ], sStringB, GetSectorIDString, MIN_RATING_TO_TRAIN_TOWN ); } else { // town swprintf( sString, pMilitiaConfirmStrings[ 10 ], pTownNames[ bTownId ], MIN_RATING_TO_TRAIN_TOWN ); } DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); return; } // continue training always handles just one sector at a time giTotalCostOfTraining = MILITIA_TRAINING_COST; // can player afford to continue training? if( LaptopSaveInfo.iCurrentBalance < giTotalCostOfTraining ) { // can't afford to continue training swprintf( sString, pMilitiaConfirmStrings[ 8 ], giTotalCostOfTraining ); DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); return; } // ok to continue, ask player GetSectorIDString( sSectorX, sSectorY, 0, sStringB, TRUE ); swprintf( sString, pMilitiaConfirmStrings[ 3 ], sStringB, pMilitiaConfirmStrings[ 4 ], giTotalCostOfTraining ); // ask player whether he'd like to continue training //DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); }