BuyAccessoryDialog.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(AFX_BuyAccessoryDialog_H__4B5E93CF_1DE2_4979_A629_AEBD725ABE65__INCLUDED_)
00022 #define AFX_BuyAccessoryDialog_H__4B5E93CF_1DE2_4979_A629_AEBD725ABE65__INCLUDED_
00023 
00024 #include <map>
00025 #include <set>
00026 #include <vector>
00027 #include <weapons/Weapon.h>
00028 #include <GLW/GLWFlag.h>
00029 #include <GLW/GLWWindow.h>
00030 #include <GLW/GLWButton.h>
00031 #include <GLW/GLWPanel.h>
00032 #include <GLW/GLWTab.h>
00033 #include <GLW/GLWCheckBoxText.h>
00034 #include <GLW/GLWDropDownText.h>
00035 
00036 class Tank;
00037 class BuyAccessoryDialog : public GLWWindow,
00038                                                 public GLWButtonI,
00039                                                 public GLWCheckBoxI,
00040                                                 public GLWDropDownI,
00041                                                 public GLWTabI
00042 {
00043 public:
00044         static BuyAccessoryDialog *instance();
00045 
00046         // Inherited from GLWButtonI
00047         virtual void draw();
00048         virtual void buttonDown(unsigned int id);
00049         virtual void display();
00050 
00051         // Inherited from GLWCheckBoxI
00052         virtual void stateChange(bool state, unsigned int id);
00053 
00054         // Inherited from GLWDropDownI
00055         virtual void select(unsigned int id, const int pos, GLWSelectorEntry value);
00056 
00057         // Inherited from GLWTabI
00058         virtual void tabDown(unsigned int id);
00059 
00060         void playerRefreshKeepPos();
00061 
00062 protected:
00063         static BuyAccessoryDialog *instance_;
00064         unsigned int okId_, giftId_;
00065         bool firstDrawTime_;
00066         std::map<std::string, GLWTab *> buyTabs_;
00067         GLWTab *sellTab_;
00068         GLWTab *favouritesTab_;
00069         GLWPanel *topPanel_;
00070         GLWDropDownText *sortDropDown_;
00071         GLWCheckBoxText *defaultTab_;
00072         GLWFlag *flag_;
00073         std::map<unsigned int, Accessory *> sellMap_;
00074         std::map<unsigned int, Accessory *> buyMap_;
00075         std::map<unsigned int, Accessory *> favMap_;
00076         std::set<std::string> favorites_;
00077 
00078         void addTabs();
00079         void loadFavorites();
00080         void saveFavorites();
00081         void playerRefresh();
00082         void addPlayerName();
00083         void addPlayerWeapons();
00084         void addPlayerWeaponsSell();
00085         void addPlayerFavorites();
00086         void addPlayerWeaponsBuy(GLWTab *tab, const char *group);
00087         bool addAccessory(Tank *tank, GLWTab *tab, float height, Accessory *current);
00088 
00089 private:
00090         BuyAccessoryDialog();
00091         virtual ~BuyAccessoryDialog();
00092 };
00093 
00094 #endif // !defined(AFX_BuyAccessoryDialog_H__4B5E93CF_1DE2_4979_A629_AEBD725ABE65__INCLUDED_)

Generated on Mon Feb 16 15:14:37 2009 for Scorched3D by  doxygen 1.5.3