Planeshift

pawscharpick.h

Go to the documentation of this file.
00001 #ifndef PAWS_CHAR_PICKER_HEADER
00002 #define PAWS_CHAR_PICKER_HEADER
00003 
00004 #include "paws/pawsstringpromptwindow.h"
00005 #include "paws/pawswidget.h"
00006 #include "net/message.h"
00007 #include "net/cmdbase.h"
00008 
00009 #include "psengine.h"
00010 
00011 class pawsObjectView;
00012 class psCharAppearance;
00013 
00014 #define MAX_CHARS 10
00015 
00016 struct Model
00017 {
00018     csString factName;
00019     csString race;
00020     csString traits;
00021     csString equipment;
00022 };
00023     
00031 class pawsCharacterPickerWindow: public pawsWidget, public psClientNetSubscriber, public iOnStringEnteredAction, public DelayedLoader
00032 {
00033 public:
00034     pawsCharacterPickerWindow();
00035     ~pawsCharacterPickerWindow();
00036     
00037     bool PostSetup();
00038     void HandleMessage( MsgEntry* me );
00039     bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget* widget);
00040     bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* widget);
00041     void Show();
00042 
00043     void SelectCharacter(int character, pawsWidget* widget);
00044     void SelectCharacter(int character);   
00045 
00047     void ReceivedStrings();
00048     
00049     void Draw();
00050     
00051     void StoreHashedPassword(csString passwordHash, csString passwordHash256) {passHash = passwordHash; passHash256 = passwordHash256;}
00052     void StoreServerName(csString servName) {serverName = servName;}
00053 
00054     bool CheckLoadStatus();
00055 private:
00056 
00058     void SetupCharacterCreationScreens();
00059   
00061     void ReturnToLoginWindow();
00062 
00064     bool characterCreationScreens;
00065     
00066     virtual void OnStringEntered(const char *name, int param,const char *value);
00067 
00068     int charactersFound;
00069     int selectedCharacter;
00070 
00071     bool connecting;
00072     bool gotStrings;
00073     int lastResend;
00074 
00075     pawsObjectView* view;
00076     Model models[MAX_CHARS];
00077 
00078     csString passHash;
00079     csString passHash256;
00080     csString serverName;
00081     psCharAppearance* charApp;
00082     bool loaded;
00083 };
00084 
00085 CREATE_PAWS_FACTORY( pawsCharacterPickerWindow );
00086 
00087 
00088 #endif
00089