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.

78 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ====
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "stdafx.h"
  7. #include "hammer.h"
  8. #include "EditPathDlg.h"
  9. #include "GameConfig.h"
  10. #include "fgdlib/GameData.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include <tier0/memdbgon.h>
  13. CEditPathDlg::CEditPathDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CEditPathDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CEditPathDlg)
  17. m_strClass = _T("");
  18. m_iDirection = -1;
  19. m_strName = _T("");
  20. //}}AFX_DATA_INIT
  21. }
  22. void CEditPathDlg::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(CEditPathDlg)
  26. DDX_Control(pDX, IDC_CLASS, m_cClass);
  27. DDX_CBString(pDX, IDC_CLASS, m_strClass);
  28. DDX_Radio(pDX, IDC_LOOP, m_iDirection);
  29. DDX_Text(pDX, IDC_NAME, m_strName);
  30. //}}AFX_DATA_MAP
  31. }
  32. BEGIN_MESSAGE_MAP(CEditPathDlg, CDialog)
  33. //{{AFX_MSG_MAP(CEditPathDlg)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. BOOL CEditPathDlg::OnInitDialog()
  37. {
  38. CDialog::OnInitDialog();
  39. CString strCurrent;
  40. m_cClass.GetWindowText(strCurrent);
  41. // add class list to combo box
  42. // setup class list
  43. m_cClass.SetRedraw(FALSE);
  44. m_cClass.ResetContent();
  45. CString str;
  46. int nCount = pGD->GetClassCount();
  47. for (int i = 0; i < nCount; i++)
  48. {
  49. GDclass *pc = pGD->GetClass(i);
  50. if (!pc->IsBaseClass())
  51. {
  52. str = pc->GetName();
  53. if (!pc->IsClass("worldspawn"))
  54. {
  55. m_cClass.AddString(str);
  56. }
  57. }
  58. }
  59. m_cClass.SetRedraw(TRUE);
  60. m_cClass.SetWindowText(strCurrent);
  61. m_cClass.Invalidate();
  62. return TRUE;
  63. }