Counter Strike : Global Offensive Source Code
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.

92 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, 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. m_bWaitForKeypress = false;
  24. //}}AFX_DATA_INIT
  25. // read from ini
  26. CWinApp *App = AfxGetApp();
  27. m_iQBSP = App->GetProfileInt(pszSection, "QBSP", 1);
  28. m_iVis = App->GetProfileInt(pszSection, "Vis", 1);
  29. m_iLight = App->GetProfileInt(pszSection, "Light", 1);
  30. m_bHDRLight = App->GetProfileInt(pszSection, "HDRLight", 0);
  31. m_bNoQuake = App->GetProfileInt(pszSection, "No Game", 0);
  32. m_strQuakeParms = App->GetProfileString(pszSection, "Game Parms", "+sv_lan 1");
  33. }
  34. void CRunMap::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CDialog::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CRunMap)
  38. DDX_Check(pDX, IDC_NOQUAKE, m_bNoQuake);
  39. DDX_Text(pDX, IDC_QUAKEPARMS, m_strQuakeParms);
  40. DDX_Radio(pDX, IDC_BSP0, m_iQBSP);
  41. DDX_Radio(pDX, IDC_VIS0, m_iVis);
  42. DDX_Radio(pDX, IDC_RAD0, m_iLight);
  43. DDX_Check(pDX, IDC_RAD_HDR, m_bHDRLight);
  44. DDX_Check(pDX, IDC_WAITFORKEYPRESS, m_bWaitForKeypress);
  45. //}}AFX_DATA_MAP
  46. }
  47. void CRunMap::SaveToIni(void)
  48. {
  49. CWinApp *App = AfxGetApp();
  50. App->WriteProfileInt(pszSection, "QBSP", m_iQBSP);
  51. App->WriteProfileInt(pszSection, "Vis", m_iVis);
  52. App->WriteProfileInt(pszSection, "Light", m_iLight);
  53. App->WriteProfileInt(pszSection, "HDRLight", m_bHDRLight);
  54. App->WriteProfileInt(pszSection, "No Game", m_bNoQuake);
  55. App->WriteProfileString(pszSection, "Game Parms", m_strQuakeParms);
  56. }
  57. BEGIN_MESSAGE_MAP(CRunMap, CDialog)
  58. //{{AFX_MSG_MAP(CRunMap)
  59. ON_BN_CLICKED(IDC_EXPERT, OnExpert)
  60. //}}AFX_MSG_MAP
  61. END_MESSAGE_MAP()
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CRunMap message handlers
  64. void CRunMap::OnExpert()
  65. {
  66. m_bSwitchMode = TRUE;
  67. UpdateData();
  68. EndDialog(IDOK);
  69. }
  70. BOOL CRunMap::OnInitDialog()
  71. {
  72. CDialog::OnInitDialog();
  73. return TRUE;
  74. }