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

📄 dlgmain1.cpp

📁 网络游戏魔域源代码 测试可以完整变异
💻 CPP
📖 第 1 页 / 共 5 页
字号:
	m_DlgEmbed.ShowWindow(SW_SHOW);
	m_DlgEmbed.EnableWindow(false);

	// Init the msgsend dialog
	m_DlgMsgSend.Create ( IDD_DIALOG_MSGSEND, CDlgMain::GetParent () ) ;
	m_DlgMsgSend.GetWindowRect ( rect ) ;
	m_DlgMsgSend.MoveWindow ( _SCR_WIDTH - rect.Width() - 295,
							 450 - rect.Height(), 
							  rect.Width (), 
							  rect.Height () ) ;
	m_DlgMsgSend.ShowWindow( SW_SHOW ) ;
	m_DlgMsgSend.EnableWindow( false ) ;

	// Init the msgreceive dialog
	m_DlgMsgReceive.Create ( IDD_DIALOG_MSGRECEIVE, CDlgMain::GetParent () ) ;
	m_DlgMsgReceive.GetWindowRect ( rect ) ;
	m_DlgMsgReceive.MoveWindow ( _SCR_WIDTH - rect.Width() - 295,
								 450 - rect.Height(), 
								 rect.Width (), 
								 rect.Height () ) ;
	m_DlgMsgReceive.ShowWindow( SW_SHOW ) ;
	m_DlgMsgReceive.EnableWindow( false ) ;

	// Init the Mpc Booth dialog
	m_DlgMpcBooth.Create ( IDD_DIALOG_MPCBOOTH, CDlgMain::GetParent () ) ;
	m_DlgMpcBooth.GetWindowRect ( rect ) ;
	m_DlgMpcBooth.MoveWindow ( 0,
							   65,
							   rect.Width (),
							   rect.Height () ) ;
	m_DlgMpcBooth.ShowWindow(SW_SHOW) ;
	m_DlgMpcBooth.EnableWindow(false) ;
	// Init the npc booth dialog
	m_DlgNpcBooth.Create ( IDD_DIALOG_NPCBOOTH, CDlgMain::GetParent () ) ;
	m_DlgNpcBooth.GetWindowRect ( rect ) ;
	m_DlgNpcBooth.MoveWindow ( 0,
							   65,
							   rect.Width (),
							   rect.Height () ) ;
	m_DlgNpcBooth.ShowWindow(SW_SHOW);
	m_DlgNpcBooth.EnableWindow(false);

	// Init the Hawk dialog
	m_DlgHawk.Create ( IDD_DIALOG_HAWK, CDlgMain::GetParent () ) ;
	m_DlgHawk.GetWindowRect ( rect ) ;
	m_DlgHawk.MoveWindow ( 0,
						   ( _SCR_HEIGHT - ( rect.Height() ) ) / 2 +80, 
						   rect.Width() , 
						   rect.Height() ) ;
	m_DlgHawk.ShowWindow(SW_SHOW);
	m_DlgHawk.EnableWindow(false);

	/*/ Init the dice dialog
	m_DlgDice.Create ( IDD_DIALOG_DICE, CDlgMain::GetParent () ) ;
	m_DlgDice.GetWindowRect ( rect ) ;
	m_DlgDice.MoveWindow ( _SCR_WIDTH -  rect.Width(),
						   0,
						   rect.Width(),
						   rect.Height() ) ;
	*/
	/*/ Init the dice dialog
	m_DlgDiceList.Create ( IDD_DIALOG_DICELIST, CDlgMain::GetParent () ) ;
	m_DlgDiceList.GetWindowRect ( rect ) ;
	m_DlgDiceList.MoveWindow ( _SCR_WIDTH -  rect.Width() - 316,
							   0, 
							   rect.Width(), 
							   rect.Height() ) ;

*/
	// Init the progress dialog
	m_DlgProgress.Create( IDD_DIALOG_PROGRESS, CDlgMain::GetParent() ) ;
	m_DlgProgress.GetWindowRect(rect);
	m_DlgProgress.MoveWindow( 0,_SCR_HEIGHT-rect.Height(),
								rect.Width(),
								rect.Height());
	m_DlgProgress.ShowWindow( SW_SHOW ) ;
	m_DlgProgress.EnableWindow( false ) ;


	// Init the mipmap dialog
	m_DlgMipmap.Create ( IDD_DIALOG_MIPMAP, CDlgMain::GetParent () ) ;
	m_DlgMipmap.GetWindowRect ( rect ) ;
	m_DlgMipmap.MoveWindow ( _SCR_WIDTH - rect.Width (),
							 0,
							 rect.Width (),
							 rect.Height () ) ;
	m_DlgMipmap.ShowWindow( SW_SHOW ) ;
	m_DlgMipmap.EnableWindow( false ) ;

	// Init the group dialog
	m_DlgGroup.Create ( IDD_DIALOG_GROUP, CDlgMain::GetParent () ) ;
	m_DlgGroup.GetWindowRect ( rect ) ;
	m_DlgGroup.MoveWindow ( _SCR_WIDTH-rect.Width(),
							_SCR_HEIGHT - rect.Height() - 230,
							rect.Width(),
							rect.Height() ) ;
	m_DlgGroup.ShowWindow( SW_SHOW ) ;
	m_DlgGroup.EnableWindow( false ) ;

	m_DlgXp.Create ( IDD_DIALOG_XP, CDlgMain::GetParent () ) ;
	m_DlgXp.ShowWindow(SW_HIDE);
	////////////////////////////////////
	
	// Init the contorl tip show
	CRect prgRect ;
	CDlgMain::GetWindowRect( rect ) ;

	//role button
	m_QueryBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10741));
	//goodbox button
	m_GoodBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10742));
	//Monster button
	m_MonsterBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10744));
	//skill button
	m_MagicBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10745));
	//faction button
	m_FactionBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10746));
	//sysset button
	m_SetupBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10747));
	//friend button
	m_FriendBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10748));
	//buy button
	m_ChatBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10749));
	//group button
	m_GroupBtn.SetTipShow((char*)g_objGameDataSet.GetStr(10750));

	m_bCreate = true ;
	
	//monster button
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

HBRUSH CDlgMain::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	pDC->SetBkMode ( TRANSPARENT ) ;
	return g_StockBrush;
}

void CDlgMain::Show()
{	
	// Show the progress dialog
	if ( m_DlgProgress.m_bShow )
		m_DlgProgress.Show() ;
	
	// Show owner
	CAni* ShowAni = g_objGameDataSet.GetDataAni ( ( char * )g_strControlAni,
												  "Dialog4",
												  EXIGENCE_IMMEDIATE ) ;
	if ( ShowAni != NULL )
	{
		// Show the up dialog
		if ( !m_bUpHide )
		{
			ShowAni->Show( 0, 768, 602 ) ;
			ShowAni->Show( 2, 956 ,530) ;
			m_BtnUpHide.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
			m_GroupBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
			m_FriendBtn.Show ( m_DlgPnt.x, m_DlgPnt.y ) ;
			m_ChatBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
		}
		else
		{
			ShowAni->Show( 1, 768, 602 ) ;	
			m_BtnUpHide.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
		}
	}
	else 
		return ;
	// Show the left dialog
	m_SetupBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
// 	m_StoneGoods.Show ( m_DlgPnt.x, m_DlgPnt.y);
	m_QueryBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
	m_FactionBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
	m_GoodBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
	m_MonsterBtn.Show ( m_DlgPnt.x, m_DlgPnt.y) ;
	m_MagicBtn.Show ( m_DlgPnt.x, m_DlgPnt.y);
	
	m_DlgNorMsgDown.Show();
	if(m_DlgTalk.GetIsGameMsgEx())
		m_DlgNorMsgUp.Show();

	if ( ::GetKeyState( VK_MENU ) >> 7  )
	{
		if (m_DlgTalk.GetIsGameMsgEx()) 
		{
			g_objGameMsg.ShowEx( true, false ) ;
		}
		else g_objGameMsg.Show(true, false);
	}
	else
	{
		if (m_DlgTalk.GetIsGameMsgEx()) 
		{
			g_objGameMsg.ShowEx( false, false ) ;
		}
		else
			g_objGameMsg.Show( false, false ) ;
	}
	
	if ( m_DlgTalk.m_bShow )
		m_DlgTalk.Show () ;
	// Show child dialog
	ShowChildDlg () ;	
}

void CDlgMain::ShowChildDlg()
{	
	// Show the message dialog

	// Show the left side dialog
	switch ( m_uCurLDlgID )
	{
	case DLG_TRADE:
		m_DlgTrade.Show() ;
		break ;
	case DLG_TBOARDINFO:
		m_DlgAnnounceInfo.Show();
		break;
	case DLG_MPCBOOTH:
		m_DlgMpcBooth.Show();
		break;
	case DLG_NPCBOOTH:
		m_DlgNpcBooth.Show();
		break;
	default:
		break ;
	}
	// Show the mid side dialog
	switch ( m_uCurMDlgID )
	{
	case DLG_AUCTION:
		m_DlgBidAuction.Show();
		break;
	case DLG_AUCPACKAGE:
		m_DlgAucPackage.Show();
		break;
	case DLG_ADDAUCITEM:
		m_DlgAddAucItem.Show();
		break;
	case DLG_IDENTIFY:
		m_DlgIdentify.Show();
		break;
	case DLG_MONSTERNPC:
		m_DlgMonsterNpc.Show();
		break;
	case DLG_MONSTERIMPROVE:
		m_DlgMonsterImprove.Show();
		break;
	case DLG_MONSTERDEPOT:
		m_DlgMonsterDepot.Show();
		break;
	case DLG_MONSTEREVOLVE:
		m_DlgMonsterEvolve.Show();
		break;
	case DLG_MONSTERHATCH:
		m_DlgMonsterHatch.Show();
		break;
	case DLG_TASKUPITEM:
		m_DlgTaskUpItem.Show();
		break;
	case DLG_INSHELP:
		m_DlgInsHelp.Show();
		break;
	case DLG_IMPROVE:
		m_DlgImprove.Show();
		break;
	case DLG_EMBED:
		m_DlgEmbed.Show();
		break;
	case DLG_SETUP:
		m_DlgSetup.Show() ;
		break ;
	case DLG_MSGSEND:
		m_DlgMsgSend.Show() ;
		break ;
	case DLG_MSGRECEIVE:
		m_DlgMsgReceive.Show() ;
		break ;
	default:
		break ;
	}


	// Show the mipmap dialog
	if ( m_DlgMipmap.m_bShow )
		m_DlgMipmap.Show() ;

	// Show the right side dialog
	switch ( m_uCurRDlgID )
	{
	case DLG_NPCEQUIP:
		m_DlgNpcEquip.Show();
		break;
	case DLG_TBOARDLIST:
		m_DlgAnnounceList.Show();
		break;
	case DLG_TBOARDUP:
		m_DlgAnnounceUp.Show();
		break;
	case DLG_TASKVIEW:
		m_DlgPlayerTaskView.Show();
		break;
	case DLG_TASKGET:
		m_DlgPlayerTaskUp.Show();
		break;
	case DLG_TASKLIST:
		m_DlgPlayerTaskList.Show();
		break;
	case DLG_CONTACT:
		m_DlgKnightage.Show();
		break;
	case DLG_DEPOT:
		m_DlgDepot.Show();
		break ;
	case DLG_NPCBUY:
		m_DlgNpcBuy.Show();
		break ;
	case DLG_MONSTER:
		m_DlgMonster.Show() ;
		break ;
	case DLG_FRIEND:
		m_DlgEnemyFriend.Show() ;
		break ;
	case DLG_REALSKILL:
		m_DlgQuery.Show();
		break;
	case DLG_QUERY:
		m_DlgQuery.Show() ;
		break ;
	default:
		break ;
	}
	
	// 摆摊叫卖
	if (m_DlgBigmap.m_bShow)
	{
		m_DlgBigmap.Show();
	}	
	if (m_DlgHawk.m_bShow)
	{
		m_DlgHawk.Show();
	}
	// the others dialog
	//shwo Relive button
	if (m_DlgXp.m_bShow)
		m_DlgXp.Show();	
	
	if (m_DlgMpcGoods.m_bShow)
	{
		m_DlgMpcGoods.Show();
	}
	
	if(m_DlgEmotion.m_bShow)
		m_DlgEmotion.Show ();
	//show the monster heads
	m_DlgMonsterHeads.Show ();
	//show the group dialog
	m_DlgGroup.Show();
}

void CDlgMain::OnMove(int x, int y) 
{
	CDialog::OnMove(x, y);
	
	m_DlgPnt.x = x ;
 	m_DlgPnt.y = y ;	
}

void CDlgMain::OnMainQuery() 
{
	if (!m_DlgQuery.m_bShow)
	{
		if (m_DlgInsHelp.m_bShow)
			m_DlgInsHelp.EnableWindow(false);
		CDlgMain::GetParent()->PostMessage(WM_MY_MESSAGE,ON_DLGTASK_CLOSE);
		CDlgMain::CloseCurDlg(1);
		CDlgMain::CloseCurDlg(2);
		m_uCurRDlgID = DLG_QUERY;
		m_DlgQuery.PopupCurChk();
		m_DlgQuery.m_btCurChildDlgID = 1;
		m_DlgQuery.m_ChkRole.SetCheckValue(1);
		m_DlgQuery.EnableWindow();
	}
	else 
	{
		if(m_DlgQuery.m_btCurChildDlgID == 1)
		{
			CDlgMain::CloseCurDlg(2);
			m_uCurRDlgID = -1;
		}
		else
		{
			m_DlgQuery.PopupCurChk();
			m_DlgQuery.HideCurDlg(m_DlgQuery.m_btCurChildDlgID);
			m_DlgQuery.m_btCurChildDlgID = 1;
			m_DlgQuery.m_ChkRole.SetCheckValue(1);
			m_DlgQuery.ShowCurDlg(1);			
		}
	}
}

void CDlgMain::OnMainFriend() 
{
	if( !m_DlgEnemyFriend.m_bShow)
	{
		if (m_DlgInsHelp.m_bShow)
			m_DlgInsHelp.EnableWindow(false);
		CDlgMain::CloseCurDlg(2);
		m_uCurRDlgID = DLG_FRIEND;
		m_DlgEnemyFriend.EnableWindow();
		return;
	}
	else
	{
		m_uCurRDlgID = -1;
		m_DlgEnemyFriend.EnableWindow(false);
		return;
	}
}

void CDlgMain::OnMainGood() 
{
	if ( !m_DlgMpcGoods.m_bShow ) 
	{
		if (m_DlgGroup.m_MenuGroup.m_bShow)
		{
			m_DlgGroup.m_MenuGroup.EnableWindow(false);
		}
		if(m_DlgEmotion.m_bShow)
			m_DlgEmotion.EnableWindow (false);
		m_DlgMpcGoods.m_ChkStones.SetCheckValue(0);
		m_DlgMpcGoods.m_ChkGoods.SetCheckValue(1);
		m_DlgMpcGoods.m_MpcGoodsGri.EnableWindow();
		m_DlgMpcGoods.m_MpcStonesGri.EnableWindow(false);
		m_DlgMpcGoods.EnableWindow() ;
		return ;
	}
	else if ( m_DlgMpcGoods.m_bShow ) 
	{
		if (m_DlgMpcGoods.m_ChkGoods.GetCheckValue() == 0)
		{
			m_DlgMpcGoods.m_ChkStones.SetCheckValue(0);
			m_DlgMpcGoods.m_ChkGoods.SetCheckValue(1);
			m_DlgMpcGoods.m_MpcGoodsGri.EnableWindow();
			m_DlgMpcGoods.m_MpcStonesGri.EnableWindow(false);
		}
		else
			m_DlgMpcGoods.EnableWindow(false);
		return ;
	}
}

void CDlgMain::OnMainSetup() 
{
	if ( !m_DlgSetup.m_bShow ) 
	{
		CDlgMain::CloseCurDlg(0) ;
		CDlgMain::CloseCurDlg(1);
		CDlgMain::CloseCurDlg(2);
		CDlgMain::CloseNpcDlg();
		CDlgMain::GetParent()->PostMessage(WM_MY_MESSAGE,ON_DLGTASK_CLOSE);
		m_uCurMDlgID = DLG_SETUP ;
		m_DlgSetup.EnableWindow() ;
		return ;
	}
	else if ( m_DlgSetup.m_bShow ) 
	{
		m_uCurMDlgID = -1 ;

⌨️ 快捷键说明

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