porymap/mainwindow.h

101 lines
2.7 KiB
C
Raw Normal View History

2016-09-07 04:50:47 +01:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QString>
#include <QModelIndex>
#include <QMainWindow>
#include <QStandardItemModel>
2016-09-07 04:50:47 +01:00
#include <QGraphicsPixmapItem>
#include <QGraphicsItemGroup>
#include <QGraphicsSceneMouseEvent>
#include <QAbstractItemModel>
#include "project.h"
#include "map.h"
#include "editor.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_action_Open_Project_triggered();
void on_mapList_activated(const QModelIndex &index);
void on_action_Save_Project_triggered();
void undo();
void redo();
2017-11-28 04:46:27 +00:00
void onMapChanged(Map *map);
2016-09-07 04:50:47 +01:00
void on_action_Save_triggered();
void on_tabWidget_2_currentChanged(int index);
void on_action_Exit_triggered();
void on_comboBox_Song_activated(const QString &arg1);
void on_comboBox_Location_activated(const QString &arg1);
void on_comboBox_Visibility_activated(const QString &arg1);
void on_comboBox_Weather_activated(const QString &arg1);
void on_comboBox_Type_activated(const QString &arg1);
void on_comboBox_BattleScene_activated(const QString &arg1);
void on_checkBox_ShowLocation_clicked(bool checked);
void on_tabWidget_currentChanged(int index);
void on_actionUndo_triggered();
void on_actionRedo_triggered();
2017-11-28 04:46:27 +00:00
void on_toolButton_newObject_clicked();
void on_toolButton_deleteObject_clicked();
void updateSelectedObjects();
void on_toolButton_Paint_clicked();
void on_toolButton_Select_clicked();
void on_toolButton_Fill_clicked();
void on_toolButton_Dropper_clicked();
void onOpenMapListContextMenu(const QPoint &point);
void onAddNewMapToGroupClick(QAction* triggeredAction);
2016-09-07 04:50:47 +01:00
private:
Ui::MainWindow *ui;
QStandardItemModel *mapListModel;
QList<QStandardItem*> *mapGroupsModel;
2017-11-28 04:46:27 +00:00
Editor *editor = NULL;
QIcon* mapIcon;
2016-09-07 04:50:47 +01:00
void setMap(QString);
2018-02-16 02:38:19 +00:00
void loadDataStructures();
2016-09-07 04:50:47 +01:00
void populateMapList();
QString getExistingDirectory(QString);
void openProject(QString dir);
QString getDefaultMap();
void setRecentMap(QString map_name);
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
2016-09-07 04:50:47 +01:00
void markAllEdited(QAbstractItemModel *model);
void markEdited(QModelIndex index);
void updateMapList();
void displayMapProperties();
2017-11-28 04:46:27 +00:00
void checkToolButtons();
2016-09-07 04:50:47 +01:00
};
enum MapListUserRoles {
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
2018-02-18 18:32:30 +00:00
TypeRole = Qt::UserRole + 2, // Used to differentiate between the different layers of the map list tree view.
};
2016-09-07 04:50:47 +01:00
#endif // MAINWINDOW_H