diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..65c5ca88
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/editor.cpp b/editor.cpp
index 9a07e9b7..17909121 100755
--- a/editor.cpp
+++ b/editor.cpp
@@ -50,7 +50,7 @@ void Editor::setEditingMap() {
map_item->draw();
map_item->setVisible(true);
map_item->setEnabled(true);
- setConnectionsVisibility(true);
+ setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
}
if (collision_item) {
collision_item->setVisible(false);
@@ -58,7 +58,7 @@ void Editor::setEditingMap() {
if (events_group) {
events_group->setVisible(false);
}
- setBorderItemsVisible(true);
+ setBorderItemsVisible(ui->checkBox_ToggleBorder->isChecked());
setConnectionItemsVisible(false);
}
@@ -68,7 +68,7 @@ void Editor::setEditingCollision() {
displayMapConnections();
collision_item->draw();
collision_item->setVisible(true);
- setConnectionsVisibility(true);
+ setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
}
if (map_item) {
map_item->setVisible(false);
@@ -76,7 +76,7 @@ void Editor::setEditingCollision() {
if (events_group) {
events_group->setVisible(false);
}
- setBorderItemsVisible(true);
+ setBorderItemsVisible(ui->checkBox_ToggleBorder->isChecked());
setConnectionItemsVisible(false);
}
@@ -88,12 +88,12 @@ void Editor::setEditingObjects() {
if (map_item) {
map_item->setVisible(true);
map_item->setEnabled(false);
- setConnectionsVisibility(true);
+ setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
}
if (collision_item) {
collision_item->setVisible(false);
}
- setBorderItemsVisible(true);
+ setBorderItemsVisible(ui->checkBox_ToggleBorder->isChecked());
setConnectionItemsVisible(false);
}
@@ -338,33 +338,54 @@ void Editor::setMap(QString map_name) {
}
void Editor::mouseEvent_map(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) {
- if (event->buttons() & Qt::RightButton) {
- item->updateMetatileSelection(event);
- } else {
- if (map_edit_mode == "paint") {
- item->paint(event);
- } else if (map_edit_mode == "fill") {
+ if (map_edit_mode == "paint") {
+ if (event->buttons() & Qt::RightButton) {
+ item->updateMetatileSelection(event);
+ } else if (event->buttons() & Qt::MiddleButton) {
item->floodFill(event);
- } else if (map_edit_mode == "pick") {
- item->pick(event);
- } else if (map_edit_mode == "select") {
- item->select(event);
+ } else {
+ item->paint(event);
}
+ } else if (map_edit_mode == "select") {
+ item->select(event);
+ } else if (map_edit_mode == "fill") {
+ if (event->buttons() & Qt::RightButton) {
+ item->updateMetatileSelection(event);
+ } else {
+ item->floodFill(event);
+ }
+ } else if (map_edit_mode == "pick") {
+
+ if (event->buttons() & Qt::RightButton) {
+ item->updateMetatileSelection(event);
+ } else {
+ item->pick(event);
+ }
+ } else if (map_edit_mode == "shift") {
+ item->shift(event);
}
}
void Editor::mouseEvent_collision(QGraphicsSceneMouseEvent *event, CollisionPixmapItem *item) {
- if (event->buttons() & Qt::RightButton) {
- item->updateMovementPermissionSelection(event);
- } else {
- if (map_edit_mode == "paint") {
- item->paint(event);
- } else if (map_edit_mode == "fill") {
+ if (map_edit_mode == "paint") {
+ if (event->buttons() & Qt::RightButton) {
+ item->updateMovementPermissionSelection(event);
+ } else if (event->buttons() & Qt::MiddleButton) {
item->floodFill(event);
- } else if (map_edit_mode == "pick") {
- item->pick(event);
- } else if (map_edit_mode == "select") {
- item->select(event);
+ } else {
+ item->paint(event);
}
+ } else if (map_edit_mode == "select") {
+ item->select(event);
+ } else if (map_edit_mode == "fill") {
+ if (event->buttons() & Qt::RightButton) {
+ item->pick(event);
+ } else {
+ item->floodFill(event);
+ }
+ } else if (map_edit_mode == "pick") {
+ item->pick(event);
+ } else if (map_edit_mode == "shift") {
+ item->shift(event);
}
}
@@ -861,6 +882,12 @@ void Editor::updateSecondaryTileset(QString tilesetLabel)
}
}
+void Editor::toggleBorderVisibility(bool visible)
+{
+ this->setBorderItemsVisible(visible);
+ this->setConnectionsVisibility(visible);
+}
+
void MetatilesPixmapItem::paintTileChanged(Map *map) {
draw();
}
@@ -1080,7 +1107,8 @@ void MapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
int y = (int)(pos.y()) / 16;
// Paint onto the map.
- if (map->smart_paths_enabled && map->selected_metatiles_width == 3 && map->selected_metatiles_height == 3) {
+ bool smartPathsEnabled = event->modifiers() & Qt::ShiftModifier;
+ if ((map->smart_paths_enabled || smartPathsEnabled) && map->selected_metatiles_width == 3 && map->selected_metatiles_height == 3) {
paintSmartPath(x, y);
} else {
paintNormal(x, y);
@@ -1091,6 +1119,51 @@ void MapPixmapItem::paint(QGraphicsSceneMouseEvent *event) {
}
}
+void MapPixmapItem::shift(QGraphicsSceneMouseEvent *event) {
+ if (map) {
+ if (event->type() == QEvent::GraphicsSceneMouseRelease) {
+ map->commit();
+ } else {
+ QPointF pos = event->pos();
+ int x = (int)(pos.x()) / 16;
+ int y = (int)(pos.y()) / 16;
+
+ if (event->type() == QEvent::GraphicsSceneMousePress) {
+ selection_origin = QPoint(x, y);
+ selection.clear();
+ } else if (event->type() == QEvent::GraphicsSceneMouseMove) {
+ if (x != selection_origin.x() || y != selection_origin.y()) {
+ int xDelta = x - selection_origin.x();
+ int yDelta = y - selection_origin.y();
+ Blockdata *backupBlockdata = map->layout->blockdata->copy();
+ for (int i = 0; i < map->getWidth(); i++)
+ for (int j = 0; j < map->getHeight(); j++) {
+ int srcX = i;
+ int srcY = j;
+ int destX = i + xDelta;
+ int destY = j + yDelta;
+ if (destX < 0)
+ do { destX += map->getWidth(); } while (destX < 0);
+ if (destY < 0)
+ do { destY += map->getHeight(); } while (destY < 0);
+ destX %= map->getWidth();
+ destY %= map->getHeight();
+
+ int blockIndex = j * map->getWidth() + i;
+ Block srcBlock = backupBlockdata->blocks->at(blockIndex);
+ map->_setBlock(destX, destY, srcBlock);
+ }
+
+ delete backupBlockdata;
+ selection_origin = QPoint(x, y);
+ selection.clear();
+ draw();
+ }
+ }
+ }
+ }
+}
+
void MapPixmapItem::paintNormal(int x, int y) {
// Snap the selected position to the top-left of the block boundary.
// This allows painting via dragging the mouse to tile the painted region.
@@ -1260,7 +1333,8 @@ void MapPixmapItem::floodFill(QGraphicsSceneMouseEvent *event) {
Block *block = map->getBlock(x, y);
int tile = map->selected_metatiles->first();
if (block && block->tile != tile) {
- if (map->smart_paths_enabled && map->selected_metatiles_width == 3 && map->selected_metatiles_height == 3)
+ bool smartPathsEnabled = event->modifiers() & Qt::ShiftModifier;
+ if ((map->smart_paths_enabled || smartPathsEnabled) && map->selected_metatiles_width == 3 && map->selected_metatiles_height == 3)
this->_floodFillSmartPath(x, y);
else
this->_floodFill(x, y);
@@ -1484,9 +1558,15 @@ void MapPixmapItem::updateCurHoveredTile(QPointF pos) {
void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
updateCurHoveredTile(event->pos());
+ if (editor->ui->actionBetter_Cursors->isChecked()){
+ setCursor(editor->cursor);
+ }
}
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
map->clearHoveredTile();
+ if (editor->ui->actionBetter_Cursors->isChecked()){
+ unsetCursor();
+ }
}
void MapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
QPointF pos = event->pos();
diff --git a/editor.h b/editor.h
index 1beadf75..ab09c365 100755
--- a/editor.h
+++ b/editor.h
@@ -7,6 +7,7 @@
#include
#include
#include
+#include
#include "project.h"
#include "ui_mainwindow.h"
@@ -66,6 +67,7 @@ public:
void setSelectedConnectionFromMap(QString mapName);
void updatePrimaryTileset(QString tilesetLabel);
void updateSecondaryTileset(QString tilesetLabel);
+ void toggleBorderVisibility(bool visible);
DraggablePixmapItem *addMapEvent(Event *event);
void selectMapEvent(DraggablePixmapItem *object);
@@ -108,6 +110,8 @@ public:
QList *copiedMetatileSelection = new QList;
QString map_edit_mode;
+ QString prev_edit_mode;
+ QCursor cursor;
void objectsView_onMousePress(QMouseEvent *event);
void objectsView_onMouseMove(QMouseEvent *event);
@@ -270,6 +274,7 @@ public:
void _floodFillSmartPath(int initialX, int initialY);
virtual void pick(QGraphicsSceneMouseEvent*);
virtual void select(QGraphicsSceneMouseEvent*);
+ virtual void shift(QGraphicsSceneMouseEvent*);
virtual void draw(bool ignoreCache = false);
void updateMetatileSelection(QGraphicsSceneMouseEvent *event);
diff --git a/mainwindow.cpp b/mainwindow.cpp
index e8afd711..bc0b41e3 100755
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -15,8 +15,14 @@
#include
#include
#include
+#include
#include
#include
+#include
+#include
+#include
+#include
+#include
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
@@ -51,6 +57,10 @@ MainWindow::MainWindow(QWidget *parent) :
openProject(default_dir);
}
}
+
+ if (settings.contains("cursor_mode") && settings.value("cursor_mode") == "0") {
+ ui->actionBetter_Cursors->setChecked(false);
+ }
}
MainWindow::~MainWindow()
@@ -549,6 +559,12 @@ void MainWindow::redo() {
editor->redo();
}
+// Open current map scripts in system default editor for .inc files
+void MainWindow::openInTextEditor() {
+ QString path = QDir::cleanPath("file://" + editor->project->root + QDir::separator() + "data/maps/" + editor->map->name + "/scripts.inc");
+ QDesktopServices::openUrl(QUrl(path));
+}
+
void MainWindow::on_action_Save_triggered() {
editor->save();
updateMapList();
@@ -589,6 +605,66 @@ void MainWindow::on_actionRedo_triggered()
redo();
}
+void MainWindow::on_actionZoom_In_triggered() {
+ scaleMapView(1);
+}
+
+void MainWindow::on_actionZoom_Out_triggered() {
+ scaleMapView(-1);
+}
+
+void MainWindow::on_actionBetter_Cursors_triggered() {
+ QSettings settings;
+ settings.setValue("cursor_mode", QString::number(ui->actionBetter_Cursors->isChecked()));
+}
+
+void MainWindow::on_actionPencil_triggered()
+{
+ on_toolButton_Paint_clicked();
+}
+
+void MainWindow::on_actionPointer_triggered()
+{
+ on_toolButton_Select_clicked();
+}
+
+void MainWindow::on_actionFlood_Fill_triggered()
+{
+ on_toolButton_Fill_clicked();
+}
+
+void MainWindow::on_actionEyedropper_triggered()
+{
+ on_toolButton_Dropper_clicked();
+}
+
+void MainWindow::on_actionMove_triggered()
+{
+ on_toolButton_Move_clicked();
+}
+
+void MainWindow::on_actionMap_Shift_triggered()
+{
+ on_toolButton_Shift_clicked();
+}
+
+void MainWindow::scaleMapView(int s) {
+ editor->map->scale_exp += s;
+
+ double base = (double)editor->map->scale_base;
+ double exp = editor->map->scale_exp;
+ double sfactor = pow(base,s);
+
+ ui->graphicsView_Map->scale(sfactor,sfactor);
+ ui->graphicsView_Objects_Map->scale(sfactor,sfactor);
+
+ ui->graphicsView_Map->setFixedSize((editor->scene->width() + 2) * pow(base,exp),
+ (editor->scene->height() + 2) * pow(base,exp));
+
+ ui->graphicsView_Objects_Map->setFixedSize((editor->scene->width() + 2) * pow(base,exp),
+ (editor->scene->height() + 2) * pow(base,exp));
+}
+
void MainWindow::addNewEvent(QString event_type)
{
if (editor) {
@@ -881,27 +957,80 @@ void MainWindow::on_toolButton_deleteObject_clicked()
}
}
+void MainWindow::on_toolButton_Open_Scripts_clicked()
+{
+ openInTextEditor();
+}
+
void MainWindow::on_toolButton_Paint_clicked()
{
editor->map_edit_mode = "paint";
+ editor->cursor = QCursor(QPixmap(":/icons/pencil_cursor.ico"), 10, 10);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ QScroller::ungrabGesture(ui->scrollArea);
+
checkToolButtons();
}
void MainWindow::on_toolButton_Select_clicked()
{
editor->map_edit_mode = "select";
+ editor->cursor = QCursor(QPixmap(":/icons/cursor.ico"), 0, 0);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ QScroller::ungrabGesture(ui->scrollArea);
+
checkToolButtons();
}
void MainWindow::on_toolButton_Fill_clicked()
{
editor->map_edit_mode = "fill";
+ editor->cursor = QCursor(QPixmap(":/icons/fill_color_cursor.ico"), 10, 10);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ QScroller::ungrabGesture(ui->scrollArea);
+
checkToolButtons();
}
void MainWindow::on_toolButton_Dropper_clicked()
{
editor->map_edit_mode = "pick";
+ editor->cursor = QCursor(QPixmap(":/icons/pipette_cursor.ico"), 10, 10);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ QScroller::ungrabGesture(ui->scrollArea);
+
+ checkToolButtons();
+}
+
+void MainWindow::on_toolButton_Move_clicked()
+{
+ editor->map_edit_mode = "move";
+ editor->cursor = QCursor(QPixmap(":/icons/move.ico"), 7, 7);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ QScroller::grabGesture(ui->scrollArea, QScroller::LeftMouseButtonGesture);
+
+ checkToolButtons();
+}
+
+void MainWindow::on_toolButton_Shift_clicked()
+{
+ editor->map_edit_mode = "shift";
+ editor->cursor = QCursor(QPixmap(":/icons/shift_cursor.ico"), 10, 10);
+
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ QScroller::ungrabGesture(ui->scrollArea);
+
checkToolButtons();
}
@@ -910,6 +1039,8 @@ void MainWindow::checkToolButtons() {
ui->toolButton_Select->setChecked(editor->map_edit_mode == "select");
ui->toolButton_Fill->setChecked(editor->map_edit_mode == "fill");
ui->toolButton_Dropper->setChecked(editor->map_edit_mode == "pick");
+ ui->toolButton_Move->setChecked(editor->map_edit_mode == "move");
+ ui->toolButton_Shift->setChecked(editor->map_edit_mode == "shift");
}
void MainWindow::onLoadMapRequested(QString mapName, QString fromMapName) {
@@ -1044,3 +1175,9 @@ void MainWindow::on_checkBox_smartPaths_stateChanged(int selected)
{
editor->map->smart_paths_enabled = selected == Qt::Checked;
}
+
+void MainWindow::on_checkBox_ToggleBorder_stateChanged(int selected)
+{
+ bool visible = selected != 0;
+ editor->toggleBorderVisibility(visible);
+}
diff --git a/mainwindow.h b/mainwindow.h
index b8a12f8b..b020ee52 100755
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -37,6 +37,8 @@ private slots:
void undo();
void redo();
+ void openInTextEditor();
+
void onLoadMapRequested(QString, QString);
void onMapChanged(Map *map);
void onMapNeedsRedrawing(Map *map);
@@ -58,7 +60,18 @@ private slots:
void on_actionRedo_triggered();
+ void on_actionZoom_In_triggered();
+ void on_actionZoom_Out_triggered();
+ void on_actionBetter_Cursors_triggered();
+ 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();
+
void on_toolButton_deleteObject_clicked();
+ void on_toolButton_Open_Scripts_clicked();
void addNewEvent(QString);
void updateSelectedObjects();
@@ -71,6 +84,10 @@ private slots:
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 onTilesetChanged(QString);
@@ -102,6 +119,8 @@ private slots:
void on_checkBox_Visibility_clicked(bool checked);
+ void on_checkBox_ToggleBorder_stateChanged(int arg1);
+
private:
Ui::MainWindow *ui;
QStandardItemModel *mapListModel;
@@ -124,6 +143,8 @@ private:
void displayMapProperties();
void checkToolButtons();
+
+ void scaleMapView(int);
};
enum MapListUserRoles {
diff --git a/mainwindow.ui b/mainwindow.ui
index f3f19222..cde58531 100755
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -171,7 +171,7 @@
true
- <html><head/><body><p>Editor</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html>
+ <html><head/><body><p>Pencil</p><p><span style=" font-weight:600;">Click</span> and drag to draw on the map.</p><p><span style=" font-weight:600;">Right-click</span> and drag to select tiles.</p></body></html>
Paint
@@ -214,7 +214,7 @@
-
- <html><head/><body><p>Flood Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html>
+ <html><head/><body><p>Bucket Fill</p><p>Fills all similar tiles in a region with the selected metatiles or collision attributes</p></body></html>
Fill
@@ -231,7 +231,7 @@
-
- <html><head/><body><p>Eye Dropper</p><p>Click to select a metatile or collision attribute.</p></body></html>
+ <html><head/><body><p>Eyedropper</p><p><span style=" font-weight:600;">Click</span> to select a metatile or collision attribute.</p></body></html>
Dropper
@@ -245,10 +245,44 @@
+ -
+
+
+ <html><head/><body><p>Move</p><p>Click to drag map around.</p></body></html>
+
+
+ ...
+
+
+
+ :/icons/move.ico:/icons/move.ico
+
+
+ true
+
+
+
+ -
+
+
+ <html><head/><body><p>Map Shift</p><p><span style=" font-weight:600;">Click and drag</span> on the map to shift the positions all metatiles at once. This is useful after resizing a map.</p></body></html>
+
+
+ Shift
+
+
+
+ :/icons/shift.ico:/icons/shift.ico
+
+
+ true
+
+
+
-
- <html><head/><body><p>Smart-path mode allows easier drawing of paths. If a 3x3 metatile block is selcted in the right panel, then smart path mode will automatically form a pathway using those selected blocks.</p><p>When smart-path mode is <span style=" font-weight:600;">not</span> enabled, clicking and dragging a selection will tile it in a grid.</p></body></html>
+ <html><head/><body><p>Smart-path mode allows easier drawing of paths. If a 3x3 metatile block is selcted in the right panel, then smart path mode will automatically form a pathway using those selected blocks.</p><p>When smart-path mode is <span style=" font-weight:600;">not</span> enabled, clicking and dragging a selection will tile it in a grid.</p><p>Hold down the <span style=" font-weight:600;">shift</span> key while editing to quickly enable smart-path mode.</p></body></html>
margin-left: 10px
@@ -267,7 +301,17 @@
- Show Grid
+ Grid
+
+
+
+ -
+
+
+ Border
+
+
+ true
@@ -334,7 +378,7 @@
0
0
- 429
+ 469
620
@@ -362,9 +406,18 @@
0
+
+ false
+
false
+
+ QAbstractScrollArea::AdjustIgnored
+
+
+ QGraphicsView::NoDrag
+
-
@@ -708,7 +761,7 @@
0
0
- 315
+ 275
86
@@ -814,7 +867,7 @@
0
0
- 365
+ 325
405
@@ -1330,6 +1383,29 @@
+ -
+
+
+ Open Map Scripts
+
+
+ false
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 20
+ 20
+
+
+
+
@@ -2044,8 +2120,29 @@
+
+
+
+
@@ -2104,6 +2201,84 @@
Export Map Image...
+
+
+ Zoom In
+
+
+ +
+
+
+
+
+ Zoom Out
+
+
+ -
+
+
+
+
+ true
+
+
+ true
+
+
+ Cursor Icons
+
+
+ <html><head/><body><p>Use reticule-styled cursors with icon showing currently selected tool.</p></body></html>
+
+
+
+
+ Pencil
+
+
+ N
+
+
+
+
+ Bucket Fill
+
+
+ B
+
+
+
+
+ Eyedropper
+
+
+ E
+
+
+
+
+ Move
+
+
+ M
+
+
+
+
+ Map Shift
+
+
+ S
+
+
+
+
+ Pointer
+
+
+ P
+
+
diff --git a/map.cpp b/map.cpp
index f114884f..626724f2 100755
--- a/map.cpp
+++ b/map.cpp
@@ -608,10 +608,11 @@ bool Map::hasUnsavedChanges() {
}
void Map::hoveredTileChanged(int x, int y, int block) {
- emit statusBarMessage(QString("X: %1, Y: %2, Metatile: 0x%3")
+ emit statusBarMessage(QString("X: %1, Y: %2, Metatile: 0x%3, Scale = %4x")
.arg(x)
.arg(y)
- .arg(QString("%1").arg(block, 3, 16, QChar('0')).toUpper()));
+ .arg(QString("%1").arg(block, 3, 16, QChar('0')).toUpper())
+ .arg(QString::number(pow(this->scale_base,this->scale_exp))));
}
void Map::clearHoveredTile() {
diff --git a/map.h b/map.h
index 017c7b8b..b41c97c4 100755
--- a/map.h
+++ b/map.h
@@ -9,6 +9,7 @@
#include
#include
#include
+#include
class HistoryItem {
public:
@@ -135,6 +136,8 @@ public:
QString show_location;
QString battle_scene;
MapLayout *layout;
+ int scale_exp = 0;
+ double scale_base = sqrt(2); // adjust scale factor with this
bool isPersistedToFile = true;
diff --git a/resources/icons/fill_color_cursor.ico b/resources/icons/fill_color_cursor.ico
new file mode 100644
index 00000000..712ab992
Binary files /dev/null and b/resources/icons/fill_color_cursor.ico differ
diff --git a/resources/icons/move.ico b/resources/icons/move.ico
new file mode 100644
index 00000000..1d247401
Binary files /dev/null and b/resources/icons/move.ico differ
diff --git a/resources/icons/pencil_cursor.ico b/resources/icons/pencil_cursor.ico
new file mode 100644
index 00000000..1ff8d8fb
Binary files /dev/null and b/resources/icons/pencil_cursor.ico differ
diff --git a/resources/icons/pipette_cursor.ico b/resources/icons/pipette_cursor.ico
new file mode 100644
index 00000000..8c226945
Binary files /dev/null and b/resources/icons/pipette_cursor.ico differ
diff --git a/resources/icons/shift.ico b/resources/icons/shift.ico
new file mode 100644
index 00000000..dab33a4e
Binary files /dev/null and b/resources/icons/shift.ico differ
diff --git a/resources/icons/shift_cursor.ico b/resources/icons/shift_cursor.ico
new file mode 100644
index 00000000..0c8722c3
Binary files /dev/null and b/resources/icons/shift_cursor.ico differ
diff --git a/resources/images.qrc b/resources/images.qrc
index dfca147d..2094922f 100755
--- a/resources/images.qrc
+++ b/resources/images.qrc
@@ -9,6 +9,7 @@
icons/map.ico
icons/cursor.ico
icons/fill_color.ico
+ icons/move.ico
icons/pencil.ico
icons/pipette.ico
images/Entities_16x16.png
@@ -16,5 +17,10 @@
icons/delete.ico
icons/viewsprites.ico
images/collisions.png
+ icons/fill_color_cursor.ico
+ icons/pencil_cursor.ico
+ icons/pipette_cursor.ico
+ icons/shift.ico
+ icons/shift_cursor.ico