menu.h

Go to the documentation of this file.
00001 
00002 //            Copyright (C) 2004-2007 by The Allacrost Project
00003 //                         All Rights Reserved
00004 //
00005 // This code is licensed under the GNU GPL version 2. It is free software 
00006 // and you may modify it and/or redistribute it under the terms of this license.
00007 // See http://www.gnu.org/copyleft/gpl.html for details.
00009 
00021 #ifndef __MENU_HEADER__
00022 #define __MENU_HEADER__
00023 
00024 #include <string>
00025 #include <vector>
00026 
00027 #include "utils.h"
00028 #include "defs.h"
00029 
00030 #include "video.h"
00031 #include "gui.h"
00032 #include "mode_manager.h"
00033 #include "global.h"
00034 
00035 #include "menu_views.h"
00036 
00038 namespace hoa_menu {
00039 
00041 extern bool MENU_DEBUG;
00042 
00044 namespace private_menu {
00045 
00047 
00048 const uint32 MAIN_INVENTORY      = 0;
00049 const uint32 MAIN_SKILLS         = 1;
00050 const uint32 MAIN_EQUIP          = 2;
00051 const uint32 MAIN_STATUS         = 3;
00052 // const uint32 MAIN_OPTIONS        = 3;
00053 const uint32 MAIN_SAVE           = 4;
00054 // const uint32 MAIN_FORMATION      = 4;
00055 const uint32 MAIN_EXIT           = 5;
00056 const uint32 MAIN_SIZE           = 6;
00058 
00060 
00061 const uint32 INV_USE    = 0;
00062 const uint32 INV_SORT   = 1;
00063 const uint32 INV_BACK   = 2;
00064 const uint32 INV_SIZE   = 3;
00066 
00068 
00069 const uint32 SKILLS_USE     = 0;
00070 const uint32 SKILLS_BACK    = 1;
00071 const uint32 SKILLS_SIZE    = 2;
00073 
00075 
00076 const uint32 EQUIP_EQUIP   = 0;
00077 const uint32 EQUIP_REMOVE  = 1;
00078 const uint32 EQUIP_BACK    = 2;
00079 const uint32 EQUIP_SIZE    = 3;
00081 
00083 
00084 const uint32 STATUS_VIEW    = 0;
00085 const uint32 STATUS_BACK    = 1;
00086 const uint32 STATUS_SIZE    = 2;
00088 
00090 
00091 const uint32 FORMATION_SWITCH  = 0;
00092 const uint32 FORMATION_BACK    = 1;
00093 const uint32 FORMATION_SIZE    = 2;
00095 
00097 
00098 const uint32 OPTIONS_EDIT    = 0;
00099 const uint32 OPTIONS_SAVE    = 1;
00100 const uint32 OPTIONS_BACK    = 2;
00101 const uint32 OPTIONS_SIZE    = 3;
00103 
00105 
00106 const uint32 SAVE_SAVE    = 0;
00107 const uint32 SAVE_BACK    = 1;
00108 const uint32 SAVE_SIZE    = 2;
00110 
00113 
00114 const uint32 SHOW_MAIN          = 0;
00115 const uint32 SHOW_INVENTORY     = 1;
00116 const uint32 SHOW_SKILLS        = 2;
00117 const uint32 SHOW_EQUIP         = 3;
00118 const uint32 SHOW_STATUS        = 4;
00119 //const uint32 SHOW_OPTIONS       = 5;
00120 const uint32 SHOW_SAVE          = 111;
00121 const uint32 SHOW_FORMATION     = 5;
00122 const uint32 SHOW_EXIT          = 6;
00124 
00129 const uint32 WINDOW_INVENTORY      = 1;
00130 const uint32 WINDOW_SKILLS         = 2;
00131 const uint32 WINDOW_STATUS         = 3;
00132 const uint32 WINDOW_EQUIP          = 4;
00133 const uint32 WINDOW_FORMATION      = 5;
00135 
00136 } // namespace private_menu
00137 
00150 class MenuMode : public hoa_mode_manager::GameMode {
00151   friend class private_menu::CharacterWindow;
00152 //  friend class private_menu::MiniCharacterSelectWindow;
00153   friend class private_menu::InventoryWindow;
00154   friend class private_menu::StatusWindow;
00155   friend class private_menu::SkillsWindow;
00156   friend class private_menu::EquipWindow;
00157   friend class private_menu::FormationWindow;
00158 
00159 public:
00163   MenuMode(hoa_utils::ustring locale_name, std::string locale_image);
00164 
00165   ~MenuMode();
00166 
00168   void Reset();
00169   
00171   void Update();
00172   
00174   void Draw();
00175 
00176 private:
00178   static MenuMode* _instance;
00179 
00181   hoa_utils::ustring _locale_name;
00182 
00186   hoa_video::StillImage _locale_graphic;
00187 
00191   hoa_video::StillImage _saved_screen;
00192 
00197   hoa_video::MenuWindow _bottom_window;
00198   hoa_video::MenuWindow _main_options_window;
00199 
00200   private_menu::CharacterWindow _character_window0;
00201   private_menu::CharacterWindow _character_window1;
00202   private_menu::CharacterWindow _character_window2;
00203   private_menu::CharacterWindow _character_window3;
00204   private_menu::InventoryWindow _inventory_window;
00205   private_menu::StatusWindow _status_window;
00206   private_menu::SkillsWindow _skills_window;
00207   private_menu::EquipWindow _equip_window;
00208   private_menu::FormationWindow _formation_window;
00209 
00210   // FIXME
00211   //std::vector<private_menu::CharacterWindow> _character_windows;
00212   //std::vector<private_menu::FormationWindow> _formation_windows;
00214 
00216   std::map<std::string, hoa_audio::SoundDescriptor> _menu_sounds;
00217   
00219   uint32 _char_selected;
00220   
00222   uint32 _item_selected;
00223     
00225   uint32 _current_menu_showing;
00226 
00228   uint32 _current_window;
00229 
00231   hoa_video::OptionBox *_current_menu;
00232   
00234   hoa_video::OptionBox _main_options;
00235 
00237 
00238   hoa_video::OptionBox _menu_inventory;
00239   hoa_video::OptionBox _menu_skills;
00240   hoa_video::OptionBox _menu_status;
00241   hoa_video::OptionBox _menu_options;
00242   hoa_video::OptionBox _menu_save;
00243   hoa_video::OptionBox _menu_equip;
00245   
00247 
00248   void _SetupOptionBoxCommonSettings(hoa_video::OptionBox *ob);
00249   void _SetupMainOptionBox();
00250   void _SetupInventoryOptionBox();
00251   void _SetupSkillsOptionBox();
00252   void _SetupStatusOptionBox();
00253   void _SetupOptionsOptionBox();
00254   void _SetupSaveOptionBox();
00255   void _SetupEquipOptionBox();
00257 
00262   void _HandleMainMenu();
00263   void _HandleInventoryMenu();
00264   void _HandleSkillsMenu();
00265   void _HandleStatusMenu();
00266   void _HandleOptionsMenu();
00267   void _HandleSaveMenu();
00268   void _HandleEquipMenu();
00270 
00272   void _DrawBottomMenu();
00273   
00275   void _DrawItemListHeader();
00276   
00277 }; // class MenuMode : public hoa_mode_manager::GameMode
00278 
00279 } // namespace hoa_menu
00280 
00281 #endif

Generated on Fri Jul 6 23:11:18 2007 for Hero of Allacrost by  doxygen 1.5.1