]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/radiant/EntityDlg.h
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / tools / radiant / EntityDlg.h
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();
55         static CPreviewDlg *ShowMaterialChooser();
56         static CPreviewDlg *ShowParticleChooser();
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:
95         entity_t *editEntity;
96         bool multipleEntities;
97         CPropertyList listKeyVal;
98         CPropertyList listVars;
99         CComboBox comboClass;
100         idDict *dict;
101         const idMD5Anim* currentAnimation;
102         int currentAnimationFrame;
103
104         const char *AngleKey();
105
106         idPointListInterface curvePoints;
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 };