2020-09-13 23:37:55 +01:00
|
|
|
#pragma once
|
2018-09-27 00:33:08 +01:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QModelIndex>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
#include <QGraphicsPixmapItem>
|
|
|
|
#include <QGraphicsItemGroup>
|
|
|
|
#include <QGraphicsSceneMouseEvent>
|
2019-01-06 18:53:31 +00:00
|
|
|
#include <QCloseEvent>
|
2018-09-27 00:33:08 +01:00
|
|
|
#include <QAbstractItemModel>
|
2020-04-30 02:41:19 +01:00
|
|
|
#include <QJSValue>
|
2018-09-27 00:33:08 +01:00
|
|
|
#include "project.h"
|
2021-04-14 06:08:18 +01:00
|
|
|
#include "orderedjson.h"
|
2018-12-21 15:25:28 +00:00
|
|
|
#include "config.h"
|
2018-09-27 00:33:08 +01:00
|
|
|
#include "map.h"
|
|
|
|
#include "editor.h"
|
2018-09-29 20:13:07 +01:00
|
|
|
#include "tileseteditor.h"
|
2019-01-07 19:46:27 +00:00
|
|
|
#include "regionmapeditor.h"
|
2019-05-21 03:08:04 +01:00
|
|
|
#include "mapimageexporter.h"
|
2018-10-05 07:02:40 +01:00
|
|
|
#include "filterchildrenproxymodel.h"
|
2019-01-07 23:14:44 +00:00
|
|
|
#include "newmappopup.h"
|
2019-03-21 23:50:50 +00:00
|
|
|
#include "newtilesetdialog.h"
|
2020-11-01 12:35:20 +00:00
|
|
|
#include "shortcutseditor.h"
|
2020-11-16 12:39:42 +00:00
|
|
|
#include "preferenceeditor.h"
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
|
|
|
|
|
2018-09-27 00:33:08 +01:00
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-04-07 19:20:31 +01:00
|
|
|
explicit MainWindow(QWidget *parent);
|
2018-09-27 00:33:08 +01:00
|
|
|
~MainWindow();
|
|
|
|
|
2020-04-07 19:20:31 +01:00
|
|
|
MainWindow() = delete;
|
|
|
|
MainWindow(const MainWindow &) = delete;
|
|
|
|
MainWindow & operator = (const MainWindow &) = delete;
|
|
|
|
|
2020-05-08 15:59:01 +01:00
|
|
|
// Scripting API
|
2020-04-30 02:41:19 +01:00
|
|
|
Q_INVOKABLE QJSValue getBlock(int x, int y);
|
2020-05-09 17:31:14 +01:00
|
|
|
void tryRedrawMapArea(bool forceRedraw);
|
|
|
|
void tryCommitMapChanges(bool commitChanges);
|
2022-08-03 20:14:25 +01:00
|
|
|
Q_INVOKABLE void setBlock(int x, int y, int metatileId, int collision, int elevation, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void setBlock(int x, int y, int rawValue, bool forceRedraw = true, bool commitChanges = true);
|
2020-05-09 17:31:14 +01:00
|
|
|
Q_INVOKABLE void setBlocksFromSelection(int x, int y, bool forceRedraw = true, bool commitChanges = true);
|
2020-05-01 00:30:24 +01:00
|
|
|
Q_INVOKABLE int getMetatileId(int x, int y);
|
2020-05-09 17:31:14 +01:00
|
|
|
Q_INVOKABLE void setMetatileId(int x, int y, int metatileId, bool forceRedraw = true, bool commitChanges = true);
|
2022-08-29 02:45:52 +01:00
|
|
|
Q_INVOKABLE int getBorderMetatileId(int x, int y);
|
|
|
|
Q_INVOKABLE void setBorderMetatileId(int x, int y, int metatileId, bool forceRedraw = true, bool commitChanges = true);
|
2020-05-01 00:30:24 +01:00
|
|
|
Q_INVOKABLE int getCollision(int x, int y);
|
2020-05-09 17:31:14 +01:00
|
|
|
Q_INVOKABLE void setCollision(int x, int y, int collision, bool forceRedraw = true, bool commitChanges = true);
|
2020-05-01 00:30:24 +01:00
|
|
|
Q_INVOKABLE int getElevation(int x, int y);
|
2020-05-09 17:31:14 +01:00
|
|
|
Q_INVOKABLE void setElevation(int x, int y, int elevation, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void bucketFill(int x, int y, int metatileId, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void bucketFillFromSelection(int x, int y, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void magicFill(int x, int y, int metatileId, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void magicFillFromSelection(int x, int y, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void shift(int xDelta, int yDelta, bool forceRedraw = true, bool commitChanges = true);
|
|
|
|
Q_INVOKABLE void redraw();
|
|
|
|
Q_INVOKABLE void commit();
|
2020-05-01 00:30:24 +01:00
|
|
|
Q_INVOKABLE QJSValue getDimensions();
|
|
|
|
Q_INVOKABLE int getWidth();
|
|
|
|
Q_INVOKABLE int getHeight();
|
2022-08-29 02:45:52 +01:00
|
|
|
Q_INVOKABLE QJSValue getBorderDimensions();
|
|
|
|
Q_INVOKABLE int getBorderWidth();
|
|
|
|
Q_INVOKABLE int getBorderHeight();
|
2020-05-01 00:30:24 +01:00
|
|
|
Q_INVOKABLE void setDimensions(int width, int height);
|
|
|
|
Q_INVOKABLE void setWidth(int width);
|
|
|
|
Q_INVOKABLE void setHeight(int height);
|
2022-08-29 02:45:52 +01:00
|
|
|
Q_INVOKABLE void setBorderDimensions(int width, int height);
|
|
|
|
Q_INVOKABLE void setBorderWidth(int width);
|
|
|
|
Q_INVOKABLE void setBorderHeight(int height);
|
2020-05-08 02:00:14 +01:00
|
|
|
void refreshAfterPaletteChange(Tileset *tileset);
|
2020-05-03 16:00:56 +01:00
|
|
|
void setTilesetPalette(Tileset *tileset, int paletteIndex, QList<QList<int>> colors);
|
2022-10-18 01:03:11 +01:00
|
|
|
Q_INVOKABLE void setPrimaryTilesetPalette(int paletteIndex, QList<QList<int>> colors, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setPrimaryTilesetPalettes(QList<QList<QList<int>>> palettes, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setSecondaryTilesetPalette(int paletteIndex, QList<QList<int>> colors, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setSecondaryTilesetPalettes(QList<QList<QList<int>>> palettes, bool forceRedraw = true);
|
2021-02-17 02:45:54 +00:00
|
|
|
QJSValue getTilesetPalette(const QList<QList<QRgb>> &palettes, int paletteIndex);
|
|
|
|
QJSValue getTilesetPalettes(const QList<QList<QRgb>> &palettes);
|
2020-05-03 16:00:56 +01:00
|
|
|
Q_INVOKABLE QJSValue getPrimaryTilesetPalette(int paletteIndex);
|
2020-05-08 02:00:14 +01:00
|
|
|
Q_INVOKABLE QJSValue getPrimaryTilesetPalettes();
|
2020-05-03 16:00:56 +01:00
|
|
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalette(int paletteIndex);
|
2020-05-08 02:00:14 +01:00
|
|
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalettes();
|
|
|
|
void refreshAfterPalettePreviewChange();
|
2020-05-03 16:31:44 +01:00
|
|
|
void setTilesetPalettePreview(Tileset *tileset, int paletteIndex, QList<QList<int>> colors);
|
2022-10-18 01:03:11 +01:00
|
|
|
Q_INVOKABLE void setPrimaryTilesetPalettePreview(int paletteIndex, QList<QList<int>> colors, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setPrimaryTilesetPalettesPreview(QList<QList<QList<int>>> palettes, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setSecondaryTilesetPalettePreview(int paletteIndex, QList<QList<int>> colors, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setSecondaryTilesetPalettesPreview(QList<QList<QList<int>>> palettes, bool forceRedraw = true);
|
2020-05-08 02:00:14 +01:00
|
|
|
Q_INVOKABLE QJSValue getPrimaryTilesetPalettePreview(int paletteIndex);
|
|
|
|
Q_INVOKABLE QJSValue getPrimaryTilesetPalettesPreview();
|
|
|
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalettePreview(int paletteIndex);
|
|
|
|
Q_INVOKABLE QJSValue getSecondaryTilesetPalettesPreview();
|
2021-12-01 00:16:25 +00:00
|
|
|
Q_INVOKABLE int getNumPrimaryTilesetMetatiles();
|
|
|
|
Q_INVOKABLE int getNumSecondaryTilesetMetatiles();
|
2021-12-13 16:41:46 +00:00
|
|
|
Q_INVOKABLE int getNumPrimaryTilesetTiles();
|
|
|
|
Q_INVOKABLE int getNumSecondaryTilesetTiles();
|
2020-05-08 02:00:14 +01:00
|
|
|
Q_INVOKABLE QString getPrimaryTileset();
|
|
|
|
Q_INVOKABLE QString getSecondaryTileset();
|
|
|
|
Q_INVOKABLE void setPrimaryTileset(QString tileset);
|
|
|
|
Q_INVOKABLE void setSecondaryTileset(QString tileset);
|
2021-11-23 21:11:07 +00:00
|
|
|
void saveMetatilesByMetatileId(int metatileId);
|
|
|
|
void saveMetatileAttributesByMetatileId(int metatileId);
|
2021-11-23 19:40:41 +00:00
|
|
|
Metatile * getMetatile(int metatileId);
|
2021-11-23 17:58:04 +00:00
|
|
|
Q_INVOKABLE QString getMetatileLabel(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileLabel(int metatileId, QString label);
|
2021-11-23 18:17:31 +00:00
|
|
|
Q_INVOKABLE int getMetatileLayerType(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileLayerType(int metatileId, int layerType);
|
|
|
|
Q_INVOKABLE int getMetatileEncounterType(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileEncounterType(int metatileId, int encounterType);
|
|
|
|
Q_INVOKABLE int getMetatileTerrainType(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileTerrainType(int metatileId, int terrainType);
|
|
|
|
Q_INVOKABLE int getMetatileBehavior(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileBehavior(int metatileId, int behavior);
|
2022-08-27 00:37:07 +01:00
|
|
|
Q_INVOKABLE int getMetatileAttributes(int metatileId);
|
|
|
|
Q_INVOKABLE void setMetatileAttributes(int metatileId, int attributes);
|
2021-11-23 18:17:31 +00:00
|
|
|
Q_INVOKABLE QJSValue getMetatileTile(int metatileId, int tileIndex);
|
2021-11-23 21:11:07 +00:00
|
|
|
Q_INVOKABLE void setMetatileTile(int metatileId, int tileIndex, int tileId, bool xflip, bool yflip, int palette, bool forceRedraw = true);
|
2021-11-24 05:29:58 +00:00
|
|
|
Q_INVOKABLE void setMetatileTile(int metatileId, int tileIndex, QJSValue tileObj, bool forceRedraw = true);
|
|
|
|
int calculateTileBounds(int * tileStart, int * tileEnd);
|
|
|
|
Q_INVOKABLE QJSValue getMetatileTiles(int metatileId, int tileStart = 0, int tileEnd = -1);
|
|
|
|
Q_INVOKABLE void setMetatileTiles(int metatileId, QJSValue tilesObj, int tileStart = 0, int tileEnd = -1, bool forceRedraw = true);
|
|
|
|
Q_INVOKABLE void setMetatileTiles(int metatileId, int tileId, bool xflip, bool yflip, int palette, int tileStart = 0, int tileEnd = -1, bool forceRedraw = true);
|
2022-01-04 02:35:15 +00:00
|
|
|
Q_INVOKABLE QJSValue getTilePixels(int tileId);
|
2021-12-31 21:41:28 +00:00
|
|
|
Q_INVOKABLE QString getSong();
|
|
|
|
Q_INVOKABLE void setSong(QString song);
|
|
|
|
Q_INVOKABLE QString getLocation();
|
|
|
|
Q_INVOKABLE void setLocation(QString location);
|
|
|
|
Q_INVOKABLE bool getRequiresFlash();
|
|
|
|
Q_INVOKABLE void setRequiresFlash(bool require);
|
|
|
|
Q_INVOKABLE QString getWeather();
|
|
|
|
Q_INVOKABLE void setWeather(QString weather);
|
|
|
|
Q_INVOKABLE QString getType();
|
|
|
|
Q_INVOKABLE void setType(QString type);
|
|
|
|
Q_INVOKABLE QString getBattleScene();
|
|
|
|
Q_INVOKABLE void setBattleScene(QString battleScene);
|
|
|
|
Q_INVOKABLE bool getShowLocationName();
|
|
|
|
Q_INVOKABLE void setShowLocationName(bool show);
|
|
|
|
Q_INVOKABLE bool getAllowRunning();
|
|
|
|
Q_INVOKABLE void setAllowRunning(bool allow);
|
|
|
|
Q_INVOKABLE bool getAllowBiking();
|
|
|
|
Q_INVOKABLE void setAllowBiking(bool allow);
|
|
|
|
Q_INVOKABLE bool getAllowEscaping();
|
|
|
|
Q_INVOKABLE void setAllowEscaping(bool allow);
|
|
|
|
Q_INVOKABLE int getFloorNumber();
|
|
|
|
Q_INVOKABLE void setFloorNumber(int floorNumber);
|
2021-11-23 18:17:31 +00:00
|
|
|
|
2022-09-05 16:53:30 +01:00
|
|
|
public slots:
|
|
|
|
void on_mainTabBar_tabBarClicked(int index);
|
|
|
|
void on_mapViewTab_tabBarClicked(int index);
|
|
|
|
|
2018-09-27 00:33:08 +01:00
|
|
|
private slots:
|
|
|
|
void on_action_Open_Project_triggered();
|
2020-04-08 01:25:09 +01:00
|
|
|
void on_action_Reload_Project_triggered();
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_mapList_activated(const QModelIndex &index);
|
|
|
|
void on_action_Save_Project_triggered();
|
2022-07-19 22:56:12 +01:00
|
|
|
void openWarpMap(QString map_name, int event_id, Event::Group event_group);
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2020-07-09 23:31:35 +01:00
|
|
|
void duplicate();
|
2021-04-14 06:08:18 +01:00
|
|
|
void setClipboardData(poryjson::Json::object);
|
|
|
|
void setClipboardData(QImage);
|
|
|
|
void copy();
|
|
|
|
void paste();
|
2018-09-27 00:33:08 +01:00
|
|
|
|
|
|
|
void onLoadMapRequested(QString, QString);
|
|
|
|
void onMapChanged(Map *map);
|
|
|
|
void onMapNeedsRedrawing();
|
2018-10-03 01:01:15 +01:00
|
|
|
void onTilesetsSaved(QString, QString);
|
2020-05-11 15:45:11 +01:00
|
|
|
void onWildMonDataChanged();
|
2022-10-24 21:18:50 +01:00
|
|
|
void openNewMapPopupWindow();
|
2019-01-07 23:14:44 +00:00
|
|
|
void onNewMapCreated();
|
2020-06-06 14:51:36 +01:00
|
|
|
void onMapCacheCleared();
|
2020-09-19 20:05:27 +01:00
|
|
|
void importMapFromAdvanceMap1_92();
|
2020-10-26 03:49:00 +00:00
|
|
|
void onMapRulerStatusChanged(const QString &);
|
2020-11-08 13:36:02 +00:00
|
|
|
void applyUserShortcuts();
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2019-01-07 23:14:44 +00:00
|
|
|
void on_action_NewMap_triggered();
|
2019-03-21 23:50:50 +00:00
|
|
|
void on_actionNew_Tileset_triggered();
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_action_Save_triggered();
|
|
|
|
void on_action_Exit_triggered();
|
2019-09-21 21:59:14 +01:00
|
|
|
void on_comboBox_Song_currentTextChanged(const QString &arg1);
|
|
|
|
void on_comboBox_Location_currentTextChanged(const QString &arg1);
|
|
|
|
void on_comboBox_Weather_currentTextChanged(const QString &arg1);
|
|
|
|
void on_comboBox_Type_currentTextChanged(const QString &arg1);
|
|
|
|
void on_comboBox_BattleScene_currentTextChanged(const QString &arg1);
|
2022-01-01 21:03:43 +00:00
|
|
|
void on_checkBox_ShowLocation_stateChanged(int selected);
|
|
|
|
void on_checkBox_AllowRunning_stateChanged(int selected);
|
|
|
|
void on_checkBox_AllowBiking_stateChanged(int selected);
|
2022-10-14 23:11:11 +01:00
|
|
|
void on_checkBox_AllowEscaping_stateChanged(int selected);
|
2020-03-11 21:06:26 +00:00
|
|
|
void on_spinBox_FloorNumber_valueChanged(int offset);
|
2020-04-21 02:54:16 +01:00
|
|
|
void on_actionUse_Encounter_Json_triggered(bool checked);
|
|
|
|
void on_actionMonitor_Project_Files_triggered(bool checked);
|
|
|
|
void on_actionUse_Poryscript_triggered(bool checked);
|
2022-07-04 21:03:13 +01:00
|
|
|
void on_actionOpen_Recent_Project_On_Launch_triggered(bool checked);
|
2020-11-01 12:35:20 +00:00
|
|
|
void on_actionEdit_Shortcuts_triggered();
|
2018-09-27 00:33:08 +01:00
|
|
|
|
|
|
|
void on_actionZoom_In_triggered();
|
|
|
|
void on_actionZoom_Out_triggered();
|
|
|
|
void on_actionBetter_Cursors_triggered();
|
2019-01-09 00:04:48 +00:00
|
|
|
void on_actionPlayer_View_Rectangle_triggered();
|
2019-01-09 15:35:34 +00:00
|
|
|
void on_actionCursor_Tile_Outline_triggered();
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_actionPencil_triggered();
|
|
|
|
void on_actionPointer_triggered();
|
|
|
|
void on_actionFlood_Fill_triggered();
|
|
|
|
void on_actionEyedropper_triggered();
|
|
|
|
void on_actionMove_triggered();
|
|
|
|
void on_actionMap_Shift_triggered();
|
|
|
|
|
|
|
|
void on_toolButton_deleteObject_clicked();
|
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
void addNewEvent(Event::Type type);
|
2022-10-18 18:44:45 +01:00
|
|
|
void tryAddEventTab(QWidget * tab, Event::Group group);
|
2022-09-06 22:11:36 +01:00
|
|
|
void displayEventTabs();
|
2018-09-27 00:33:08 +01:00
|
|
|
void updateSelectedObjects();
|
2018-11-28 01:39:57 +00:00
|
|
|
void updateObjects();
|
2018-09-27 00:33:08 +01:00
|
|
|
|
|
|
|
void on_toolButton_Paint_clicked();
|
|
|
|
void on_toolButton_Select_clicked();
|
|
|
|
void on_toolButton_Fill_clicked();
|
|
|
|
void on_toolButton_Dropper_clicked();
|
|
|
|
void on_toolButton_Move_clicked();
|
|
|
|
void on_toolButton_Shift_clicked();
|
|
|
|
|
|
|
|
void onOpenMapListContextMenu(const QPoint &point);
|
|
|
|
void onAddNewMapToGroupClick(QAction* triggeredAction);
|
2019-01-07 23:14:44 +00:00
|
|
|
void onAddNewMapToAreaClick(QAction* triggeredAction);
|
|
|
|
void onAddNewMapToLayoutClick(QAction* triggeredAction);
|
2018-09-27 00:33:08 +01:00
|
|
|
void currentMetatilesSelectionChanged();
|
|
|
|
|
|
|
|
void on_action_Export_Map_Image_triggered();
|
2020-04-18 19:07:41 +01:00
|
|
|
void on_actionExport_Stitched_Map_Image_triggered();
|
2021-01-18 21:13:51 +00:00
|
|
|
void on_actionExport_Map_Timelapse_Image_triggered();
|
2020-09-19 20:05:27 +01:00
|
|
|
void on_actionImport_Map_from_Advance_Map_1_92_triggered();
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2021-02-06 00:43:49 +00:00
|
|
|
void on_comboBox_ConnectionDirection_currentTextChanged(const QString &arg1);
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_spinBox_ConnectionOffset_valueChanged(int offset);
|
2019-09-21 21:59:14 +01:00
|
|
|
void on_comboBox_ConnectedMap_currentTextChanged(const QString &mapName);
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_pushButton_AddConnection_clicked();
|
|
|
|
void on_pushButton_RemoveConnection_clicked();
|
2019-09-21 21:59:14 +01:00
|
|
|
void on_comboBox_DiveMap_currentTextChanged(const QString &mapName);
|
|
|
|
void on_comboBox_EmergeMap_currentTextChanged(const QString &mapName);
|
|
|
|
void on_comboBox_PrimaryTileset_currentTextChanged(const QString &arg1);
|
|
|
|
void on_comboBox_SecondaryTileset_currentTextChanged(const QString &arg1);
|
2020-03-14 07:44:55 +00:00
|
|
|
void on_pushButton_ChangeDimensions_clicked();
|
2018-09-27 00:33:08 +01:00
|
|
|
void on_checkBox_smartPaths_stateChanged(int selected);
|
2022-01-01 21:03:43 +00:00
|
|
|
void on_checkBox_Visibility_stateChanged(int selected);
|
|
|
|
void on_checkBox_ToggleBorder_stateChanged(int selected);
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2018-09-27 19:27:57 +01:00
|
|
|
void resetMapViewScale();
|
|
|
|
|
2018-09-29 20:13:07 +01:00
|
|
|
void on_actionTileset_Editor_triggered();
|
|
|
|
|
2018-10-05 07:02:40 +01:00
|
|
|
void mapSortOrder_changed(QAction *action);
|
|
|
|
|
|
|
|
void on_lineEdit_filterBox_textChanged(const QString &arg1);
|
|
|
|
|
2020-10-26 03:49:00 +00:00
|
|
|
void moveEvent(QMoveEvent *event);
|
2019-01-06 18:53:31 +00:00
|
|
|
void closeEvent(QCloseEvent *);
|
|
|
|
|
2018-11-28 01:39:57 +00:00
|
|
|
void eventTabChanged(int index);
|
|
|
|
|
2019-01-06 18:53:31 +00:00
|
|
|
void on_horizontalSlider_CollisionTransparency_valueChanged(int value);
|
2019-01-08 15:30:36 +00:00
|
|
|
void on_toolButton_ExpandAll_clicked();
|
|
|
|
void on_toolButton_CollapseAll_clicked();
|
2019-01-08 16:28:20 +00:00
|
|
|
void on_actionAbout_Porymap_triggered();
|
2021-02-03 15:24:59 +00:00
|
|
|
void on_actionOpen_Log_File_triggered();
|
2021-02-03 16:24:07 +00:00
|
|
|
void on_actionOpen_Config_Folder_triggered();
|
2019-02-03 16:38:45 +00:00
|
|
|
void on_pushButton_AddCustomHeaderField_clicked();
|
|
|
|
void on_pushButton_DeleteCustomHeaderField_clicked();
|
|
|
|
void on_tableWidget_CustomHeaderFields_cellChanged(int row, int column);
|
2019-02-09 23:19:11 +00:00
|
|
|
void on_horizontalSlider_MetatileZoom_valueChanged(int value);
|
2019-06-20 17:40:36 +01:00
|
|
|
void on_pushButton_NewWildMonGroup_clicked();
|
2020-11-14 03:00:09 +00:00
|
|
|
void on_pushButton_DeleteWildMonGroup_clicked();
|
2019-06-20 17:40:36 +01:00
|
|
|
void on_pushButton_ConfigureEncountersJSON_clicked();
|
2022-09-08 02:38:30 +01:00
|
|
|
void on_pushButton_CreatePrefab_clicked();
|
2019-01-08 16:28:20 +00:00
|
|
|
|
2019-01-07 19:46:27 +00:00
|
|
|
void on_actionRegion_Map_Editor_triggered();
|
2020-11-16 12:39:42 +00:00
|
|
|
void on_actionEdit_Preferences_triggered();
|
2020-12-01 15:13:56 +00:00
|
|
|
void togglePreferenceSpecificUi();
|
2019-01-07 19:46:27 +00:00
|
|
|
|
2022-09-05 16:53:30 +01:00
|
|
|
public:
|
2018-09-27 00:33:08 +01:00
|
|
|
Ui::MainWindow *ui;
|
2022-09-05 16:53:30 +01:00
|
|
|
Editor *editor = nullptr;
|
|
|
|
|
|
|
|
private:
|
2021-02-15 07:45:38 +00:00
|
|
|
QLabel *label_MapRulerStatus = nullptr;
|
|
|
|
QPointer<TilesetEditor> tilesetEditor = nullptr;
|
|
|
|
QPointer<RegionMapEditor> regionMapEditor = nullptr;
|
|
|
|
QPointer<ShortcutsEditor> shortcutsEditor = nullptr;
|
|
|
|
QPointer<MapImageExporter> mapImageExporter = nullptr;
|
2022-04-29 02:42:47 +01:00
|
|
|
QPointer<NewMapPopup> newMapPrompt = nullptr;
|
2021-02-15 07:45:38 +00:00
|
|
|
QPointer<PreferenceEditor> preferenceEditor = nullptr;
|
2018-10-05 07:02:40 +01:00
|
|
|
FilterChildrenProxyModel *mapListProxyModel;
|
2018-09-27 00:33:08 +01:00
|
|
|
QStandardItemModel *mapListModel;
|
2018-10-05 07:02:40 +01:00
|
|
|
QList<QStandardItem*> *mapGroupItemsList;
|
2018-09-29 15:22:50 +01:00
|
|
|
QMap<QString, QModelIndex> mapListIndexes;
|
2018-09-27 00:33:08 +01:00
|
|
|
QIcon* mapIcon;
|
2018-10-03 03:46:08 +01:00
|
|
|
QIcon* mapEditedIcon;
|
2019-02-26 01:40:46 +00:00
|
|
|
QIcon* mapOpenedIcon;
|
2018-10-05 07:02:40 +01:00
|
|
|
|
2021-05-03 20:47:29 +01:00
|
|
|
QAction *undoAction = nullptr;
|
|
|
|
QAction *redoAction = nullptr;
|
|
|
|
|
|
|
|
QAction *copyAction = nullptr;
|
|
|
|
QAction *pasteAction = nullptr;
|
2020-07-29 20:51:04 +01:00
|
|
|
|
2018-11-28 01:39:57 +00:00
|
|
|
QWidget *eventTabObjectWidget;
|
|
|
|
QWidget *eventTabWarpWidget;
|
|
|
|
QWidget *eventTabTriggerWidget;
|
|
|
|
QWidget *eventTabBGWidget;
|
|
|
|
QWidget *eventTabHealspotWidget;
|
|
|
|
QWidget *eventTabMultipleWidget;
|
|
|
|
|
|
|
|
DraggablePixmapItem *selectedObject;
|
|
|
|
DraggablePixmapItem *selectedWarp;
|
|
|
|
DraggablePixmapItem *selectedTrigger;
|
|
|
|
DraggablePixmapItem *selectedBG;
|
|
|
|
DraggablePixmapItem *selectedHealspot;
|
|
|
|
|
|
|
|
bool isProgrammaticEventTabChange;
|
2019-08-07 15:48:07 +01:00
|
|
|
bool projectHasUnsavedChanges;
|
2020-09-13 23:34:18 +01:00
|
|
|
bool projectOpenFailure = false;
|
2022-12-03 13:49:08 +00:00
|
|
|
bool newMapDefaultsSet = false;
|
2018-11-28 01:39:57 +00:00
|
|
|
|
2018-12-21 15:25:28 +00:00
|
|
|
MapSortOrder mapSortOrder;
|
2018-10-05 07:02:40 +01:00
|
|
|
|
2021-11-23 21:11:07 +00:00
|
|
|
bool needsFullRedraw = false;
|
|
|
|
|
2018-12-20 23:30:35 +00:00
|
|
|
bool setMap(QString, bool scrollTreeView = false);
|
2018-09-27 00:33:08 +01:00
|
|
|
void redrawMapScene();
|
2020-05-21 00:30:17 +01:00
|
|
|
void refreshMapScene();
|
2020-02-12 00:34:08 +00:00
|
|
|
bool loadDataStructures();
|
2020-04-07 19:20:31 +01:00
|
|
|
bool loadProjectCombos();
|
2020-02-12 16:22:40 +00:00
|
|
|
bool populateMapList();
|
2018-10-05 07:02:40 +01:00
|
|
|
void sortMapList();
|
2018-09-27 00:33:08 +01:00
|
|
|
QString getExistingDirectory(QString);
|
2018-12-20 23:30:35 +00:00
|
|
|
bool openProject(QString dir);
|
2018-09-27 00:33:08 +01:00
|
|
|
QString getDefaultMap();
|
|
|
|
void setRecentMap(QString map_name);
|
|
|
|
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
|
|
|
|
|
2019-02-26 01:40:46 +00:00
|
|
|
void drawMapListIcons(QAbstractItemModel *model);
|
2018-09-27 00:33:08 +01:00
|
|
|
void updateMapList();
|
|
|
|
|
|
|
|
void displayMapProperties();
|
|
|
|
void checkToolButtons();
|
2020-04-21 20:12:20 +01:00
|
|
|
void clickToolButtonFromEditMode(QString editMode);
|
2018-09-27 00:33:08 +01:00
|
|
|
|
2021-09-08 22:25:21 +01:00
|
|
|
void markMapEdited();
|
2020-07-31 22:12:08 +01:00
|
|
|
void showWindowTitle();
|
|
|
|
|
2018-12-20 23:30:35 +00:00
|
|
|
void initWindow();
|
2018-10-05 23:39:50 +01:00
|
|
|
void initCustomUI();
|
2018-09-27 00:33:08 +01:00
|
|
|
void initExtraSignals();
|
|
|
|
void initEditor();
|
2018-10-05 07:02:40 +01:00
|
|
|
void initMiscHeapObjects();
|
|
|
|
void initMapSortOrder();
|
2020-11-08 13:36:02 +00:00
|
|
|
void initShortcuts();
|
|
|
|
void initExtraShortcuts();
|
2018-12-26 18:20:51 +00:00
|
|
|
void setProjectSpecificUIVisibility();
|
2022-03-23 03:49:49 +00:00
|
|
|
void setWildEncountersUIEnabled(bool enabled);
|
2018-09-27 00:33:08 +01:00
|
|
|
void loadUserSettings();
|
2020-06-26 00:34:46 +01:00
|
|
|
void applyMapListFilter(QString filterText);
|
2019-01-07 23:14:44 +00:00
|
|
|
void restoreWindowState();
|
2019-08-14 23:02:00 +01:00
|
|
|
void setTheme(QString);
|
2018-12-20 23:30:35 +00:00
|
|
|
bool openRecentProject();
|
2018-10-03 01:01:18 +01:00
|
|
|
void updateTilesetEditor();
|
2022-07-19 22:56:12 +01:00
|
|
|
Event::Group getEventGroupFromTabWidget(QWidget *tab);
|
2020-03-31 17:41:15 +01:00
|
|
|
void closeSupplementaryWindows();
|
2020-08-03 22:37:54 +01:00
|
|
|
void setWindowDisabled(bool);
|
2018-10-05 07:02:40 +01:00
|
|
|
|
2020-11-09 10:50:15 +00:00
|
|
|
void initTilesetEditor();
|
|
|
|
bool initRegionMapEditor();
|
|
|
|
void initShortcutsEditor();
|
|
|
|
void connectSubEditorsToShortcutsEditor();
|
|
|
|
|
2018-10-05 07:02:40 +01:00
|
|
|
bool isProjectOpen();
|
2021-01-18 21:13:51 +00:00
|
|
|
void showExportMapImageWindow(ImageExporterMode mode);
|
2020-07-06 18:36:59 +01:00
|
|
|
void redrawMetatileSelection();
|
2020-11-08 13:36:02 +00:00
|
|
|
|
|
|
|
QObjectList shortcutableObjects() const;
|
2022-10-16 03:32:05 +01:00
|
|
|
void addCustomHeaderValue(QString key, QJsonValue value, bool isNew = false);
|
2022-10-24 14:33:51 +01:00
|
|
|
int insertTilesetLabel(QStringList * list, QString label);
|
2018-09-27 00:33:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum MapListUserRoles {
|
|
|
|
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
|
2018-10-05 07:02:40 +01:00
|
|
|
TypeRole, // Used to differentiate between the different layers of the map list tree view.
|
2019-02-01 17:43:25 +00:00
|
|
|
TypeRole2, // Used for various extra data needed.
|
2018-09-27 00:33:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|