windownewmap.h 1.8 KB

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