battle_windows.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 and
00006 // 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 
00022 #ifndef __BATTLE_WINDOWS_HEADER__
00023 #define __BATTLE_WINDOWS_HEADER__
00024 
00025 #include "utils.h"
00026 #include "defs.h"
00027 
00028 #include "video.h"
00029 #include "global.h"
00030 
00031 
00032 #include "battle_actors.h"
00033 
00034 namespace hoa_battle {
00035 
00036 namespace private_battle {
00037 
00043 enum ACTION_WINDOW_VIEWS {
00044   VIEW_INVALID = -1,
00045   VIEW_ACTION_CATEGORY = 0,
00046   VIEW_ACTION_SELECTION = 1,
00047   VIEW_TARGET_SELECTION = 2,
00048   VIEW_ACTION_INFORMATION = 3,
00049   VIEW_TOTAL = 4
00050 };
00051 
00057 enum FINISH_WINDOW_VIEWS {
00058   FINISH_INVALID = -1,
00059   FINISH_ANNOUNCE_WIN = 0,
00060   FINISH_ANNOUNCE_LOSE = 1,
00061   FINISH_TOTAL = 2
00062 };
00063 
00101 class ActionWindow : public hoa_video::MenuWindow {
00102   friend class BattleMode;
00103 public:
00104   ActionWindow();
00105 
00106   ~ActionWindow();
00107 
00112   void Initialize(BattleCharacterActor* character);
00113 
00118   void Reset();
00119 
00121   void Update();
00122 
00124   void Draw();
00125 
00127 
00128   ACTION_WINDOW_VIEWS GetState() const
00129     { return _state; }
00130 
00131   uint32 GetActionCategory() const
00132     { return _selected_action_category; }
00133 
00134   hoa_global::GLOBAL_TARGET GetActionTargetType() const
00135     { return _action_target_type; }
00136 
00137   bool IsActionTargetAlly() const
00138     { return _action_target_ally; }
00139 
00140   hoa_global::GlobalSkill* GetSelectedSkill() const
00141     { return _skill_list->at(_selected_action); }
00142 
00143   hoa_global::GlobalItem* GetSelectedItem() const
00144     { return _item_list[_selected_action]; }
00146 private:
00148   ACTION_WINDOW_VIEWS _state;
00149 
00151   BattleCharacterActor* _character;
00152 
00156   uint32 _selected_action_category;
00157 
00159   uint32 _selected_action;
00160 
00162   hoa_global::GLOBAL_TARGET _action_target_type;
00163 
00165   bool _action_target_ally;
00166 
00173   std::vector<hoa_global::GlobalItem*> _item_list;
00174 
00180   std::vector<hoa_global::GlobalSkill*>* _skill_list;
00181 
00186   hoa_video::OptionBox _action_category_list;
00187 
00189   hoa_video::OptionBox _action_selection_list;
00190 
00192   std::vector<hoa_video::StillImage> _action_category_icons;
00193 
00194   // TODO: implement when rendered text system is more mature
00195 /*
00196   / ** \brief A string of text which serves as a list header for the action selection screen
00197   *** This pointer is set to either _skill_selection_header or _item_selection_header
00198   ** /
00199   hoa_video::RenderedString* _action_selection_header;
00200 
00202   hoa_video::RenderedString* _skill_selection_header;
00203 
00205   hoa_video::RenderedString* _item_selection_header;
00206 */
00207 
00209   void _UpdateActionCategory();
00210 
00212   void _UpdateActionSelection();
00213 
00215   void _UpdateTargetSelection();
00216 
00218   void _UpdateActionInformation();
00219 
00221   void _DrawActionCategory();
00222 
00224   void _DrawActionSelection();
00225 
00227   void _DrawTargetSelection();
00228 
00230   void _DrawActionInformation();
00231 
00233   void _ConstructActionSelectionList();
00234 }; // class ActionWindow : public hoa_video::MenuWindow
00235 
00258 class FinishWindow : public hoa_video::MenuWindow {
00259   friend class BattleMode;
00260 public:
00261   FinishWindow();
00262 
00263   ~FinishWindow();
00264 
00268   void Initialize(bool victory);
00269 
00271   void Update();
00272 
00274   void Draw();
00275 
00276   FINISH_WINDOW_VIEWS GetState() const
00277     { return _state; }
00278 
00279 private:
00281   FINISH_WINDOW_VIEWS _state;
00282 
00284 //  hoa_video::RenderedText* _finish_status;
00285 
00287   hoa_video::OptionBox _lose_options;
00288 }; // class FinishWindow : public hoa_video:MenuWindow
00289 
00290 } // namespace private_battle
00291 
00292 } // namespace hoa_battle
00293 
00294 #endif // __BATTLE_WINDOWS_HEADER__

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