RandomMapTab.h 2.0 KB

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