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

📄 cbprompt.cpp

📁 网页游戏赤壁
💻 CPP
📖 第 1 页 / 共 4 页
字号:
	infor_text.SetTextColor( RGB(255, 255, 255) );
	// to blit this text to the just position
	infor_text.MyTextOut( DD_GetBackBuffer(), 552, 194, Grade );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}

// to updata the value of experence
BOOL	FACE_UpdateExperience(int experience)
{
	int		iResult;

	class	CDDText prompt_text;		// the prompt string 
	class	CDDText	infor_text;			// the text that inpur from FACE_CURRENT_PROMPT_BLOCK

	char	Experience[8];	//	经验值

	if( FACE_CURRENT_PROMPT_BLOCK.PromptBlockId != PROMPT_UNIT )
		return FALSE;

	// to blit part of the prompt background to the back buffer 
	POINT	Dest ;
	RECT	temp ;

	Dest.x = 501 ;		Dest.y = 253 ;
	temp.left = 501 ;	temp.top = 253 ;
	temp.right = 620 ;	temp.bottom = 269 ;

	bmPromptArea.Blit(&Dest, &temp);
	
	FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.Experience = experience;
// to blit all prompt word for attribute of this general to the prompt area
	iResult = prompt_text.BeginText( 8 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text show 
	prompt_text.SetTextColor( RGB(255, 255, 120) );
	// to read the all string first
	CText_apply  Text;
	char jy[50] ;	//"经 验"
	memset (jy,0,sizeof(jy));
	Text.Text_open ("set\\hz.ext");
	Text.Text_use (jy,9);
	Text.Text_close ();
	// to blit the attribute prompt word to the prompt area
	prompt_text.MyTextOut(DD_GetBackBuffer(), 512, 253, jy);
	prompt_text.GetDDSurface()->Erase();
	prompt_text.EndText();
// to blit all attribute to the prompt area
	// to covert all int attribute to string 
	_itoa( FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.Experience, Experience, 10 );
	// to blit all attribute to the prompt area
	iResult = infor_text.BeginText( 12 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text
	infor_text.SetTextColor( RGB(255, 255, 255) );
	// to blit the texts
	infor_text.MyTextOut(DD_GetBackBuffer(), 580, 253, Experience );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}

// to updata the value of ruse
BOOL	FACE_UpdateRuse(int ruse)
{
	int		iResult;

	class	CDDText prompt_text;		// the prompt string 
	class	CDDText	infor_text;			// the text that inpur from FACE_CURRENT_PROMPT_BLOCK

	char	Ruse[8];

	if( FACE_CURRENT_PROMPT_BLOCK.PromptBlockId != PROMPT_UNIT )
		return FALSE;

	// to blit part of the prompt background to the back buffer 
	POINT	Dest ;
	RECT	temp ;

	Dest.x = 501 ;		Dest.y = 272 ;
	temp.left = 501 ;	temp.top = 272 ;
	temp.right = 620 ;	temp.bottom = 288 ;

	bmPromptArea.Blit(&Dest, &temp);
	
	FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.Ruse = ruse;
// to blit all prompt word for attribute of this general to the prompt area
	iResult = prompt_text.BeginText( 8 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text show 
	prompt_text.SetTextColor( RGB(255, 255, 120) );
	// to read the all string first
	CText_apply  Text;
	char ml[50] ;	//"谋 略"
	memset (ml,0,sizeof(ml));
	Text.Text_open ("set\\hz.ext");
	Text.Text_use (ml,10);
	Text.Text_close ();
	// to blit the attribute prompt word to the prompt area
	prompt_text.MyTextOut(DD_GetBackBuffer(), 512, 272, ml);
	prompt_text.GetDDSurface()->Erase();
	prompt_text.EndText();
// to blit all attribute to the prompt area
	// to covert all int attribute to string 
	_itoa( FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.Ruse, Ruse, 10 );
	// to blit all attribute to the prompt area
	iResult = infor_text.BeginText( 12 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text
	infor_text.SetTextColor( RGB(255, 255, 255) );
	// to blit the texts
	infor_text.MyTextOut(DD_GetBackBuffer(), 580, 272, Ruse );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}

// to updata the value of ruse
BOOL	FACE_UpdateMorale(int morale)
{
	int		iResult;

	class	CDDText prompt_text;		// the prompt string 
	class	CDDText	infor_text;			// the text that inpur from FACE_CURRENT_PROMPT_BLOCK

	char	Morale[8];

	if( FACE_CURRENT_PROMPT_BLOCK.PromptBlockId != PROMPT_UNIT )
		return FALSE;

	// to blit part of the prompt background to the back buffer 
	POINT	Dest ;
	RECT	temp ;

	Dest.x = 501 ;		Dest.y = 291 ;
	temp.left = 501 ;	temp.top = 291 ;
	temp.right = 620 ;	temp.bottom = 307 ;

	bmPromptArea.Blit(&Dest, &temp);
	
	FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.UnitMorale = morale;
// to blit all prompt word for attribute of this general to the prompt area
	iResult = prompt_text.BeginText( 8 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text show 
	prompt_text.SetTextColor( RGB(255, 255, 120) );
	// to read the all string first
	CText_apply  Text;
	char sq[50] ;	//"士 气"
	memset (sq,0,sizeof(sq));
	Text.Text_open ("set\\hz.ext");
	Text.Text_use (sq,11);
	Text.Text_close ();
	// to blit the attribute prompt word to the prompt area
	prompt_text.MyTextOut(DD_GetBackBuffer(), 512, 291, sq);
	prompt_text.GetDDSurface()->Erase();
	prompt_text.EndText();
// to blit all attribute to the prompt area
	// to covert all int attribute to string 
	_itoa( FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.UnitMorale, Morale, 10 );
	// to blit all attribute to the prompt area
	iResult = infor_text.BeginText( 12 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text
	infor_text.SetTextColor( RGB(255, 255, 255) );
	// to blit the texts
	infor_text.MyTextOut(DD_GetBackBuffer(), 580, 291, Morale );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}
// to updata the value of solider number
BOOL	FACE_UpdateSoliderNumber(int solider)
{
	int		iResult;

	class	CDDText prompt_text;		// the prompt string 
	class	CDDText	infor_text;			// the text that inpur from FACE_CURRENT_PROMPT_BLOCK

	char	SoliderNumber[8];	//士兵数

	if( FACE_CURRENT_PROMPT_BLOCK.PromptBlockId != PROMPT_UNIT )
		return FALSE;

	// to blit part of the prompt background to the back buffer 
	POINT	Dest ;
	RECT	temp ;

	Dest.x = 501 ;		Dest.y = 308 ;
	temp.left = 501 ;	temp.top = 308 ;
	temp.right = 620 ;	temp.bottom = 324 ;

	bmPromptArea.Blit(&Dest, &temp);

	FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.NumberOfSolider = solider;
// to blit all prompt word for attribute of this general to the prompt area
	iResult = prompt_text.BeginText( 8 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text show 
	prompt_text.SetTextColor( RGB(255, 255, 120) );
	// to read the all string first
	CText_apply  Text;
	char rs[50] ;	//"人数"
	memset (rs,0,sizeof(rs));
	Text.Text_open ("set\\hz.ext");
	Text.Text_use (rs,12);
	Text.Text_close ();
	// to blit the attribute prompt word to the prompt area
	prompt_text.MyTextOut(DD_GetBackBuffer(), 512, 308, rs); //"人 数"
	prompt_text.GetDDSurface()->Erase();
	prompt_text.EndText();
// to blit all attribute to the prompt area
	// to covert all int attribute to string 
	_itoa( FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.NumberOfSolider, SoliderNumber, 10 );
	// to blit all attribute to the prompt area
	iResult = infor_text.BeginText( 12 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text
	infor_text.SetTextColor( RGB(255, 255, 255) );
	// to blit the texts
	infor_text.MyTextOut(DD_GetBackBuffer(), 580, 308, SoliderNumber );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}

// to updata the office of general
BOOL	FACE_UpdateOffice(LPCTSTR office)
{
	int		iResult;
	class	CDDText	infor_text;			// the text that inpur from FACE_CURRENT_PROMPT_BLOCK

	if( FACE_CURRENT_PROMPT_BLOCK.PromptBlockId != PROMPT_UNIT )
		return FALSE;

	// to blit part of the prompt background to the back buffer 
	POINT	Dest ;
	RECT	temp ;

	Dest.x = 568 ;		Dest.y = 200 ;
	temp.left = 568 ;	temp.top = 200 ;
	temp.right = 620 ;	temp.bottom = 244 ;

	bmPromptArea.Blit(&Dest, &temp);
	
	strcpy(FACE_CURRENT_PROMPT_BLOCK.PromptBlockUnion.Unit.Office, office);

	char	cFirstPart[7];		//	前三个字+'\0'
	char	cSecondPart[7];		//  后三个字+'\0'

	cFirstPart[0] = office[0]; 
	cFirstPart[1] = office[1]; 
	cFirstPart[2] = office[2]; 
	cFirstPart[3] = office[3]; 
	cFirstPart[4] = office[4]; 
	cFirstPart[5] = office[5]; 
	cFirstPart[6] = '\0'; 
	cSecondPart[0] = office[6]; 
	cSecondPart[1] = office[7]; 
	cSecondPart[2] = office[8]; 
	cSecondPart[3] = office[9]; 
	cSecondPart[4] = office[10]; 
	cSecondPart[5] = office[11]; 
	cSecondPart[6] = '\0'; 

	// to blit all attribute to the prompt area
	iResult = infor_text.BeginText( 12 );
	if( ! iResult )
		return FALSE;
	// to set the color of this text
	infor_text.SetTextColor( RGB(255, 255, 255) );
	infor_text.MyTextOut(DD_GetBackBuffer(), 570, 205, cFirstPart );
	infor_text.GetDDSurface()->Erase();
	infor_text.MyTextOut(DD_GetBackBuffer(), 570, 225, cSecondPart );
	infor_text.GetDDSurface()->Erase();
	// to release the text surface
	infor_text.EndText( );
// to blit all prompt word for attribute of this general to the prompt area

	/////////////////////////////////////////////////////////////
	// if current is displaying a menu, return with do nothing
	//	July.24.1997
	if( FACE_GetCommandState() == COMMAND_STATE_MENU )
		return FALSE ;

	bmPromptArea.Update();

	return TRUE;
}

⌨️ 快捷键说明

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