Debian Codegraph @

source/tools/atlas/AtlasUI/ActorEditor/ActorEditor.h

raw
1 /* Copyright (C) 2025 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include "tools/atlas/AtlasObject/AtlasObject.h"
19 #include "tools/atlas/AtlasUI/CustomControls/Windows/AtlasWindow.h"
20
21 #include <wx/defs.h>
22 #include <wx/event.h>
23
24 class ActorEditorListCtrl;
25 class wxCheckBox;
26 class wxComboBox;
27 class wxWindow;
28
29 class ActorEditor : public AtlasWindow
30 {
31 enum
32 {
33 ID_CreateEntity = ID_Custom
34 };
35
36 public:
37 ActorEditor(wxWindow* parent);
38
39 private:
40 void OnCreateEntity(wxCommandEvent& event);
41
42 protected:
43 AtObj FreezeData();
44 void ThawData(AtObj& in);
45
46 AtObj ExportData();
47 void ImportData(AtObj& in);
48
49 // TODO: er, what's the difference between freeze/thaw and export/import?
50 // Why is the code duplicated between them?
51
52 virtual wxString GetDefaultOpenDirectory();
53
54 private:
55 ActorEditorListCtrl* m_ActorEditorListCtrl;
56
57 wxCheckBox* m_CastShadows;
58 wxCheckBox* m_Float;
59 wxComboBox* m_Material;
60
61 // Some data is not modifiable in the editor
62 // but should be persisted so for convenience keep a copy of the last loaded file.
63 AtObj m_Actor;
64
65 DECLARE_EVENT_TABLE();
66 };