ActionPopup.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 **
00004 ** Copyright (C) 2006-2010 The TBT Team.
00005 **
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 **
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 **
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
00015 */
00016 
00017 #ifndef ACTIONPOPUP_HH_
00018 # define ACTIONPOPUP_HH_
00019 
00020 # include "Constants.hh"
00021 # include "Sprite.hh"
00022 # include "VirtualSurface.hh"
00023 
00024 class Api;
00025 
00026 BEGIN_NS(sdlvisu);
00027 
00028 # define POPUP_ITEM_HEIGHT 40
00029 # define POPUP_ITEM_WIDTH 120
00030 
00033 enum eActionsImageIndex {
00034   AII_MOVE = 0,
00035   AII_DUMMYGOFORIT,
00036   AII_BLOCK,
00037   AII_DUMMYGATHER,
00038   AII_PASS,
00039   AII_FOUL,
00040   AII_BLITZ,
00041   AII_DUMMYROLLOVER,
00042   AII_DUMMYGETUP,
00043   AII_TRANSMIT,
00044   AII_THROWTM,
00045   AII_DUMMYLEAP,
00046 
00047   AII_NB
00048 };
00049 
00052 enum eEffortsImageIndex {
00053   EII_MOVE = 0,
00054   EII_GOFORIT,
00055   EII_BLOCK,
00056   EII_GATHER,
00057   EII_THROW,
00058   EII_FOUL,
00059   EII_BLITZ,
00060   EII_ROLLOVER,
00061   EII_STANDUP,
00062   EII_TRANSMIT,
00063   EII_THROWTM,
00064   EII_LEAP,
00065 
00066   EII_NB
00067 };
00068 
00069 class VisuPlayer;
00070 class Game;
00071 
00076 class ActionPopup : public VirtualSurface
00077 {
00078 public:
00079   ActionPopup(Game& g);
00080   virtual ~ActionPopup();
00081 
00082   void prepareActionMenu(VisuPlayer* vp);
00083   void prepareEffortMenu(VisuPlayer* vp);
00084   void clear();
00085 
00086   virtual void show();
00087   virtual void hide();
00088   virtual void setPos(const Point& to);
00089   virtual void update();
00090 
00091 private:
00092   Api*      api_;
00093   Game&     game_;
00094 
00095   VisuPlayer*   vp_;
00096   Sprite    e_sprite_[EII_NB];    
00097   Sprite    e_sprite_on_[EII_NB]; 
00098   Sprite    a_sprite_[AII_NB];    
00099   Sprite    a_sprite_on_[AII_NB]; 
00100   int     displayed_items_[AII_NB + EII_NB]; 
00101   int     displayed_items_nb_;               
00102   bool    is_actions_menu_; 
00103 };
00104 
00105 END_NS(sdlvisu);
00106 
00107 #endif /* !ACTIONPOPUP_HH_ */
Generated on Mon Apr 5 21:17:11 2010 for Stechec/TBT by  doxygen 1.6.3