void CreateMouseRegionsForIMPMainPageBasedOnCharGenStatus( void ) { // this procedure will create masks for the char generation main page // mask for personality page button MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 0 ],LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 13 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5, CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback ); // mask for attrib page button MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 1 ],LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 133 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5, CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback ); // mask for portrait page button MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 2 ],LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 253 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5, CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback ); // mask for voice page button MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 3 ],LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 373 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5, CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback ); return; }
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 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 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 InitEditorRegions() { INT32 x; //By doing this, all of the buttons underneath are blanketed and can't be used anymore. //Any new buttons will cover this up as well. Think of it as a barrier between the editor buttons, //and the game's interface panel buttons and regions. MSYS_DefineRegion( &EditorRegion, 0, 360, 640, 480, MSYS_PRIORITY_NORMAL, 0, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); //Create the regions for the terrain tile selections for( x = 0; x < NUM_TERRAIN_TILE_REGIONS; x++ ) { MSYS_DefineRegion(&TerrainTileButtonRegion[x],(INT16)(261+x*42),369,(INT16)(303+x*42),391, MSYS_PRIORITY_NORMAL, 0, MSYS_NO_CALLBACK,(MOUSE_CALLBACK)TerrainTileButtonRegionCallback); MSYS_SetRegionUserData( &TerrainTileButtonRegion[x], 0, x ); MSYS_DisableRegion( &TerrainTileButtonRegion[x] ); } gfShowTerrainTileButtons=FALSE; //Create the region for the items selection window. MSYS_DefineRegion( &ItemsRegion, 100, 360, 540, 440, MSYS_PRIORITY_NORMAL, 0, (MOUSE_CALLBACK)MouseMovedInItemsRegion, (MOUSE_CALLBACK)MouseClickedInItemsRegion ); MSYS_DisableRegion( &ItemsRegion ); //Create the region for the merc inventory panel. MSYS_DefineRegion( &MercRegion, 175, 361, 450, 460, MSYS_PRIORITY_NORMAL, 0, MouseMovedInMercRegion, MouseClickedInMercRegion ); MSYS_DisableRegion( &MercRegion ); }
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; }
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); }
void CreateMapScreenBottomMessageScrollBarRegion( void ) { #ifdef JA2DEMO MSYS_DefineRegion( &gMapMessageScrollBarRegion, MESSAGE_SCROLL_AREA_START_X, MESSAGE_SCROLL_AREA_START_Y, MESSAGE_SCROLL_AREA_END_X, MESSAGE_SCROLL_AREA_END_Y, MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MapScreenMessageScrollBarCallBack ); #else MSYS_DefineRegion( &gMapMessageScrollBarRegion, MESSAGE_SCROLL_AREA_START_X, MESSAGE_SCROLL_AREA_START_Y, MESSAGE_SCROLL_AREA_END_X, MESSAGE_SCROLL_AREA_END_Y, MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MapScreenMessageScrollBarCallBack ); #endif }
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 CreateCompressModePause( void ) { MSYS_DefineRegion( &gMapPauseRegion, 487, 456, 522, 467, MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressModeClickCallback ); SetRegionFastHelpText( &gMapPauseRegion, pMapScreenBottomFastHelp[ 7 ] ); }
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 ); }
void CreateDestroyMouseRegionMasksForTimeCompressionButtons( void ) { BOOLEAN fDisabled = FALSE; static BOOLEAN fCreated = FALSE; // allowed to time compress? if( AllowedToTimeCompress( )== FALSE ) { // no, disable buttons fDisabled = TRUE; } if( fInMapMode == FALSE ) { fDisabled = FALSE; } // check if disabled and not created, create if( ( fDisabled ) && ( fCreated == FALSE ) ) { // mask over compress more button MSYS_DefineRegion( &gTimeCompressionMask[ 0 ], 528, 456, 528 + 13, 456 + 14, MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback ); // mask over compress less button MSYS_DefineRegion( &gTimeCompressionMask[ 1 ], 466, 456, 466 + 13, 456 + 14, MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback ); // mask over pause game button MSYS_DefineRegion( &gTimeCompressionMask[ 2 ], 487, 456, 522, 467, MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback ); fCreated = TRUE; } else if( ( fDisabled == FALSE ) && ( fCreated ) ) { // created and no longer need to disable MSYS_RemoveRegion( &gTimeCompressionMask[ 0 ] ); MSYS_RemoveRegion( &gTimeCompressionMask[ 1 ] ); MSYS_RemoveRegion( &gTimeCompressionMask[ 2 ] ); fCreated = FALSE; } }
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 CreateFileDialog( UINT16 *zTitle ) { iFDlgState = DIALOG_NONE; DisableEditorTaskbar(); MSYS_DefineRegion( &BlanketRegion, 0, 0, gsVIEWPORT_END_X, gsVIEWPORT_END_Y, MSYS_PRIORITY_HIGH - 5, 0, 0, 0 ); //Okay and cancel buttons iFileDlgButtons[0] = CreateTextButton( L"Okay", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 354, 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgOkCallback ); iFileDlgButtons[1] = CreateTextButton( L"Cancel", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 406, 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgCancelCallback ); //Scroll buttons iFileDlgButtons[2] = CreateSimpleButton( 426,92,"EDITOR//uparrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgUpCallback ); iFileDlgButtons[3] = CreateSimpleButton( 426,182,"EDITOR//downarrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgDwnCallback ); //File list window iFileDlgButtons[4] = CreateHotSpot( (179+4), (69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback); //Title button iFileDlgButtons[5] = CreateTextButton(zTitle, HUGEFONT, FONT_LTKHAKI, FONT_DKKHAKI, BUTTON_USE_DEFAULT,179,39,281,30,BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH-2,BUTTON_NO_CALLBACK,BUTTON_NO_CALLBACK); DisableButton(iFileDlgButtons[5]); SpecifyDisabledButtonStyle( iFileDlgButtons[5], DISABLED_STYLE_NONE ); iFileDlgButtons[6] = -1; if( iCurrentAction == ACTION_SAVE_MAP ) { //checkboxes //The update world info checkbox iFileDlgButtons[6] = CreateCheckBoxButton( 183, 229, "EDITOR//smcheckbox.sti", MSYS_PRIORITY_HIGH, UpdateWorldInfoCallback ); if( gfUpdateSummaryInfo ) ButtonList[ iFileDlgButtons[6] ]->uiFlags |= BUTTON_CLICKED_ON; } //Add the text input fields InitTextInputModeWithScheme( DEFAULT_SCHEME ); //field 1 (filename) AddTextInputField( /*233*/183, 195, 190, 20, MSYS_PRIORITY_HIGH, gzFilename, 30, INPUTTYPE_EXCLUSIVE_DOSFILENAME ); //field 2 -- user field that allows mouse/key interaction with the filename list AddUserInputField( FileDialogModeCallback ); }
void InitDoorEditing( INT32 iMapIndex ) { DOOR *pDoor; if( !DoorAtGridNo( iMapIndex ) && !OpenableAtGridNo( iMapIndex ) ) return; gfEditingDoor = TRUE; iDoorMapIndex = iMapIndex; DisableEditorTaskbar(); MSYS_DefineRegion( &DoorRegion, 0, 0, SCREEN_BUFFER_WIDTH, SCREEN_BUFFER_HEIGHT, MSYS_PRIORITY_HIGH-2, 0, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); iDoorButton[ DOOR_BACKGROUND ] = CreateTextButton( 0, 0, 0, 0, BUTTON_USE_DEFAULT, 200, 130, 240, 100, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH - 1, BUTTON_NO_CALLBACK, BUTTON_NO_CALLBACK ); DisableButton( iDoorButton[ DOOR_BACKGROUND ] ); SpecifyDisabledButtonStyle( iDoorButton[ DOOR_BACKGROUND ], DISABLED_STYLE_NONE ); iDoorButton[ DOOR_OKAY ] = CreateTextButton(gzEditorStrings[EDITOR_STR_OKAY], FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 330, 195, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, DoorOkayCallback ); iDoorButton[ DOOR_CANCEL ] = CreateTextButton(gzEditorStrings[EDITOR_STR_CANCEL], FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 385, 195, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, DoorCancelCallback ); InitTextInputModeWithScheme( DEFAULT_SCHEME ); AddTextInputField( 210, 155, 25, 16, MSYS_PRIORITY_HIGH, L"0", 3, INPUTTYPE_NUMERICSTRICT ); AddTextInputField( 210, 175, 25, 16, MSYS_PRIORITY_HIGH, L"0", 2, INPUTTYPE_NUMERICSTRICT ); AddTextInputField( 210, 195, 25, 16, MSYS_PRIORITY_HIGH, L"0", 2, INPUTTYPE_NUMERICSTRICT ); iDoorButton[ DOOR_LOCKED ] = CreateCheckBoxButton( 210, 215, "EDITOR\\SmCheckbox.sti", MSYS_PRIORITY_HIGH, DoorToggleLockedCallback ); pDoor = FindDoorInfoAtGridNo( iDoorMapIndex ); if( pDoor ) { if( pDoor->fLocked ) { ButtonList[ iDoorButton[ DOOR_LOCKED ] ]->uiFlags |= BUTTON_CLICKED_ON; } SetInputFieldStringWithNumericStrictValue( 0, pDoor->ubLockID ); SetInputFieldStringWithNumericStrictValue( 1, pDoor->ubTrapID ); SetInputFieldStringWithNumericStrictValue( 2, pDoor->ubTrapLevel ); } else { ButtonList[ iDoorButton[ DOOR_LOCKED ] ]->uiFlags |= BUTTON_CLICKED_ON; } }
void CreateMouseRegionsForLevelMarkers( void ) { INT16 sCounter = 0; CHAR16 sString[ 64 ]; for( sCounter = 0; sCounter < 4 ; sCounter++ ) { MSYS_DefineRegion(&LevelMouseRegions[ sCounter ], MAP_LEVEL_MARKER_X, ( INT16 )( MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * sCounter ) ), MAP_LEVEL_MARKER_X + MAP_LEVEL_MARKER_WIDTH, ( INT16 )( MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * ( sCounter + 1 ) ) ), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, LevelMarkerBtnCallback ); MSYS_SetRegionUserData(&LevelMouseRegions[sCounter],0,sCounter); swprintf( sString, L"%s %d", zMarksMapScreenText[ 0 ], sCounter + 1 ); SetRegionFastHelpText( &LevelMouseRegions[ sCounter ], sString ); } }
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; } }
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 InitPopupMenu( INT32 iButtonID, UINT8 ubPopupMenuID, UINT8 ubDirection ) { UINT16 usX, usY; UINT16 usMenuHeight; UINT16 usMenuWidth = 0; UINT16 usCurrStrWidth; UINT8 ubColumn, ubEntry; UINT8 ubCounter; GUI_BUTTON *button; //calculate the location of the menu based on the button position. //This also calculates the menu's direction based on position. gPopup.usFont = (UINT16)SMALLFONT1; gusEntryHeight = GetFontHeight( gPopup.usFont ); button = ButtonList[ iButtonID ]; MSYS_DisableRegion( &gBottomPanalRegion ); switch( ubDirection ) { case DIR_UPRIGHT: usX = button->Area.RegionTopLeftX; usY = button->Area.RegionTopLeftY; break; case DIR_UPLEFT: usX = button->Area.RegionBottomRightX; usY = button->Area.RegionTopLeftY; break; case DIR_DOWNRIGHT: usX = button->Area.RegionTopLeftX; usY = button->Area.RegionBottomRightY; break; case DIR_DOWNLEFT: usX = button->Area.RegionBottomRightX; usY = button->Area.RegionBottomRightY; break; } //Decipher the popupMenuID switch( ubPopupMenuID ) { case CHANGETSET_POPUP: //change tileset gPopup.ubNumEntries = NUM_TILESETS; break; case OWNERSHIPGROUP_POPUP: case CHANGECIVGROUP_POPUP: gPopup.ubNumEntries = NUM_CIV_GROUPS; break; case SCHEDULEACTION_POPUP: gPopup.ubNumEntries = NUM_SCHEDULE_ACTIONS; break; case ACTIONITEM_POPUP: gPopup.ubNumEntries = NUM_ACTIONITEMS; break; default: return; } gPopup.usFont = (UINT16)SMALLFONT1; gusEntryHeight = GetFontHeight( gPopup.usFont ); button = ButtonList[ iButtonID ]; MSYS_DisableRegion( &gBottomPanalRegion ); gPopup.ubPopupMenuID = ubPopupMenuID; gPopup.ubSelectedIndex = 0; gPopup.ubActiveType = POPUP_ACTIVETYPE_NOT_YET_DETERMINED; gPopup.fActive = TRUE; fWaitingForLButtonRelease = FALSE; gPopup.fUseKeyboardInfoUntilMouseMoves = FALSE; //Initialize the last mouse position to be out of bounds. gPopup.usLastMouseX = 1000; gPopup.usLastMouseY = 1000; //clear the column widths. for( ubColumn = 0; ubColumn < MAX_COLUMNS; ubColumn++ ) gPopup.ubColumnWidth[ ubColumn ] = 0; //1) Calc total entry height of the popup region. gPopup.ubColumns = 1; gPopup.ubMaxEntriesPerColumn = gPopup.ubNumEntries; usMenuHeight = gPopup.ubNumEntries * gusEntryHeight + 3; while( usMenuHeight >= usY && ( ubDirection == DIR_UPLEFT || ubDirection == DIR_UPRIGHT ) || 480-usMenuHeight >= usY && ( ubDirection == DIR_DOWNLEFT || ubDirection == DIR_DOWNRIGHT ) ) { //menu has too many entries. Increase the number of columns until the height is //less than the max height. gPopup.ubMaxEntriesPerColumn = (gPopup.ubNumEntries+gPopup.ubColumns)/(gPopup.ubColumns+1); usMenuHeight = gPopup.ubMaxEntriesPerColumn * gusEntryHeight + 3; gPopup.ubColumns++; } //now we have the number of columns as well as the max number of entries per column, and //the total menu height. //We now calculate the total width of the menu as well as the max width of each column. ubCounter = 0; usMenuWidth = 0; for( ubColumn = 0; ubColumn < gPopup.ubColumns; ubColumn++ ) { for( ubEntry = 0; ubEntry < gPopup.ubMaxEntriesPerColumn; ubEntry++ ) { if( ubCounter >= gPopup.ubNumEntries ) break; //done (don't want to process undefined entries...) usCurrStrWidth = 16 + StringPixLength( GetPopupMenuString( ubCounter ) , gPopup.usFont ); if( usCurrStrWidth > gPopup.ubColumnWidth[ ubColumn ] ) { gPopup.ubColumnWidth[ ubColumn ] = (UINT8)usCurrStrWidth; } ubCounter++; } usMenuWidth += gPopup.ubColumnWidth[ ubColumn ]; } //Calculate popup menu boundaries based on direction from argument point. switch( ubDirection ) { case DIR_UPRIGHT: gPopup.usLeft = usX; gPopup.usTop = usY - usMenuHeight - 1; gPopup.usRight = usX + usMenuWidth; gPopup.usBottom = usY - 1; break; case DIR_UPLEFT: gPopup.usLeft = usX - usMenuWidth; gPopup.usTop = usY - usMenuHeight - 1; gPopup.usRight = usX; gPopup.usBottom = usY - 1; break; case DIR_DOWNRIGHT: gPopup.usLeft = usX; gPopup.usTop = usY + 1; gPopup.usRight = usX + usMenuWidth; gPopup.usBottom = usY + usMenuHeight + 1; break; case DIR_DOWNLEFT: gPopup.usLeft = usX - usMenuWidth; gPopup.usTop = usY + 1; gPopup.usRight = usX; gPopup.usBottom = usY + usMenuHeight + 1; break; } MSYS_DefineRegion( &popupRegion, 0, 0, 640, 480, MSYS_PRIORITY_HIGHEST, CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); RenderPopupMenu(); }
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 ); }
INT32 AddSlider( UINT8 ubStyle, UINT16 usCursor, UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT16 usNumberOfIncrements, INT8 sPriority, SLIDER_CHANGE_CALLBACK SliderChangeCallback, UINT32 uiFlags ) { SLIDER *pTemp = NULL; SLIDER *pNewSlider = NULL; AssertMsg( gfSliderInited, "Trying to Add a Slider Bar when the Slider System was never inited"); //checks if( ubStyle >= NUM_SLIDER_STYLES ) return( -1 ); pNewSlider = (SLIDER *) MemAlloc( sizeof( SLIDER ) ); if( pNewSlider == NULL ) { return( -1 ); } memset( pNewSlider, 0, sizeof( SLIDER ) ); //Assign the settings to the current slider pNewSlider->ubStyle = ubStyle; pNewSlider->usPosX = usPosX; pNewSlider->usPosY = usPosY; // pNewSlider->usWidth = usWidth; pNewSlider->usNumberOfIncrements = usNumberOfIncrements; pNewSlider->SliderChangeCallback = SliderChangeCallback; pNewSlider->usCurrentIncrement = 0; pNewSlider->usBackGroundColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) ); pNewSlider->uiFlags = uiFlags; //Get a new Identifier for the slider //Temp just increment for now pNewSlider->uiSliderID = guiCurrentSliderID; //increment counter guiCurrentSliderID++; // // Create the mouse regions for each increment in the slider // //add the region usPosX = pNewSlider->usPosX; usPosY = pNewSlider->usPosY; //Add the last one, the width will be whatever is left over switch( ubStyle ) { case SLIDER_VERTICAL_STEEL: pNewSlider->uiFlags |= SLIDER_VERTICAL; pNewSlider->usWidth = STEEL_SLIDER_WIDTH; pNewSlider->usHeight = usWidth; pNewSlider->ubSliderWidth = STEEL_SLIDER_WIDTH; pNewSlider->ubSliderHeight = STEEL_SLIDER_HEIGHT; MSYS_DefineRegion( &pNewSlider->ScrollAreaMouseRegion, (UINT16)(usPosX-pNewSlider->usWidth/2), usPosY, (UINT16)(usPosX+pNewSlider->usWidth/2), (UINT16)(pNewSlider->usPosY+pNewSlider->usHeight), sPriority, usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack ); MSYS_SetRegionUserData( &pNewSlider->ScrollAreaMouseRegion, 1, pNewSlider->uiSliderID ); break; case SLIDER_DEFAULT_STYLE: default: pNewSlider->uiFlags |= SLIDER_HORIZONTAL; pNewSlider->usWidth = usWidth; pNewSlider->usHeight = DEFUALT_SLIDER_SIZE; MSYS_DefineRegion( &pNewSlider->ScrollAreaMouseRegion, usPosX, (UINT16)(usPosY-DEFUALT_SLIDER_SIZE), (UINT16)(pNewSlider->usPosX+pNewSlider->usWidth), (UINT16)(usPosY+DEFUALT_SLIDER_SIZE), sPriority, usCursor, SelectedSliderMovementCallBack, SelectedSliderButtonCallBack ); MSYS_SetRegionUserData( &pNewSlider->ScrollAreaMouseRegion, 1, pNewSlider->uiSliderID ); break; } // // Load the graphic image for the slider box // //add the slider into the list pTemp = pSliderHead; //if its the first time in if( pSliderHead == NULL ) { pSliderHead = pNewSlider; pNewSlider->pNext = NULL; } else { while( pTemp->pNext != NULL ) { pTemp = pTemp->pNext; } pTemp->pNext = pNewSlider; pNewSlider->pPrev = pTemp; pNewSlider->pNext = NULL; } CalculateNewSliderBoxPosition( pNewSlider ); return( pNewSlider->uiSliderID ); }
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; } }
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 ); }
void CreateChatLogMessageScrollBarRegion( void ) { MSYS_DefineRegion( &gChatLogScrollBarRegion, CHATLOG_SCROLL_AREA_START_X, CHATLOG_SCROLL_AREA_START_Y, CHATLOG_SCROLL_AREA_END_X, CHATLOG_SCROLL_AREA_END_Y, MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ChatScreenMessageScrollBarCallBack ); }
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 ); }