some code cleanup

This commit is contained in:
garak
2023-04-07 21:50:46 -04:00
parent 2d2b7f723b
commit f4cd57c988
16 changed files with 187 additions and 213 deletions

View File

@@ -14,25 +14,16 @@ private:
using QGraphicsPixmapItem::paint;
public:
enum class PaintMode {
Disabled,
Metatiles,
EventObjects
};
LayoutPixmapItem(Layout *layout, MetatileSelector *metatileSelector, Settings *settings) {
this->layout = layout;
// this->map->setMapItem(this);
this->metatileSelector = metatileSelector;
this->settings = settings;
this->paintingMode = PaintMode::Metatiles;
this->lockedAxis = LayoutPixmapItem::Axis::None;
this->prevStraightPathState = false;
setAcceptHoverEvents(true);
}
LayoutPixmapItem::PaintMode paintingMode;
Layout *layout;
MetatileSelector *metatileSelector;
@@ -95,12 +86,17 @@ public:
void lockNondominantAxis(QGraphicsSceneMouseEvent *event);
QPoint adjustCoords(QPoint pos);
void setEditsEnabled(bool enabled) { this->editsEnabled = enabled; }
bool getEditsEnabled() { return this->editsEnabled; }
private:
void paintSmartPath(int x, int y, bool fromScriptCall = false);
static QList<int> smartPathTable;
unsigned actionId_ = 0;
bool editsEnabled = true;
signals:
void startPaint(QGraphicsSceneMouseEvent *, LayoutPixmapItem *);
void endPaint(QGraphicsSceneMouseEvent *, LayoutPixmapItem *);