QuickSpellPanel.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * QuickSpellPanel.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../gui/CIntObject.h"
  12. class CFilledTexture;
  13. class TransparentFilledRectangle;
  14. class CButton;
  15. class CLabel;
  16. class BattleInterface;
  17. class QuickSpellPanel : public CIntObject
  18. {
  19. private:
  20. std::shared_ptr<CFilledTexture> background;
  21. std::shared_ptr<TransparentFilledRectangle> rect;
  22. std::vector<std::shared_ptr<CButton>> buttons;
  23. std::vector<std::shared_ptr<TransparentFilledRectangle>> buttonsIsAutoGenerated;
  24. std::vector<std::shared_ptr<TransparentFilledRectangle>> buttonsDisabled;
  25. std::vector<std::shared_ptr<CLabel>> labels;
  26. BattleInterface & owner;
  27. public:
  28. static constexpr int QUICKSPELL_SLOTS = 12;
  29. bool isEnabled; // isActive() is not working on multiple conditions, because of this we need a seperate flag
  30. QuickSpellPanel(BattleInterface & owner);
  31. void create();
  32. std::vector<std::tuple<SpellID, bool>> getSpells() const;
  33. void show(Canvas & to) override;
  34. void inputModeChanged(InputMode modi) override;
  35. };