doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EntityDlg.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 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.
23 
24 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.
25 
26 ===========================================================================
27 */
28 #pragma once
29 #include "afxcmn.h"
30 #include "afxwin.h"
31 #include "PropertyList.h"
32 #include "PreviewDlg.h"
33 
34 // CEntityDlg dialog
35 
36 
37 
38 class CEntityDlg : public CDialog
39 {
40  DECLARE_DYNAMIC(CEntityDlg)
41 public:
42  CEntityDlg(CWnd* pParent = NULL); // standard constructor
43  virtual ~CEntityDlg();
44  void SetDict(idDict *_dict) {
45  dict = dict;
46  }
47  void SetEditEntity(entity_t *ent) {
48  editEntity = ent;
49  }
50  void CreateEntity();
51  void AssignModel ();
52  static CPreviewDlg *ShowModelChooser();
53  static CPreviewDlg *ShowGuiChooser();
54  static CPreviewDlg *ShowSoundChooser();
57  static CPreviewDlg *ShowSkinChooser( entity_t *ent );
58 
59  void SetKeyVal(const char *key, const char *val) {
60  editKey.SetWindowText(key);
61  editVal.SetWindowText(val);
62  }
63 
64  void EditCurvePoints();
65  void AddCurvePoints();
66  void InsertCurvePoint();
67  void DeleteCurvePoint();
68 
69 // Dialog Data
70  enum { IDD = IDD_DIALOG_ENTITY };
71 
72 protected:
73  virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
74 
75  //DECLARE_MESSAGE_MAP()
76 public:
77 
78  virtual BOOL OnInitDialog();
79  virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
80  void AddClassNames();
81  void UpdateEntitySel(eclass_t *ent);
82  void SetKeyValPairs( bool updateAnims = true );
83  static const char *TranslateString(const char *p);
84  void AddProp();
85  void DelProp();
86  void UpdateFromListBox();
87  CEdit editKey;
88  CEdit editVal;
89  void UpdateKeyVal(const char *key, const char *val);
90  void SelectCurvePointByRay(const idVec3 &org, const idVec3 &dir, int buttons);
91  void UpdateEntityCurve();
92 
93 
94 private:
99  CComboBox comboClass;
103 
104  const char *AngleKey();
105 
107 public:
108  void UpdateFromAnimationFrame ( bool updateKeyValueDisplay = true);
109  DECLARE_MESSAGE_MAP()
110  afx_msg void OnSize(UINT nType, int cx, int cy);
111  CStatic staticTitle;
112  CStatic staticKey;
113  CStatic staticVal;
114  CStatic staticFrame;
115  CButton btnPlayAnim;
116  CButton btnStopAnim;
117  CButton btnBrowse;
118  CButton btn135;
119  CButton btn90;
120  CButton btn45;
121  CButton btn180;
122  CButton btn360;
123  CButton btn225;
124  CButton btn270;
125  CButton btn315;
126  CButton btnUp;
127  CButton btnDown;
128  CButton btnModel;
129  CButton btnSound;
130  CButton btnGui;
131  CButton btnParticle;
132  CButton btnSkin;
133  CButton btnCurve;
134  CComboBox cbAnimations;
135  CSliderCtrl slFrameSlider;
136  afx_msg void OnCbnSelchangeComboClass();
137  afx_msg void OnLbnSelchangeListkeyval();
138  virtual BOOL PreTranslateMessage(MSG* pMsg);
139  afx_msg void OnBnClickedE135();
140  afx_msg void OnBnClickedE90();
141  afx_msg void OnBnClickedE45();
142  afx_msg void OnBnClickedE180();
143  afx_msg void OnBnClickedE0();
144  afx_msg void OnBnClickedE225();
145  afx_msg void OnBnClickedE270();
146  afx_msg void OnBnClickedE315();
147  afx_msg void OnBnClickedEUp();
148  afx_msg void OnBnClickedEDown();
149  afx_msg void OnBnClickedButtonModel();
150  afx_msg void OnBnClickedButtonSound();
151  afx_msg void OnBnClickedButtonGui();
152  afx_msg void OnBnClickedButtonBrowse();
153  afx_msg void OnCbnDblclkComboClass();
154  afx_msg void OnBnClickedButtonCreate();
155  afx_msg void OnBnClickedStartAnimation();
156  afx_msg void OnBnClickedStopAnimation();
157  CButton btnCreate;
158  afx_msg void OnLbnDblclkListkeyval();
159  afx_msg void OnLbnSelchangeListVars();
160  afx_msg void OnLbnDblclkListVars();
161  void OnNMReleasedcaptureSlider1(NMHDR *pNMHDR, LRESULT *pResult);
162  afx_msg void OnCbnAnimationChange ();
163  void OnTimer(UINT nIDEvent);
164  afx_msg void OnBnClickedButtonParticle();
165  afx_msg void OnBnClickedButtonSkin();
166  afx_msg void OnBnClickedButtonCurve();
167 
168 };
CStatic staticVal
Definition: EntityDlg.h:113
afx_msg void OnBnClickedButtonGui()
Definition: EntityDlg.cpp:877
CButton btnParticle
Definition: EntityDlg.h:131
CPropertyList listVars
Definition: EntityDlg.h:98
void EditCurvePoints()
Definition: EntityDlg.cpp:1202
CEdit editVal
Definition: EntityDlg.h:88
virtual BOOL PreTranslateMessage(MSG *pMsg)
Definition: EntityDlg.cpp:489
afx_msg void OnBnClickedE315()
Definition: EntityDlg.cpp:741
CButton btnDown
Definition: EntityDlg.h:127
virtual void DoDataExchange(CDataExchange *pDX)
Definition: EntityDlg.cpp:59
CButton btnSkin
Definition: EntityDlg.h:132
void UpdateFromAnimationFrame(bool updateKeyValueDisplay=true)
Definition: EntityDlg.cpp:1088
afx_msg void OnLbnDblclkListVars()
Definition: EntityDlg.cpp:1050
afx_msg void OnCbnSelchangeComboClass()
Definition: EntityDlg.cpp:249
static const char * TranslateString(const char *p)
Definition: EntityDlg.cpp:285
void AddProp()
Definition: EntityDlg.cpp:596
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
static CPreviewDlg * ShowSoundChooser()
Definition: EntityDlg.cpp:828
CButton btnUp
Definition: EntityDlg.h:126
virtual int OnToolHitTest(CPoint point, TOOLINFO *pTI) const
Definition: EntityDlg.cpp:109
afx_msg void OnCbnDblclkComboClass()
Definition: EntityDlg.cpp:932
#define IDD_DIALOG_ENTITY
afx_msg void OnBnClickedButtonModel()
Definition: EntityDlg.cpp:859
CEntityDlg(CWnd *pParent=NULL)
Definition: EntityDlg.cpp:47
Definition: Vector.h:316
CStatic staticFrame
Definition: EntityDlg.h:114
void UpdateFromListBox()
Definition: EntityDlg.cpp:308
CButton btnModel
Definition: EntityDlg.h:128
afx_msg void OnBnClickedButtonSkin()
Definition: EntityDlg.cpp:895
afx_msg void OnLbnDblclkListkeyval()
Definition: EntityDlg.cpp:1028
void UpdateKeyVal(const char *key, const char *val)
Definition: EntityDlg.cpp:1066
afx_msg void OnBnClickedButtonCurve()
Definition: EntityDlg.cpp:905
void AddClassNames()
Definition: EntityDlg.cpp:117
void AddCurvePoints()
Definition: EntityDlg.cpp:1168
static CPreviewDlg * ShowParticleChooser()
Definition: EntityDlg.cpp:785
#define BOOL
Definition: mprintf.c:71
CButton btn225
Definition: EntityDlg.h:123
CButton btnCurve
Definition: EntityDlg.h:133
afx_msg void OnBnClickedE45()
Definition: EntityDlg.cpp:691
CButton btn270
Definition: EntityDlg.h:124
void SetKeyValPairs(bool updateAnims=true)
Definition: EntityDlg.cpp:322
afx_msg void OnCbnAnimationChange()
Definition: EntityDlg.cpp:1102
entity_t * editEntity
Definition: EntityDlg.h:95
CStatic staticKey
Definition: EntityDlg.h:112
afx_msg void OnBnClickedE270()
Definition: EntityDlg.cpp:731
virtual ~CEntityDlg()
Definition: EntityDlg.cpp:55
afx_msg void OnBnClickedEDown()
Definition: EntityDlg.cpp:761
void CreateEntity()
Definition: EntityDlg.cpp:942
CComboBox cbAnimations
Definition: EntityDlg.h:134
CButton btn315
Definition: EntityDlg.h:125
virtual BOOL OnInitDialog()
Definition: EntityDlg.cpp:97
afx_msg void OnBnClickedE0()
Definition: EntityDlg.cpp:711
CButton btn90
Definition: EntityDlg.h:119
afx_msg void OnBnClickedE135()
Definition: EntityDlg.cpp:671
afx_msg void OnBnClickedE90()
Definition: EntityDlg.cpp:681
static CPreviewDlg * ShowModelChooser()
Definition: EntityDlg.cpp:771
void SetEditEntity(entity_t *ent)
Definition: EntityDlg.h:47
afx_msg void OnSize(UINT nType, int cx, int cy)
Definition: EntityDlg.cpp:159
bool multipleEntities
Definition: EntityDlg.h:96
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
CButton btn360
Definition: EntityDlg.h:122
void AssignModel()
Definition: EntityDlg.cpp:855
idPointListInterface curvePoints
Definition: EntityDlg.h:106
CButton btnPlayAnim
Definition: EntityDlg.h:115
CButton btn180
Definition: EntityDlg.h:121
void InsertCurvePoint()
Definition: EntityDlg.cpp:1227
CStatic staticTitle
Definition: EntityDlg.h:111
afx_msg void OnBnClickedStopAnimation()
Definition: EntityDlg.cpp:1146
afx_msg void OnLbnSelchangeListVars()
Definition: EntityDlg.cpp:1046
CButton btnStopAnim
Definition: EntityDlg.h:116
afx_msg void OnLbnSelchangeListkeyval()
Definition: EntityDlg.cpp:417
static CPreviewDlg * ShowMaterialChooser()
Definition: EntityDlg.cpp:841
void UpdateEntitySel(eclass_t *ent)
Definition: EntityDlg.cpp:407
afx_msg void OnBnClickedButtonParticle()
Definition: EntityDlg.cpp:886
static CPreviewDlg * ShowGuiChooser()
Definition: EntityDlg.cpp:814
void OnTimer(UINT nIDEvent)
Definition: EntityDlg.cpp:1151
static CPreviewDlg * ShowSkinChooser(entity_t *ent)
Definition: EntityDlg.cpp:799
const idMD5Anim * currentAnimation
Definition: EntityDlg.h:101
afx_msg void OnBnClickedStartAnimation()
Definition: EntityDlg.cpp:1138
void UpdateEntityCurve()
Definition: EntityDlg.cpp:1321
int currentAnimationFrame
Definition: EntityDlg.h:102
CButton btnGui
Definition: EntityDlg.h:130
const char * AngleKey()
Definition: EntityDlg.cpp:658
void DelProp()
Definition: EntityDlg.cpp:465
afx_msg void OnBnClickedEUp()
Definition: EntityDlg.cpp:751
void SetKeyVal(const char *key, const char *val)
Definition: EntityDlg.h:59
afx_msg void OnBnClickedButtonSound()
Definition: EntityDlg.cpp:868
CButton btn45
Definition: EntityDlg.h:120
idDict * dict
Definition: EntityDlg.h:100
void OnNMReleasedcaptureSlider1(NMHDR *pNMHDR, LRESULT *pResult)
Definition: EntityDlg.cpp:1076
CPropertyList listKeyVal
Definition: EntityDlg.h:97
afx_msg void OnBnClickedButtonBrowse()
Definition: EntityDlg.cpp:928
CEdit editKey
Definition: EntityDlg.h:87
afx_msg void OnBnClickedButtonCreate()
Definition: EntityDlg.cpp:1023
CButton btnSound
Definition: EntityDlg.h:129
GLfloat GLfloat p
Definition: glext.h:4674
afx_msg void OnBnClickedE225()
Definition: EntityDlg.cpp:721
CSliderCtrl slFrameSlider
Definition: EntityDlg.h:135
void DeleteCurvePoint()
Definition: EntityDlg.cpp:1292
afx_msg void OnBnClickedE180()
Definition: EntityDlg.cpp:701
void SelectCurvePointByRay(const idVec3 &org, const idVec3 &dir, int buttons)
Definition: EntityDlg.cpp:1343
CButton btn135
Definition: EntityDlg.h:118
CComboBox comboClass
Definition: EntityDlg.h:99
void SetDict(idDict *_dict)
Definition: EntityDlg.h:44
CButton btnCreate
Definition: EntityDlg.h:157
CButton btnBrowse
Definition: EntityDlg.h:117