Planeshift
pawscharcreatemain.h
Go to the documentation of this file.
1 /*
2  * pawscharcreatemain.h - author: Andrew Craig
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 #ifndef PAWS_CHARACTER_CREATION_MAIN
20 #define PAWS_CHARACTER_CREATION_MAIN
21 
22 #include "paws/pawswidget.h"
23 #include "paws/pawstextbox.h"
24 #include "psengine.h"
25 
27 // FORWARD DECLARATIONS
30 class pawsTextBox;
31 class psCreationManager;
33 class pawsObjectView;
34 class psCharAppearance;
35 struct RaceDefinition;
37 
38 // general name validity funcs
39 bool CheckNameForRepeatingLetters(csString name);
40 bool FilterName(const char* name);
41 csString NormalizeCharacterName(const csString & name);
42 
53 {
54 public:
55 
58 
59  void HandleMessage( MsgEntry* me );
60  bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
61  bool PostSetup();
62  bool OnChange(pawsWidget *widget);
63  void Show();
64  bool CheckLoadStatus();
65 
66  /* Reloads all character creation windows so that they reset */
67  void ResetAllWindows();
68 
69  void Reset();
70 
71 private:
72  void SetHairStyle( int newStyle );
73  void RemoveHairStyle( int oldStyle );
74 
77  void UpdateCP();
78 
82  void ChangeFace( int currentFaceChoice );
83 
86  void GrayRaceButtons( );
87 
90  void GrayStyleButtons( );
91 
94  void SelectGender(int newGender);
95 
97  pawsTextBox* faceLabel;
98 
100  int currentFaceChoice;
101 
102  void ChangeBeardStyle( int currentChoice );
103  pawsTextBox* beardStyleLabel;
104  int currentBeardStyleChoice;
105 
112  void ChangeHairStyle( int currentChoice, int old );
113  pawsTextBox* hairStyleLabel;
114  int activeHairStyle;
115 
116  void ChangeHairColour( int currentChoice );
117  int activeHairColour;
118  pawsTextBox* hairColourLabel;
119 
120  void ChangeSkinColour( int currentChoice );
121  int currentSkinColour;
122  pawsTextBox* skinColourLabel;
123 
125  psCreationManager* createManager;
126 
128  pawsMultiLineTextBox* raceDescription;
129 
131  pawsTextBox* cpPoints;
132 
134  pawsRadioButtonGroup* gender;
135 
137  pawsButton* maleButton;
139  pawsButton* femaleButton;
140 
142  pawsObjectView* view;
143 
145  int currentGender;
146 
148  int lastGender;
149 
150  int lastRaceID;
151  csString newWindow;
153  RaceDefinition* race;
154 
155 
161  void UpdateRace(int id);
162 
164  bool nameWarning;
166  pawsEditTextBox* lastnameTextBox;
167  pawsEditTextBox* firstnameTextBox;
168 
169  psCharAppearance* charApp;
170 
171  bool loaded;
172  csString factName;
173 };
174 
175 
177 
178 #endif
179 
180 
bool FilterName(const char *name)
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
This widget is used to view a mesh in it's own seperate world.
bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
Defines a race.
Definition: psclientchar.h:205
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
The main creation window for creating a new character.
void HandleMessage(MsgEntry *me)
An edit box widget/.
Definition: pawstextbox.h:409
A manager class that handles all the details of a characters appearance.
Definition: charapp.h:65
csString NormalizeCharacterName(const csString &name)
bool CheckNameForRepeatingLetters(csString name)
void Show()
Makes widget visible and brings it to the front.
CREATE_PAWS_FACTORY(pawsCreationMain)
bool PostSetup()
This is called after the widget and all of it's children have been created.
A simple button widget.
Definition: pawsbutton.h:43
bool CheckLoadStatus()
void ResetAllWindows()
A basic text box widget.
Definition: pawstextbox.h:42
Handles all the details of the character creation on the client side.
Definition: psclientchar.h:261
bool OnChange(pawsWidget *widget)
Called whenever a widget is selected.
This is a set of radio buttons and is used to control them.
Definition: pawsradio.h:131