Planeshift
eeditediteffecttoolbox.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Robberts
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
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  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef EEDIT_EDIT_EFFECT_TOOLBOX_HEADER
21 #define EEDIT_EDIT_EFFECT_TOOLBOX_HEADER
22 
23 #include "eedittoolbox.h"
24 #include "paws/pawswidget.h"
25 
26 #include "eeditselectstring.h"
27 #include "eeditselectvec3.h"
28 #include "eeditselectfloat.h"
29 #include "eeditselectyesno.h"
30 #include "eeditselectnewanchor.h"
31 
32 class pawsButton;
33 class pawsListBox;
34 
35 class psEffect;
36 class psEffectAnchor;
38 class psEffectObj;
39 class pawsTree;
40 class pawsSimpleTreeNode;
41 class pawsSeqTreeNode;
42 
50 class EEditEditEffectToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditEditEffectToolbox>
51 {
52 public:
54  virtual ~EEditEditEffectToolbox();
55 
61  void LoadEffect(psEffect * effect);
62 
63  // inheritted from EEditToolbox
64  virtual void Update(unsigned int elapsed);
65  virtual size_t GetType() const;
66  virtual const char * GetName() const;
67 
68  // inheritted from pawsWidget
69  virtual bool PostSetup();
70  virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
71 
78  virtual bool OnSelected( pawsWidget* widget);
79  virtual void OnUpdateData(const char *dataname,PAWSData& data);
80 
82  {
83  AT_NONE = 0,
87 
89  };
90 
91 private:
92 
95  void UpdateEffectData(psEffect * effect, char owner, char attr, int index, int index2, int index3, PAWSData & data);
96 
99  void RebuildTreeRoot();
100 
112  void BuildAnchorNode(pawsSimpleTreeNode * node, psEffectAnchor * anchor, unsigned char anchorType);
113 
119  void BuildDirectionNode(pawsSeqTreeNode * node, psEffectAnchor * anchor, size_t index);
120 
126  void BuildSocketNode(pawsSeqTreeNode * node, psEffectAnchorSocket * anchor, size_t index);
127 
134  void BuildAnchorKeyFrameNode(pawsSeqTreeNode * node, psEffectAnchor * anchor, size_t index, size_t keyIndex);
135 
140  void LoadEffectAnchor(psEffectAnchor * anchor, size_t index);
141 
146  void LoadEffectObject(psEffectObj * obj, size_t index);
147 
148  // store a reference to the effect we're currently editing
149  psEffect * currEffect;
150  csString currEffectName;
151 
152  // effect tree stuff
153  pawsTree * effectItemsTree;
154  pawsSimpleTreeNode * effectItemsRoot;
155  pawsSimpleTreeNode * effectAnchorsRoot;
156  pawsSimpleTreeNode * effectObjsRoot;
157 };
158 
160 
163 #endif
CREATE_PAWS_FACTORY(EEditEditEffectToolbox)
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
virtual void Update(unsigned int elapsed)
Updates the toobox.
The effect class.
Definition: pseffect.h:51
A simple list box widget.
Definition: pawslistbox.h:202
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
virtual ~EEditEditEffectToolbox()
An effect is not much more than a collection of effect objects.
Definition: pseffectobj.h:207
virtual const char * GetName() const
Gets the name of the toolbox.
void LoadEffect(psEffect *effect)
Loads the given effect tree.
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
A simple button widget.
Definition: pawsbutton.h:43
This allows you to edit the effect.
virtual bool OnSelected(pawsWidget *widget)
Called whenever a widget is selected.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
virtual void OnUpdateData(const char *dataname, PAWSData &data)
virtual size_t GetType() const
Gets the toolbox type.
Effect anchors provide a base location / anchor point for all effect objs.