BOOLEAN InitAimDefaults() { VOBJECT_DESC VObjectDesc; // load the Rust bacground graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiRustBackGround)); // load the Aim Symbol graphic and add it if(gGameExternalOptions.gfUseNewStartingGearInterface) { VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_AIMSYMBOL_SMALL ); CHECKF(AddVideoObject(&VObjectDesc, &guiAimSymbol)); //Mouse region for the Links MSYS_DefineRegion( &gSelectedAimLogo, AIM_SYMBOL_SMALL_X, AIM_SYMBOL_SMALL_Y, AIM_SYMBOL_SMALL_X+AIM_SYMBOL_SMALL_WIDTH, AIM_SYMBOL_SMALL_Y+AIM_SYMBOL_SMALL_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectAimLogoRegionCallBack); MSYS_AddRegion(&gSelectedAimLogo); } else { VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_AIMSYMBOL ); CHECKF(AddVideoObject(&VObjectDesc, &guiAimSymbol)); //Mouse region for the Links MSYS_DefineRegion( &gSelectedAimLogo, AIM_SYMBOL_X, AIM_SYMBOL_Y, AIM_SYMBOL_X+AIM_SYMBOL_WIDTH, AIM_SYMBOL_Y+AIM_SYMBOL_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectAimLogoRegionCallBack); MSYS_AddRegion(&gSelectedAimLogo); } return(TRUE); }
void DropDownBase::Create(UINT16 sX, UINT16 sY) { Destroy(); Init(sX, sY); VOBJECT_DESC VObjectDesc; // Gold Arrow for the scroll area VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; FilenameForBPP( "LAPTOP\\GoldArrows.sti", VObjectDesc.ImageFile ); if ( !AddVideoObject( &VObjectDesc, &muiGoldArrowImages ) ) return; gDropObj = (void*) this; MSYS_DefineRegion( &mSelectedOpenDropDownRegion, musStartX + musWidth, musStartY, musStartX + musWidth + musArrowWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_OPEN, &DropDownBase::Dummyfunc) ); MSYS_AddRegion(&mSelectedOpenDropDownRegion); //click anywhere on the screen to close the window( only when the drop down window is active) MSYS_DefineRegion( &mSelectedCloseDropDownRegion, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y , LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y, MSYS_PRIORITY_HIGH-1, CURSOR_LAPTOP_SCREEN, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_CLOSE, &DropDownBase::Dummyfunc) ); MSYS_AddRegion(&mSelectedCloseDropDownRegion); MSYS_DisableRegion(&mSelectedCloseDropDownRegion); MSYS_DefineRegion( &mBubbleHelpRegion, musStartX, musStartY, musStartX + musWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); MSYS_AddRegion(&mBubbleHelpRegion); mfMouseRegionsCreated = TRUE; }
void CreateIMPBeginScreenMouseRegions( void ) { // this function creates the IMP mouse regions // are we only reviewing text?.. if so, do not create regions if( ubTextEnterMode == 5 ) return; // full name region MSYS_DefineRegion(&gIMPBeginScreenMouseRegions[ 0 ] , LAPTOP_SCREEN_UL_X + 196, LAPTOP_SCREEN_WEB_UL_Y + 135, LAPTOP_SCREEN_UL_X + 196 + FULL_NAME_REGION_WIDTH, LAPTOP_SCREEN_WEB_UL_Y + 135 + 24, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, (MOUSE_CALLBACK)SelectFullNameRegionCallBack ); // nick name region MSYS_DefineRegion(&gIMPBeginScreenMouseRegions[ 1 ] , LAPTOP_SCREEN_UL_X + 196, LAPTOP_SCREEN_WEB_UL_Y + 195, LAPTOP_SCREEN_UL_X + 196 + NICK_NAME_REGION_WIDTH, LAPTOP_SCREEN_WEB_UL_Y + 195 + 24, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, (MOUSE_CALLBACK)SelectNickNameRegionCallBack ); // IMP_MALE gender area MSYS_DefineRegion(&gIMPBeginScreenMouseRegions[ 2 ] , MALE_BOX_X, MALE_BOX_Y, MALE_BOX_X + MALE_BOX_WIDTH, MALE_BOX_Y + MALE_BOX_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, (MOUSE_CALLBACK)MvtOnMaleRegionCallBack, (MOUSE_CALLBACK)SelectMaleRegionCallBack ); // IMP_FEMALE gender region MSYS_DefineRegion(&gIMPBeginScreenMouseRegions[ 3 ] , FEMALE_BOX_X, MALE_BOX_Y, FEMALE_BOX_X + MALE_BOX_WIDTH, MALE_BOX_Y + MALE_BOX_HEIGHT, MSYS_PRIORITY_HIGH, CURSOR_WWW, (MOUSE_CALLBACK)MvtOnFemaleRegionCallBack, (MOUSE_CALLBACK)SelectFemaleRegionCallBack ); // add regions MSYS_AddRegion(&gIMPBeginScreenMouseRegions[ 0 ]); MSYS_AddRegion(&gIMPBeginScreenMouseRegions[ 1 ]); MSYS_AddRegion(&gIMPBeginScreenMouseRegions[ 2 ]); MSYS_AddRegion(&gIMPBeginScreenMouseRegions[ 3 ]); return; }
void DropDownBase::Create_Drop() { Destroy_Drop(); Init_Drop(); UINT16 i; UINT16 usPosX = musStartX_Drop; UINT16 usPosY = musStartY_Drop; UINT16 usHeight = 0; for( i=0; i< DROPDOWN_REGIONS; ++i) { MSYS_DefineRegion( &mDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+musWidth-6), (UINT16)(usPosY+musFontHeight+7), MSYS_PRIORITY_HIGH, CURSOR_WWW, CallBackWrapper((void*) this, DROPDOWN_MOVEMENT, &DropDownBase::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_REGION, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mDropDownRegion[i]); MSYS_SetRegionUserData( &mDropDownRegion[ i ], 0, i); usPosY += musFontHeight + 2; } usHeight = usPosY - musStartY_Drop + 10; //create the scroll bars regions //up arrow usPosX = musUpArrowX; usPosY = musUpArrowY; for(i=0; i<2; ++i) { MSYS_DefineRegion( &mgSelectedUpDownArrowOnScrollAreaRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), (UINT16)(usPosY+DEF_SCROLL_ARROW_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_ARROW, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mgSelectedUpDownArrowOnScrollAreaRegion[i]); MSYS_SetRegionUserData( &mgSelectedUpDownArrowOnScrollAreaRegion[ i ], 0, i); usPosX = musDownArrowX; usPosY = musDownArrowY; } //the scroll area itself usPosX = musUpArrowX; usPosY = musUpArrowY + DEF_SCROLL_ARROW_HEIGHT; usHeight = ( musAreaHeight - DEF_SCROLL_ARROW_HEIGHT - 4 ) / (mNumDisplayedEntries); for(i=0; i<DROPDOWN_REGIONS - 1; ++i) { MSYS_DefineRegion( &mSelectedScrollAreaDropDownRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), (UINT16)(usPosY+usHeight), MSYS_PRIORITY_HIGH+1, CURSOR_LAPTOP_SCREEN, CallBackWrapper((void*) this, DROPDOWN_SCROLL_MOVEMENT, &DropDownBase::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_SCROLL_REGION, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mSelectedScrollAreaDropDownRegion[i]); MSYS_SetRegionUserData( &mSelectedScrollAreaDropDownRegion[ i ], 0, i); usPosY += usHeight; } //put the last one down to cover the remaining area MSYS_DefineRegion( &mSelectedScrollAreaDropDownRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), musDownArrowY, MSYS_PRIORITY_HIGH+1, CURSOR_LAPTOP_SCREEN, CallBackWrapper((void*) this, DROPDOWN_SCROLL_MOVEMENT, &DropDownBase::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_SCROLL_REGION, &DropDownBase::Dummyfunc)); MSYS_AddRegion(&mSelectedScrollAreaDropDownRegion[i]); MSYS_SetRegionUserData( &mSelectedScrollAreaDropDownRegion[ i ], 0, i); MSYS_EnableRegion(&mSelectedCloseDropDownRegion); mfMouseRegionsCreated_Drop = TRUE; }
BOOLEAN EnterInsuranceInfo() { VOBJECT_DESC VObjectDesc; UINT16 usPosX; InitInsuranceDefaults(); // load the Insurance bullet graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\bullet.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiBulletImage)); //left arrow guiInsPrevButtonImage = LoadButtonImage("LAPTOP\\InsLeftButton.sti", 2,0,-1,1,-1 ); guiInsPrevBackButton = CreateIconAndTextButton( guiInsPrevButtonImage, InsInfoText[INS_INFO_PREVIOUS], INS_FONT_BIG, INS_FONT_COLOR, INS_FONT_SHADOW, INS_FONT_COLOR, INS_FONT_SHADOW, TEXT_CJUSTIFIED, INS_INFO_LEFT_ARROW_BUTTON_X, INS_INFO_LEFT_ARROW_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, BtnInsPrevButtonCallback); SetButtonCursor( guiInsPrevBackButton, CURSOR_WWW ); SpecifyButtonTextOffsets( guiInsPrevBackButton, 17, 16, FALSE ); //Right arrow guiInsNextButtonImage = LoadButtonImage("LAPTOP\\InsRightButton.sti", 2,0,-1,1,-1 ); guiInsNextBackButton = CreateIconAndTextButton( guiInsNextButtonImage, InsInfoText[INS_INFO_NEXT], INS_FONT_BIG, INS_FONT_COLOR, INS_FONT_SHADOW, INS_FONT_COLOR, INS_FONT_SHADOW, TEXT_CJUSTIFIED, INS_INFO_RIGHT_ARROW_BUTTON_X, INS_INFO_RIGHT_ARROW_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, BtnInsNextButtonCallback); SetButtonCursor( guiInsNextBackButton, CURSOR_WWW ); SpecifyButtonTextOffsets( guiInsNextBackButton, 18, 16, FALSE ); usPosX = INS_INFO_LINK_START_X; //link to go to the contract page //link to go to the home page MSYS_DefineRegion( &gSelectedInsuranceInfoHomeLinkRegion, usPosX, INS_INFO_LINK_TO_CONTRACT_Y-37, (UINT16)(usPosX + INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y+2, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectInsuranceInfoHomeLinkRegionCallBack); MSYS_AddRegion(&gSelectedInsuranceInfoHomeLinkRegion); usPosX += INS_INFO_LINK_START_OFFSET + INS_INFO_LINK_TO_CONTRACT_WIDTH; MSYS_DefineRegion( &gSelectedInsuranceInfoLinkRegion, usPosX, INS_INFO_LINK_TO_CONTRACT_Y-37, (UINT16)(usPosX + INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y+2, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectInsuranceLinkRegionCallBack); MSYS_AddRegion(&gSelectedInsuranceInfoLinkRegion); gubCurrentInsInfoSubPage = INS_INFO_INFO_TOC; RenderInsuranceInfo(); return(TRUE); }
BOOLEAN InitAimPolicyTocMenu(void) { UINT16 i, usPosY; UINT16 usHeight; UINT32 uiStartLoc=0; if(gfInPolicyToc) return(TRUE); usHeight = GetFontHeight(AIM_POLICY_TOC_FONT); usPosY = AIM_POLICY_TOC_Y; for(i=0; i<NUM_AIM_POLICY_TOC_BUTTONS; i++) { //Mouse region for the toc buttons MSYS_DefineRegion( &gSelectedPolicyTocMenuRegion[i], AIM_POLICY_TOC_X, usPosY, (UINT16)(AIM_POLICY_TOC_X + AIM_CONTENTBUTTON_WIDTH), (UINT16)(usPosY + AIM_CONTENTBUTTON_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectPolicyTocMenuRegionCallBack); MSYS_AddRegion(&gSelectedPolicyTocMenuRegion[i]); MSYS_SetRegionUserData( &gSelectedPolicyTocMenuRegion[i], 0, i+2); usPosY += AIM_POLICY_TOC_GAP_Y; } gfInPolicyToc = TRUE; return(TRUE); }
void CreateDestroyBackGroundMouseMask( BOOLEAN fCreate ) { static BOOLEAN fRegionCreated = FALSE; if( fCreate ) { if( fRegionCreated ) return; // Make a mouse region MSYS_DefineRegion( &(gBackRegion), 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGHEST, CURSOR_NORMAL, MSYS_NO_CALLBACK, SelectMainMenuBackGroundRegionCallBack ); // Add region MSYS_AddRegion(&(gBackRegion) ); fRegionCreated = TRUE; } else { if( !fRegionCreated ) return; MSYS_RemoveRegion( &gBackRegion ); fRegionCreated = FALSE; } }
void InitAlumniFaceRegions() { UINT16 usPosX, usPosY,i,x,y, usNumRows; if(gfFaceMouseRegionsActive) return; if( gubPageNum == 2 ) usNumRows = 2; else usNumRows = AIM_ALUMNI_NUM_FACE_ROWS; usPosX = AIM_ALUMNI_START_GRID_X; usPosY = AIM_ALUMNI_START_GRID_Y; i=0; for(y=0; y<usNumRows; y++) { for(x=0; x<AIM_ALUMNI_NUM_FACE_COLS; x++) { MSYS_DefineRegion( &gMercAlumniFaceMouseRegions[ i ], usPosX, usPosY, (INT16)(usPosX + AIM_ALUMNI_ALUMNI_FACE_WIDTH), (INT16)(usPosY + AIM_ALUMNI_ALUMNI_FACE_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectAlumniFaceRegionCallBack); // Add region MSYS_AddRegion( &gMercAlumniFaceMouseRegions[ i ] ); MSYS_SetRegionUserData( &gMercAlumniFaceMouseRegions[ i ], 0, i+(20*gubPageNum)); usPosX += AIM_ALUMNI_GRID_OFFSET_X; i++; } usPosX = AIM_ALUMNI_START_GRID_X; usPosY += AIM_ALUMNI_GRID_OFFSET_Y; } //the 3rd page now has an additional row with 1 merc on it, so add a new row if( gubPageNum == 2 ) { MSYS_DefineRegion( &gMercAlumniFaceMouseRegions[ i ], usPosX, usPosY, (INT16)(usPosX + AIM_ALUMNI_ALUMNI_FACE_WIDTH), (INT16)(usPosY + AIM_ALUMNI_ALUMNI_FACE_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectAlumniFaceRegionCallBack); // Add region MSYS_AddRegion( &gMercAlumniFaceMouseRegions[ i ] ); MSYS_SetRegionUserData( &gMercAlumniFaceMouseRegions[ i ], 0, i+(20*gubPageNum)); } gfFaceMouseRegionsActive = TRUE; }
BOOLEAN EnterBriefingRoomEnter() { VOBJECT_DESC VObjectDesc; UINT16 i, usPosY; //----------------------------------------- // upon entry to Imp home page memset(pPlayerBriefingRoomEnterActivationString, 0, sizeof(pPlayerBriefingRoomEnterActivationString)); // reset string position iStringBriefingRoomEnterPos =0; // reset activation cursor position uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X; // we have now vsisited IMP, reset fact we haven't fNotVistedImpYet = FALSE; //------------------------ LaptopInitBriefingRoomEnter(); InitBriefingRoomEnterDefaults(); // load the Rust bacground graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; //FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile); FilenameForBPP("BriefingRoom\\aimlogo.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterLogoAim)); // load the MemberShipcard graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("BriefingRoom\\BUTTONS.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoomEnter)); // this procedure will load the activation indent into memory VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOM_MISSIONACTIVATIONINDENT)); //** Mouse Regions ** usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120; for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++) { if ( i == 0 ) MSYS_DefineRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i], BRIEFINGROOM_MISSION_TOC_X+120, usPosY, (UINT16)(BRIEFINGROOM_MISSION_TOC_X+120 + BRIEFINGROOM_MISSION_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_MISSION_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomEnterLocationButton); MSYS_AddRegion(&gSelectedBriefingRoomEnterTocMenuRegion[i]); usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y; } fFirstTimeInBriefingRoomEnter = FALSE; RenderBriefingRoomEnter(); return( TRUE ); }
void CreateIMPVoiceMouseRegions( void ) { // will create mouse regions needed for the IMP voices page MSYS_DefineRegion( &gVoicePortraitRegion, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 176, LAPTOP_SCREEN_UL_X + 200 + 100, LAPTOP_SCREEN_WEB_UL_Y + 176 + 100, MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, IMPPortraitRegionButtonCallback ); MSYS_AddRegion( &gVoicePortraitRegion ); }
BOOLEAN InitTocMenu() { UINT16 i, usPosY; UINT16 usHeight; UINT16 usWidth=0; CHAR16 sText[400]; UINT8 ubLocInFile[] = { IN_THE_BEGINNING, THE_ISLAND_METAVIRA, GUS_TARBALLS, WORD_FROM_FOUNDER, INCORPORATION}; HVOBJECT hContentButtonHandle; GetVideoObject(&hContentButtonHandle, guiContentButton); usHeight = GetFontHeight(AIM_HISTORY_TOC_TEXT_FONT); usPosY = AIM_HISTORY_CONTENTBUTTON_Y; for(i=0; i<NUM_AIM_HISTORY_PAGES; i++) { if(!g_bUseXML_Strings) { UINT32 uiStartLoc = AIM_HISTORY_LINE_SIZE * ubLocInFile[i]; LoadEncryptedDataFromFile(AIMHISTORYFILE, sText, uiStartLoc, AIM_HISTORY_LINE_SIZE); } else { Loc::GetString(Loc::AIM_HISTORY, L"Line", ubLocInFile[i], sText, 400); } usWidth = StringPixLength(sText, AIM_HISTORY_TOC_TEXT_FONT); //if the mouse regions havent been inited, init them if( !gfInToc ) { //Mouse region for the history toc buttons MSYS_DefineRegion( &gSelectedHistoryTocMenuRegion[i], AIM_HISTORY_TOC_X, usPosY, (UINT16)(AIM_HISTORY_TOC_X + AIM_CONTENTBUTTON_WIDTH), (UINT16)(usPosY + AIM_CONTENTBUTTON_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectHistoryTocMenuRegionCallBack); MSYS_AddRegion(&gSelectedHistoryTocMenuRegion[i]); MSYS_SetRegionUserData( &gSelectedHistoryTocMenuRegion[i], 0, i+1); } BltVideoObject(FRAME_BUFFER, hContentButtonHandle, 0,AIM_HISTORY_TOC_X, usPosY, VO_BLT_SRCTRANSPARENCY,NULL); DrawTextToScreen(sText, AIM_HISTORY_TOC_X, (UINT16)(usPosY + AIM_HISTORY_TOC_Y), AIM_CONTENTBUTTON_WIDTH, AIM_HISTORY_TOC_TEXT_FONT, AIM_HISTORY_TOC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); usPosY += AIM_HISTORY_TOC_GAP_Y; } gfInToc = TRUE; return(TRUE); }
BOOLEAN EnterFloristCards() { UINT16 i, j, usPosX, usPosY; VOBJECT_DESC VObjectDesc; UINT8 ubCount; InitFloristDefaults(); // load the Flower Account Box graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\CardBlank.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiCardBackground)); ubCount = 0; usPosY = FLORIST_CARD_FIRST_POS_Y; for(j=0; j<3; j++) { usPosX = FLORIST_CARD_FIRST_POS_X; for(i=0; i<3; i++) { MSYS_DefineRegion( &gSelectedFloristCardsRegion[ubCount], usPosX, usPosY, (UINT16)(usPosX + FLORIST_CARD_CARD_WIDTH), (UINT16)(usPosY + FLORIST_CARD_CARD_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristCardsRegionCallBack ); MSYS_AddRegion(&gSelectedFloristCardsRegion[ubCount]); MSYS_SetRegionUserData( &gSelectedFloristCardsRegion[ubCount], 0, ubCount ); ubCount++; usPosX += FLORIST_CARD_FIRST_OFFSET_X; } usPosY += FLORIST_CARD_FIRST_OFFSET_Y; } guiFlowerCardsButtonImage = LoadButtonImage("LAPTOP\\FloristButtons.sti", -1,0,-1,1,-1 ); guiFlowerCardsBackButton = CreateIconAndTextButton( guiFlowerCardsButtonImage, sFloristCards[FLORIST_CARDS_BACK], FLORIST_BUTTON_TEXT_FONT, FLORIST_BUTTON_TEXT_UP_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR, FLORIST_BUTTON_TEXT_DOWN_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR, TEXT_CJUSTIFIED, FLORIST_CARD_BACK_BUTTON_X, FLORIST_CARD_BACK_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, BtnFlowerCardsBackButtonCallback); SetButtonCursor(guiFlowerCardsBackButton, CURSOR_WWW ); //passing the currently selected card to -1, so it is not used gbCurrentlySelectedCard = -1; RenderFloristCards(); return(TRUE); }
void CreateDestroyDoneMouseRegion(UINT16 usPosY) { static BOOLEAN DoneRegionCreated=FALSE; if( ( !DoneRegionCreated ) && ( usPosY != 0) ) { usPosY -= AIM_ALUMNI_DONE_HEIGHT; MSYS_DefineRegion( &gDoneRegion, AIM_ALUMNI_DONE_X-2, usPosY, (AIM_ALUMNI_DONE_X-2 + AIM_ALUMNI_DONE_WIDTH), (INT16)(usPosY + AIM_ALUMNI_DONE_HEIGHT), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectAlumniDoneRegionCallBack); // Add region MSYS_AddRegion( &gDoneRegion ); DoneRegionCreated = TRUE; } if( DoneRegionCreated && usPosY == 0) { MSYS_RemoveRegion( &gDoneRegion ); DoneRegionCreated = FALSE; // gfDestroyDoneRegion = FALSE; } }
void EnterIMPMinorTrait( void ) { UINT8 ubCnt; // UINT32 ubCnt; VOBJECT_DESC VObjectDesc; //add the skill trait buttons AddIMPMinorTraitButtons(); // load the stats graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SkillTraitSmallGreyIdent.sti", VObjectDesc.ImageFile); if( !AddVideoObject(&VObjectDesc, &guiIMT_GreyGoldBox ) ) { Assert( 0 ); return; } giIMPMinorlTraitFinsihButtonImage = LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 ); giIMPMinorlTraitFinsihButton = CreateIconAndTextButton( giIMPMinorlTraitFinsihButtonImage, pImpButtonText[ 24 ], FONT12ARIAL, FONT_WHITE, DEFAULT_SHADOW, FONT_WHITE, DEFAULT_SHADOW, TEXT_CJUSTIFIED, LAPTOP_SCREEN_UL_X + ( 350 ), LAPTOP_SCREEN_WEB_UL_Y + ( 340 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPMinorTraitFinishCallback ); SetButtonCursor( giIMPMinorlTraitFinsihButton, CURSOR_WWW); //if we are not DONE and are just reviewing if( iCurrentProfileMode != IMP__FINISH ) { for (ubCnt = 0; ubCnt<IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS; ubCnt++ ) { gfMinorTraitQuestions[ ubCnt ] = FALSE; } //Have the NONE trait initially selected gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_MINOR_NONE ] = TRUE; } HandleMinorTraitButtonStates( ); // add regions for help texts UINT16 usPosX = IMP_MINOR_TRAIT__LEFT_COLUMN_START_X + 62; UINT16 usPosY = IMP_MINOR_TRAIT__LEFT_COLUMN_START_Y + 8; for( ubCnt=0; ubCnt<IMP_SKILL_TRAITS_NEW_NUMBER_MINOR_SKILLS; ubCnt++ ) { MSYS_DefineRegion( &gMR_MinorTraitHelpTextRegions[ubCnt], ( usPosX ), ( usPosY ), (usPosX + 156), ( usPosY + 17), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, NULL ); MSYS_AddRegion( &gMR_MinorTraitHelpTextRegions[ubCnt] ); //Determine the next x location if( ubCnt < IMP_MINOR_TRAIT__TRAITS_TO_START_RIGHT_COL ) usPosX = IMP_MINOR_TRAIT__LEFT_COLUMN_START_X + 62; else usPosX = IMP_MINOR_TRAIT__RIGHT_COLUMN_START_X + 62; //Determine the next Y location if( ubCnt == IMP_MINOR_TRAIT__TRAITS_TO_START_RIGHT_COL ) usPosY = IMP_MINOR_TRAIT__RIGHT_COLUMN_START_Y + 8; else usPosY += IMP_MINOR_TRAIT__SPACE_BTN_BUTTONS; //if its the none button if( ubCnt == IMP_SKILL_TRAITS_NEW_MINOR_NONE-1 ) { usPosX = IMP_MINOR_TRAIT__NONE_BTN_LOC_X + 62; usPosY = IMP_MINOR_TRAIT__NONE_BTN_LOC_Y + 8; } } //reset last selected trait memset( gbLastSelectedMinorTrait, -1, NUM_MINOR_TRAITS ); }
BOOLEAN EnterAimSort() { VOBJECT_DESC VObjectDesc; UINT8 ubCurNumber=0; UINT16 ubWidth; UINT8 i; //Everytime into Aim Sort, reset array. for(i=0; i<MAX_NUMBER_MERCS; i++) { AimMercArray[i] = i; } InitAimDefaults(); // load the SortBy box graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SortBy.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiSortByBox)); // load the ToAlumni graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOALUMNI ); CHECKF(AddVideoObject(&VObjectDesc, &guiToAlumni)); // load the ToMugShots graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOMUGSHOTS ); CHECKF(AddVideoObject(&VObjectDesc, &guiToMugShots)); // load the ToStats graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOSTATS ); CHECKF(AddVideoObject(&VObjectDesc, &guiToStats)); // load the SelectLight graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SelectLight.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiSelectLight)); //** Mouse Regions ** //Mouse region for the ToMugShotRegion MSYS_DefineRegion( &gSelectedToMugShotRegion, AIM_SORT_TO_MUGSHOTS_X, AIM_SORT_TO_MUGSHOTS_Y, (AIM_SORT_TO_MUGSHOTS_X + AIM_SORT_TO_MUGSHOTS_SIZE), (AIM_SORT_TO_MUGSHOTS_Y + AIM_SORT_TO_MUGSHOTS_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToMugShotRegionCallBack ); MSYS_AddRegion(&gSelectedToMugShotRegion); //Mouse region for the ToStatsRegion MSYS_DefineRegion( &gSelectedToStatsRegion, AIM_SORT_TO_STATS_X, AIM_SORT_TO_STATS_Y, (AIM_SORT_TO_STATS_X + AIM_SORT_TO_STATS_SIZE), (AIM_SORT_TO_STATS_Y + AIM_SORT_TO_STATS_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToStatsRegionCallBack ); MSYS_AddRegion(&gSelectedToStatsRegion); //Mouse region for the ToArhciveRegion MSYS_DefineRegion( &gSelectedToArchiveRegion, AIM_SORT_TO_ALUMNI_X, AIM_SORT_TO_ALUMNI_Y, (AIM_SORT_TO_ALUMNI_X + AIM_SORT_TO_ALUMNI_SIZE), (AIM_SORT_TO_ALUMNI_Y + AIM_SORT_TO_ALUMNI_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToArchiveRegionCallBack ); MSYS_AddRegion(&gSelectedToArchiveRegion); //CURSOR_WWW MSYS_NO_CURSOR ubCurNumber = 0; //Mouse region for the Price Check Box ubWidth = StringPixLength( AimSortText[PRICE], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; MSYS_DefineRegion( &gSelectedPriceBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectPriceBoxRegionCallBack ); MSYS_AddRegion(&gSelectedPriceBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[EXPERIENCE], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Experience Check Box MSYS_DefineRegion( &gSelectedExpBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectExpBoxRegionCallBack ); MSYS_AddRegion(&gSelectedExpBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMARKSMANSHIP], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Markmanship Check Box MSYS_DefineRegion( &gSelectedMarkBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMarkBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMarkBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMEDICAL], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MEDICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Medical Check Box MSYS_DefineRegion( &gSelectedMedicalBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMedicalBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMedicalBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[EXPLOSIVES], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MEDICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Explosive Check Box MSYS_DefineRegion( &gSelectedExplosiveBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectExplosiveBoxRegionCallBack ); MSYS_AddRegion(&gSelectedExplosiveBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMECHANICAL], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MEDICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Mechanical Check Box MSYS_DefineRegion( &gSelectedMechanicalBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMechanicalBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMechanicalBoxRegion); ubCurNumber+=2; ubWidth = AimSortCheckBoxLoc[ ubCurNumber ] - StringPixLength( AimSortText[ASCENDING], AIM_SORT_FONT_SORT_TEXT) - 6; //Mouse region for the Ascend Check Box MSYS_DefineRegion( &gSelectedAscendBoxRegion, ubWidth , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)(AimSortCheckBoxLoc[ ubCurNumber ] + AIM_SORT_CHECKBOX_SIZE), (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectAscendBoxRegionCallBack ); MSYS_AddRegion(&gSelectedAscendBoxRegion); ubCurNumber+=2; ubWidth = AimSortCheckBoxLoc[ ubCurNumber ] - StringPixLength( AimSortText[DESCENDING], AIM_SORT_FONT_SORT_TEXT) - 6; //Mouse region for the Descend Check Box MSYS_DefineRegion( &gSelectedDescendBoxRegion, ubWidth, AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)(AimSortCheckBoxLoc[ ubCurNumber ] + AIM_SORT_CHECKBOX_SIZE), (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectDescendBoxRegionCallBack ); MSYS_AddRegion(&gSelectedDescendBoxRegion); InitAimMenuBar(); RenderAimSort(); return( TRUE ); }
INT32 DoMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { VSURFACE_DESC vs_desc; UINT16 usTextBoxWidth; UINT16 usTextBoxHeight; SGPRect aRect; UINT32 uiDestPitchBYTES, uiSrcPitchBYTES; UINT8 *pDestBuf, *pSrcBuf; INT16 sButtonX, sButtonY, sBlankSpace; UINT8 ubMercBoxBackground = BASIC_MERC_POPUP_BACKGROUND, ubMercBoxBorder = BASIC_MERC_POPUP_BORDER; UINT8 ubFontColor, ubFontShadowColor; UINT16 usCursor; INT32 iId = -1; GetMousePos( &pOldMousePosition ); //this variable can be unset if ur in a non gamescreen and DONT want the msg box to use the save buffer gfDontOverRideSaveBuffer = TRUE; SetCurrentCursorFromDatabase( CURSOR_NORMAL ); if( gMsgBox.BackRegion.uiFlags & MSYS_REGION_EXISTS ) { return( 0 ); } // Based on style.... switch( ubStyle ) { //default case MSG_BOX_BASIC_STYLE: ubMercBoxBackground = DIALOG_MERC_POPUP_BACKGROUND; ubMercBoxBorder = DIALOG_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\popupbuttons.sti", -1,0,-1,1,-1 ); ubFontColor = FONT_MCOLOR_WHITE; ubFontShadowColor = DEFAULT_SHADOW; usCursor = CURSOR_NORMAL; break; case MSG_BOX_RED_ON_WHITE: ubMercBoxBackground = WHITE_MERC_POPUP_BACKGROUND; ubMercBoxBorder = RED_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\msgboxRedButtons.sti", -1,0,-1,1,-1 ); ubFontColor = 2; ubFontShadowColor = NO_SHADOW; usCursor = CURSOR_LAPTOP_SCREEN; break; case MSG_BOX_BLUE_ON_GREY: ubMercBoxBackground = GREY_MERC_POPUP_BACKGROUND; ubMercBoxBorder = BLUE_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\msgboxGreyButtons.sti", -1,0,-1,1,-1 ); ubFontColor = 2; ubFontShadowColor = FONT_MCOLOR_WHITE; usCursor = CURSOR_LAPTOP_SCREEN; break; case MSG_BOX_IMP_STYLE: ubMercBoxBackground = IMP_POPUP_BACKGROUND; ubMercBoxBorder = DIALOG_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\msgboxGreyButtons.sti", -1,0,-1,1,-1 ); ubFontColor = 2; ubFontShadowColor = FONT_MCOLOR_WHITE; usCursor = CURSOR_LAPTOP_SCREEN; break; case MSG_BOX_BASIC_SMALL_BUTTONS: ubMercBoxBackground = DIALOG_MERC_POPUP_BACKGROUND; ubMercBoxBorder = DIALOG_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\popupbuttons.sti", -1,2,-1,3,-1 ); ubFontColor = FONT_MCOLOR_WHITE; ubFontShadowColor = DEFAULT_SHADOW; usCursor = CURSOR_NORMAL; break; case MSG_BOX_LAPTOP_DEFAULT: ubMercBoxBackground = LAPTOP_POPUP_BACKGROUND; ubMercBoxBorder = LAPTOP_POP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\popupbuttons.sti", -1,0,-1,1,-1 ); ubFontColor = FONT_MCOLOR_WHITE; ubFontShadowColor = DEFAULT_SHADOW; usCursor = CURSOR_LAPTOP_SCREEN; break; default: ubMercBoxBackground = BASIC_MERC_POPUP_BACKGROUND; ubMercBoxBorder = BASIC_MERC_POPUP_BORDER; // Add button images gMsgBox.iButtonImages = LoadButtonImage( "INTERFACE\\msgboxbuttons.sti", -1,0,-1,1,-1 ); ubFontColor = FONT_MCOLOR_WHITE; ubFontShadowColor = DEFAULT_SHADOW; usCursor = CURSOR_NORMAL; break; } if ( usFlags & MSG_BOX_FLAG_USE_CENTERING_RECT && pCenteringRect != NULL ) { aRect.iTop = pCenteringRect->iTop; aRect.iLeft = pCenteringRect->iLeft; aRect.iBottom = pCenteringRect->iBottom; aRect.iRight = pCenteringRect->iRight; } else { // Use default! aRect.iTop = 0; aRect.iLeft = 0; aRect.iBottom = 480; aRect.iRight = 640; } // Set some values! gMsgBox.usFlags = usFlags; gMsgBox.uiExitScreen = uiExitScreen; gMsgBox.ExitCallback = ReturnCallback; gMsgBox.fRenderBox = TRUE; gMsgBox.bHandled = 0; // Init message box gMsgBox.iBoxId = PrepareMercPopupBox( iId, ubMercBoxBackground, ubMercBoxBorder, zString, MSGBOX_DEFAULT_WIDTH, 40, 10, 30, &usTextBoxWidth, &usTextBoxHeight ); if( gMsgBox.iBoxId == -1 ) { #ifdef JA2BETAVERSION AssertMsg( 0, "Failed in DoMessageBox(). Probable reason is because the string was too large to fit in max message box size." ); #endif return 0; } // Save height,width gMsgBox.usWidth = usTextBoxWidth; gMsgBox.usHeight = usTextBoxHeight; // Determine position ( centered in rect ) gMsgBox.sX = (INT16)( ( ( ( aRect.iRight - aRect.iLeft ) - usTextBoxWidth ) / 2 ) + aRect.iLeft ); gMsgBox.sY = (INT16)( ( ( ( aRect.iBottom - aRect.iTop ) - usTextBoxHeight ) / 2 ) + aRect.iTop ); if ( guiCurrentScreen == GAME_SCREEN ) { gfStartedFromGameScreen = TRUE; } if ( (fInMapMode == TRUE ) ) { // fMapExitDueToMessageBox = TRUE; gfStartedFromMapScreen = TRUE; fMapPanelDirty = TRUE; } // Set pending screen SetPendingNewScreen( MSG_BOX_SCREEN); // Init save buffer vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE; vs_desc.usWidth = usTextBoxWidth; vs_desc.usHeight = usTextBoxHeight; vs_desc.ubBitDepth = 16; if( AddVideoSurface( &vs_desc, &gMsgBox.uiSaveBuffer) == FALSE ) { return( - 1 ); } //Save what we have under here... pDestBuf = LockVideoSurface( gMsgBox.uiSaveBuffer, &uiDestPitchBYTES); pSrcBuf = LockVideoSurface( FRAME_BUFFER, &uiSrcPitchBYTES); Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0 , 0, gMsgBox.sX , gMsgBox.sY, usTextBoxWidth, usTextBoxHeight ); UnLockVideoSurface( gMsgBox.uiSaveBuffer ); UnLockVideoSurface( FRAME_BUFFER ); // Create top-level mouse region MSYS_DefineRegion( &(gMsgBox.BackRegion), 0, 0, 640, 480, MSYS_PRIORITY_HIGHEST, usCursor, MSYS_NO_CALLBACK, MsgBoxClickCallback ); if( gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] == FALSE ) { if( usFlags & MSG_BOX_FLAG_OK ) { SimulateMouseMovement( ( gMsgBox.sX + ( usTextBoxWidth / 2 ) + 27 ), ( gMsgBox.sY + ( usTextBoxHeight - 10 ) ) ); } else { SimulateMouseMovement( gMsgBox.sX + usTextBoxWidth / 2 , gMsgBox.sY + usTextBoxHeight - 4 ); } } // Add region MSYS_AddRegion(&(gMsgBox.BackRegion) ); // findout if cursor locked, if so, store old params and store, restore when done if( IsCursorRestricted() ) { fCursorLockedToArea = TRUE; GetRestrictedClipCursor( &MessageBoxRestrictedCursorRegion ); FreeMouseCursor( ); } // Create four numbered buttons if ( usFlags & MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS ) { // This is exclusive of any other buttons... no ok, no cancel, no nothing sBlankSpace = usTextBoxWidth - MSGBOX_SMALL_BUTTON_WIDTH * 4 - MSGBOX_SMALL_BUTTON_X_SEP * 3; sButtonX = sBlankSpace / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiButton[0] = CreateIconAndTextButton( gMsgBox.iButtonImages, L"1", FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NumberedMsgBoxCallback ); MSYS_SetBtnUserData( gMsgBox.uiButton[0], 0, 1); SetButtonCursor(gMsgBox.uiButton[0], usCursor); sButtonX += MSGBOX_SMALL_BUTTON_WIDTH + MSGBOX_SMALL_BUTTON_X_SEP; gMsgBox.uiButton[1] = CreateIconAndTextButton( gMsgBox.iButtonImages, L"2", FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NumberedMsgBoxCallback ); MSYS_SetBtnUserData( gMsgBox.uiButton[1], 0, 2); SetButtonCursor(gMsgBox.uiButton[1], usCursor); sButtonX += MSGBOX_SMALL_BUTTON_WIDTH + MSGBOX_SMALL_BUTTON_X_SEP; gMsgBox.uiButton[2] = CreateIconAndTextButton( gMsgBox.iButtonImages, L"3", FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NumberedMsgBoxCallback ); MSYS_SetBtnUserData( gMsgBox.uiButton[2], 0, 3); SetButtonCursor(gMsgBox.uiButton[2], usCursor); sButtonX += MSGBOX_SMALL_BUTTON_WIDTH + MSGBOX_SMALL_BUTTON_X_SEP; gMsgBox.uiButton[3] = CreateIconAndTextButton( gMsgBox.iButtonImages, L"4", FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NumberedMsgBoxCallback ); MSYS_SetBtnUserData( gMsgBox.uiButton[3], 0, 4); SetButtonCursor(gMsgBox.uiButton[3], usCursor); ForceButtonUnDirty( gMsgBox.uiButton[3] ); ForceButtonUnDirty( gMsgBox.uiButton[2] ); ForceButtonUnDirty( gMsgBox.uiButton[1] ); ForceButtonUnDirty( gMsgBox.uiButton[0] ); } else { // Create text button if ( usFlags & MSG_BOX_FLAG_OK ) { // sButtonX = ( usTextBoxWidth - MSGBOX_BUTTON_WIDTH ) / 2; sButtonX = ( usTextBoxWidth - GetMSgBoxButtonWidth( gMsgBox.iButtonImages ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiOKButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_OK ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)OKMsgBoxCallback ); SetButtonCursor(gMsgBox.uiOKButton, usCursor); ForceButtonUnDirty( gMsgBox.uiOKButton ); } // Create text button if ( usFlags & MSG_BOX_FLAG_CANCEL ) { sButtonX = ( usTextBoxWidth - GetMSgBoxButtonWidth( gMsgBox.iButtonImages ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiOKButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_CANCEL ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)OKMsgBoxCallback ); SetButtonCursor(gMsgBox.uiOKButton, usCursor); ForceButtonUnDirty( gMsgBox.uiOKButton ); } if ( usFlags & MSG_BOX_FLAG_YESNO ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_YES ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_NO ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); } if ( usFlags & MSG_BOX_FLAG_CONTINUESTOP ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pUpdatePanelButtons[ 0 ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pUpdatePanelButtons[ 1 ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); } if ( usFlags & MSG_BOX_FLAG_OKCONTRACT ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_OK ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)OKMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_REHIRE ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)ContractMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); } if ( usFlags & MSG_BOX_FLAG_YESNOCONTRACT ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 3; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_YES ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_NO ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); gMsgBox.uiOKButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_REHIRE ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + 2 * ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)ContractMsgBoxCallback ); SetButtonCursor(gMsgBox.uiOKButton, usCursor); ForceButtonUnDirty( gMsgBox.uiOKButton ); } if ( usFlags & MSG_BOX_FLAG_GENERICCONTRACT ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 3; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, gzUserDefinedButton1, FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, gzUserDefinedButton2, FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); gMsgBox.uiOKButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_REHIRE ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + 2 * ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)ContractMsgBoxCallback ); SetButtonCursor(gMsgBox.uiOKButton, usCursor); ForceButtonUnDirty( gMsgBox.uiOKButton ); } if ( usFlags & MSG_BOX_FLAG_GENERIC ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, gzUserDefinedButton1, FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, gzUserDefinedButton2, FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); } if ( usFlags & MSG_BOX_FLAG_YESNOLIE ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 3; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_YES ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_NO ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); gMsgBox.uiOKButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_LIE ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + 2 * ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)LieMsgBoxCallback ); SetButtonCursor(gMsgBox.uiOKButton, usCursor); ForceButtonUnDirty( gMsgBox.uiOKButton ); } if ( usFlags & MSG_BOX_FLAG_OKSKIP ) { sButtonX = ( usTextBoxWidth - ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ) / 2; sButtonY = usTextBoxHeight - MSGBOX_BUTTON_HEIGHT - 10; gMsgBox.uiYESButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_OK ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)YESMsgBoxCallback ); SetButtonCursor(gMsgBox.uiYESButton, usCursor); ForceButtonUnDirty( gMsgBox.uiYESButton ); gMsgBox.uiNOButton = CreateIconAndTextButton( gMsgBox.iButtonImages, pMessageStrings[ MSG_SKIP ], FONT12ARIAL, ubFontColor, ubFontShadowColor, ubFontColor, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gMsgBox.sX + sButtonX + ( MSGBOX_BUTTON_WIDTH + MSGBOX_BUTTON_X_SEP ) ), (INT16)(gMsgBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)NOMsgBoxCallback ); SetButtonCursor(gMsgBox.uiNOButton, usCursor); ForceButtonUnDirty( gMsgBox.uiNOButton ); } } InterruptTime(); PauseGame(); LockPauseState( 1 ); // Pause timers as well.... PauseTime( TRUE ); // Save mouse restriction region... GetRestrictedClipCursor( &gOldCursorLimitRectangle ); FreeMouseCursor( ); gfNewMessageBox = TRUE; gfInMsgBox = TRUE; return( iId ); }
INT32 DoChatBox( bool bIncludeChatLog, const STR16 zString, UINT32 uiExitScreen, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { VSURFACE_DESC vs_desc; UINT16 usTextBoxWidth; UINT16 usTextBoxHeight; UINT16 usYMargin; SGPRect aRect; UINT32 uiDestPitchBYTES, uiSrcPitchBYTES; UINT8 *pDestBuf, *pSrcBuf; INT16 sButtonX, sButtonY; UINT8 ubMercBoxBackground = BASIC_MERC_POPUP_BACKGROUND, ubMercBoxBorder = BASIC_MERC_POPUP_BORDER; UINT8 ubFontColor, ubFontShadowColor; UINT16 usCursor; INT32 iId = -1; // clear the ouput string memset(gszChatBoxInputString,0,sizeof(CHAR16)*255); gIncludeChatLog = bIncludeChatLog; GetMousePos( &pOldMousePosition ); if (bIncludeChatLog) usYMargin = CHATBOX_Y_MARGIN_LOG; else usYMargin = CHATBOX_Y_MARGIN_NOLOG; //this variable can be unset if ur in a non gamescreen and DONT want the msg box to use the save buffer gfDontOverRideSaveBuffer = TRUE; SetCurrentCursorFromDatabase( CURSOR_NORMAL ); if( gChatBox.BackRegion.uiFlags & MSYS_REGION_EXISTS ) { return( 0 ); } // set style ubMercBoxBackground = DIALOG_MERC_POPUP_BACKGROUND; ubMercBoxBorder = DIALOG_MERC_POPUP_BORDER; // Add button images gChatBox.iButtonImages = LoadButtonImage( "INTERFACE\\popupbuttons.sti", -1,0,-1,1,-1 ); ubFontColor = CHATBOX_FONT_COLOR; ubFontShadowColor = DEFAULT_SHADOW; usCursor = CURSOR_NORMAL; // Use default! aRect.iTop = 0; aRect.iLeft = 0; aRect.iBottom = SCREEN_HEIGHT; aRect.iRight = SCREEN_WIDTH; // Set some values! //gChatBox.usFlags = usFlags; gChatBox.uiExitScreen = uiExitScreen; gChatBox.ExitCallback = ReturnCallback; gChatBox.fRenderBox = TRUE; gChatBox.bHandled = 0; // Init message box if (bIncludeChatLog) // we need a string just long enough to give 1 line, but max length of the box, we render the chatlog over this string so well never see it. DONT DELETE ANY SPACES gChatBox.iBoxId = PrepareMercPopupBox( iId, ubMercBoxBackground, ubMercBoxBorder, L"A string that will be hidden, ", CHATBOX_WIDTH, CHATBOX_X_MARGIN, usYMargin, CHATBOX_Y_MARGIN_BOTTOM, &usTextBoxWidth, &usTextBoxHeight ); else gChatBox.iBoxId = PrepareMercPopupBox( iId, ubMercBoxBackground, ubMercBoxBorder, zString, CHATBOX_WIDTH, CHATBOX_X_MARGIN, usYMargin, CHATBOX_Y_MARGIN_BOTTOM, &usTextBoxWidth, &usTextBoxHeight ); if( gChatBox.iBoxId == -1 ) { #ifdef JA2BETAVERSION AssertMsg( 0, "Failed in DoMessageBox(). Probable reason is because the string was too large to fit in max message box size." ); #endif return 0; } // Save height,width gChatBox.usWidth = usTextBoxWidth; gChatBox.usHeight = usTextBoxHeight; // Determine position ( centered in rect ) gChatBox.sX = (INT16)( ( ( ( aRect.iRight - aRect.iLeft ) - usTextBoxWidth ) / 2 ) + aRect.iLeft ); gChatBox.sY = (INT16)( ( ( ( aRect.iBottom - aRect.iTop ) - usTextBoxHeight ) / 2 ) + aRect.iTop ); if ( guiCurrentScreen == GAME_SCREEN ) { gfStartedFromGameScreen = TRUE; } if ( (fInMapMode == TRUE ) ) { // fMapExitDueToMessageBox = TRUE; gfStartedFromMapScreen = TRUE; fMapPanelDirty = TRUE; } // Set pending screen SetPendingNewScreen( MP_CHAT_SCREEN); // Init save buffer vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE; vs_desc.usWidth = usTextBoxWidth; vs_desc.usHeight = usTextBoxHeight; vs_desc.ubBitDepth = 16; if( AddVideoSurface( &vs_desc, &gChatBox.uiSaveBuffer) == FALSE ) { return( - 1 ); } //Save what we have under here... pDestBuf = LockVideoSurface( gChatBox.uiSaveBuffer, &uiDestPitchBYTES); pSrcBuf = LockVideoSurface( FRAME_BUFFER, &uiSrcPitchBYTES); Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0 , 0, gChatBox.sX , gChatBox.sY, usTextBoxWidth, usTextBoxHeight ); UnLockVideoSurface( gChatBox.uiSaveBuffer ); UnLockVideoSurface( FRAME_BUFFER ); // Create top-level mouse region MSYS_DefineRegion( &(gChatBox.BackRegion), 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGHEST, usCursor, MSYS_NO_CALLBACK, ChatBoxClickCallback ); // Add region MSYS_AddRegion(&(gChatBox.BackRegion) ); // findout if cursor locked, if so, store old params and store, restore when done if( IsCursorRestricted() ) { fCursorLockedToArea = TRUE; GetRestrictedClipCursor( &ChatBoxRestrictedCursorRegion ); FreeMouseCursor( ); } // vars for positioning controls on the chatbox int usPosX = 0; int usPosY = gChatBox.sY + GetFontHeight(CHATBOX_FONT_TITLE) + CHATBOX_Y_GAP + 5; if (bIncludeChatLog) { // CREATE BUTTONS AND IMAGES FOR CHATLOG VOBJECT_DESC VObjectDesc; // will create buttons for interface bottom VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP( "INTERFACE\\mpchatbox.sti", VObjectDesc.ImageFile ); if( !AddVideoObject( &VObjectDesc, &guiCHATLOGIMG ) ) Assert( false ); gChatMessageLogRegion.iTop = usPosY; gChatMessageLogRegion.iLeft = gChatBox.sX + (CHATBOX_X_MARGIN / 2); gChatMessageLogRegion.iBottom = usPosY + CHATBOX_LOG_HEIGHT; gChatMessageLogRegion.iRight = gChatMessageLogRegion.iLeft + CHATBOX_LOG_WIDTH; // SETUP SCROLLING AREA BOUNDS CHATLOG_SCROLL_AREA_START_Y = gChatMessageLogRegion.iTop+20; CHATLOG_SCROLL_AREA_END_Y = gChatMessageLogRegion.iBottom-20; CHATLOG_SCROLL_AREA_HEIGHT = ( CHATLOG_SCROLL_AREA_END_Y - CHATLOG_SCROLL_AREA_START_Y + 1 ); CHATLOG_SCROLL_AREA_START_X = gChatMessageLogRegion.iRight + CHATBOX_SLIDER_GAP + 1; CHATLOG_SCROLL_AREA_END_X = gChatMessageLogRegion.iRight + CHATBOX_SLIDER_GAP + 1 + CHAT_SLIDER_WIDTH; CHATLOG_SCROLL_AREA_WIDTH = ( CHATLOG_SCROLL_AREA_END_X - CHATLOG_SCROLL_AREA_START_X + 1 ); CHAT_SLIDER_BAR_RANGE = ( CHATLOG_SCROLL_AREA_HEIGHT - CHAT_SLIDER_HEIGHT ); LoadChatLogSliderBar(); // Load Scroll button images guiChatLogScrollButtonsImage[ CHAT_SCROLL_MESSAGE_UP ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 ); guiChatLogScrollButtonsImage[ CHAT_SCROLL_MESSAGE_DOWN ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 ); // Create buttons guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiChatLogScrollButtonsImage[ CHAT_SCROLL_MESSAGE_UP ], gChatMessageLogRegion.iRight + CHATBOX_SLIDER_GAP + 2 , gChatMessageLogRegion.iTop + 1 , BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST, (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageUpChatLogCallback); guiChatLogScrollButtons[ CHAT_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiChatLogScrollButtonsImage[ CHAT_SCROLL_MESSAGE_DOWN ], gChatMessageLogRegion.iRight + CHATBOX_SLIDER_GAP + 2, gChatMessageLogRegion.iBottom - 16, BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST, (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageDownChatLogCallback); usPosY = gChatBox.sY + CHATBOX_Y_MARGIN_LOG + (CHATBOX_Y_GAP * 2) + GetFontHeight(FONT12ARIAL) + 5; // END CREATE CHATLOG } else usPosY = gChatBox.sY + CHATBOX_Y_MARGIN_NOLOG + (CHATBOX_Y_GAP * 2) + GetFontHeight(FONT12ARIAL); // get the middle of the box UINT16 middleBox = ( usTextBoxWidth / 2 ); // CREATE SEND TO ALLIES / ALL TOGGLES // send to all int toggleWidth = 32 + StringPixLength( gzMPChatToggleText[ 0 ], CHATBOX_FONT_TOGGLE ); usPosX = gChatBox.sX + ((middleBox - toggleWidth)/2); guiChatToggles[ 0 ] = CreateCheckBoxButton( usPosX, usPosY, "INTERFACE\\OptionsCheckBoxes_12x12.sti", MSYS_PRIORITY_HIGHEST, BtnChatTogglesCallback ); MSYS_SetBtnUserData( guiChatToggles[ 0 ], 0, 0 ); // send to allies toggleWidth = 32 + StringPixLength( gzMPChatToggleText[ 1 ], CHATBOX_FONT_TOGGLE ); usPosX = gChatBox.sX + middleBox + ((middleBox - toggleWidth)/2); guiChatToggles[ 1 ] = CreateCheckBoxButton( usPosX, usPosY, "INTERFACE\\OptionsCheckBoxes_12x12.sti", MSYS_PRIORITY_HIGHEST, BtnChatTogglesCallback ); MSYS_SetBtnUserData( guiChatToggles[ 1 ], 0, 1 ); usPosY += CHATBOX_TOGGLE_HEIGHT + CHATBOX_Y_GAP; // SET DEFAULT FLAGGED if (gbChatSendToAll) ButtonList[ guiChatToggles[ 0 ] ]->uiFlags |= BUTTON_CLICKED_ON; else ButtonList[ guiChatToggles[ 1 ] ]->uiFlags |= BUTTON_CLICKED_ON; // END CREATE TOGGLES // CREATE TEXT INPUT BOX InitTextInputMode(); // API call to initialise text input mode for this screen // does not mean we are inputting text right away // Player Name field SetTextInputCursor( CUROSR_IBEAM_WHITE ); SetTextInputFont( (UINT16) FONT12ARIALFIXEDWIDTH ); //FONT12ARIAL //FONT12ARIALFIXEDWIDTH Set16BPPTextFieldColor( Get16BPPColor(FROMRGB( 0, 0, 0) ) ); SetBevelColors( Get16BPPColor(FROMRGB(136, 138, 135)), Get16BPPColor(FROMRGB(24, 61, 81)) ); SetTextInputRegularColors( FONT_WHITE, 2 ); SetTextInputHilitedColors( 2, FONT_WHITE, FONT_WHITE ); SetCursorColor( Get16BPPColor(FROMRGB(255, 255, 255) ) ); usPosX = gChatBox.sX + (CHATBOX_X_MARGIN / 2); //Add Player Name textbox AddTextInputField( usPosX , usPosY , usTextBoxWidth - CHATBOX_X_MARGIN, 20, MSYS_PRIORITY_HIGH+2, gszChatBoxInputString, 255, INPUTTYPE_ASCII );//23 gChatTextBoxRegion.iTop = usPosY; gChatTextBoxRegion.iLeft = usPosX; gChatTextBoxRegion.iBottom = usPosY+20; gChatTextBoxRegion.iRight = usPosX+usTextBoxWidth - CHATBOX_X_MARGIN; // exit text input mode in this screen and clean up text boxes SetActiveField( 0 ); usPosY += CHATBOX_INPUT_HEIGHT + CHATBOX_Y_GAP; // END CREATE TEXT INPUT BOX // CREATE OK AND CANCEL BUTTONS // get the button width UINT16 btnWidth = GetChatBoxButtonWidth( gChatBox.iButtonImages ); // Create OK Button sButtonX = middleBox + ((middleBox - btnWidth)/2); sButtonY = usTextBoxHeight - CHATBOX_BUTTON_HEIGHT - 10; gChatBox.uiOKButton = CreateIconAndTextButton( gChatBox.iButtonImages, pMessageStrings[ MSG_OK ], FONT12ARIAL, CHATBOX_FONT_COLOR, ubFontShadowColor, CHATBOX_FONT_COLOR, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gChatBox.sX + sButtonX ), (INT16)(gChatBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)OKChatBoxCallback ); SetButtonCursor(gChatBox.uiOKButton, usCursor); ForceButtonUnDirty( gChatBox.uiOKButton ); // move the mouse over the ok button if( gGameSettings.fOptions[ TOPTION_DONT_MOVE_MOUSE ] == FALSE ) { SimulateMouseMovement( ( gChatBox.sX + sButtonX + 27 ), ( gChatBox.sY + sButtonY + 10) ); } // Create Cancel Button sButtonX = ((middleBox - btnWidth)/2); sButtonY = usTextBoxHeight - CHATBOX_BUTTON_HEIGHT - 10; gChatBox.uiNOButton = CreateIconAndTextButton( gChatBox.iButtonImages, pMessageStrings[ MSG_CANCEL ], FONT10ARIAL, CHATBOX_FONT_COLOR, ubFontShadowColor, CHATBOX_FONT_COLOR, ubFontShadowColor, TEXT_CJUSTIFIED, (INT16)(gChatBox.sX + sButtonX ), (INT16)(gChatBox.sY + sButtonY ), BUTTON_TOGGLE ,MSYS_PRIORITY_HIGHEST, DEFAULT_MOVE_CALLBACK, (GUI_CALLBACK)CancelChatBoxCallback ); SetButtonCursor(gChatBox.uiNOButton, usCursor); ForceButtonUnDirty( gChatBox.uiNOButton ); // END CREATE BUTTONS #if 0 gChatBox.fWasPaused = GamePaused(); if (!gChatBox.fWasPaused) { InterruptTime(); PauseGame(); LockPauseState( 1 ); // Pause timers as well.... PauseTime( TRUE ); } #endif // Save mouse restriction region... GetRestrictedClipCursor( &gOldCursorLimitRectangle ); FreeMouseCursor( ); gfNewChatBox = TRUE; gfInChatBox = TRUE; return( iId ); }
BOOLEAN EnterAIM() { VOBJECT_DESC VObjectDesc; gubWarningTimer = 0; gubCurrentAdvertisment = AIM_AD_WARNING_BOX; LaptopInitAim(); InitAimDefaults(); // load the MemberShipcard graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\membercard.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiMemberCard)); // load the Policies graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\Policies.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiPolicies)); // load the Links graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\Links.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiLinks)); // load the History graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_HISTORY ); CHECKF(AddVideoObject(&VObjectDesc, &guiHistory)); // load the Wanring graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_WARNING ); CHECKF(AddVideoObject(&VObjectDesc, &guiWarning)); // load the flower advertisment and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\flowerad_16.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiFlowerAdvertisement)); // load the your ad advertisment and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_YOURAD13 ); CHECKF(AddVideoObject(&VObjectDesc, &guiAdForAdsImages)); // load the insurance advertisment and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_INSURANCEAD10 ); CHECKF(AddVideoObject(&VObjectDesc, &guiInsuranceAdImages)); // load the funeral advertisment and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_FUNERALAD9 ); CHECKF(AddVideoObject(&VObjectDesc, &guiFuneralAdImages)); /* JA25 No Bobbyr in exp // load the funeral advertisment and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_BOBBYRAYAD21 ); CHECKF(AddVideoObject(&VObjectDesc, &guiBobbyRAdImages )); */ //** Mouse Regions ** //Mouse region for the MebershipCard MSYS_DefineRegion( &gSelectedMemberCardRegion, MEMBERCARD_X, MEMBERCARD_Y , (MEMBERCARD_X + LINK_SIZE_X), (MEMBERCARD_Y + LINK_SIZE_Y), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectMemberCardRegionCallBack ); MSYS_AddRegion(&gSelectedMemberCardRegion); //Mouse region for the Policies MSYS_DefineRegion( &gSelectedPoliciesRegion, POLICIES_X, POLICIES_Y , (POLICIES_X + LINK_SIZE_X), (POLICIES_Y + LINK_SIZE_Y), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectPoliciesRegionCallBack ); MSYS_AddRegion(&gSelectedPoliciesRegion); //Mouse region for the History MSYS_DefineRegion( &gSelectedHistoryRegion, HISTORY_X, HISTORY_Y , (HISTORY_X + LINK_SIZE_X), (HISTORY_Y + LINK_SIZE_Y), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectHistoryRegionCallBack ); MSYS_AddRegion(&gSelectedHistoryRegion); //Mouse region for the Links MSYS_DefineRegion( &gSelectedLinksRegion, LINKS_X, LINKS_Y , (LINKS_X + LINK_SIZE_X), (LINKS_Y + LINK_SIZE_Y), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinksRegionCallBack ); MSYS_AddRegion(&gSelectedLinksRegion); //Mouse region for the Links MSYS_DefineRegion( &gSelectedBannerRegion, AIM_AD_TOP_LEFT_X, AIM_AD_TOP_LEFT_Y, AIM_AD_BOTTOM_RIGHT_X, AIM_AD_BOTTOM_RIGHT_Y, MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectBannerRegionCallBack); MSYS_AddRegion(&gSelectedBannerRegion); // disable the region because only certain banners will be 'clickable' MSYS_DisableRegion(&gSelectedBannerRegion); gubAimMenuButtonDown=255; fFirstTimeIn = FALSE; RenderAIM(); return( TRUE ); }
BOOLEAN EnterAimSort() { VOBJECT_DESC VObjectDesc; UINT8 ubCurNumber=0; UINT16 ubWidth; AimSortCheckBoxLoc[0] = AIM_SORT_SORT_BY_X + 9; AimSortCheckBoxLoc[1] = AIM_SORT_SORT_BY_Y + 34; AimSortCheckBoxLoc[2] = AIM_SORT_SORT_BY_X + 9; AimSortCheckBoxLoc[3] = AIM_SORT_SORT_BY_Y + 47; AimSortCheckBoxLoc[4] = AIM_SORT_SORT_BY_X + 9; AimSortCheckBoxLoc[5] = AIM_SORT_SORT_BY_Y + 60; AimSortCheckBoxLoc[6] = AIM_SORT_SORT_BY_X + 105; AimSortCheckBoxLoc[7] = AIM_SORT_SORT_BY_Y + 34; AimSortCheckBoxLoc[8] = AIM_SORT_SORT_BY_X + 105; AimSortCheckBoxLoc[9] = AIM_SORT_SORT_BY_Y + 47; AimSortCheckBoxLoc[10] = AIM_SORT_SORT_BY_X + 105; AimSortCheckBoxLoc[11] = AIM_SORT_SORT_BY_Y + 60; AimSortCheckBoxLoc[12] = AIM_SORT_SORT_BY_X + 201; AimSortCheckBoxLoc[13] = AIM_SORT_SORT_BY_Y + 34; AimSortCheckBoxLoc[14] = AIM_SORT_SORT_BY_X + 201; AimSortCheckBoxLoc[15] = AIM_SORT_SORT_BY_Y + 47; AimSortCheckBoxLoc[16] = AIM_SORT_SORT_BY_X + 201; AimSortCheckBoxLoc[17] = AIM_SORT_SORT_BY_Y + 60; AimSortCheckBoxLoc[18] = AIM_SORT_SORT_BY_X + 297; AimSortCheckBoxLoc[19] = AIM_SORT_SORT_BY_Y + 34; AimSortCheckBoxLoc[20] = AIM_SORT_SORT_BY_X + 297; AimSortCheckBoxLoc[21] = AIM_SORT_SORT_BY_Y + 47; AimSortCheckBoxLoc[22] = AIM_SORT_SORT_BY_X + 297; AimSortCheckBoxLoc[23] = AIM_SORT_SORT_BY_Y + 60; AimSortCheckBoxLoc[24] = AIM_SORT_SORT_BY_X + 9; AimSortCheckBoxLoc[25] = AIM_SORT_SORT_BY_Y + 21; //Ascending & Descending Check Box AimSortCheckBoxLoc[26] = AIM_SORT_SORT_BY_X + 372; AimSortCheckBoxLoc[27] = AIM_SORT_SORT_BY_Y + 4; AimSortCheckBoxLoc[28] = AIM_SORT_SORT_BY_X + 372; AimSortCheckBoxLoc[29] = AIM_SORT_SORT_BY_Y + 17; InitAimDefaults(); // load the SortBy box graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SortBy.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiSortByBox)); // load the ToAlumni graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOALUMNI ); CHECKF(AddVideoObject(&VObjectDesc, &guiToAlumni)); // load the ToMugShots graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOMUGSHOTS ); CHECKF(AddVideoObject(&VObjectDesc, &guiToMugShots)); // load the ToStats graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; GetMLGFilename( VObjectDesc.ImageFile, MLG_TOSTATS ); CHECKF(AddVideoObject(&VObjectDesc, &guiToStats)); // load the SelectLight graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SelectLight.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiSelectLight)); //** Mouse Regions ** //Mouse region for the ToMugShotRegion MSYS_DefineRegion( &gSelectedToMugShotRegion, AIM_SORT_TO_MUGSHOTS_X, AIM_SORT_TO_MUGSHOTS_Y, (AIM_SORT_TO_MUGSHOTS_X + AIM_SORT_TO_MUGSHOTS_SIZE), (AIM_SORT_TO_MUGSHOTS_Y + AIM_SORT_TO_MUGSHOTS_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToMugShotRegionCallBack ); MSYS_AddRegion(&gSelectedToMugShotRegion); //Mouse region for the ToStatsRegion MSYS_DefineRegion( &gSelectedToStatsRegion, AIM_SORT_TO_STATS_X, AIM_SORT_TO_STATS_Y, (AIM_SORT_TO_STATS_X + AIM_SORT_TO_STATS_SIZE), (AIM_SORT_TO_STATS_Y + AIM_SORT_TO_STATS_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToStatsRegionCallBack ); MSYS_AddRegion(&gSelectedToStatsRegion); //Mouse region for the ToArchiveRegion MSYS_DefineRegion( &gSelectedToArchiveRegion, AIM_SORT_TO_ALUMNI_X, AIM_SORT_TO_ALUMNI_Y, (AIM_SORT_TO_ALUMNI_X + AIM_SORT_TO_ALUMNI_SIZE), (AIM_SORT_TO_ALUMNI_Y + AIM_SORT_TO_ALUMNI_SIZE), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectToArchiveRegionCallBack ); MSYS_AddRegion(&gSelectedToArchiveRegion); //CURSOR_WWW MSYS_NO_CURSOR ubCurNumber = 0; //Mouse region for the Price Check Box ubWidth = StringPixLength( AimSortText[PRICE], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; MSYS_DefineRegion( &gSelectedPriceBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectPriceBoxRegionCallBack ); MSYS_AddRegion(&gSelectedPriceBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[EXPERIENCE], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Experience Check Box MSYS_DefineRegion( &gSelectedExpBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectExpBoxRegionCallBack ); MSYS_AddRegion(&gSelectedExpBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMARKSMANSHIP], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_PRICE_TEXT_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Markmanship Check Box MSYS_DefineRegion( &gSelectedMarkBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMarkBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMarkBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMECHANICAL], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MECHANICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Mechanical Check Box MSYS_DefineRegion( &gSelectedMechanicalBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMechanicalBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMechanicalBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMEXPLOSIVES], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MECHANICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Explosive Check Box MSYS_DefineRegion( &gSelectedExplosiveBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectExplosiveBoxRegionCallBack ); MSYS_AddRegion(&gSelectedExplosiveBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMMEDICAL], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_MECHANICAL_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Medical Check Box MSYS_DefineRegion( &gSelectedMedicalBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectMedicalBoxRegionCallBack ); MSYS_AddRegion(&gSelectedMedicalBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMHEALTH], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_HEALTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Health Check Box MSYS_DefineRegion( &gSelectedHealthBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectHealthBoxRegionCallBack ); MSYS_AddRegion(&gSelectedHealthBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMAGILITY], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_HEALTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Agility Check Box MSYS_DefineRegion( &gSelectedAgilityBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectAgilityBoxRegionCallBack ); MSYS_AddRegion(&gSelectedAgilityBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMDEXTERITY], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_HEALTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Dexterity Check Box MSYS_DefineRegion( &gSelectedDexterityBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectDexterityBoxRegionCallBack ); MSYS_AddRegion(&gSelectedDexterityBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMSTRENGTH], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_STRENGTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Strength Check Box MSYS_DefineRegion( &gSelectedStrengthBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectStrengthBoxRegionCallBack ); MSYS_AddRegion(&gSelectedStrengthBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMLEADERSHIP], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_STRENGTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Leadership Check Box MSYS_DefineRegion( &gSelectedLeadershipBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectLeadershipBoxRegionCallBack ); MSYS_AddRegion(&gSelectedLeadershipBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[AIMWISDOM], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_STRENGTH_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Wisdom Check Box MSYS_DefineRegion( &gSelectedWisdomBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectWisdomBoxRegionCallBack ); MSYS_AddRegion(&gSelectedWisdomBoxRegion); ubCurNumber+=2; ubWidth = StringPixLength( AimSortText[NAME], AIM_SORT_FONT_SORT_TEXT) + AimSortCheckBoxLoc[ ubCurNumber ] + (AIM_SORT_NAME_X - AimSortCheckBoxLoc[ ubCurNumber ]) - 3; //Mouse region for the Name Check Box MSYS_DefineRegion( &gSelectedNameBoxRegion, AimSortCheckBoxLoc[ ubCurNumber ] , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)ubWidth, (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectNameBoxRegionCallBack ); MSYS_AddRegion(&gSelectedNameBoxRegion); ubCurNumber+=2; ubWidth = AimSortCheckBoxLoc[ ubCurNumber ] - StringPixLength( AimSortText[ASCENDING], AIM_SORT_FONT_SORT_TEXT) - 6; //Mouse region for the Ascend Check Box MSYS_DefineRegion( &gSelectedAscendBoxRegion, ubWidth , AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)(AimSortCheckBoxLoc[ ubCurNumber ] + AIM_SORT_CHECKBOX_SIZE), (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectAscendBoxRegionCallBack ); MSYS_AddRegion(&gSelectedAscendBoxRegion); ubCurNumber+=2; ubWidth = AimSortCheckBoxLoc[ ubCurNumber ] - StringPixLength( AimSortText[DESCENDING], AIM_SORT_FONT_SORT_TEXT) - 6; //Mouse region for the Descend Check Box MSYS_DefineRegion( &gSelectedDescendBoxRegion, ubWidth, AimSortCheckBoxLoc[ubCurNumber + 1] , (UINT16)(AimSortCheckBoxLoc[ ubCurNumber ] + AIM_SORT_CHECKBOX_SIZE), (UINT16)(AimSortCheckBoxLoc[ ubCurNumber + 1 ] + AIM_SORT_CHECKBOX_SIZE), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, SelectDescendBoxRegionCallBack ); MSYS_AddRegion(&gSelectedDescendBoxRegion); InitAimMenuBar(); RenderAimSort(); return( TRUE ); }
BOOLEAN EnterCreditsScreen() { UINT32 uiCnt; VOBJECT_DESC VObjectDesc; gfModCredits = TRUE; ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0 ); VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; if (iResolution >= _640x480 && iResolution < _800x600) { FilenameForBPP("INTERFACE\\Credits.sti", VObjectDesc.ImageFile); } else if (iResolution < _1024x768) { FilenameForBPP("INTERFACE\\Credits_800x600.sti", VObjectDesc.ImageFile); } else { FilenameForBPP("INTERFACE\\Credits_1024x768.sti", VObjectDesc.ImageFile); } CHECKF(AddVideoObject(&VObjectDesc, &guiCreditBackGroundImage )); VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("INTERFACE\\Credit Faces.sti", VObjectDesc.ImageFile); CHECKF(AddVideoObject(&VObjectDesc, &guiCreditFaces )); //Initialize the root credit node InitCreditNode( ); guiCreditsExitScreen = CREDIT_SCREEN; gfCrdtHaveRenderedFirstFrameToSaveBuffer = FALSE; guiCreditScreenActiveFont = FONT12ARIAL; gubCreditScreenActiveColor = FONT_MCOLOR_DKWHITE; guiCreditScreenTitleFont = FONT14ARIAL; gubCreditScreenTitleColor = FONT_MCOLOR_RED; guiCrdtNodeScrollSpeed = CRDT_NODE_DELAY_AMOUNT; gubCrdtJustification = CENTER_JUSTIFIED; guiCurrentCreditRecord = 0; guiCrdtLastTimeUpdatingNode = GetJA2Clock(); guiGapBetweenCreditSections = CRDT_SPACE_BN_SECTIONS; guiGapBetweenCreditNodes = CRDT_SPACE_BN_NODES; guiGapTillReadNextCredit = CRDT_SPACE_BN_NODES; for( uiCnt=0; uiCnt < NUM_PEOPLE_IN_CREDITS; uiCnt++) { // Make a mouse region MSYS_DefineRegion( &gCrdtMouseRegions[uiCnt], gCreditFaces[uiCnt].sX + xResOffset, gCreditFaces[uiCnt].sY + yResOffset, (INT16)(gCreditFaces[uiCnt].sX + gCreditFaces[uiCnt].sWidth + xResOffset), (INT16)(gCreditFaces[uiCnt].sY + gCreditFaces[uiCnt].sHeight + yResOffset), MSYS_PRIORITY_NORMAL, CURSOR_WWW, SelectCreditFaceMovementRegionCallBack, SelectCreditFaceRegionCallBack ); // Add region MSYS_AddRegion( &gCrdtMouseRegions[uiCnt] ); MSYS_SetRegionUserData( &gCrdtMouseRegions[uiCnt], 0, uiCnt ); } giCurrentlySelectedFace = -1; gfPauseCreditScreen = FALSE; InitCreditEyeBlinking(); return( TRUE ); }
void EnterIMPDisabilityTrait( void ) { VOBJECT_DESC VObjectDesc; //add the disability trait buttons AddImpDisabilityTraitButtons(); // load the stats graphic and add it VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE; FilenameForBPP("LAPTOP\\SkillTraitSmallGreyIdent.sti", VObjectDesc.ImageFile); if( !AddVideoObject(&VObjectDesc, &guiIST_GreyGoldBox3 ) ) { Assert( 0 ); return; } giIMPDisabilityTraitFinsihButtonImage = LoadButtonImage( "LAPTOP\\button_5.sti" ,-1,0,-1,1,-1 ); giIMPDisabilityTraitFinsihButton = CreateIconAndTextButton( giIMPDisabilityTraitFinsihButtonImage, pImpButtonText[ 24 ], FONT12ARIAL, FONT_WHITE, DEFAULT_SHADOW, FONT_WHITE, DEFAULT_SHADOW, TEXT_CJUSTIFIED, LAPTOP_SCREEN_UL_X + ( 350 ), LAPTOP_SCREEN_WEB_UL_Y + ( 340 ), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnIMPDisabilityTraitFinishCallback ); SetButtonCursor( giIMPDisabilityTraitFinsihButton, CURSOR_WWW); //if we are not DONE and are just reviewing if( iCurrentProfileMode != IMP__FINISH ) { //Have the NONE trait initially selected gfDisabilityTraitQuestions[ IMP_NO_DISABILITY ] = TRUE; } HandleDisabilityTraitButtonStates( ); // add regions for help texts UINT16 usPosX = IMP_DISABILITY_COLUMN_START_X + 62; UINT16 usPosY = IMP_DISABILITY_COLUMN_START_Y + 8; for( UINT8 ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ ) { MSYS_DefineRegion( &gMR_DisabilityHelpTextRegions[ubCnt], usPosX, ( usPosY ), (usPosX + 156), ( usPosY + 17), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, NULL ); MSYS_AddRegion( &gMR_DisabilityHelpTextRegions[ubCnt] ); //Determine the next x location if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN ) usPosX = IMP_DISABILITY_COLUMN_START_X + 62; else usPosX = IMP_DISABILITY_2ND_COLUMN_START_X + 62; //Determine the next Y location if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN ) usPosY = IMP_DISABILITY_COLUMN_START_Y + 8; else usPosY += IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS; } }