porymap/include/mainwindow.h

436 lines
18 KiB
C
Raw Normal View History

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>
#include <QCloseEvent>
2018-09-27 00:33:08 +01:00
#include <QAbstractItemModel>
#include <QJSValue>
2018-09-27 00:33:08 +01:00
#include "project.h"
#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"
#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"
#include "newmappopup.h"
2019-03-21 23:50:50 +00:00
#include "newtilesetdialog.h"
#include "shortcutseditor.h"
#include "preferenceeditor.h"
2023-08-23 07:32:32 +01:00
#include "projectsettingseditor.h"
2023-09-01 19:00:09 +01:00
#include "customscriptseditor.h"
2024-08-21 18:06:30 +01:00
#include "wildmonchart.h"
2024-01-21 07:00:28 +00:00
#include "updatepromoter.h"
2024-08-15 03:46:37 +01:00
#include "aboutporymap.h"
2018-09-27 00:33:08 +01:00
2018-09-27 00:33:08 +01:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent);
2018-09-27 00:33:08 +01:00
~MainWindow();
MainWindow() = delete;
MainWindow(const MainWindow &) = delete;
MainWindow & operator = (const MainWindow &) = delete;
2020-05-08 15:59:01 +01:00
// Scripting API
Q_INVOKABLE QJSValue getBlock(int x, int y);
void tryRedrawMapArea(bool forceRedraw);
void tryCommitMapChanges(bool commitChanges);
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);
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);
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);
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);
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);
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);
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();
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);
void saveMetatilesByMetatileId(int metatileId);
void saveMetatileAttributesByMetatileId(int metatileId);
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);
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);
2024-01-03 21:58:50 +00:00
Q_INVOKABLE QString getMetatileBehaviorName(int metatileId);
Q_INVOKABLE void setMetatileBehaviorName(int metatileId, QString behavior);
2022-08-27 00:37:07 +01:00
Q_INVOKABLE int getMetatileAttributes(int metatileId);
Q_INVOKABLE void setMetatileAttributes(int metatileId, int attributes);
Q_INVOKABLE QJSValue getMetatileTile(int metatileId, int tileIndex);
Q_INVOKABLE void setMetatileTile(int metatileId, int tileIndex, int tileId, bool xflip, bool yflip, int palette, bool forceRedraw = true);
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);
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);
public slots:
void on_mainTabBar_tabBarClicked(int index);
void on_mapViewTab_tabBarClicked(int index);
2023-12-17 01:35:54 +00:00
void onWarpBehaviorWarningClicked();
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();
2024-07-16 21:26:59 +01:00
void on_action_Close_Project_triggered();
2018-09-27 00:33:08 +01:00
void on_mapList_activated(const QModelIndex &index);
void on_action_Save_Project_triggered();
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();
void setClipboardData(poryjson::Json::object);
void setClipboardData(QImage);
void copy();
void paste();
2018-09-27 00:33:08 +01:00
2024-08-09 06:29:28 +01:00
void onOpenConnectedMap(MapConnection*);
2018-09-27 00:33:08 +01:00
void onMapNeedsRedrawing();
2018-10-03 01:01:15 +01:00
void onTilesetsSaved(QString, QString);
void openNewMapPopupWindow();
void onNewMapCreated();
void onMapCacheCleared();
void onMapLoaded(Map *map);
void importMapFromAdvanceMap1_92();
void onMapRulerStatusChanged(const QString &);
void applyUserShortcuts();
2018-09-27 00:33:08 +01: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();
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);
void on_checkBox_ShowLocation_stateChanged(int selected);
void on_checkBox_AllowRunning_stateChanged(int selected);
void on_checkBox_AllowBiking_stateChanged(int selected);
void on_checkBox_AllowEscaping_stateChanged(int selected);
2020-03-11 21:06:26 +00:00
void on_spinBox_FloorNumber_valueChanged(int offset);
2023-09-07 04:33:13 +01:00
void on_actionShortcuts_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();
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();
2024-07-08 16:44:23 +01:00
void onDeleteKeyPressed();
2018-09-27 00:33:08 +01:00
void on_toolButton_deleteObject_clicked();
void addNewEvent(Event::Type type);
void tryAddEventTab(QWidget * tab);
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);
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();
void on_actionExport_Stitched_Map_Image_triggered();
void on_actionExport_Map_Timelapse_Image_triggered();
void on_actionImport_Map_from_Advance_Map_1_92_triggered();
2018-09-27 00:33:08 +01:00
void on_pushButton_AddConnection_clicked();
2024-06-29 03:01:13 +01:00
void on_button_OpenDiveMap_clicked();
void on_button_OpenEmergeMap_clicked();
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);
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);
void moveEvent(QMoveEvent *event);
void closeEvent(QCloseEvent *);
2018-11-28 01:39:57 +00:00
void eventTabChanged(int index);
2024-08-04 22:39:56 +01:00
void on_checkBox_MirrorConnections_stateChanged(int selected);
2024-07-25 21:32:26 +01:00
void on_actionDive_Emerge_Map_triggered();
2024-07-24 20:46:20 +01:00
void on_groupBox_DiveMapOpacity_toggled(bool on);
void on_slider_DiveEmergeMapOpacity_valueChanged(int value);
void on_slider_DiveMapOpacity_valueChanged(int value);
void on_slider_EmergeMapOpacity_valueChanged(int value);
void on_horizontalSlider_CollisionTransparency_valueChanged(int value);
void on_toolButton_ExpandAll_clicked();
void on_toolButton_CollapseAll_clicked();
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();
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);
2023-12-07 18:45:08 +00:00
void on_horizontalSlider_CollisionZoom_valueChanged(int value);
void on_pushButton_NewWildMonGroup_clicked();
void on_pushButton_DeleteWildMonGroup_clicked();
2024-08-21 18:06:30 +01:00
void on_pushButton_SummaryChart_clicked();
void on_pushButton_ConfigureEncountersJSON_clicked();
void on_pushButton_CreatePrefab_clicked();
2023-12-07 18:45:08 +00:00
void on_spinBox_SelectedElevation_valueChanged(int elevation);
void on_spinBox_SelectedCollision_valueChanged(int collision);
void on_actionRegion_Map_Editor_triggered();
2023-09-07 04:33:13 +01:00
void on_actionPreferences_triggered();
2024-01-21 03:07:52 +00:00
void on_actionCheck_for_Updates_triggered();
void togglePreferenceSpecificUi();
2023-09-07 04:33:13 +01:00
void on_actionProject_Settings_triggered();
2023-09-01 19:00:09 +01:00
void on_actionCustom_Scripts_triggered();
2023-09-06 18:40:55 +01:00
void reloadScriptEngine();
public:
2018-09-27 00:33:08 +01:00
Ui::MainWindow *ui;
QPointer<Editor> editor = nullptr;
private:
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;
QPointer<PreferenceEditor> preferenceEditor = nullptr;
2023-08-23 07:32:32 +01:00
QPointer<ProjectSettingsEditor> projectSettingsEditor = nullptr;
2023-09-01 19:00:09 +01:00
QPointer<CustomScriptsEditor> customScriptsEditor = nullptr;
2024-01-21 07:00:28 +00:00
QPointer<UpdatePromoter> updatePromoter = nullptr;
2024-01-24 16:56:04 +00:00
QPointer<NetworkAccessManager> networkAccessManager = nullptr;
2024-08-15 03:46:37 +01:00
QPointer<AboutPorymap> aboutWindow = nullptr;
2024-08-21 18:06:30 +01:00
QPointer<WildMonChart> wildMonChart = 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;
2024-08-09 06:29:28 +01:00
QIcon mapIcon;
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
2024-01-03 20:09:12 +00:00
QMap<Event::Group, DraggablePixmapItem*> lastSelectedEvent;
2018-11-28 01:39:57 +00:00
bool isProgrammaticEventTabChange;
bool newMapDefaultsSet = false;
2023-08-18 23:46:25 +01:00
bool tilesetNeedsRedraw = false;
2024-06-29 03:01:13 +01:00
bool userSetMap(QString, bool scrollTreeView = false);
bool setMap(QString, bool scrollTreeView = false);
2018-09-27 00:33:08 +01:00
void redrawMapScene();
void refreshMapScene();
2024-07-16 19:19:47 +01:00
bool checkProjectSanity();
bool loadProjectData();
bool setProjectUI();
2024-07-16 21:26:59 +01:00
void clearProjectUI();
2018-10-05 07:02:40 +01:00
void sortMapList();
2023-09-01 19:00:09 +01:00
void openSubWindow(QWidget * window);
2018-09-27 00:33:08 +01:00
QString getExistingDirectory(QString);
2024-07-16 21:26:59 +01:00
bool openProject(QString dir, bool initial = false);
bool closeProject();
2024-01-05 07:49:22 +00:00
void showProjectOpenFailure();
void saveGlobalConfigs();
bool setInitialMap();
2018-09-27 00:33:08 +01:00
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
2023-12-28 05:55:45 +00:00
void refreshRecentProjectsMenu();
2018-09-27 00:33:08 +01:00
2024-08-08 22:26:42 +01:00
void updateMapListIcon(const QString &mapName);
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
void markMapEdited();
2024-07-08 21:01:30 +01:00
void markMapEdited(Map*);
void showWindowTitle();
void initWindow();
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();
void initShortcuts();
void initExtraShortcuts();
2018-09-27 00:33:08 +01:00
void loadUserSettings();
void applyMapListFilter(QString filterText);
void restoreWindowState();
void setTheme(QString);
void updateTilesetEditor();
Event::Group getEventGroupFromTabWidget(QWidget *tab);
bool closeSupplementaryWindows();
void setWindowDisabled(bool);
2018-10-05 07:02:40 +01:00
void initTilesetEditor();
bool initRegionMapEditor(bool silent = false);
bool askToFixRegionMapEditor();
void initShortcutsEditor();
void initCustomScriptsEditor();
void connectSubEditorsToShortcutsEditor();
2023-12-17 01:35:54 +00:00
void openProjectSettingsEditor(int tab);
2018-10-05 07:02:40 +01:00
bool isProjectOpen();
void showExportMapImageWindow(ImageExporterMode mode);
2024-01-26 20:29:48 +00:00
double getMetatilesZoomScale();
void redrawMetatileSelection();
2024-01-26 20:29:48 +00:00
void scrollMetatileSelectorToSelection();
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);
2024-01-21 03:07:52 +00:00
2024-01-21 04:02:43 +00:00
void checkForUpdates(bool requestedByUser);
2024-08-09 06:29:28 +01:00
void setDivingMapsVisible(bool visible);
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
};
2024-07-03 18:41:00 +01:00
// These are namespaced in a struct to avoid colliding with e.g. class Map.
struct MainTab {
enum {
Map,
Events,
Header,
Connections,
WildPokemon,
};
};
struct MapViewTab {
enum {
Metatiles,
Collision,
Prefabs,
};
};
2018-09-27 00:33:08 +01:00
#endif // MAINWINDOW_H