windownewmap.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 newMapHumanTeams = "NewMapWindow/HumanTeams"; //map index
  27. const QString newMapCpuTeams = "NewMapWindow/CpuTeams"; //map index
  28. const QString newMapWaterContent = "NewMapWindow/WaterContent";
  29. const QString newMapMonsterStrength = "NewMapWindow/MonsterStrength";
  30. const QString newMapTemplate = "NewMapWindow/Template";
  31. const QString randomString = "Random";
  32. const std::map<int, int> players
  33. {
  34. {0, CMapGenOptions::RANDOM_SIZE},
  35. {1, 1},
  36. {2, 2},
  37. {3, 3},
  38. {4, 4},
  39. {5, 5},
  40. {6, 6},
  41. {7, 7},
  42. {8, 8}
  43. };
  44. const std::map<int, int> cpuPlayers
  45. {
  46. {0, CMapGenOptions::RANDOM_SIZE},
  47. {1, 0},
  48. {2, 1},
  49. {3, 2},
  50. {4, 3},
  51. {5, 4},
  52. {6, 5},
  53. {7, 6},
  54. {8, 7}
  55. };
  56. const std::map<int, std::pair<int, int>> mapSizes
  57. {
  58. {0, {36, 36}},
  59. {1, {72, 72}},
  60. {2, {108, 108}},
  61. {3, {144, 144}},
  62. };
  63. public:
  64. explicit WindowNewMap(QWidget *parent = nullptr);
  65. ~WindowNewMap();
  66. private slots:
  67. void on_cancelButton_clicked();
  68. void on_okButton_clicked();
  69. void on_sizeCombo_activated(int index);
  70. void on_twoLevelCheck_stateChanged(int arg1);
  71. void on_humanCombo_activated(int index);
  72. void on_cpuCombo_activated(int index);
  73. void on_randomMapCheck_stateChanged(int arg1);
  74. void on_templateCombo_activated(int index);
  75. void on_widthTxt_textChanged(const QString &arg1);
  76. void on_heightTxt_textChanged(const QString &arg1);
  77. void on_checkSeed_toggled(bool checked);
  78. void on_humanTeamsCombo_activated(int index);
  79. void on_cpuTeamsCombo_activated(int index);
  80. private:
  81. void updateTemplateList();
  82. void loadUserSettings();
  83. void saveUserSettings();
  84. private:
  85. Ui::WindowNewMap *ui;
  86. CMapGenOptions mapGenOptions;
  87. bool randomMap = false;
  88. };