SaveMapOptionsDlg.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. FinalSun/FinalAlert 2 Mission Editor
  3. Copyright (C) 1999-2024 Electronic Arts, Inc.
  4. Authored by Matthias Wagner
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. */
  16. // SaveMapOptionsDlg.cpp: Implementierungsdatei
  17. //
  18. #include "stdafx.h"
  19. #include "finalsun.h"
  20. #include "SaveMapOptionsDlg.h"
  21. #include "variables.h"
  22. #include "inifile.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Dialogfeld CSaveMapOptionsDlg
  30. CSaveMapOptionsDlg::CSaveMapOptionsDlg(CWnd* pParent /*=NULL*/)
  31. : CDialog(CSaveMapOptionsDlg::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(CSaveMapOptionsDlg)
  34. m_Compress = 1;
  35. m_PreviewMode = 0;
  36. m_MapName = _T("");
  37. m_AirWar = FALSE;
  38. m_Cooperative = FALSE;
  39. m_Duel = FALSE;
  40. m_Meatgrind = FALSE;
  41. m_Megawealth = FALSE;
  42. m_Navalwar = FALSE;
  43. m_Nukewar = FALSE;
  44. m_Standard = FALSE;
  45. m_TeamGame = FALSE;
  46. //}}AFX_DATA_INIT
  47. CIniFile& ini=Map->GetIniFile();
  48. if(!Map->IsMultiplayer())
  49. m_PreviewMode=1;
  50. m_MapName=ini.sections["Basic"].values["Name"];
  51. }
  52. void CSaveMapOptionsDlg::DoDataExchange(CDataExchange* pDX)
  53. {
  54. CDialog::DoDataExchange(pDX);
  55. //{{AFX_DATA_MAP(CSaveMapOptionsDlg)
  56. DDX_Radio(pDX, IDC_COMPRESS, m_Compress);
  57. DDX_Radio(pDX, IDC_PREVIEWMODE, m_PreviewMode);
  58. DDX_Text(pDX, IDC_MAPNAME, m_MapName);
  59. #ifdef RA2_MODE
  60. DDX_Check(pDX, IDC_AIRWAR, m_AirWar);
  61. DDX_Check(pDX, IDC_COOPERATIVE, m_Cooperative);
  62. DDX_Check(pDX, IDC_DUEL, m_Duel);
  63. DDX_Check(pDX, IDC_MEATGRIND, m_Meatgrind);
  64. DDX_Check(pDX, IDC_MEGAWEALTH, m_Megawealth);
  65. DDX_Check(pDX, IDC_NAVALWAR, m_Navalwar);
  66. DDX_Check(pDX, IDC_NUKEWAR, m_Nukewar);
  67. DDX_Check(pDX, IDC_STANDARD, m_Standard);
  68. DDX_Check(pDX, IDC_TEAMGAME, m_TeamGame);
  69. #endif
  70. //}}AFX_DATA_MAP
  71. }
  72. BEGIN_MESSAGE_MAP(CSaveMapOptionsDlg, CDialog)
  73. //{{AFX_MSG_MAP(CSaveMapOptionsDlg)
  74. //}}AFX_MSG_MAP
  75. END_MESSAGE_MAP()
  76. /////////////////////////////////////////////////////////////////////////////
  77. // Behandlungsroutinen für Nachrichten CSaveMapOptionsDlg
  78. BOOL CSaveMapOptionsDlg::OnInitDialog()
  79. {
  80. CDialog::OnInitDialog();
  81. CIniFile& ini=Map->GetIniFile();
  82. if(!Map->IsMultiplayer())
  83. {
  84. GetDlgItem(IDC_PREVIEWMODE)->EnableWindow(FALSE);
  85. GetDlgItem(IDC_NOPREVIEW)->EnableWindow(FALSE);
  86. GetDlgItem(IDC_EXISTINGPREVIEW)->EnableWindow(FALSE);
  87. #ifndef TS_MODE
  88. GetDlgItem(IDC_AIRWAR)->EnableWindow(FALSE);
  89. GetDlgItem(IDC_COOPERATIVE)->EnableWindow(FALSE);
  90. GetDlgItem(IDC_DUEL)->EnableWindow(FALSE);
  91. GetDlgItem(IDC_MEATGRIND)->EnableWindow(FALSE);
  92. GetDlgItem(IDC_MEGAWEALTH)->EnableWindow(FALSE);
  93. GetDlgItem(IDC_NAVALWAR)->EnableWindow(FALSE);
  94. GetDlgItem(IDC_NUKEWAR)->EnableWindow(FALSE);
  95. GetDlgItem(IDC_STANDARD)->EnableWindow(FALSE);
  96. GetDlgItem(IDC_TEAMGAME)->EnableWindow(FALSE);
  97. #endif
  98. }
  99. return TRUE; // return TRUE unless you set the focus to a control
  100. // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
  101. }