EntityDlg.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #pragma once
  21. #include "afxcmn.h"
  22. #include "afxwin.h"
  23. #include "PropertyList.h"
  24. #include "PreviewDlg.h"
  25. // CEntityDlg dialog
  26. class CEntityDlg : public CDialog
  27. {
  28. DECLARE_DYNAMIC(CEntityDlg)
  29. public:
  30. CEntityDlg(CWnd* pParent = NULL); // standard constructor
  31. virtual ~CEntityDlg();
  32. void SetDict(idDict *_dict) {
  33. dict = dict;
  34. }
  35. void SetEditEntity(entity_t *ent) {
  36. editEntity = ent;
  37. }
  38. void CreateEntity();
  39. void AssignModel ();
  40. static CPreviewDlg *ShowModelChooser();
  41. static CPreviewDlg *ShowGuiChooser();
  42. static CPreviewDlg *ShowSoundChooser();
  43. static CPreviewDlg *ShowMaterialChooser();
  44. static CPreviewDlg *ShowParticleChooser();
  45. static CPreviewDlg *ShowSkinChooser( entity_t *ent );
  46. void SetKeyVal(const char *key, const char *val) {
  47. editKey.SetWindowText(key);
  48. editVal.SetWindowText(val);
  49. }
  50. void EditCurvePoints();
  51. void AddCurvePoints();
  52. void InsertCurvePoint();
  53. void DeleteCurvePoint();
  54. // Dialog Data
  55. enum { IDD = IDD_DIALOG_ENTITY };
  56. protected:
  57. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  58. //DECLARE_MESSAGE_MAP()
  59. public:
  60. virtual BOOL OnInitDialog();
  61. virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
  62. void AddClassNames();
  63. void UpdateEntitySel(eclass_t *ent);
  64. void SetKeyValPairs( bool updateAnims = true );
  65. static const char *TranslateString(const char *p);
  66. void AddProp();
  67. void DelProp();
  68. void UpdateFromListBox();
  69. CEdit editKey;
  70. CEdit editVal;
  71. void UpdateKeyVal(const char *key, const char *val);
  72. void SelectCurvePointByRay(const idVec3 &org, const idVec3 &dir, int buttons);
  73. void UpdateEntityCurve();
  74. private:
  75. entity_t *editEntity;
  76. bool multipleEntities;
  77. CPropertyList listKeyVal;
  78. CPropertyList listVars;
  79. CComboBox comboClass;
  80. idDict *dict;
  81. const idMD5Anim* currentAnimation;
  82. int currentAnimationFrame;
  83. const char *AngleKey();
  84. idPointListInterface curvePoints;
  85. public:
  86. void UpdateFromAnimationFrame ( bool updateKeyValueDisplay = true);
  87. DECLARE_MESSAGE_MAP()
  88. afx_msg void OnSize(UINT nType, int cx, int cy);
  89. CStatic staticTitle;
  90. CStatic staticKey;
  91. CStatic staticVal;
  92. CStatic staticFrame;
  93. CButton btnPlayAnim;
  94. CButton btnStopAnim;
  95. CButton btnBrowse;
  96. CButton btn135;
  97. CButton btn90;
  98. CButton btn45;
  99. CButton btn180;
  100. CButton btn360;
  101. CButton btn225;
  102. CButton btn270;
  103. CButton btn315;
  104. CButton btnUp;
  105. CButton btnDown;
  106. CButton btnModel;
  107. CButton btnSound;
  108. CButton btnGui;
  109. CButton btnParticle;
  110. CButton btnSkin;
  111. CButton btnCurve;
  112. CComboBox cbAnimations;
  113. CSliderCtrl slFrameSlider;
  114. afx_msg void OnCbnSelchangeComboClass();
  115. afx_msg void OnLbnSelchangeListkeyval();
  116. virtual BOOL PreTranslateMessage(MSG* pMsg);
  117. afx_msg void OnBnClickedE135();
  118. afx_msg void OnBnClickedE90();
  119. afx_msg void OnBnClickedE45();
  120. afx_msg void OnBnClickedE180();
  121. afx_msg void OnBnClickedE0();
  122. afx_msg void OnBnClickedE225();
  123. afx_msg void OnBnClickedE270();
  124. afx_msg void OnBnClickedE315();
  125. afx_msg void OnBnClickedEUp();
  126. afx_msg void OnBnClickedEDown();
  127. afx_msg void OnBnClickedButtonModel();
  128. afx_msg void OnBnClickedButtonSound();
  129. afx_msg void OnBnClickedButtonGui();
  130. afx_msg void OnBnClickedButtonBrowse();
  131. afx_msg void OnCbnDblclkComboClass();
  132. afx_msg void OnBnClickedButtonCreate();
  133. afx_msg void OnBnClickedStartAnimation();
  134. afx_msg void OnBnClickedStopAnimation();
  135. CButton btnCreate;
  136. afx_msg void OnLbnDblclkListkeyval();
  137. afx_msg void OnLbnSelchangeListVars();
  138. afx_msg void OnLbnDblclkListVars();
  139. void OnNMReleasedcaptureSlider1(NMHDR *pNMHDR, LRESULT *pResult);
  140. afx_msg void OnCbnAnimationChange ();
  141. void OnTimer(UINT nIDEvent);
  142. afx_msg void OnBnClickedButtonParticle();
  143. afx_msg void OnBnClickedButtonSkin();
  144. afx_msg void OnBnClickedButtonCurve();
  145. };