📄 interfac.cpp
字号:
class CDDButton ml_Attack;
class CDDButton ml_Guard; // guard --> 防御
class CDDButton ml_LineUp; // lineup --> 阵型
class CDDButton ml_Rest;
class CDDButton ml_Stratagem; // stratagem --> 计谋
class CDDButton ml_Dismiss; // dismiss --> 解散
class CDDButton ml_Single; // single --> 单挑
class CDDButton ml_Transport; // transport --> 运载
class CDDButton ml_Chao_Build; // 君主为曹操时的建造
class CDDButton ml_Liu_Build; // 君主为刘备时的建造
class CDDButton ml_Repair;
class CDDButton ml_Ship;
class CDDButton ml_Unship;
class CDDButton ml_Back; // 回送
class CDDButton ml_Chao_Build_Main;
class CDDButton ml_Chao_Build_Farm;
class CDDButton ml_Chao_Build_Lumber;
class CDDButton ml_Chao_Build_WeaponFactory;
class CDDButton ml_Chao_Build_Shop;
class CDDButton ml_Chao_Build_FootmanSchool;
class CDDButton ml_Chao_Build_KnightSchool;
class CDDButton ml_Chao_Build_BowmanSchool;
class CDDButton ml_Chao_Build_VehiclemanSchool;
class CDDButton ml_Chao_Build_Shipyard;
class CDDButton ml_Chao_Build_Tower;
class CDDButton ml_Chao_Build_Flag;
class CDDButton ml_Chao_Build_Door;
class CDDButton ml_Chao_Build_PageUp;
class CDDButton ml_Chao_Build_PageDown;
class CDDButton prompt_Chao_House; // 曹操方民居图标
class CDDButton ml_Liu_Build_Main;
class CDDButton ml_Liu_Build_Farm;
class CDDButton ml_Liu_Build_Lumber;
class CDDButton ml_Liu_Build_WeaponFactory;
class CDDButton ml_Liu_Build_Shop;
class CDDButton ml_Liu_Build_FootmanSchool;
class CDDButton ml_Liu_Build_KnightSchool;
class CDDButton ml_Liu_Build_BowmanSchool;
class CDDButton ml_Liu_Build_VehiclemanSchool;
class CDDButton ml_Liu_Build_Shipyard;
class CDDButton ml_Liu_Build_Tower;
class CDDButton ml_Liu_Build_Flag;
class CDDButton ml_Liu_Build_Door;
class CDDButton ml_Liu_Build_PageUp;
class CDDButton ml_Liu_Build_PageDown;
class CDDButton prompt_Liu_House; // 刘备方民居图标
class CDDButton ml_LineUp_One; //一字长蛇阵
class CDDButton ml_LineUp_Two; //二龙出水阵
class CDDButton ml_LineUp_Three; //三才天地阵
class CDDButton ml_LineUp_Four; //四象奇门阵
class CDDButton ml_LineUp_Five; //五行梅花阵
class CDDButton ml_LineUp_Six; //六合连环阵
class CDDButton ml_LineUp_Seven; //七星北斗阵
class CDDButton ml_LineUp_Eight; //八门金锁阵
class CDDButton ml_LineUp_Nine; //九宫八卦阵
class CDDButton ml_LineUp_Ten; //十面埋伏阵
class CDDButton ml_LineUp_PageUp;
class CDDButton ml_LineUp_PageDown;
class CDDButton ml_Stratagem_Encourage; //激励
class CDDButton ml_Stratagem_SpeedUp; //加速
class CDDButton ml_Stratagem_SpeedDown; //减速
class CDDButton ml_Stratagem_SeeFar; //远视
class CDDButton ml_Stratagem_Anarchy; //混乱
class CDDButton ml_Stratagem_RollTimber;//滚木
class CDDButton ml_Stratagem_Ambuscade; //埋伏
class CDDButton ml_Stratagem_BringBack; //恢复
class CDDButton ml_Stratagem_Fire; //火攻
////////////////////////////////////
// all menu
////////////////////////////////////
extern CDDMenu * CurrentMenu;
extern CDDMenu Menu_Main;
extern CDDMenu Menu_NewGame;
extern CDDMenu Menu_MainLoad;
extern CDDMenu Menu_NetWork;
extern CDDMenu Menu_NetWork_InputName;
extern CDDMenu Menu_NetWork_Serial;
extern CDDMenu Menu_NetWork_Internet;
extern CDDMenu Menu_NetWork_Ipx;
extern CDDMenu Menu_NetWork_SetNet;
extern CDDMenu Menu_NetWork_SetNet_SelectMap;
extern CDDMenu Menu_NetWork_SetNet_SelectKing;
extern CDDMenu Menu_NetWork_Modem;
/////////////////////////////
// system menu structure
extern CDDMenu Menu_System;
extern CDDMenu Menu_System_Save;
extern CDDMenu Menu_System_Load;
extern CDDMenu Menu_System_Query;
extern CDDMenu Menu_System_Query_General_1;
extern CDDMenu Menu_System_Query_General_2;
extern CDDMenu Menu_System_Query_Army;
extern CDDMenu Menu_System_Query_Building;
extern CDDMenu Menu_System_Query_Campaign_Mission;
extern CDDMenu Menu_System_Option;
extern CDDMenu Menu_System_Help;
extern CDDMenu Menu_System_Help_Operate;
extern CDDMenu Menu_System_Help_Icon;
extern CDDMenu Menu_System_Help_Game;
extern CDDMenu Menu_System_Exit;
///////////////////////////
// menu to select general
extern CDDMenu Menu_Select_General;
// menu to show the information of the generals want to single battle
extern CDDMenu Menu_Single ;
extern CDDMenu Menu_Single_Reject ;
extern CDDMenu Menu_Single_Result ;
/////////////////////////////////////
// menu to show some error and prompt information
extern CDDMenu Menu_Link_Error ;
/////////////////////////////////////
// to store the six golbal list pointers for establish menu
////////////////////////////////////
class CDDList * pEstablishList_1;
class CDDList * pEstablishList_2;
class CDDList * pEstablishList_3;
class CDDList * pEstablishList_4;
class CDDList * pEstablishList_5;
class CDDList * pEstablishList_6;
/////////////////////////////////////
// all bitmap button
/////////////////////////////////////
// ClassName VaribleName BitmapSize top-left point bottom-right point
/////////////////////////////////////////////////
// to preload the main back-ground of begin menu
/////////////////////////////////////////////////
BOOL FACE_PreloadMainBackGround()
{
CScan_read FSCAN;
int BitmapFileId = NONE;
char fname[20];
if( psMainBack == NULL )
{
strcpy( fname, "set\\mainback.exp" );
FSCAN.scan_open (fname);
POINT pShow;
int nWidth;
int nHeight;
// to read the date of top surface bitmap from file interface.set
FSCAN.l_scan(sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight));//lwc
// to close this information file
FSCAN.scan_close ();
psMainBack = new CDDBitmap;
// to load bitmap from file
if( !psMainBack->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
}
return TRUE;
}
// to show the main back-ground of the begin menu of this game
// if every intput veriable is 0 then to show the whole bitmap
// if they are not 0 then to show the assigned block of this bitmap
BOOL FACE_ShowMainBackGround(int PosX/*=0*/, int PosY/*=0*/, int Width/*=0*/, int Height/*=0*/)
{
RECT FileRect;
POINT pShow;
if( psMainBack != NULL )
{
if( PosX == 0 )
{
//to blit the all main back-ground to the back buffer
psMainBack->Show();
}
else
{
pShow.x = PosX;
pShow.y = PosY;
FileRect.left = PosX;
FileRect.top = PosY;
FileRect.right = FileRect.left + Width;
FileRect.bottom = FileRect.top + Height;
//to blit the assigned area to the back buffer
psMainBack->m_BitmapSurface.BltToBack(pShow, &FileRect);
// to update the region that this bitmap placed
DDC_UpdateScreen(&FileRect);
}
}
return FALSE;
}
//////////////////////////////////
void FACE_DeleteMainBackGround()
{
if(psMainBack == NULL)
return;
psMainBack->Release();
psMainBack = NULL;
}
//////////////////////////////////
// to clear command unit argion
void FACE_ClearCommandUnitArea(BOOL flag)
{
// pCurrentCommandUnit = NULL;
if(flag)
bmCommandArea.Update();
else
{
FACE_HideAllCommandButton();
bmCommandArea.Blit();
}
}
/////////////////////////////////////////////////
// to set the state of the twenty number buttons
void FACE_SetNumberButtonState(int number, int state, BOOL ShowCurrentPage/*=TRUE*/)
{
Assert( (state==BUTTON_UP) || (state==BUTTON_DISABLE));
if( (number >= 0)&&(number<10) )
{
m_nSmallNumber.m_pButton[number]->SetState(state);
// m_nSmallNumber.m_pButton[number]->Show();
}
else if( (number >= 10)&&(number<20) )
{
m_nBigNumber.m_pButton[number-10]->SetState(state);
// m_nBigNumber.m_pButton[number-10]->Show();
}
if( ShowCurrentPage )
{
if( nNumState )
m_nBigNumber.Show();
else
m_nSmallNumber.Show();
}
}
//////////////////////////////////
// to clear prompt argion
void FACE_ClearPromptArea()
{
bmPromptArea.Show();
}
//////////////////////////////////
BOOL FACE_LoadAllBmp( )
{
CScan_read FSCAN; // for read the interfac.exp data file
CScan_read FSCANP; // for read the prompt.exp string file
CScan_read FSCAND; // for read the cost.exp data file
CScan_read FSCANJ; // for read the jimou.exp data file
int BitmapFileId;
char fname[20];
POINT pShow;
int OneBitmapWidth = 0;
int OneBitmapHeight = 0;
int nState;
int nID;
int nWidth, nHeight;
int FrameWidth;
int ColorId;
char PromptString[256];
char pfname[256];
// to open the whole information of the interface
strcpy( fname, "set\\Interfac.exp" );
FSCAN.scan_open (fname);
// to read the date of top surface bitmap from file interface.exp
FSCAN.l_scan(sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight ));//lwc
//fscanf( fp, "%d%d%d%d%d", BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight );
if( !sTop.PreLoad( BitmapFileId, pShow.x, pShow.y, OneBitmapWidth, OneBitmapHeight) )
return FALSE;
FSCAN.l_scan(sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight ));//lwc
//fscanf( fp, "%d%d%d%d%d", BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight );
if( !sBottom.PreLoad( BitmapFileId, pShow.x, pShow.y, OneBitmapWidth, OneBitmapHeight) )
return FALSE;
FSCAN.l_scan(sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight ));//lwc
//fscanf( fp, "%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight );
if( !sLeft.PreLoad( BitmapFileId, pShow.x, pShow.y, OneBitmapWidth, OneBitmapHeight) )
return FALSE;
FSCAN.l_scan(sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &OneBitmapWidth, &OneBitmapHeight ));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -