blob: 4abf2f8776cc5c2d8b8c4f01cfb61f2577438da3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef OBJECTBAR_H
#define OBJECTBAR_H
#ifdef _WIN32
#pragma once
#endif
#include "AutoSelCombo.h"
#include "HammerBar.h"
#include "FilteredComboBox.h"
class CMapView;
class BoundBox;
class CMapClass;
class Vector;
class CPrefab;
#define MAX_PREV_SEL 12
class CObjectBar : public CHammerBar, public CFilteredComboBox::ICallbacks
{
public:
CObjectBar();
BOOL Create(CWnd *pParentWnd);
static LPCTSTR GetDefaultEntityClass(void);
virtual BOOL PreTranslateMessage(MSG* pMsg);
void UpdateListForTool(int iTool);
void SetupForBlockTool();
void DoHideControls();
CMapClass *CreateInBox(BoundBox *pBox, CMapView *pView = NULL);
BOOL GetPrefabBounds(BoundBox *pBox);
// If this is on, then it'll randomize the yaw when entities are placed.
bool UseRandomYawOnEntityPlacement();
void DoDataExchange(CDataExchange *pDX);
bool IsEntityToolCreatingPrefab( void );
bool IsEntityToolCreatingEntity( void );
CMapClass *BuildPrefabObjectAtPoint( Vector const &HitPos );
// CFilteredComboBox::ICallbacks implementation.
virtual void OnTextChanged( const char *pText );
private:
enum
{
listPrimitives,
listPrefabs,
listEntities
} ListType;
//{{AFX_DATA(CMapViewBar)
enum { IDD = IDD_OBJECTBAR };
//}}AFX_DATA
CFilteredComboBox m_CreateList; // this should really be m_ItemList
CComboBox m_CategoryList;
CEdit m_Faces;
CSpinButtonCtrl m_FacesSpin;
CPrefab* FindPrefabByName( const char *pName );
void LoadBlockCategories( void );
void LoadEntityCategories( void );
void LoadPrefabCategories( void );
void LoadBlockItems( void );
void LoadEntityItems( void );
void LoadPrefabItems( void );
int UpdatePreviousSelection( int iTool );
int GetPrevSelIndex(DWORD dwGameID, int *piNewIndex = NULL);
BOOL EnableFaceControl(CWnd *pWnd, BOOL bModifyWnd);
int iEntitySel;
int iBlockSel;
// previous selections:
DWORD m_dwPrevGameID;
struct tagprevsel
{
DWORD dwGameID;
struct tagblock
{
CString strItem;
CString strCategory;
} block;
struct tagentity
{
CString strItem;
CString strCategory;
} entity;
} m_PrevSel[MAX_PREV_SEL];
int m_iLastTool;
protected:
afx_msg void UpdateControl(CCmdUI*);
afx_msg void UpdateFaceControl(CCmdUI*);
afx_msg void OnCategorylistSelchange();
afx_msg void OnChangeCategory();
DECLARE_MESSAGE_MAP()
};
#endif // OBJECTBAR_H
|