No Description

mainwindow.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QString>
  4. #include <QModelIndex>
  5. #include <QMainWindow>
  6. #include <QStandardItemModel>
  7. #include <QGraphicsPixmapItem>
  8. #include <QGraphicsItemGroup>
  9. #include <QGraphicsSceneMouseEvent>
  10. #include <QAbstractItemModel>
  11. #include "project.h"
  12. #include "map.h"
  13. #include "editor.h"
  14. namespace Ui {
  15. class MainWindow;
  16. }
  17. class MainWindow : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit MainWindow(QWidget *parent = 0);
  22. ~MainWindow();
  23. public slots:
  24. void setStatusBarMessage(QString message, int timeout = 0);
  25. private slots:
  26. void on_action_Open_Project_triggered();
  27. void on_mapList_activated(const QModelIndex &index);
  28. void on_action_Save_Project_triggered();
  29. void undo();
  30. void redo();
  31. void onLoadMapRequested(QString, QString);
  32. void onMapChanged(Map *map);
  33. void on_action_Save_triggered();
  34. void on_tabWidget_2_currentChanged(int index);
  35. void on_action_Exit_triggered();
  36. void on_comboBox_Song_activated(const QString &arg1);
  37. void on_comboBox_Location_activated(const QString &arg1);
  38. void on_comboBox_Visibility_activated(const QString &arg1);
  39. void on_comboBox_Weather_activated(const QString &arg1);
  40. void on_comboBox_Type_activated(const QString &arg1);
  41. void on_comboBox_BattleScene_activated(const QString &arg1);
  42. void on_checkBox_ShowLocation_clicked(bool checked);
  43. void on_tabWidget_currentChanged(int index);
  44. void on_actionUndo_triggered();
  45. void on_actionRedo_triggered();
  46. void on_toolButton_deleteObject_clicked();
  47. void addNewEvent(QString);
  48. void updateSelectedObjects();
  49. void on_toolButton_Paint_clicked();
  50. void on_toolButton_Select_clicked();
  51. void on_toolButton_Fill_clicked();
  52. void on_toolButton_Dropper_clicked();
  53. void onOpenMapListContextMenu(const QPoint &point);
  54. void onAddNewMapToGroupClick(QAction* triggeredAction);
  55. void onTilesetChanged(QString);
  56. void on_action_Export_Map_Image_triggered();
  57. void on_comboBox_ConnectionDirection_currentIndexChanged(const QString &arg1);
  58. void on_spinBox_ConnectionOffset_valueChanged(int offset);
  59. void on_comboBox_ConnectedMap_currentTextChanged(const QString &mapName);
  60. void on_pushButton_AddConnection_clicked();
  61. void on_pushButton_RemoveConnection_clicked();
  62. void on_comboBox_DiveMap_currentTextChanged(const QString &mapName);
  63. void on_comboBox_EmergeMap_currentTextChanged(const QString &mapName);
  64. void on_comboBox_PrimaryTileset_activated(const QString &arg1);
  65. void on_comboBox_SecondaryTileset_activated(const QString &arg1);
  66. private:
  67. Ui::MainWindow *ui;
  68. QStandardItemModel *mapListModel;
  69. QList<QStandardItem*> *mapGroupsModel;
  70. Editor *editor = NULL;
  71. QIcon* mapIcon;
  72. void setMap(QString);
  73. void loadDataStructures();
  74. void populateMapList();
  75. QString getExistingDirectory(QString);
  76. void openProject(QString dir);
  77. QString getDefaultMap();
  78. void setRecentMap(QString map_name);
  79. QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
  80. void markAllEdited(QAbstractItemModel *model);
  81. void markEdited(QModelIndex index);
  82. void updateMapList();
  83. void displayMapProperties();
  84. void checkToolButtons();
  85. };
  86. enum MapListUserRoles {
  87. GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
  88. TypeRole = Qt::UserRole + 2, // Used to differentiate between the different layers of the map list tree view.
  89. };
  90. #endif // MAINWINDOW_H