OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spellicons.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_SPELLICONS_H
2 #define MWGUI_SPELLICONS_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "../mwmechanics/magiceffects.hpp"
8 
9 namespace MyGUI
10 {
11  class Widget;
12  class ImageBox;
13 }
14 namespace ESM
15 {
16  struct ENAMstruct;
17  struct EffectList;
18 }
19 
20 namespace MWGui
21 {
22 
23  // information about a single magic effect source as required for display in the tooltip
25  {
27  : mMagnitude(0)
28  , mRemainingTime(0.f)
29  , mTotalTime(0.f)
30  , mPermanent(false)
31  {}
32  std::string mSource; // display name for effect source (e.g. potion name)
36  float mTotalTime;
37  bool mPermanent; // the effect is permanent
38  };
39 
41  {
42  public:
44 
45  std::map <int, std::vector<MagicEffectInfo> > mEffectSources;
46 
47  virtual ~EffectSourceVisitor() {}
48 
49  virtual void visit (MWMechanics::EffectKey key,
50  const std::string& sourceName, const std::string& sourceId, int casterActorId,
51  float magnitude, float remainingTime = -1, float totalTime = -1);
52  };
53 
54  class SpellIcons
55  {
56  public:
57  void updateWidgets(MyGUI::Widget* parent, bool adjustSize);
58 
59  private:
60 
61  std::map<int, MyGUI::ImageBox*> mWidgetMap;
62  };
63 
64 }
65 
66 #endif
Definition: magiceffects.hpp:73
Definition: spellicons.hpp:24
std::map< int, std::vector< MagicEffectInfo > > mEffectSources
Definition: spellicons.hpp:45
std::string mSource
Definition: spellicons.hpp:32
float mRemainingTime
Definition: spellicons.hpp:35
void updateWidgets(MyGUI::Widget *parent, bool adjustSize)
Definition: spellicons.cpp:44
Definition: spellicons.hpp:54
bool mIsPermanent
Definition: spellicons.hpp:43
bool mPermanent
Definition: spellicons.hpp:37
float mTotalTime
Definition: spellicons.hpp:36
MagicEffectInfo()
Definition: spellicons.hpp:26
Definition: magiceffects.hpp:17
virtual void visit(MWMechanics::EffectKey key, const std::string &sourceName, const std::string &sourceId, int casterActorId, float magnitude, float remainingTime=-1, float totalTime=-1)
Definition: spellicons.cpp:28
MWMechanics::EffectKey mKey
Definition: spellicons.hpp:33
int mMagnitude
Definition: spellicons.hpp:34
virtual ~EffectSourceVisitor()
Definition: spellicons.hpp:47
std::map< int, MyGUI::ImageBox * > mWidgetMap
Definition: spellicons.hpp:61
Definition: spellicons.hpp:40