/* FinalSun/FinalAlert 2 Mission Editor Copyright (C) 1999-2024 Electronic Arts, Inc. Authored by Matthias Wagner This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // NewMap.cpp: Implementierungsdatei // #include "stdafx.h" #include "FinalSun.h" #include "NewMap.h" #include "MapOpenDialog.h" #include "resource.h" #include "mapdata.h" #include "variables.h" #include "functions.h" extern CFinalSunApp theApp; #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CNewMap CNewMap::CNewMap(CWnd* pParent /*=NULL*/) : CDialog(CNewMap::IDD, pParent) { //{{AFX_DATA_INIT(CNewMap) m_ImportOverlay = FALSE; m_ImportTrees = FALSE; m_ImportUnits = FALSE; m_Multiplayer = FALSE; m_House = _T(""); m_PrepareHouses = FALSE; m_AutoProduction = FALSE; m_Height = 0; m_Width = 0; m_Import = -1; m_Theater = 0; m_GroundHeight = 2; //}}AFX_DATA_INIT } void CNewMap::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CNewMap) DDX_Control(pDX, IDOK, m_OK); DDX_Check(pDX, IDC_IMPORTOVERLAY, m_ImportOverlay); DDX_Check(pDX, IDC_IMPORTTREES, m_ImportTrees); DDX_Check(pDX, IDC_IMPORTUNITS, m_ImportUnits); DDX_Check(pDX, IDC_MULTIPLAYER, m_Multiplayer); DDX_CBString(pDX, IDC_HOUSE, m_House); DDX_Check(pDX, IDC_PREPAREHOUSES, m_PrepareHouses); DDX_Check(pDX, IDC_AUTOPROD, m_AutoProduction); DDX_Text(pDX, IDC_HEIGHT, m_Height); DDV_MinMaxUInt(pDX, m_Height, 8, 255); DDX_Text(pDX, IDC_WIDTH, m_Width); DDV_MinMaxUInt(pDX, m_Width, 8, 255); DDX_Radio(pDX, IDC_IMPORT, m_Import); DDX_CBIndex(pDX, IDC_THEATER, m_Theater); DDX_CBIndex(pDX, IDC_GROUNDHEIGHT, m_GroundHeight); DDX_Control(pDX, IDC_IMPORTFILE, m_ImportFile); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CNewMap, CDialog) //{{AFX_MSG_MAP(CNewMap) ON_BN_CLICKED(IDC_BROWSE, OnBrowse) ON_BN_CLICKED(IDC_MULTIPLAYER, OnMultiplayer) ON_CBN_EDITCHANGE(IDC_IMPORTFILE, OnEditchangeImportfile) ON_BN_CLICKED(IDC_IMPORT, OnImport) ON_BN_CLICKED(IDC_NEW, OnNew) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CNewMap BOOL CNewMap::OnInitDialog() { CDialog::OnInitDialog(); // preset some stuff m_ImportOverlay=TRUE; m_ImportUnits=TRUE; m_OK.EnableWindow(FALSE); m_ImportTrees=TRUE; m_PrepareHouses=TRUE; m_AutoProduction=TRUE; m_Theater=0; m_Import=1; m_Width=64; m_Height=64; CComboBox& house=*((CComboBox*)(GetDlgItem(IDC_HOUSE))); int i; for(i=0;i