Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
mapwindowoverlay.hpp
1 //////////////////////////////
2 //
3 // File: lxs/game/mapwindowoverlay.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Oct 12 2013
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __LXS_MAPWINDOWOV__
15 #define __LXS_MAPWINDOWOV__
16 #include <deque>
17 #include "lxs/windowing/containerwindow.hpp"
18 namespace LxS
19 {
20  namespace CoreGraphics
21  {
22  class Font;
23  class Circle;
24  }
25  namespace Windowing
26  {
27  class Button;
28  class ProgressBar;
29  }
30  namespace Game
31  {
32  class Map;
33  class DialogueLine;
34  //!Current status (HUD) of game (HP, battle mode results etc.)
36  {
37  LxS::CoreGraphics::Font * testfont;// to check width of strings for purposes of alignment
38  struct charstatus
39  {
40  Character * assoc_chara;
41  LxS::CoreGraphics::Font * events;
43  charstatus(Character * _assoc_chara);
44  ~charstatus();
45  };
46  charstatus * protag_status;
47  charstatus * enemy_status;
48  LxS::CoreGraphics::Font * statusline;
49  std::deque<LxS::Windowing::ProgressBar* > action_queue;
50  std::deque<LxS::Windowing::Button*>possible_actions;
51  void ResolveAction(LxS::Windowing::Button * b);
52  bool actionlistattached;
53  Map * currentMap;
54  LxS::Windowing::Button * a_potion;
55  LxS::Windowing::Button * a_attack;
56  LxS::Windowing::Button * a_escape;
57  float time_last_up;
58  void ArrangeButtons();
59  void SetActiveActions();
60  public:
61  //! enumeration of causes for message. Used in color parameter of AddMessage i.e. (each of these presets has colour associated with it)
62  enum
63  {
64  ProtagWounded,
65  EnemyWounded,
66  ProtagHealed
67  };
68  //! default ctor. Need to SetCurrentMap before initializing
70  //! clear dialogs
71  void ClearTalkMode();
72 
73  //! start talk mode - display greetings message from an NPC
74  void InitiateTalk();
75 
76  //! Display dialogue options
77  void TalkToNPC();
78 
79  //! display sentence said by an NPC
80  void MakeNPCTalk();
81 
82  /*!
83  * \brief Associate Map object with this overlay object
84  * \param _currentMap a map object for which this overlay is used
85  */
86  void SetCurrentMap(Map * _currentMap)
87  {
88  currentMap=_currentMap;
89  }
90  //! handle window resize (rearrange contents
91  void ResizeHandler();
92  //! report something (i.e. that enemy was wounded)
93  void AddMessage(std::string msg, int color);
94  //! reset (clear) all displayed messages
95  void Reset();
96  void UnloadResources();
97  /*!
98  * \brief set progress of current action
99  * \param p progress [0-1]
100  */
101  void SetCurrentActionProgress(float p);
102  /*!
103  * \brief drop current progressbar
104  */
106  //! clear sequence of progressbar. (i.e. upon leaving battlemode)
108  //! add progressbar (i.e. upon entering battlemode)
109  void AddActionProgress(const std::string & _text);
110  void Render(Rendermode mode);
111  void Animate(float dt);
112  void Initialize();
113 
114  ~MapWindowOverlay();
115  };
116  }
117 }
118 #endif