RandomMapTab.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * RandomMapTab.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 "CSelectionBase.h"
  12. #include "../../lib/FunctionList.h"
  13. #include "../../lib/GameConstants.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. class CMapGenOptions;
  16. VCMI_LIB_NAMESPACE_END
  17. class CToggleButton;
  18. class CLabel;
  19. class CLabelGroup;
  20. class RandomMapTab : public CIntObject
  21. {
  22. public:
  23. RandomMapTab();
  24. void updateMapInfoByHost();
  25. void setMapGenOptions(std::shared_ptr<CMapGenOptions> opts);
  26. CFunctionList<void(std::shared_ptr<CMapInfo>, std::shared_ptr<CMapGenOptions>)> mapInfoChanged;
  27. private:
  28. void addButtonsWithRandToGroup(CToggleGroup * group, const std::vector<std::string> & defs, int startIndex, int endIndex, int btnWidth, int helpStartIndex, int helpRandIndex, int randIndex = -1, bool animIdfromBtnId = true) const;
  29. void addButtonsToGroup(CToggleGroup * group, const std::vector<std::string> & defs, int startIndex, int endIndex, int btnWidth, int helpStartIndex, bool animIdfromBtnId = true) const;
  30. void deactivateButtonsFrom(CToggleGroup * group, int startId);
  31. void validatePlayersCnt(int playersCnt);
  32. void validateCompOnlyPlayersCnt(int compOnlyPlayersCnt);
  33. std::vector<int> getPossibleMapSizes();
  34. std::shared_ptr<CPicture> background;
  35. std::shared_ptr<CLabel> labelHeadlineBig;
  36. std::shared_ptr<CLabel> labelHeadlineSmall;
  37. std::shared_ptr<CLabel> labelMapSize;
  38. std::shared_ptr<CToggleGroup> groupMapSize;
  39. std::shared_ptr<CToggleButton> buttonTwoLevels;
  40. std::shared_ptr<CLabelGroup> labelGroupForOptions;
  41. std::shared_ptr<CToggleGroup> groupMaxPlayers;
  42. std::shared_ptr<CToggleGroup> groupMaxTeams;
  43. std::shared_ptr<CToggleGroup> groupCompOnlyPlayers;
  44. std::shared_ptr<CToggleGroup> groupCompOnlyTeams;
  45. std::shared_ptr<CToggleGroup> groupWaterContent;
  46. std::shared_ptr<CToggleGroup> groupMonsterStrength;
  47. std::shared_ptr<CButton> buttonShowRandomMaps;
  48. std::shared_ptr<CMapGenOptions> mapGenOptions;
  49. std::shared_ptr<CMapInfo> mapInfo;
  50. };