windownewmap.h 1.9 KB

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