⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interfa1.cpp

📁 经典游戏赤壁的源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
			if( !pAllListUnit[0]->m_pList[j]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			pAllListUnit[0]->m_pList[j]->SetID( nID );
		}
		FSCAN.scan_close (); 
		//fclose (fp) ;
		// to show this menu
		Menu_System_Save.Blit();
		pAllBitmap[0]->Blit();
		Menu_System_Save.m_MenuButtonUnit.Blit();
		pAllListUnit[0]->Blit();
		// to close the menu date file
		Menu_System_Save.Update();

		return TRUE;
	}
	else if( lParam == MENU_SYSTEMENU_LOAD )
	{
		strcpy( fname, "set\\m_sload.exp" );
		FSCAN.scan_open (fname); 
		/*
		fp = fopen (fname, "r") ;  // Interfac.set store the all bitmap information
		if(!fp)									 // of game interface
		{
			ErrorMessage( hwndGame, INTERFACE_ERROR+0,"Cannot open menu data file: ",fname );
			return FALSE;
		}*/
		CurrentMenu = &Menu_System_Load;
		// to set this menu's ID
		Menu_System_Load.SetID( lParam );
		// to preload the background of this menu
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y)); 
	    //fscanf( fp, "%d%d%d", &BitmapFileId, &pShow.x, &pShow.y);
		if( !Menu_System_Load.PreLoad(BitmapFileId, pShow.x, pShow.y) )
			return FALSE;
		// to preload the scroll bar bitmap file
		pAllBitmap[0] = new CDDBitmap;
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight)); 
	    //fscanf( fp, "%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight);
		if( !pAllBitmap[0]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
			return FALSE;
		// to preload all button of this menu
		for(int i=0; i<4; i++)
		{
			Menu_System_Load.m_MenuButtonUnit.m_pButton[i] = new CDDButton;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( !Menu_System_Load.m_MenuButtonUnit.m_pButton[i]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			Menu_System_Load.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
		}
		pAllListUnit[0] = new CDDListUnit;
		// to preload all list in this load game menu
		for(int j=0; j<4; j++)
		{
			pAllListUnit[0]->m_pList[j] = new CDDList;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( !pAllListUnit[0]->m_pList[j]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			pAllListUnit[0]->m_pList[j]->SetID( nID );
		}
		// to close the menu date file
		FSCAN.scan_close (); 
		//fclose (fp) ;
		// to show this menu
		Menu_System_Load.Blit();
		pAllBitmap[0]->Blit();
		Menu_System_Load.m_MenuButtonUnit.Blit();
		pAllListUnit[0]->Blit();
		Menu_System_Load.Update();

		return TRUE;
	}
	else if( lParam == MENU_SYSTEMENU_OPTION )
	{
		int		nTotalPart, nCurrentPart;
		int		nFlag;

		strcpy( fname, "set\\m_option.exp" );
		FSCAN.scan_open (fname); 
		/*
		fp = fopen (fname, "r") ;  // Interfac.set store the all bitmap information
		if(!fp)									 // of game interface
		{
			ErrorMessage( hwndGame, INTERFACE_ERROR+0,"Cannot open menu data file: ",fname );
			return FALSE;
		}*/
		CurrentMenu = &Menu_System_Option;
		// to set this menu's ID
		Menu_System_Option.SetID( lParam );
		// to preload the background of this menu
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y)); 
		//fscanf( fp, "%d%d%d", &BitmapFileId, &pShow.x, &pShow.y);
		if( !Menu_System_Option.PreLoad(BitmapFileId, pShow.x, pShow.y) )
			return FALSE;
		// to preload all button of this menu
		Menu_System_Option.m_MenuButtonUnit.m_pButton[0] = new CDDButton;
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
		//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
		if( !Menu_System_Option.m_MenuButtonUnit.m_pButton[0]->
			PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
			return FALSE;
		Menu_System_Option.m_MenuButtonUnit.m_pButton[0]->SetID(nID);
		// to blit the back-ground of this menu
		Menu_System_Option.Blit();

		// to preload all scroll-bar of this menu
		for(int j=0; j<4; j++)
		{
			pAllScrollBar[j] = new CDDScrollBar;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y,
						&nWidth, &nHeight, &nID, &nTotalPart, &nCurrentPart, &nFlag));

			if( ! pAllScrollBar[j]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			pAllScrollBar[j]->SetID(nID);
			pAllScrollBar[j]->SetTotalPart(nTotalPart);
			pAllScrollBar[j]->SetCurrentPart(nCurrentPart);
//			pAllScrollBar[j]->Show(nFlag);
		}
		pAllScrollBar[0]->SetCurrentPart(GAME.nVolumeCD);
		pAllScrollBar[1]->SetCurrentPart(GAME.nVolume);
		switch(GAME.nSpeed)
		{
			case 100 :
				pAllScrollBar[2]->SetCurrentPart(0);
				break;
			case 50 :
				pAllScrollBar[2]->SetCurrentPart(1);
				break;
			case 30 :
				pAllScrollBar[2]->SetCurrentPart(2);
				break;
			case 20 :
				pAllScrollBar[2]->SetCurrentPart(3);
				break;
			default :
				pAllScrollBar[2]->SetCurrentPart(2);
				break;
		}
		pAllScrollBar[3]->SetCurrentPart(GAME.nSpeedScroll - 1);

		// to preload all check-box of this menu
		pAllCheckBoxUnit[0] = new CDDCheckBoxUnit;
		for(int k=0; k<2; k++)
		{
			pAllCheckBoxUnit[0]->m_pCheckBox[k] = new CDDCheckBox;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( ! pAllCheckBoxUnit[0]->m_pCheckBox[k]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			pAllCheckBoxUnit[0]->m_pCheckBox[k]->SetID(nID);
		}
		if( GAME.bFightEnabled == TRUE )
		{
			pAllCheckBoxUnit[0]->m_pCheckBox[0]->SetState(CHECKBOX_CHECK_UP);
			pAllCheckBoxUnit[0]->m_pCheckBox[1]->SetState(CHECKBOX_NOCHECK_UP);
		}
		else
		{
			pAllCheckBoxUnit[0]->m_pCheckBox[0]->SetState(CHECKBOX_NOCHECK_UP);
			pAllCheckBoxUnit[0]->m_pCheckBox[1]->SetState(CHECKBOX_CHECK_UP);
		}
			
		FSCAN.scan_close (); 
		//fclose(fp);
		// to preload all scroll-bar of this menu
		for(int l=0; l<4; l++)
			pAllScrollBar[l]->Blit(FIRST);
		pAllCheckBoxUnit[0]->Blit();
		Menu_System_Option.Update();

		return TRUE;
	}
	else if( lParam == MENU_SYSTEMENU_QUERY_CAMPAIGN_MISSION )
	{

		strcpy( fname, "set\\M_qaim.exp" );
		FSCAN.scan_open (fname); 
		/*
		fp = fopen (fname, "r") ;  // Interfac.set store the all bitmap information
		if(!fp)									 // of game interface
		{
			ErrorMessage( hwndGame, INTERFACE_ERROR+0,"Cannot open menu data file: ",fname );
			return FALSE;
		}
		*/
		CurrentMenu = &Menu_System_Query_Campaign_Mission;
		// to set this menu's ID
		Menu_System_Query_Campaign_Mission.SetID( lParam );
		// to preload the background of this menu
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y)); 
	    //fscanf( fp, "%d%d%d", &BitmapFileId, &pShow.x, &pShow.y);
		if( !Menu_System_Query_Campaign_Mission.PreLoad(BitmapFileId, pShow.x, pShow.y) )
			return FALSE;
		// to preload all button of this menu
		for(int i=0; i<1; i++)
		{
			Menu_System_Query_Campaign_Mission.m_MenuButtonUnit.m_pButton[i] = new CDDButton;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( !Menu_System_Query_Campaign_Mission.m_MenuButtonUnit.m_pButton[i]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			Menu_System_Query_Campaign_Mission.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
		}
		// to close the date file of this menu
		FSCAN.scan_close (); 
		// to blit the text of mission to the back-ground of this menu
		CText_apply Text;			// the instance to open a pressed file for read the mission text
		char		mission[80] ;	// the string to store the input mission text	
		int			theMissionLine ;	// the line serial number of this mission in the mission.set

		if( GAME_bNetwork == FALSE )
		{
			theMissionLine = GAME.nID + 36 ;		// 21 --> the first line of mission information is at 9st line in mission.set
			memset (mission, 0, sizeof(mission)) ;
			Text.Text_open ("set\\mission.ext") ;
			Text.Text_use (mission, theMissionLine) ;
			Text.Text_close ();
			Menu_System_Query_Campaign_Mission.SetString(mission) ;
		}
		else
		{
			Menu_System_Query_Campaign_Mission.SetString(" ") ;
		}

		// to set the title of this menu
		Menu_System_Query_Campaign_Mission.SetTitle( GAME.strName ) ;

		// to show the background  and the prompt string of this menu
		Menu_System_Query_Campaign_Mission.Blit();
		// to show the menu from back buffer to front buffer
		Menu_System_Query_Campaign_Mission.Update();

		return TRUE;
	}

	else if( lParam == MENU_SYSTEMENU_HELP )
	{
		strcpy( fname, "set\\M_shelp.exp" );
		FSCAN.scan_open (fname); 
		/*
		fp = fopen (fname, "r") ;  // Interfac.set store the all bitmap information
		if(!fp)									 // of game interface
		{
			ErrorMessage( hwndGame, INTERFACE_ERROR+0,"Cannot open menu data file: ",fname );
			return FALSE;
		}
		*/
		CurrentMenu = &Menu_System_Help;
		// to set this menu's ID
		Menu_System_Help.SetID( lParam );
		// to preload the background of this menu
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y));
	    //fscanf( fp, "%d%d%d", &BitmapFileId, &pShow.x, &pShow.y);
		if( !Menu_System_Help.PreLoad(BitmapFileId, pShow.x, pShow.y) )
			return FALSE;
		// to preload all button of this menu
		for(int i=0; i<4; i++)
		{
			Menu_System_Help.m_MenuButtonUnit.m_pButton[i] = new CDDButton;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID));
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( !Menu_System_Help.m_MenuButtonUnit.m_pButton[i]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			Menu_System_Help.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
		}
		// to close the date file of this menu
		FSCAN.scan_close (); 
		// to show the background of this menu
		Menu_System_Help.Show();
//		Menu_System_Help.Update();
		return TRUE;
	}
	else if( lParam == MENU_SYSTEMENU_HELP_OPREATE )
	{
		strcpy( fname, "set\\m_shoper.exp" );
		FSCAN.scan_open (fname); 
		/*
		fp = fopen (fname, "r") ;  // Interfac.set store the all bitmap information
		if(!fp)									 // of game interface
		{
			ErrorMessage( hwndGame, INTERFACE_ERROR+0,"Cannot open menu data file: ",fname );
			return FALSE;
		}
		*/
		CurrentMenu = &Menu_System_Help_Operate;
		// to set this menu's ID
		Menu_System_Help_Operate.SetID( lParam );
		// to preload the background of this menu
		FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y)); 
	    //fscanf( fp, "%d%d%d", &BitmapFileId, &pShow.x, &pShow.y);
		if( !Menu_System_Help_Operate.PreLoad(BitmapFileId, pShow.x, pShow.y) )
			return FALSE;
		// to preload all button of this menu
		for(int i=0; i<3; i++)
		{
			Menu_System_Help_Operate.m_MenuButtonUnit.m_pButton[i] = new CDDButton;
			FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID)); 
			//fscanf( fp, "%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID);
			if( !Menu_System_Help_Operate.m_MenuButtonUnit.m_pButton[i]->
				PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
				return FALSE;
			Menu_System_Help_Operate.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
		}
		// to close the date file of this menu
		FSCAN.scan_close (); 
		// to read the help text from the information file
		CText_apply Text;			// the instance to open a pressed file for read the mission text
		char		help_text[1024] ;	// the string to store the input mission text	
		int			LineSer ;	// the line serial number of this mission in the mission.set

		Menu_System_Help_Operate.SetStringSer(1) ;
		LineSer = Menu_System_Help_Operate.GetStringSer() ;
		memset (help_text, 0, sizeof(help_text)) ;
		Text.Text_open ("set\\help.ext") ;
		Text.Text_use (help_text, LineSer) ;
		Text.Text_close ();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -