windownewmap.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * windownewmap.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 <QDialog>
  12. #include "../lib/rmg/CMapGenOptions.h"
  13. namespace Ui
  14. {
  15. class WindowNewMap;
  16. }
  17. class WindowNewMap : public QDialog
  18. {
  19. Q_OBJECT
  20. const QString newMapWidth = "NewMapWindow/Width";
  21. const QString newMapHeight = "NewMapWindow/Height";
  22. const QString newMapTwoLevel = "NewMapWindow/TwoLevel";
  23. const QString newMapGenerateRandom = "NewMapWindow/GenerateRandom";
  24. const QString newMapPlayers = "NewMapWindow/Players"; //map index
  25. const QString newMapCpuPlayers = "NewMapWindow/CpuPlayers"; //map index
  26. const QString newMapWaterContent = "NewMapWindow/WaterContent";
  27. const QString newMapMonsterStrength = "NewMapWindow/MonsterStrength";
  28. const QString newMapTemplate = "NewMapWindow/Template";
  29. const int playerLimit = 8;
  30. const std::map<int, int> players
  31. {
  32. {0, CMapGenOptions::RANDOM_SIZE},
  33. {1, 1},
  34. {2, 2},
  35. {3, 3},
  36. {4, 4},
  37. {5, 5},
  38. {6, 6},
  39. {7, 7},
  40. {8, 8}
  41. };
  42. const std::map<int, int> cpuPlayers
  43. {
  44. {0, CMapGenOptions::RANDOM_SIZE},
  45. {1, 0},
  46. {2, 1},
  47. {3, 2},
  48. {4, 3},
  49. {5, 4},
  50. {6, 5},
  51. {7, 6},
  52. {8, 7}
  53. };
  54. public:
  55. explicit WindowNewMap(QWidget *parent = nullptr);
  56. ~WindowNewMap();
  57. private slots:
  58. void on_cancelButton_clicked();
  59. void on_okButton_clicked();
  60. void on_sizeCombo_activated(int index);
  61. void on_twoLevelCheck_stateChanged(int arg1);
  62. void on_humanCombo_activated(int index);
  63. void on_cpuCombo_activated(int index);
  64. void on_randomMapCheck_stateChanged(int arg1);
  65. void on_templateCombo_activated(int index);
  66. void on_widthTxt_textChanged(const QString &arg1);
  67. void on_heightTxt_textChanged(const QString &arg1);
  68. void on_checkSeed_toggled(bool checked);
  69. private:
  70. void updateTemplateList();
  71. void loadUserSettings();
  72. void saveUserSettings();
  73. private:
  74. Ui::WindowNewMap *ui;
  75. CMapGenOptions mapGenOptions;
  76. bool randomMap = false;
  77. };