| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program 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 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/editor/ObjectDialog.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:38 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Object keypad dialog |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 14 5/08/99 1:39a Matt |
| 30 | * Added a function to delete all objects of a certain type, and support |
| 31 | * for placing and attaching groups to the terrain. |
| 32 | * |
| 33 | * 13 3/27/99 12:52p Chris |
| 34 | * The editor object placement code now allows objects to be pushed into |
| 35 | * wall (when a toggle box is checked) |
| 36 | * |
| 37 | * 12 2/03/99 1:20a Matt |
| 38 | * Made the object combo box on the object tab sort, and replaced the |
| 39 | * listbox of pictures with a big picture of the current item. |
| 40 | * |
| 41 | * 11 1/27/99 11:03a Samir |
| 42 | * added rotate 90 button to object dialog. |
| 43 | * |
| 44 | * 10 10/22/98 11:02a Chris |
| 45 | * Added object regrounding |
| 46 | * |
| 47 | * 9 10/08/98 7:18p Chris |
| 48 | * Added object swap types |
| 49 | * |
| 50 | * 8 8/24/98 12:24p Jason |
| 51 | * added waypoints and player start position flags |
| 52 | * |
| 53 | * 7 5/18/98 2:56p Matt |
| 54 | * Added code to readjust all ground object (for after the terrain has |
| 55 | * moved). |
| 56 | * |
| 57 | * 6 1/07/98 6:39p Jason |
| 58 | * Fixed player object number stuff |
| 59 | * |
| 60 | * 5 8/29/97 2:49p Samir |
| 61 | * Added new object movement features. |
| 62 | * |
| 63 | * 4 8/25/97 7:39p Samir |
| 64 | * Using new GrListBox from old editorPictListBox |
| 65 | * |
| 66 | * 3 8/12/97 10:57p Matt |
| 67 | * Made object page work for the generic object types (robot, powerup, |
| 68 | * building, clutter) |
| 69 | * |
| 70 | * 2 7/24/97 2:54p Matt |
| 71 | * Got rid of some member variables that kept track of current robot, |
| 72 | * powerup, & object type, and used variables in D3EditState instead. |
| 73 | * |
| 74 | * 19 6/04/97 11:56a Samir |
| 75 | * Added PowerupProp Dialog. |
| 76 | * |
| 77 | * 18 6/03/97 4:55p Mark |
| 78 | * |
| 79 | * 17 5/01/97 12:33p Jason |
| 80 | * added reset objects function |
| 81 | * |
| 82 | * 16 4/15/97 11:29a Samir |
| 83 | * Iimplemented menu item object placement and deletion. |
| 84 | * |
| 85 | * 15 4/03/97 5:08p Matt |
| 86 | * Removed handlers for buttons that have been removed |
| 87 | * |
| 88 | * 14 4/03/97 1:18p Matt |
| 89 | * Added handler code for object movement mode toggle button (on object |
| 90 | * keypad) |
| 91 | * |
| 92 | * 13 4/02/97 12:22p Samir |
| 93 | * Fixed object box scroll problems by keeping an array of item starts for |
| 94 | * each obj_type and fixed problem of placing a bad robot (door) when |
| 95 | * first placing objects. |
| 96 | * |
| 97 | * 12 3/25/97 6:31p Samir |
| 98 | * Ability to select and probably place robots. |
| 99 | * |
| 100 | * 11 2/26/97 3:35p Mark |
| 101 | * |
| 102 | * 10 2/21/97 6:26p Samir |
| 103 | * Object palette works (shitty scaling of powerups.) |
| 104 | * |
| 105 | * 9 2/20/97 4:26p Mark |
| 106 | * |
| 107 | * 8 2/19/97 5:26p Samir |
| 108 | * When setting focus on objID listbox, update its contents. |
| 109 | * |
| 110 | * 7 2/19/97 2:16p Samir |
| 111 | * Added RunKeypadFunction handler. |
| 112 | * |
| 113 | * 6 2/18/97 12:47p Samir |
| 114 | * Able to select object types and ids from keypad. |
| 115 | * |
| 116 | * 5 2/17/97 6:20p Samir |
| 117 | * Added Move and Placement of objects. |
| 118 | * |
| 119 | * 4 1/27/97 11:38a Samir |
| 120 | * Added horizontal scrolling of keypad modeless dialog. |
| 121 | * |
| 122 | * $NoKeywords: $ |
| 123 | */ |
| 124 | |
| 125 | ///////////////////////////////////////////////////////////////////////////// |
| 126 | // CObjectDialog dialog |
| 127 | |
| 128 | #include "KeypadDialog.h" |
| 129 | #include "GrListBox.h" |
| 130 | #include "object.h" |
| 131 | |
| 132 | class CObjectDialog; |
| 133 | |
| 134 | class CObjectDialog : public CKeypadDialog { |
| 135 | // Construction |
| 136 | public: |
| 137 | CObjectDialog(CWnd *pParent = NULL); // standard constructor |
| 138 | |
| 139 | void PlaceObject(); |
| 140 | void DeleteObject(); |
| 141 | |
| 142 | // Dialog Data |
| 143 | //{{AFX_DATA(CObjectDialog) |
| 144 | enum { IDD = IDD_OBJECTKEYPAD }; |
| 145 | // NOTE: the ClassWizard will add data members here |
| 146 | //}}AFX_DATA |
| 147 | |
| 148 | // Overrides |
| 149 | // ClassWizard generated virtual function overrides |
| 150 | //{{AFX_VIRTUAL(CObjectDialog) |
| 151 | protected: |
| 152 | virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support |
| 153 | //}}AFX_VIRTUAL |
| 154 | |
| 155 | public: |
| 156 | void UpdateIDList(); |
| 157 | |
| 158 | // Given an item number, return the object ID |
| 159 | int ItemToID(int item); |
| 160 | |
| 161 | // Given an object ID number, return the item number |
| 162 | int IDToItem(int id); |
| 163 | |
| 164 | // Implementation |
| 165 | protected: |
| 166 | // Generated message map functions |
| 167 | //{{AFX_MSG(CObjectDialog) |
| 168 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 169 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 170 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 171 | afx_msg void OnObjectPlaceObject(); |
| 172 | virtual BOOL OnInitDialog(); |
| 173 | afx_msg void OnSelchangeComboObjType(); |
| 174 | afx_msg void OnSelchangeComboObjID(); |
| 175 | afx_msg void OnObjPadDelobj(); |
| 176 | afx_msg void OnObjpadNextobj(); |
| 177 | afx_msg void OnSetfocusComboObjID(); |
| 178 | afx_msg void OnObjectpadGroup(); |
| 179 | afx_msg void OnObjContPreview(); |
| 180 | afx_msg void OnPaint(); |
| 181 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); |
| 182 | afx_msg void OnObjpadFlagobjmulti(); |
| 183 | afx_msg void OnObjpadFlipobj(); |
| 184 | afx_msg void OnObjpadSetdefault(); |
| 185 | afx_msg void OnDestroy(); |
| 186 | afx_msg void OnResetObjects(); |
| 187 | afx_msg BOOL OnHelpInfo(HELPINFO *pHelpInfo); |
| 188 | afx_msg void OnObjpadProperties(); |
| 189 | afx_msg void OnSelChangeCoordSysSelect(); |
| 190 | afx_msg void OnObjmoveX(); |
| 191 | afx_msg void OnObjmoveY(); |
| 192 | afx_msg void OnObjmoveXY(); |
| 193 | afx_msg void OnObjmoveZ(); |
| 194 | afx_msg void OnObjmoveP(); |
| 195 | afx_msg void OnObjmoveH(); |
| 196 | afx_msg void OnObjmoveB(); |
| 197 | afx_msg void OnObjmovePH(); |
| 198 | afx_msg void OnObjpadResetAllObjHeights(); |
| 199 | afx_msg void OnObjpadResetCurobjHeight(); |
| 200 | afx_msg void OnPrevStartPositon(); |
| 201 | afx_msg void OnNextStartPos(); |
| 202 | afx_msg void OnJumpToStartPos(); |
| 203 | afx_msg void OnRedCheck(); |
| 204 | afx_msg void OnBlueCheck(); |
| 205 | afx_msg void OnGreenCheck(); |
| 206 | afx_msg void OnYellowCheck(); |
| 207 | afx_msg void OnSelendokSwapSourceCombo(); |
| 208 | afx_msg void OnSelendokSwapDestCombo(); |
| 209 | afx_msg void OnObjectSwapButton(); |
| 210 | afx_msg void OnSelendokRegroundCombo(); |
| 211 | afx_msg void OnRegroundButton(); |
| 212 | afx_msg void OnObjRot90(); |
| 213 | afx_msg void OnObjectPushthroughwalls(); |
| 214 | afx_msg void OnObjpadDeleteAll(); |
| 215 | //}}AFX_MSG |
| 216 | DECLARE_MESSAGE_MAP() |
| 217 | |
| 218 | private: |
| 219 | void InitObjIDComboBox(CComboBox *box); |
| 220 | void InitObjTypeComboBox(CComboBox *box); |
| 221 | |
| 222 | private: |
| 223 | int m_current_start_pos; |
| 224 | |
| 225 | private: |
| 226 | // loads and saves settings for this keypad |
| 227 | int GetFreePlayerIndex(); |
| 228 | void UpdateDialog(); |
| 229 | void DrawPicture(CWnd *wnd); |
| 230 | }; |