mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 12:26:05 -05:00
Merge branch 'master' into event-paste
This commit is contained in:
@@ -28,6 +28,7 @@ protected:
|
||||
virtual QMap<QString, QString> getKeyValueMap() = 0;
|
||||
virtual void onNewConfigFileCreated() = 0;
|
||||
virtual void setUnreadKeys() = 0;
|
||||
void setConfigBool(QString key, bool * field, QString value);
|
||||
};
|
||||
|
||||
class PorymapConfig: public KeyValueConfigBase
|
||||
@@ -38,6 +39,7 @@ public:
|
||||
}
|
||||
virtual void reset() override {
|
||||
this->recentProject = "";
|
||||
this->reopenOnLaunch = true;
|
||||
this->mapSortOrder = MapSortOrder::Group;
|
||||
this->prettyCursors = true;
|
||||
this->collisionOpacity = 50;
|
||||
@@ -53,6 +55,7 @@ public:
|
||||
this->textEditorGotoLine = "";
|
||||
}
|
||||
void setRecentProject(QString project);
|
||||
void setReopenOnLaunch(bool enabled);
|
||||
void setMapSortOrder(MapSortOrder order);
|
||||
void setPrettyCursors(bool enabled);
|
||||
void setMainGeometry(QByteArray, QByteArray, QByteArray, QByteArray);
|
||||
@@ -71,6 +74,7 @@ public:
|
||||
void setTextEditorOpenFolder(const QString &command);
|
||||
void setTextEditorGotoLine(const QString &command);
|
||||
QString getRecentProject();
|
||||
bool getReopenOnLaunch();
|
||||
MapSortOrder getMapSortOrder();
|
||||
bool getPrettyCursors();
|
||||
QMap<QString, QByteArray> getMainGeometry();
|
||||
@@ -96,6 +100,7 @@ protected:
|
||||
virtual void setUnreadKeys() override {};
|
||||
private:
|
||||
QString recentProject;
|
||||
bool reopenOnLaunch;
|
||||
QString stringFromByteArray(QByteArray);
|
||||
QByteArray bytesFromString(QString);
|
||||
MapSortOrder mapSortOrder;
|
||||
|
||||
@@ -8,6 +8,13 @@ template <typename T>
|
||||
class History {
|
||||
public:
|
||||
History() { }
|
||||
|
||||
~History() {
|
||||
while (!history.isEmpty()) {
|
||||
delete history.takeLast();
|
||||
}
|
||||
}
|
||||
|
||||
T back() {
|
||||
if (head > 0) {
|
||||
return history.at(--head);
|
||||
|
||||
@@ -250,6 +250,7 @@ private slots:
|
||||
void on_actionUse_Encounter_Json_triggered(bool checked);
|
||||
void on_actionMonitor_Project_Files_triggered(bool checked);
|
||||
void on_actionUse_Poryscript_triggered(bool checked);
|
||||
void on_actionOpen_Recent_Project_On_Launch_triggered(bool checked);
|
||||
void on_actionEdit_Shortcuts_triggered();
|
||||
|
||||
void on_mainTabBar_tabBarClicked(int index);
|
||||
|
||||
33
include/ui/colorpicker.h
Normal file
33
include/ui/colorpicker.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef COLORPICKER_H
|
||||
#define COLORPICKER_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QGraphicsScene>
|
||||
|
||||
namespace Ui {
|
||||
class ColorPicker;
|
||||
}
|
||||
|
||||
class ColorPicker : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ColorPicker(QWidget *parent = nullptr);
|
||||
~ColorPicker();
|
||||
|
||||
QColor getColor() { return this->color; }
|
||||
|
||||
private:
|
||||
Ui::ColorPicker *ui;
|
||||
QGraphicsScene *scene = nullptr;
|
||||
QTimer *timer = nullptr;
|
||||
|
||||
QPoint lastCursorPos = QPoint(0, 0);
|
||||
|
||||
QColor color = Qt::white;
|
||||
|
||||
void hover(int mouseX, int mouseY);
|
||||
};
|
||||
|
||||
#endif // COLORPICKER_H
|
||||
@@ -2,6 +2,7 @@
|
||||
#define PALETTEEDITOR_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QValidator>
|
||||
#include <QSlider>
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
@@ -31,23 +32,43 @@ public:
|
||||
private:
|
||||
Ui::PaletteEditor *ui;
|
||||
Project *project = nullptr;
|
||||
|
||||
QList<QList<QSlider*>> sliders;
|
||||
QList<QList<QSpinBox *>> spinners;
|
||||
QList<QFrame*> frames;
|
||||
QList<QLabel*> rgbLabels;
|
||||
QList<QToolButton *> pickButtons;
|
||||
QList<QLineEdit *> hexEdits;
|
||||
|
||||
Tileset *primaryTileset;
|
||||
Tileset *secondaryTileset;
|
||||
|
||||
QList<History<PaletteHistoryItem*>> palettesHistory;
|
||||
void disableSliderSignals();
|
||||
void enableSliderSignals();
|
||||
void initColorSliders();
|
||||
void refreshColorSliders();
|
||||
void refreshColors();
|
||||
void refreshColor(int);
|
||||
void setColor(int);
|
||||
|
||||
void refreshColorUis();
|
||||
void updateColorUi(int index, QRgb color);
|
||||
void commitEditHistory(int paletteid);
|
||||
void restoreWindowState();
|
||||
void setSignalsEnabled(bool enabled);
|
||||
void setColorsFromHistory(PaletteHistoryItem*, int);
|
||||
void closeEvent(QCloseEvent*);
|
||||
void pickColor(int i);
|
||||
|
||||
void setRgb(int index, QRgb rgb);
|
||||
void setRgbFromSliders(int colorIndex);
|
||||
void setRgbFromHexEdit(int colorIndex);
|
||||
void setRgbFromSpinners(int colorIndex);
|
||||
|
||||
void setBitDepth(int bits);
|
||||
int bitDepth = 24;
|
||||
|
||||
class HexCodeValidator : public QValidator {
|
||||
virtual QValidator::State validate(QString &input, int &) const override {
|
||||
input = input.toUpper();
|
||||
return QValidator::Acceptable;
|
||||
}
|
||||
};
|
||||
|
||||
HexCodeValidator *hexValidator = nullptr;
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
Reference in New Issue
Block a user