mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 12:57:06 -05:00
Add transparency slider for overlayed collision tiles on the map
This commit is contained in:
@@ -31,15 +31,18 @@ public:
|
||||
this->recentMap = "";
|
||||
this->mapSortOrder = MapSortOrder::Group;
|
||||
this->prettyCursors = true;
|
||||
this->collisionOpacity = 50;
|
||||
}
|
||||
void setRecentProject(QString project);
|
||||
void setRecentMap(QString map);
|
||||
void setMapSortOrder(MapSortOrder order);
|
||||
void setPrettyCursors(bool enabled);
|
||||
void setCollisionOpacity(int opacity);
|
||||
QString getRecentProject();
|
||||
QString getRecentMap();
|
||||
MapSortOrder getMapSortOrder();
|
||||
bool getPrettyCursors();
|
||||
int getCollisionOpacity();
|
||||
protected:
|
||||
QString getConfigFilepath();
|
||||
void parseConfigKeyValue(QString key, QString value);
|
||||
@@ -50,6 +53,7 @@ private:
|
||||
QString recentMap;
|
||||
MapSortOrder mapSortOrder;
|
||||
bool prettyCursors;
|
||||
int collisionOpacity;
|
||||
};
|
||||
|
||||
extern PorymapConfig porymapConfig;
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
QPixmap render(bool ignoreCache);
|
||||
QPixmap renderCollision(bool ignoreCache);
|
||||
QPixmap renderCollision(qreal opacity, bool ignoreCache);
|
||||
bool blockChanged(int, Blockdata*);
|
||||
void cacheBlockdata();
|
||||
void cacheCollision();
|
||||
|
||||
@@ -114,6 +114,7 @@ public:
|
||||
|
||||
int scale_exp = 0;
|
||||
double scale_base = sqrt(2); // adjust scale factor with this
|
||||
qreal collisionOpacity = 0.5;
|
||||
|
||||
void objectsView_onMousePress(QMouseEvent *event);
|
||||
void objectsView_onMouseMove(QMouseEvent *event);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <QGraphicsPixmapItem>
|
||||
#include <QGraphicsItemGroup>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QCloseEvent>
|
||||
#include <QAbstractItemModel>
|
||||
#include "project.h"
|
||||
#include "config.h"
|
||||
@@ -52,7 +53,6 @@ private slots:
|
||||
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);
|
||||
@@ -137,10 +137,14 @@ private slots:
|
||||
|
||||
void on_lineEdit_filterBox_textChanged(const QString &arg1);
|
||||
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
void eventTabChanged(int index);
|
||||
|
||||
void selectedEventIndexChanged(int index);
|
||||
|
||||
void on_horizontalSlider_CollisionTransparency_valueChanged(int value);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
TilesetEditor *tilesetEditor = nullptr;
|
||||
|
||||
@@ -10,17 +10,19 @@
|
||||
class CollisionPixmapItem : public MapPixmapItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
CollisionPixmapItem(Map *map, MovementPermissionsSelector *movementPermissionsSelector, MetatileSelector *metatileSelector, Settings *settings)
|
||||
CollisionPixmapItem(Map *map, MovementPermissionsSelector *movementPermissionsSelector, MetatileSelector *metatileSelector, Settings *settings, qreal *opacity)
|
||||
: MapPixmapItem(map, metatileSelector, settings){
|
||||
this->movementPermissionsSelector = movementPermissionsSelector;
|
||||
this->opacity = opacity;
|
||||
}
|
||||
MovementPermissionsSelector *movementPermissionsSelector;
|
||||
qreal *opacity;
|
||||
void updateMovementPermissionSelection(QGraphicsSceneMouseEvent *event);
|
||||
virtual void paint(QGraphicsSceneMouseEvent*);
|
||||
virtual void floodFill(QGraphicsSceneMouseEvent*);
|
||||
virtual void magicFill(QGraphicsSceneMouseEvent*);
|
||||
virtual void pick(QGraphicsSceneMouseEvent*);
|
||||
virtual void draw(bool ignoreCache = false);
|
||||
void draw(bool ignoreCache = false);
|
||||
|
||||
signals:
|
||||
void mouseEvent(QGraphicsSceneMouseEvent *, CollisionPixmapItem *);
|
||||
|
||||
Reference in New Issue
Block a user