📄 interfa1.cpp
字号:
for(int i_1=0; i_1<3; i_1++)
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[5+i_1] = new CDDButton;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( !Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[5+i_1]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[5+i_1]->SetID(nID);
if( GAME.nMe == 1 && i_1 != 0 )
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[5+i_1]->SetState( BUTTON_UP );
}
else
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[5+i_1]->SetState( BUTTON_DISABLE );
}
// to preload the button that only be BUTTON_UP state to the game joiner
for(int i_2=0; i_2<1; i_2++)
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[8+i_2] = new CDDButton;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( !Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[8+i_2]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[8+i_2]->SetID(nID);
if( GAME.nMe == 2 || GAME.nMe == 1 )
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[8+i_2]->SetState( BUTTON_UP );
}
else
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[8+i_2]->SetState( BUTTON_DISABLE );
}
// to preload the button that only be BUTTON_UP state to the game joiner
for(int i_3=0; i_3<1; i_3++)
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[9+i_3] = new CDDButton;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( !Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[9+i_3]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[9+i_3]->SetID(nID);
if( GAME.nMe == 3 || GAME.nMe == 1 )
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[9+i_3]->SetState( BUTTON_UP );
}
else
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[9+i_3]->SetState( BUTTON_DISABLE );
}
// to preload the button that only be BUTTON_UP state to the game joiner
for(int i_4=0; i_4<1; i_4++)
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[10+i_4] = new CDDButton;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( !Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[10+i_4]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[10+i_4]->SetID(nID);
if( GAME.nMe == 4 || GAME.nMe == 1 )
{
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[10+i_4]->SetState( BUTTON_UP );
}
else
Menu_NetWork_SetNet.m_MenuButtonUnit.m_pButton[10+i_4]->SetState( BUTTON_DISABLE );
}
// to preload all ally check-box of this menu
for(int j=0; j<16; j++)
{
pAllCheckBoxUnit[j] = new CDDCheckBoxUnit;
pAllCheckBoxUnit[j]->m_pCheckBox[0] = new CDDCheckBox;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( ! pAllCheckBoxUnit[j]->m_pCheckBox[0]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
pAllCheckBoxUnit[j]->m_pCheckBox[0]->SetID(nID);
pAllCheckBoxUnit[j]->m_pCheckBox[0]->SetState(nState);
}
// to preload all agree check-box of this menu
for( int J=16; J<(16+4); J++ )
{
pAllCheckBoxUnit[J] = new CDDCheckBoxUnit;
pAllCheckBoxUnit[J]->m_pCheckBox[0] = new CDDCheckBox;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight, &nID, &nState));
if( ! pAllCheckBoxUnit[J]->m_pCheckBox[0]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
pAllCheckBoxUnit[J]->m_pCheckBox[0]->SetID(nID);
pAllCheckBoxUnit[J]->m_pCheckBox[0]->SetState(nState);
}
FSCAN.scan_close ();
// to new the instance of CDDString and blit it to the menu MENU_SETNET
for( int k=0; k<4; k++ )
{
pAllString[k] = new CDDString ;
pAllString[k]->m_bName = TRUE ;
pAllString[k]->SetPos( (pAllBitmap[0]->GetPosition().x+40), (pAllBitmap[0]->GetPosition().y+48+32*k) ) ;
if( GAME.Players[k+1].nType != PLAYER_TYPE_NONE )
{
pAllString[k]->SetString( GAME.Players[k+1].strName ) ;
pAllString[k]->Blit() ;
}
}
/*
Net_Message_1.m_bIsUse = FALSE ;
Net_Message_2.m_bIsUse = FALSE ;
Net_Message_3.m_bIsUse = FALSE ;
Net_Message_4.m_bIsUse = FALSE ;
*/
Net_Message_1.SetPos( (pAllBitmap[0]->GetPosition().x+4), (pAllBitmap[0]->GetPosition().y+173) ) ;
Net_Message_2.SetPos( (pAllBitmap[0]->GetPosition().x+4), (pAllBitmap[0]->GetPosition().y+173+20) ) ;
Net_Message_3.SetPos( (pAllBitmap[0]->GetPosition().x+4), (pAllBitmap[0]->GetPosition().y+173+40) ) ;
Net_Message_4.SetPos( (pAllBitmap[0]->GetPosition().x+4), (pAllBitmap[0]->GetPosition().y+173+60) ) ;
Net_EchoPrompt_Message.SetPos( (pAllBitmap[0]->GetPosition().x+4), (pAllBitmap[0]->GetPosition().y+264) ) ;
// to show this menu
pAllBitmap[0]->Blit();
Menu_NetWork_SetNet.Blit();
for(int m=0; m<20; m++)
{
pAllCheckBoxUnit[m]->Blit();
}
//////////////////////////////////////////
// to set this flag for DH Nov.8.1997
IsInSetNetMenu = TRUE ;
//////////////////////////////////////////
PostMessage( hwndGame, WM_COMMAND, NET_UPDATESETTING, 0 );
return TRUE;
}
else if(lParam == MENU_MAIN_NETWORK_SETNET_SELECTKING )
{
strcpy( fname, "set\\setk_ic.exp" );
FSCAN.scan_open (fname);
CurrentMenu = &Menu_NetWork_SetNet_SelectKing;
// to set this menu's ID
Menu_NetWork_SetNet_SelectKing.SetID( lParam );
// to preload the background of this menu
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y));
if( !Menu_NetWork_SetNet_SelectKing.PreLoad(BitmapFileId, pShow.x, pShow.y) )
return FALSE;
// to preload all button of this menu
for(int i=0; i<3; i++)
{
Menu_NetWork_SetNet_SelectKing.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));
if( !Menu_NetWork_SetNet_SelectKing.m_MenuButtonUnit.m_pButton[i]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet_SelectKing.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
}
FSCAN.scan_close ();
// to show this menu
Menu_NetWork_SetNet_SelectKing.Show();
return TRUE;
}
else if( lParam == MENU_MAIN_NETWORK_SETNET_SELECTMAP )
{
strcpy( fname, "set\\setm_ic.exp" );
FSCAN.scan_open (fname);
CurrentMenu = &Menu_NetWork_SetNet_SelectMap;
// to set this menu's ID
Menu_NetWork_SetNet_SelectMap.SetID( lParam );
// to preload the back-ground 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));
if( !pAllBitmap[0]->PreLoad(BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
// to preload the background bitmap file of scroll bar
pAllBitmap[1] = new CDDBitmap;
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d%d", &BitmapFileId, &pShow.x, &pShow.y, &nWidth, &nHeight));
if( !pAllBitmap[1]->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_NetWork_SetNet_SelectMap.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));
if( !Menu_NetWork_SetNet_SelectMap.m_MenuButtonUnit.m_pButton[i]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_SetNet_SelectMap.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
}
// to preload all list in this load game menu
pAllListUnit[0] = new CDDListUnit;
for(int j=0; j<3; 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));
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 ();
// to show this menu
pAllBitmap[0]->Blit();
pAllBitmap[1]->Blit();
pAllListUnit[0]->Blit();
Menu_NetWork_SetNet_SelectMap.m_MenuButtonUnit.Blit();
pAllBitmap[0]->Update();
return TRUE;
}
else if( lParam == MENU_MAIN_NETWORK_MODEM )
{
strcpy( fname, "set\\m_modem.exp" );
FSCAN.scan_open (fname);
CurrentMenu = &Menu_NetWork_Modem;
// to set this menu's ID
Menu_NetWork_Modem.SetID( lParam );
// to set the smallest box of this menu
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d%d", &pShow.x, &pShow.y, &nWidth, &nHeight));
Menu_NetWork_Modem.SetPosition(pShow.x, pShow.y);
Menu_NetWork_Modem.SetSize(nWidth, nHeight);
// to preload all button of this menu
for(int i=0; i<3; i++)
{
Menu_NetWork_Modem.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));
if( !Menu_NetWork_Modem.m_MenuButtonUnit.m_pButton[i]->PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_NetWork_Modem.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
}
FSCAN.scan_close ();
// to show this menu
Menu_NetWork_Modem.Show();
return TRUE;
}
else if( lParam == MENU_SYSTEMENU )
{
strcpy( fname, "set\\system.exp" );
FSCAN.scan_open (fname);
CurrentMenu = &Menu_System;
// to set this menu's ID
Menu_System.SetID( lParam );
// to preload the back-ground of this menu
FSCAN.l_scan (sscanf (FSCAN.expand_buf,"%d%d%d", &BitmapFileId, &pShow.x, &pShow.y ));
Menu_System.PreLoad(BitmapFileId, pShow.x, pShow.y);
// to preload all button of this menu
for(int i=0; i<7; i++ )
{
Menu_System.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));
if( !Menu_System.m_MenuButtonUnit.m_pButton[i]->PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_System.m_MenuButtonUnit.m_pButton[i]->SetID(nID);
if( GAME_bNetwork == TRUE )
{
if( (Menu_System.m_MenuButtonUnit.m_pButton[i]->GetID() == BUTTON_SYSTEMENU_SAVE) ||
(Menu_System.m_MenuButtonUnit.m_pButton[i]->GetID() == BUTTON_SYSTEMENU_LOAD) )
{
Menu_System.m_MenuButtonUnit.m_pButton[i]->SetState(BUTTON_DISABLE) ;
}
}
}
Menu_System.Show();
FSCAN.scan_close ();
return TRUE;
}
else if( lParam == MENU_SYSTEMENU_SAVE )
{
strcpy( fname, "set\\m_ssave.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_Save;
// to set this menu's ID
Menu_System_Save.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_Save.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_Save.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_Save.m_MenuButtonUnit.m_pButton[i]->
PreLoad( BitmapFileId, pShow.x, pShow.y, nWidth, nHeight) )
return FALSE;
Menu_System_Save.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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -