Planeshift
pawsconfigcamera.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 
21 #ifndef PAWS_CONFIG_CAMERA_HEADER
22 #define PAWS_CONFIG_CAMERA_HEADER
23 
24 // CS INCLUDES
25 #include <csutil/array.h>
26 
27 // PAWS INCLUDES
28 #include "paws/pawswidget.h"
29 #include "paws/pawsbutton.h"
30 #include "paws/pawstextbox.h"
31 #include "pawsconfigwindow.h"
32 
33 class psCamera;
34 
36 // pawsConfigCamera
38 
43 {
44 public:
46  virtual ~pawsConfigCamera();
47 
48  // from pawsConfigSectionWindow:
49  virtual bool Initialize();
50  virtual bool LoadConfig();
51  virtual bool SaveConfig();
52  virtual void SetDefault();
53 
54  // from pawsWidget:
55  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
56 
57 protected:
58 
64  float GetCameraSetting(const csString& settingName, int mode) const;
65 
71  void SetCameraSetting(const csString& settingName, float value, int mode) const;
72 
76  void SaveConfigByTreeNodes(pawsTreeNode * subtreeRoot);
77 
81  bool CreateTree();
82 
83  // Adds widgets to all nodes in subtree with root 'subtreeRoot'
84  // -- command label, key combination label and button that opens FingeringWindow
85  void CreateTreeWidgets(pawsTreeNode * subtreeRoot);
86 
87  // Sets all labels (in subtree with root 'subtreeRoot')
88  void SetLabels(pawsTreeNode * subtreeRoot);
89 
93  void SetCameraValues(pawsTreeNode * subtreeRoot);
94 
95  float labelWidth;
96  float inputWidth;
97 
98  pawsTree * tree; // the tree that makes whole window GUI
99 };
100 
101 
102 
103 
105 {
106 public:
108  {
109  Register( "pawsConfigCamera" );
110  }
112  {
113  return new pawsConfigCamera();
114  }
115 };
116 
117 
118 
119 #endif
virtual ~pawsConfigCamera()
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
virtual bool SaveConfig()
remembers settings in-game and saves them permanently to a file also
Handles camera modes like first person, thrid person, speak to npc manages collision of camera with m...
Definition: pscamera.h:55
Configuration screen for camera settings like first/third person view, collision, spring...
void SetCameraSetting(const csString &settingName, float value, int mode) const
applies a camera setting to the camera
void CreateTreeWidgets(pawsTreeNode *subtreeRoot)
void SetCameraValues(pawsTreeNode *subtreeRoot)
Sets all values to the ones that have the camera (in subtree with root &#39;subtreeRoot&#39;) ...
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
void SetLabels(pawsTreeNode *subtreeRoot)
virtual void SetDefault()
sets content of dialog according to default configuration
void SaveConfigByTreeNodes(pawsTreeNode *subtreeRoot)
a recursive function to apply the tree&#39;s settings to the camera
virtual bool Initialize()
virtual bool LoadConfig()
sets content of dialog according to current configuration
bool CreateTree()
Creates the tree that makes the whole GUI.
float GetCameraSetting(const csString &settingName, int mode) const
Grabs a camera setting from the camera.