Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: The UI for simple map compiles.
  4. //
  5. //=============================================================================//
  6. #include "stdafx.h"
  7. #include "hammer.h"
  8. #include "RunMap.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include <tier0/memdbgon.h>
  11. static LPCTSTR pszSection = "Run Map";
  12. CRunMap::CRunMap(CWnd* pParent /*=NULL*/)
  13. : CDialog(CRunMap::IDD, pParent)
  14. {
  15. m_bSwitchMode = FALSE;
  16. //{{AFX_DATA_INIT(CRunMap)
  17. m_iVis = -1;
  18. m_bNoQuake = FALSE;
  19. m_strQuakeParms = _T("");
  20. m_iLight = -1;
  21. m_iQBSP = -1;
  22. m_bHDRLight = FALSE;
  23. //}}AFX_DATA_INIT
  24. // read from ini
  25. CWinApp *App = AfxGetApp();
  26. m_iQBSP = App->GetProfileInt(pszSection, "QBSP", 1);
  27. m_iVis = App->GetProfileInt(pszSection, "Vis", 1);
  28. m_iLight = App->GetProfileInt(pszSection, "Light", 1);
  29. m_bHDRLight = App->GetProfileInt(pszSection, "HDRLight", 0);
  30. m_bNoQuake = App->GetProfileInt(pszSection, "No Game", 0);
  31. m_strQuakeParms = App->GetProfileString(pszSection, "Game Parms", "");
  32. }
  33. void CRunMap::DoDataExchange(CDataExchange* pDX)
  34. {
  35. CDialog::DoDataExchange(pDX);
  36. //{{AFX_DATA_MAP(CRunMap)
  37. DDX_Check(pDX, IDC_NOQUAKE, m_bNoQuake);
  38. DDX_Text(pDX, IDC_QUAKEPARMS, m_strQuakeParms);
  39. DDX_Radio(pDX, IDC_BSP0, m_iQBSP);
  40. DDX_Radio(pDX, IDC_VIS0, m_iVis);
  41. DDX_Radio(pDX, IDC_RAD0, m_iLight);
  42. DDX_Check(pDX, IDC_RAD_HDR, m_bHDRLight);
  43. //}}AFX_DATA_MAP
  44. }
  45. void CRunMap::SaveToIni(void)
  46. {
  47. CWinApp *App = AfxGetApp();
  48. App->WriteProfileInt(pszSection, "QBSP", m_iQBSP);
  49. App->WriteProfileInt(pszSection, "Vis", m_iVis);
  50. App->WriteProfileInt(pszSection, "Light", m_iLight);
  51. App->WriteProfileInt(pszSection, "HDRLight", m_bHDRLight);
  52. App->WriteProfileInt(pszSection, "No Game", m_bNoQuake);
  53. App->WriteProfileString(pszSection, "Game Parms", m_strQuakeParms);
  54. }
  55. BEGIN_MESSAGE_MAP(CRunMap, CDialog)
  56. //{{AFX_MSG_MAP(CRunMap)
  57. ON_BN_CLICKED(IDC_EXPERT, OnExpert)
  58. //}}AFX_MSG_MAP
  59. END_MESSAGE_MAP()
  60. /////////////////////////////////////////////////////////////////////////////
  61. // CRunMap message handlers
  62. void CRunMap::OnExpert()
  63. {
  64. m_bSwitchMode = TRUE;
  65. EndDialog(IDOK);
  66. }
  67. BOOL CRunMap::OnInitDialog()
  68. {
  69. CDialog::OnInitDialog();
  70. return TRUE;
  71. }