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

📄 dialogsetview.cpp

📁 网络游戏魔域源代码 测试可以完整变异
💻 CPP
字号:
// DialogSetView.cpp : implementation file
//

#include "stdafx.h"
#include "Architect.h"
#include "DialogSetView.h"
#include "ArchitectDlg.h"
#include "2DMapSceneObj.h"
#include "3DGameMap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CArchitectDlg* g_pDialog;
/////////////////////////////////////////////////////////////////////////////
// CDialogSetView dialog


CDialogSetView::CDialogSetView(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogSetView::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogSetView)
	m_bResource = FALSE;
	m_bMinMap = FALSE;
	m_bBgLimit = FALSE;
	m_bShowCell = FALSE;
	m_bShowMask = FALSE;
	m_bShowArea = FALSE;
	m_bShowAltitude = FALSE;
	m_bTerrainRange = FALSE;
	m_bSceneRange = FALSE;
	m_bCoverRange = FALSE;
	m_bScrInfo = TRUE;
	m_bScale2 = FALSE;
	m_bScale16 = FALSE;
	m_bScale4 = FALSE;
	m_bScale8 = FALSE;
	m_bExit = FALSE;
	//}}AFX_DATA_INIT
}


void CDialogSetView::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogSetView)
	DDX_Control(pDX, IDC_COMBO_REGIONSHOW, m_ctrlRegionShow);
	DDX_Check(pDX, IDC_CHECK_RESOURCE, m_bResource);	
	DDX_Check(pDX, IDC_CHECK_MINMAP, m_bMinMap);
	DDX_Check(pDX, IDC_CHECK_LIMIT, m_bBgLimit);
	DDX_Check(pDX, IDC_CHECK_CELL, m_bShowCell);
	DDX_Check(pDX, IDC_CHECK_MASK, m_bShowMask);
	DDX_Check(pDX, IDC_CHECK_AREA, m_bShowArea);
	DDX_Check(pDX, IDC_CHECK_ALTITUDE, m_bShowAltitude);
	DDX_Check(pDX, IDC_CHECK_TRANGE, m_bTerrainRange);
	DDX_Check(pDX, IDC_CHECK_SCENE_RANGE, m_bSceneRange);
	DDX_Check(pDX, IDC_CHECK_COVERRANGE, m_bCoverRange);
	DDX_Check(pDX, IDC_CHECK_SCRINFO, m_bScrInfo);
	DDX_Check(pDX, IDC_CHECK_SCALE2, m_bScale2);
	DDX_Check(pDX, IDC_CHECK_SCALE16, m_bScale16);
	DDX_Check(pDX, IDC_CHECK_SCALE4, m_bScale4);
	DDX_Check(pDX, IDC_CHECK_SCALE8, m_bScale8);
	DDX_Check(pDX, IDC_CHECK_EXIT, m_bExit);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialogSetView, CDialog)
	//{{AFX_MSG_MAP(CDialogSetView)
	ON_BN_CLICKED(IDC_CHECK_MASK, OnCheckMask)
	ON_BN_CLICKED(IDC_CHECK_AREA, OnCheckArea)
	ON_BN_CLICKED(IDC_CHECK_ALTITUDE, OnCheckAltitude)
	ON_BN_CLICKED(IDC_CHECK_EXIT, OnCheckExit)
	ON_BN_CLICKED(IDC_CHECK_MINMAP, OnCheckMinmap)
	ON_BN_CLICKED(IDC_CHECK_LIMIT, OnCheckLimit)
	ON_BN_CLICKED(IDC_CHECK_CELL, OnCheckCell)
	ON_BN_CLICKED(IDC_CHECK_COVERRANGE, OnCheckCoverrange)
	ON_BN_CLICKED(IDC_CHECK_TRANGE, OnCheckTrange)
	ON_BN_CLICKED(IDC_CHECK_SCENE_RANGE, OnCheckSceneRange)
	ON_BN_CLICKED(IDC_CHECK_SCRINFO, OnCheckScrinfo)
	ON_BN_CLICKED(IDC_CHECK_SCALE2, OnCheckScale2)
	ON_BN_CLICKED(IDC_CHECK_SCALE4, OnCheckScale4)
	ON_BN_CLICKED(IDC_CHECK_SCALE8, OnCheckScale8)
	ON_BN_CLICKED(IDC_CHECK_SCALE16, OnCheckScale16)
	ON_BN_CLICKED(IDC_CHECK_RESOURCE, OnCheckResource)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogSetView message handlers

void CDialogSetView::OnCheckMask() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
}

void CDialogSetView::OnCheckArea() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
}

void CDialogSetView::OnCheckAltitude() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
}

void CDialogSetView::OnCheckExit() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
}

void CDialogSetView::OnCheckResource() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
	g_objGameMap.SetShowRes (m_bResource);
}

void CDialogSetView::OnCheckMinmap() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
}

void CDialogSetView::OnCheckLimit() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
}

void CDialogSetView::OnCheckCell() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);	
}

void CDialogSetView::OnCheckCoverrange() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	C2DMapCoverObj::s_bStroke = m_bCoverRange;
}

void CDialogSetView::OnCheckTrange() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	C2DMapTerrainObjPart::s_bStroke = m_bTerrainRange;
}

void CDialogSetView::OnCheckSceneRange() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	C2DMapSceneObj::s_bStroke = m_bSceneRange;
}

void CDialogSetView::OnCheckScrinfo() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
}

void CDialogSetView::OnCheckScale2() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);

	if(m_bScale2)
	{
		m_bScale16	=	false;
		m_bScale4	=	false;
		m_bScale8	=	false;
		g_objGameMap.SetScale(128);
	}
	else
	{
		g_objGameMap.SetScale(256);
	}
	this->UpdateData(false);
	
}

void CDialogSetView::OnCheckScale4() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	if(m_bScale4)
	{
		m_bScale16	=	false;
		m_bScale2	=	false;
		m_bScale8	=	false;
		g_objGameMap.SetScale(64);
	}
	else
	{
		g_objGameMap.SetScale(256);
	}
	this->UpdateData(false);
	
}

void CDialogSetView::OnCheckScale8() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	if(m_bScale8)
	{
		m_bScale16	=	false;
		m_bScale4	=	false;
		m_bScale2	=	false;
		g_objGameMap.SetScale(32);
	}
	else
	{
		g_objGameMap.SetScale(256);
	}
	this->UpdateData(false);
	
}

void CDialogSetView::OnCheckScale16() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData(true);
	if(m_bScale16)
	{
		m_bScale2	=	false;
		m_bScale4	=	false;
		m_bScale8	=	false;
		g_objGameMap.SetScale(16);
	}
	else
	{
		g_objGameMap.SetScale(256);
	}
	this->UpdateData(false);	
}

void CDialogSetView::OnOK() 
{
	// TODO: Add extra validation here
	return;
	CDialog::OnOK();
}

void CDialogSetView::OnCancel() 
{
	// TODO: Add extra cleanup here
	return;
	CDialog::OnCancel();
}

BOOL CDialogSetView::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_ctrlRegionShow.InsertString(0, "不显示");	
	for(int i = 0; i < 16; i ++)
	{
		char szTemp[256];
		sprintf(szTemp, "类型%d", i+1);
		m_ctrlRegionShow.InsertString(m_ctrlRegionShow.GetCount(), szTemp);	
	}
	m_ctrlRegionShow.SetCurSel(4);
	this->UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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