Planeshift
|
00001 /* 00002 * pawscharcreatemain.h - author: Andrew Craig 00003 * 00004 * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 */ 00019 #ifndef PAWS_CHARACTER_CREATION_MAIN 00020 #define PAWS_CHARACTER_CREATION_MAIN 00021 00022 #include "paws/pawswidget.h" 00023 #include "paws/pawstextbox.h" 00024 #include "psengine.h" 00025 00027 // FORWARD DECLARATIONS 00029 class pawsMultiLineTextBox; 00030 class pawsTextBox; 00031 class psCreationManager; 00032 class pawsRadioButtonGroup; 00033 class pawsObjectView; 00034 class psCharAppearance; 00035 struct RaceDefinition; 00037 00038 // general name validity funcs 00039 bool CheckNameForRepeatingLetters(csString name); 00040 bool FilterName(const char* name); 00041 csString NormalizeCharacterName(const csString & name); 00042 00052 class pawsCreationMain : public pawsWidget, public psClientNetSubscriber, public DelayedLoader 00053 { 00054 public: 00055 00056 pawsCreationMain(); 00057 ~pawsCreationMain(); 00058 00059 void HandleMessage( MsgEntry* me ); 00060 bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget ); 00061 bool PostSetup(); 00062 bool OnChange(pawsWidget *widget); 00063 void Show(); 00064 bool CheckLoadStatus(); 00065 00066 /* Reloads all character creation windows so that they reset */ 00067 void ResetAllWindows(); 00068 00069 void Reset(); 00070 00071 private: 00072 void SetHairStyle( int newStyle ); 00073 void RemoveHairStyle( int oldStyle ); 00074 00077 void UpdateCP(); 00078 00082 void ChangeFace( int currentFaceChoice ); 00083 00086 void GrayRaceButtons( ); 00087 00090 void GrayStyleButtons( ); 00091 00094 void SelectGender(int newGender); 00095 00097 pawsTextBox* faceLabel; 00098 00100 int currentFaceChoice; 00101 00102 void ChangeBeardStyle( int currentChoice ); 00103 pawsTextBox* beardStyleLabel; 00104 int currentBeardStyleChoice; 00105 00112 void ChangeHairStyle( int currentChoice, int old ); 00113 pawsTextBox* hairStyleLabel; 00114 int activeHairStyle; 00115 00116 void ChangeHairColour( int currentChoice ); 00117 int activeHairColour; 00118 pawsTextBox* hairColourLabel; 00119 00120 void ChangeSkinColour( int currentChoice ); 00121 int currentSkinColour; 00122 pawsTextBox* skinColourLabel; 00123 00125 psCreationManager* createManager; 00126 00128 pawsMultiLineTextBox* raceDescription; 00129 00131 pawsTextBox* cpPoints; 00132 00134 pawsRadioButtonGroup* gender; 00135 00137 pawsButton* maleButton; 00139 pawsButton* femaleButton; 00140 00142 pawsObjectView* view; 00143 00145 int currentGender; 00146 00148 int lastGender; 00149 00150 int lastRaceID; 00151 csString newWindow; 00153 RaceDefinition* race; 00154 00155 00161 void UpdateRace(int id); 00162 00164 bool nameWarning; 00166 pawsEditTextBox* lastnameTextBox; 00167 pawsEditTextBox* firstnameTextBox; 00168 00169 psCharAppearance* charApp; 00170 00171 bool loaded; 00172 csString factName; 00173 }; 00174 00175 00176 CREATE_PAWS_FACTORY( pawsCreationMain ); 00177 00178 #endif 00179 00180