RandomMapTab.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include "../../lib/rmg/CRmgTemplate.h"
  15. #include "../gui/InterfaceObjectConfigurable.h"
  16. VCMI_LIB_NAMESPACE_BEGIN
  17. class CMapGenOptions;
  18. VCMI_LIB_NAMESPACE_END
  19. class CToggleButton;
  20. class CLabel;
  21. class CLabelGroup;
  22. class CSlider;
  23. class CPicture;
  24. class RandomMapTab : public InterfaceObjectConfigurable
  25. {
  26. public:
  27. RandomMapTab();
  28. void updateMapInfoByHost();
  29. void setMapGenOptions(std::shared_ptr<CMapGenOptions> opts);
  30. void setTemplate(const CRmgTemplate *);
  31. CMapGenOptions & obtainMapGenOptions() {return *mapGenOptions;}
  32. CFunctionList<void(std::shared_ptr<CMapInfo>, std::shared_ptr<CMapGenOptions>)> mapInfoChanged;
  33. private:
  34. void deactivateButtonsFrom(CToggleGroup & group, const std::set<int> & allowed);
  35. std::vector<int> getPossibleMapSizes();
  36. std::shared_ptr<CMapGenOptions> mapGenOptions;
  37. std::shared_ptr<CMapInfo> mapInfo;
  38. //options allowed - need to store as impact each other
  39. std::set<int> playerCountAllowed, playerTeamsAllowed, compCountAllowed, compTeamsAllowed;
  40. };
  41. class TeamAlignmentsWidget: public InterfaceObjectConfigurable
  42. {
  43. public:
  44. TeamAlignmentsWidget(RandomMapTab & randomMapTab);
  45. private:
  46. std::shared_ptr<CFilledTexture> background;
  47. std::shared_ptr<CLabelGroup> labels;
  48. std::shared_ptr<CButton> buttonOk, buttonCancel;
  49. std::vector<std::shared_ptr<CToggleGroup>> players;
  50. std::vector<std::shared_ptr<CIntObject>> placeholders;
  51. };