mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-22 00:26:37 -05:00
Merge branch 'master' of https://github.com/huderlem/porymap into slam
This commit is contained in:
@@ -14,7 +14,6 @@ class AboutPorymap : public QMainWindow
|
||||
public:
|
||||
explicit AboutPorymap(QWidget *parent = nullptr);
|
||||
~AboutPorymap();
|
||||
QList<int> getVersionNumbers();
|
||||
private:
|
||||
Ui::AboutPorymap *ui;
|
||||
};
|
||||
|
||||
@@ -4,12 +4,23 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QMouseEvent>
|
||||
|
||||
class ClickableGraphicsView : public QGraphicsView
|
||||
class NoScrollGraphicsView : public QGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClickableGraphicsView() : QGraphicsView() {}
|
||||
ClickableGraphicsView(QWidget *parent) : QGraphicsView(parent) {}
|
||||
NoScrollGraphicsView(QWidget *parent = nullptr) : QGraphicsView(parent) {}
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event) {
|
||||
event->ignore();
|
||||
}
|
||||
};
|
||||
|
||||
class ClickableGraphicsView : public NoScrollGraphicsView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClickableGraphicsView(QWidget *parent = nullptr) : NoScrollGraphicsView(parent) {}
|
||||
|
||||
public:
|
||||
void mouseReleaseEvent(QMouseEvent *event) override {
|
||||
|
||||
@@ -45,13 +45,14 @@ public:
|
||||
QPoint getSelectionDimensions();
|
||||
void draw();
|
||||
bool select(uint16_t metatile);
|
||||
bool selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
|
||||
void setTilesets(Tileset*, Tileset*);
|
||||
MetatileSelection getMetatileSelection();
|
||||
void setPrefabSelection(MetatileSelection selection);
|
||||
void setExternalSelection(int, int, QList<uint16_t>, QList<QPair<uint16_t, uint16_t>>);
|
||||
QPoint getMetatileIdCoordsOnWidget(uint16_t);
|
||||
void setLayout(Layout *layout);
|
||||
bool isInternalSelection() const { return (!this->externalSelection && !this->prefabSelection); }
|
||||
Tileset *primaryTileset;
|
||||
Tileset *secondaryTileset;
|
||||
protected:
|
||||
|
||||
@@ -134,6 +134,8 @@ private:
|
||||
void setTilesets(QString primaryTilesetLabel, QString secondaryTilesetLabel);
|
||||
void reset();
|
||||
void drawSelectedTiles();
|
||||
void redrawTileSelector();
|
||||
void redrawMetatileSelector();
|
||||
void importTilesetTiles(Tileset*, bool);
|
||||
void importTilesetMetatiles(Tileset*, bool);
|
||||
void refresh();
|
||||
|
||||
50
include/ui/updatepromoter.h
Normal file
50
include/ui/updatepromoter.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef UPDATEPROMOTER_H
|
||||
#define UPDATEPROMOTER_H
|
||||
|
||||
#include "network.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QPushButton>
|
||||
#include <QVersionNumber>
|
||||
|
||||
namespace Ui {
|
||||
class UpdatePromoter;
|
||||
}
|
||||
|
||||
class UpdatePromoter : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UpdatePromoter(QWidget *parent, NetworkAccessManager *manager);
|
||||
~UpdatePromoter() {};
|
||||
|
||||
void checkForUpdates();
|
||||
void updatePreferences();
|
||||
|
||||
private:
|
||||
Ui::UpdatePromoter *ui;
|
||||
NetworkAccessManager *const manager;
|
||||
QPushButton * button_Downloads;
|
||||
QPushButton * button_Retry;
|
||||
|
||||
QString changelog;
|
||||
QUrl downloadUrl;
|
||||
QVersionNumber newVersion;
|
||||
bool foundReleases;
|
||||
|
||||
QSet<QUrl> visitedUrls; // Prevent infinite redirection
|
||||
|
||||
void resetDialog();
|
||||
void get(const QUrl &url);
|
||||
void processWebpage(const QJsonDocument &data, const QUrl &nextUrl);
|
||||
void error(const QString &err, const QDateTime time = QDateTime());
|
||||
|
||||
private slots:
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
|
||||
signals:
|
||||
void changedPreferences();
|
||||
};
|
||||
|
||||
#endif // UPDATEPROMOTER_H
|
||||
Reference in New Issue
Block a user