CSpellWindow.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include "../global.h"
  3. #include "../CPlayerInterface.h"
  4. struct SDL_Surface;
  5. class CDefHandler;
  6. struct SDL_Rect;
  7. class CGHeroInstance;
  8. class SpellbookInteractiveArea : public ClickableL, public ClickableR, public Hoverable
  9. {
  10. private:
  11. boost::function<void()> onLeft;
  12. std::string textOnRclick;
  13. boost::function<void()> onHoverOn;
  14. boost::function<void()> onHoverOff;
  15. public:
  16. void clickLeft(boost::logic::tribool down);
  17. void clickRight(boost::logic::tribool down);
  18. void hover(bool on);
  19. void activate();
  20. void deactivate();
  21. SpellbookInteractiveArea(SDL_Rect & myRect, boost::function<void()> funcL, std::string textR, boost::function<void()> funcHon, boost::function<void()> funcHoff);//c-tor
  22. };
  23. class CSpellWindow : public IShowActivable, public CIntObject
  24. {
  25. private:
  26. SDL_Surface * background, * leftCorner, * rightCorner;
  27. CDefHandler * spells, //pictures of spells
  28. * spellTab, //school select
  29. * schools, //schools' pictures
  30. * schoolW, * schoolE, * schoolF, * schoolA; //schools' 'borders'
  31. SpellbookInteractiveArea * exitBtn, * battleSpells, * adventureSpells, * manaPoints;
  32. SpellbookInteractiveArea * selectSpellsA, * selectSpellsE, * selectSpellsF, * selectSpellsW, * selectSpellsAll;
  33. CStatusBar * statusBar;
  34. Uint8 selectedTab; // 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic, 4 - all schools
  35. public:
  36. CSpellWindow(const SDL_Rect & myRect, const CGHeroInstance * myHero); //c-tor
  37. ~CSpellWindow(); //d-tor
  38. void fexitb();
  39. void fadvSpellsb();
  40. void fbattleSpellsb();
  41. void fmanaPtsb();
  42. void fspellsAb();
  43. void fspellsEb();
  44. void fspellsFb();
  45. void fspellsWb();
  46. void fspellsAllb();
  47. void activate();
  48. void deactivate();
  49. void show(SDL_Surface * to = NULL);
  50. };