diff --git a/forms/gridsettingsdialog.ui b/forms/gridsettingsdialog.ui
index 8673a9b3..75d31de1 100644
--- a/forms/gridsettingsdialog.ui
+++ b/forms/gridsettingsdialog.ui
@@ -114,7 +114,10 @@
-
- 1
+ 2
+
+
+ 999
@@ -141,7 +144,10 @@
-
- 1
+ 2
+
+
+ 999
@@ -175,10 +181,24 @@
-
-
+
+
+ 0
+
+
+ 999
+
+
-
-
+
+
+ 0
+
+
+ 999
+
+
-
diff --git a/include/editor.h b/include/editor.h
index 671c70d0..88eec307 100644
--- a/include/editor.h
+++ b/include/editor.h
@@ -23,6 +23,7 @@
#include "collisionpixmapitem.h"
#include "mappixmapitem.h"
#include "settings.h"
+#include "gridsettings.h"
#include "movablerect.h"
#include "cursortilerect.h"
#include "mapruler.h"
@@ -68,6 +69,7 @@ public:
void displayMapConnections();
void displayMapBorder();
void displayMapGrid();
+ void updateMapGrid();
void displayWildMonTables();
void updateMapBorder();
diff --git a/include/mainwindow.h b/include/mainwindow.h
index 3f4625db..f2a31741 100644
--- a/include/mainwindow.h
+++ b/include/mainwindow.h
@@ -26,7 +26,7 @@
#include "shortcutseditor.h"
#include "preferenceeditor.h"
#include "projectsettingseditor.h"
-#include "gridsettingsdialog.h"
+#include "gridsettings.h"
#include "customscriptseditor.h"
#include "wildmonchart.h"
#include "updatepromoter.h"
diff --git a/include/settings.h b/include/settings.h
index 0e0e8df5..d37283cd 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -4,15 +4,6 @@
#include
-struct GridSettings {
- uint width = 16;
- uint height = 16;
- int offsetX = 0;
- int offsetY = 0;
- Qt::PenStyle style = Qt::SolidLine;
- QColor color = Qt::black;
-};
-
class Settings
{
public:
diff --git a/include/ui/gridsettings.h b/include/ui/gridsettings.h
new file mode 100644
index 00000000..0a966e4c
--- /dev/null
+++ b/include/ui/gridsettings.h
@@ -0,0 +1,99 @@
+#ifndef GRIDSETTINGS_H
+#define GRIDSETTINGS_H
+
+#include
+#include
+
+class GridSettings {
+public:
+ explicit GridSettings() {};
+ ~GridSettings() {};
+
+ enum Style {
+ Solid,
+ LargeDashes,
+ SmallDashes,
+ Crosshairs,
+ Dots,
+ };
+
+ uint width = 16;
+ uint height = 16;
+ int offsetX = 0;
+ int offsetY = 0;
+ Style style = Style::Solid;
+ QColor color = Qt::black;
+ QList getHorizontalDashPattern() const { return this->getDashPattern(this->width); }
+ QList getVerticalDashPattern() const { return this->getDashPattern(this->height); }
+
+ static QString getStyleName(Style style);
+ static GridSettings::Style getStyleFromName(const QString &name);
+private:
+ static const QMap