BattleControlPanel.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * CBattleControlPanel.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. VCMI_LIB_NAMESPACE_BEGIN
  13. class CStack;
  14. VCMI_LIB_NAMESPACE_END
  15. class CButton;
  16. class BattleInterface;
  17. class BattleConsole;
  18. class BattleControlPanel : public CIntObject
  19. {
  20. BattleInterface * owner;
  21. std::shared_ptr<CPicture> menu;
  22. std::shared_ptr<CButton> bOptions;
  23. std::shared_ptr<CButton> bSurrender;
  24. std::shared_ptr<CButton> bFlee;
  25. std::shared_ptr<CButton> bAutofight;
  26. std::shared_ptr<CButton> bSpell;
  27. std::shared_ptr<CButton> bWait;
  28. std::shared_ptr<CButton> bDefence;
  29. std::shared_ptr<CButton> bConsoleUp;
  30. std::shared_ptr<CButton> bConsoleDown;
  31. std::shared_ptr<CButton> btactNext;
  32. std::shared_ptr<CButton> btactEnd;
  33. //button handle funcs:
  34. void bOptionsf();
  35. void bSurrenderf();
  36. void bFleef();
  37. void bAutofightf();
  38. void bSpellf();
  39. void bWaitf();
  40. void bDefencef();
  41. void bConsoleUpf();
  42. void bConsoleDownf();
  43. void bTacticNextStack();
  44. void bTacticPhaseEnd();
  45. void reallyFlee(); //performs fleeing without asking player
  46. void reallySurrender(); //performs surrendering without asking player
  47. public:
  48. std::shared_ptr<BattleConsole> console;
  49. // block all UI elements, e.g. during enemy turn
  50. // unlike activate/deactivate this method will correctly grey-out all elements
  51. void blockUI(bool on);
  52. void show(SDL_Surface * to) override;
  53. void showAll(SDL_Surface * to) override;
  54. void tacticPhaseStarted();
  55. void tacticPhaseEnded();
  56. BattleControlPanel(BattleInterface * owner, const Point & position);
  57. };