diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui
index 4bb93491..3e02c9f8 100644
--- a/forms/mainwindow.ui
+++ b/forms/mainwindow.ui
@@ -6,8 +6,8 @@
0
0
- 1117
- 788
+ 1287
+ 815
@@ -202,14 +202,14 @@
-
-
+
0
0
- 100
+ 200
0
@@ -226,501 +226,472 @@
-
-
- true
-
-
-
- 1
- 0
-
-
-
- 0
-
-
- false
-
-
- false
-
-
-
-
+
+
+
+ 0
-
-
- :/icons/map.ico:/icons/map.ico
-
-
- Map
-
-
- <html><head/><body><p>Edit the map layout.</p><p>Select metatiles or collision attributes from the right panel, and paint them onto the map.</p></body></html>
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 6
-
- -
-
-
- Qt::Horizontal
+
-
+
+
-
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ true
+
+
+
+ 1
+ 0
+
+
+
+ 0
+
+
+ false
+
+
+
+
-
-
-
- 1
- 0
-
+
+
+ 0
-
- QFrame::StyledPanel
+
+ 0
-
- QFrame::Raised
+
+ 0
-
- 1
+
+ 0
-
-
- 3
-
-
- 3
-
-
- 3
-
-
- 3
-
-
- 6
-
-
-
-
+
+ 6
+
+
-
+
+
+ Qt::Horizontal
+
+
-
- 0
+
+ 1
0
-
-
- 0
- 32
-
-
QFrame::StyledPanel
QFrame::Raised
-
+
+ 1
+
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
- 4
+ 6
-
- 4
-
-
- 4
-
-
- 4
-
-
- 4
-
-
-
-
-
- true
+
-
+
+
+ QFrame::StyledPanel
-
- <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
-
-
-
- :/icons/pencil.ico:/icons/pencil.ico
-
-
- true
-
-
- true
-
-
- false
+
+ QFrame::Raised
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 1
+ 0
+
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 543
+ 600
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 166
+ 16
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 166
+ 16
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 16
+ 166
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ false
+
+
+ false
+
+
+ QAbstractScrollArea::AdjustIgnored
+
+
+ QGraphicsView::NoDrag
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 16
+ 166
+
+
+
+
+
+
+
+
+
- -
-
-
- true
-
-
- <html><head/><body><p>Pointer</p><p>Does nothing</p></body></html>
-
-
- Select
-
-
-
- :/icons/cursor.ico:/icons/cursor.ico
-
-
- true
-
-
-
- -
-
-
- <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
-
-
-
- :/icons/fill_color.ico:/icons/fill_color.ico
-
-
- true
-
-
-
- -
-
-
- <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
-
-
-
- :/icons/pipette.ico:/icons/pipette.ico
-
-
- true
-
-
-
- -
-
-
- <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 of 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><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
-
-
- Smart Paths
-
-
-
- -
-
-
- <html><head/><body><p>Toggles a grid over the map's metatile boundaries.</p><p><span style=" font-weight:600;">Ctrl + G</span></p></body></html>
-
-
-
-
-
- Grid
-
-
-
- -
-
-
- Border
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- <html><head/><body><p>Change a map layout's width and height.</p></body></html>
-
-
- Change Dimensions
-
-
-
-
-
-
- -
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
+
-
- 1
+
+ 0
0
-
- true
+
+
+ 0
+ 32
+
-
-
-
- 0
- 0
- 542
- 628
-
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 4
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 0
- 0
-
-
-
- false
-
-
- false
-
-
- QAbstractScrollArea::AdjustIgnored
-
-
- QGraphicsView::NoDrag
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 166
- 16
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 16
- 166
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 166
- 16
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 16
- 166
-
-
-
-
-
-
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+ -
+
+
+ true
+
+
+ <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
+
+
+
+ :/icons/pencil.ico:/icons/pencil.ico
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+
+ -
+
+
+ true
+
+
+ <html><head/><body><p>Pointer</p><p>Does nothing</p></body></html>
+
+
+ Select
+
+
+
+ :/icons/cursor.ico:/icons/cursor.ico
+
+
+ true
+
+
+
+ -
+
+
+ <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
+
+
+
+ :/icons/fill_color.ico:/icons/fill_color.ico
+
+
+ true
+
+
+
+ -
+
+
+ <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
+
+
+
+ :/icons/pipette.ico:/icons/pipette.ico
+
+
+ true
+
+
+
+ -
+
+
+ <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 of all metatiles (Map tab) or events (Events tab) 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><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
+
+
+ Smart Paths
+
+
+
+ -
+
+
+ <html><head/><body><p>Toggles a grid over the map's metatile boundaries.</p><p><span style=" font-weight:600;">Ctrl + G</span></p></body></html>
+
+
+
+
+
+ Grid
+
+
+
+ -
+
+
+ Border
+
+
+ true
+
+
+
+ -
+
+
+ <html><head/><body><p>Change a map layout's width and height.</p></body></html>
+
+
+ Change Dimensions
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
-
-
-
- 0
- 0
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 3
-
-
- 3
-
-
- 3
-
-
- 3
-
- -
-
-
- true
-
+
-
+
0
0
-
-
- 156
- 0
-
+
+ QFrame::StyledPanel
-
- 0
+
+ QFrame::Raised
-
-
-
- 0
- 0
-
-
-
- Metatiles
-
-
+
+
3
@@ -733,51 +704,508 @@
3
-
- 3
-
-
-
-
+
-
+
+
+ true
+
-
+
0
0
-
- Qt::ScrollBarAlwaysOn
+
+
+ 156
+ 0
+
-
- Qt::ScrollBarAsNeeded
+
+ 0
-
- QAbstractScrollArea::AdjustIgnored
-
-
- true
-
-
- Qt::AlignHCenter|Qt::AlignTop
-
-
-
- true
-
-
-
- 8
- 0
- 224
- 324
-
-
+
-
+
0
0
-
+
+ Metatiles
+
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
-
+
+
+ Primary Tileset
+
+
+
+ -
+
+
+ Qt::StrongFocus
+
+
+ <html><head/><body><p>Primary Tileset</p><p>Defines the first 0x200 metatiles available for the map.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Secondary Tileset
+
+
+
+ -
+
+
+ Qt::StrongFocus
+
+
+ <html><head/><body><p>Secondary Tileset</p><p>Defines the second 0x200 metatiles available for the map.</p></body></html>
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 92
+
+
+
+
+ 16777215
+ 92
+
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ QLayout::SetDefaultConstraint
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Selection
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 443
+ 74
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Border
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 48
+
+
+
+ <html><head/><body><p>The border is a 2x2 metatile which is repeated outside of the map layout's boundary. Draw on this border area to modify it.</p></body></html>
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+ Qt::ScrollBarAsNeeded
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::ScrollBarAlwaysOn
+
+
+ Qt::ScrollBarAsNeeded
+
+
+ QAbstractScrollArea::AdjustIgnored
+
+
+ true
+
+
+ Qt::AlignHCenter|Qt::AlignTop
+
+
+
+ true
+
+
+
+ 8
+ 0
+ 431
+ 341
+
+
+
+
+ 0
+ 0
+
+
+
+
+ QLayout::SetDefaultConstraint
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractScrollArea::AdjustIgnored
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+ -
+
+
+ 10
+
+
+ 90
+
+
+ 30
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+ Collision
+
+
QLayout::SetDefaultConstraint
@@ -793,11 +1221,24 @@
0
-
- 0
-
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 64
+ 512
+
+
+
+
+ -
+
Qt::Vertical
@@ -809,60 +1250,68 @@
- -
-
-
- true
+
-
+
+
+ Qt::Horizontal
-
-
- 0
- 0
-
+
+
+ 40
+ 20
+
-
- Qt::ScrollBarAlwaysOff
+
+
+ -
+
+
+ Qt::Horizontal
-
- Qt::ScrollBarAlwaysOff
+
+
+ 40
+ 20
+
-
- QAbstractScrollArea::AdjustIgnored
+
+
+ -
+
+
+ 0
+
+
+ 100
+
+
+ 50
+
+
+ Qt::Horizontal
- -
-
-
- Qt::Horizontal
+
-
+
+
+ Opacity
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
+
- -
-
+
+
+
+
+ -
+
+
+ true
+
0
@@ -871,210 +1320,48 @@
- 0
- 92
+ 444
+ 0
-
-
- 16777215
- 92
-
-
-
- QFrame::NoFrame
-
-
- QFrame::Raised
-
-
-
- 0
-
-
- QLayout::SetDefaultConstraint
-
+
- 0
+ 3
- 0
+ 3
- 0
+ 3
- 0
+ 3
-
-
-
-
- Selection
+
-
+
+
+ There are no events on the current map.
+
+
+ Qt::AlignCenter
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- QFrame::NoFrame
-
-
- QFrame::Plain
-
-
- true
-
-
-
-
- 0
- 0
- 256
- 74
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- Qt::ScrollBarAlwaysOff
-
-
- Qt::ScrollBarAlwaysOff
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 110
-
-
-
-
- 16777215
- 110
-
-
-
- Border
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- 0
- 0
-
+
+
+
+ 16777215
+ 32
+
-
-
- QLayout::SetMinAndMaxSize
-
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
0
@@ -1087,152 +1374,374 @@
0
-
- 0
-
-
-
-
+
-
+
+
+
+ 40
+ 32
+
+
+
+ <html><head/><body><p>Add a new event to the map.</p></body></html>
+
+
+ New Object
+
+
+
+ :/icons/add.ico:/icons/add.ico
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+
+ -
+
-
+
0
0
- 0
- 0
+ 40
+ 32
-
+
+ <html><head/><body><p>Delete the selected event from the map.</p></body></html>
+
+
+ Delete
+
+
+
+ :/icons/delete.ico:/icons/delete.ico
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+ false
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
- 16777215
- 16777215
+ 40
+ 20
-
- true
+
+
+ -
+
+
+
+ 0
+ 0
+
-
-
-
- 0
- 0
- 234
- 83
-
+
+ Open Map Scripts
+
+
+ false
+
+
+
+
+
+
+ -
+
+
+ 0
+
+
+
+ Objects
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ true
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ Warps
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ true
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ Triggers
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ true
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ BGs
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ true
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ Healspots
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ true
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ Multiple
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
0
0
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 1
- 1
-
-
-
-
- 16777215
- 16777215
-
-
-
- <html><head/><body><p>The border is a group of metatiles which are repeated outside of the map layout's boundary. Draw on this border area to modify it.</p></body></html>
-
-
-
-
+
+ true
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+
+ 0
+ 0
+ 430
+ 521
+
+
+
+
+ 0
+ 0
+
+
+
-
-
-
-
-
-
-
-
- -
-
-
- 10
-
-
- 90
-
-
- 30
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
-
-
-
- Primary Tileset
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>Primary Tileset</p><p>Defines the first 0x200 metatiles available for the map.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Secondary Tileset
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- <html><head/><body><p>Secondary Tileset</p><p>Defines the second 0x200 metatiles available for the map.</p></body></html>
-
-
- true
-
+
+
+
@@ -1240,1084 +1749,22 @@
-
-
- true
-
-
-
- 0
- 0
-
-
-
- Collision
-
-
-
- QLayout::SetDefaultConstraint
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 64
- 512
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- 0
-
-
- 100
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Opacity
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- Events
-
-
- <html><head/><body><p>Edit the map's events.</p><p>View and modify objects, warps, signs, etc.</p></body></html>
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
-
- 0
- 0
-
-
-
- Qt::Horizontal
-
-
-
-
- 1
- 0
-
-
-
- true
-
-
-
-
- 0
- 0
- 371
- 684
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 166
- 16
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 166
- 16
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 16
- 166
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 16
- 166
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 444
- 0
-
-
-
-
- 3
-
-
- 3
-
-
- 3
-
-
- 3
-
- -
-
-
- There are no events on the current map.
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 16777215
- 32
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 40
- 32
-
-
-
- <html><head/><body><p>Add a new event to the map.</p></body></html>
-
-
- New Object
-
-
-
- :/icons/add.ico:/icons/add.ico
-
-
- Qt::ToolButtonTextBesideIcon
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 40
- 32
-
-
-
- <html><head/><body><p>Delete the selected event from the map.</p></body></html>
-
-
- Delete
-
-
-
- :/icons/delete.ico:/icons/delete.ico
-
-
- Qt::ToolButtonTextBesideIcon
-
-
- false
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Open Map Scripts
-
-
- false
-
-
-
-
-
-
- -
-
-
- 0
-
-
-
- Objects
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 430
- 575
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- Warps
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 98
- 28
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- Triggers
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 98
- 28
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- BGs
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 98
- 28
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- Healspots
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 98
- 28
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
- Multiple
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
-
- 0
- 0
-
-
-
- true
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
-
- 0
- 0
- 98
- 28
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0
- 0
-
-
-
- Header
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- false
-
-
-
- 0
- 0
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- QFormLayout::FieldsStayAtSizeHint
-
-
- 12
-
-
- 9
-
-
-
-
-
- Song
-
-
-
- -
-
-
- <html><head/><body><p>The default background music for this map.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Location
-
-
-
- -
-
-
- <html><head/><body><p>The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Requires Flash
-
-
-
- -
-
-
- <html><head/><body><p>Whether or not the map is dark and requires Flash to illuminate.</p></body></html>
-
-
-
-
-
-
- -
-
-
- Weather
-
-
-
- -
-
-
- <html><head/><body><p>The default weather for this map.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Type
-
-
-
- -
-
-
- <html><head/><body><p>The map type is a general attribute, which is used for many different things. For example. it determines whether biking or running is allowed.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Battle scene
-
-
-
- -
-
-
- <html><head/><body><p>Determines the type of battle scene graphics to use.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- Show Location Name
-
-
-
- -
-
-
- <html><head/><body><p>Whether or not to display the location name when the player enters the map.</p></body></html>
-
-
-
-
-
-
- -
-
-
- Allow Running
-
-
-
- -
-
-
- <html><head/><body><p>Allows the player to use Running Shoes</p></body></html>
-
-
-
-
-
-
- -
-
-
- Allow Biking
-
-
-
- -
-
-
- <html><head/><body><p>Allows the player to use a Bike</p></body></html>
-
-
-
-
-
-
- -
-
-
- Allow Dig & Escape Rope
-
-
-
- -
-
-
- <html><head/><body><p>Allows the player to use Dig or Escape Rope</p></body></html>
-
-
-
-
-
-
- -
-
-
- Floor Number
-
-
-
- -
-
-
- <html><head/><body><p>Floor number to be used for maps with elevators.</p></body></html>
-
-
- -128
-
-
- 127
-
-
- -
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
-
-
-
- Custom Fields
-
-
-
- -
-
-
- QFrame::NoFrame
-
-
- QFrame::Plain
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
- Add
-
-
-
- -
-
-
- Delete
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
- -
-
-
- Custom fields will be added to the map.json file for the current map.
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
- true
-
-
- false
-
-
-
- Key
-
-
-
-
- Value
-
-
-
-
-
-
-
-
-
-
-
- Connections
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
+
-
+
0
0
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
+
+
+ 0
+
0
@@ -2330,258 +1777,362 @@
0
-
- 0
-
-
-
-
+
-
+
+
+ false
+
-
+
0
0
-
-
- 0
- 32
-
-
QFrame::StyledPanel
QFrame::Raised
-
-
- 4
+
+
+ QFormLayout::FieldsStayAtSizeHint
-
- 4
-
-
- 4
-
-
- 4
+
+ 12
- 4
+ 9
-
-
-
-
-
- 0
- 0
-
+
-
+
+
+ Song
+
+
+ -
+
- <html><head/><body><p>Add a new connection.</p></body></html>
-
-
-
-
-
-
- :/icons/add.ico
-
-
-
-
- -
-
-
- <html><head/><body><p>Remove the currently-selected connection.</p></body></html>
-
-
-
-
-
-
- :/icons/delete.ico
-
-
-
-
- -
-
-
- Number of Connections:
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Expanding
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- <html><head/><body><p>If enabled, connections will automatically be updated on the connected map.</p></body></html>
-
-
- Mirror to Connecting Maps
-
-
- true
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 32
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 6
-
-
- 4
-
-
- 4
-
-
- 4
-
-
- 4
-
-
-
-
-
- Map
-
-
-
- -
-
-
- <html><head/><body><p>The destination map name of the connection.</p></body></html>
+ <html><head/><body><p>The default background music for this map.</p></body></html>
true
- -
-
+
-
+
- Offset
+ Location
- -
-
+
-
+
- <html><head/><body><p>The number of metatiles to offset the connection.</p></body></html>
+ <html><head/><body><p>The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Requires Flash
+
+
+
+ -
+
+
+ <html><head/><body><p>Whether or not the map is dark and requires Flash to illuminate.</p></body></html>
+
+
+
+
+
+
+ -
+
+
+ Weather
+
+
+
+ -
+
+
+ <html><head/><body><p>The default weather for this map.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Type
+
+
+
+ -
+
+
+ <html><head/><body><p>The map type is a general attribute, which is used for many different things. For example. it determines whether biking or running is allowed.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Battle scene
+
+
+
+ -
+
+
+ <html><head/><body><p>Determines the type of battle scene graphics to use.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Show Location Name
+
+
+
+ -
+
+
+ <html><head/><body><p>Whether or not to display the location name when the player enters the map.</p></body></html>
+
+
+
+
+
+
+ -
+
+
+ Allow Running
+
+
+
+ -
+
+
+ <html><head/><body><p>Allows the player to use Running Shoes</p></body></html>
+
+
+
+
+
+
+ -
+
+
+ Allow Biking
+
+
+
+ -
+
+
+ <html><head/><body><p>Allows the player to use a Bike</p></body></html>
+
+
+
+
+
+
+ -
+
+
+ Allow Dig & Escape Rope
+
+
+
+ -
+
+
+ <html><head/><body><p>Allows the player to use Dig or Escape Rope</p></body></html>
+
+
+
+
+
+
+ -
+
+
+ Floor Number
+
+
+
+ -
+
+
+ <html><head/><body><p>Floor number to be used for maps with elevators.</p></body></html>
- -999
+ -128
- 999
+ 127
- -
-
-
- <html><head/><body><p>The direction of the connection.</p></body></html>
-
-
-
-
- up
-
-
- -
-
- right
-
-
- -
-
- down
-
-
- -
-
- left
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
+
-
+
QFrame::StyledPanel
QFrame::Raised
-
+
+
-
+
+
+ Custom Fields
+
+
+
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Add
+
+
+
+ -
+
+
+ Delete
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+ -
+
+
+ Custom fields will be added to the map.json file for the current map.
+
+
+ false
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+ true
+
+
+ false
+
+
+
+ Key
+
+
+
+
+ Value
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
0
@@ -2598,110 +2149,26 @@
0
-
-
+
-
- 1
- 0
-
-
-
- true
-
-
-
-
- 0
- 0
- 818
- 574
-
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
-
-
- 0
- 0
- 0
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
- -
-
-
-
+
0
0
+
+
+ 0
+ 32
+
+
QFrame::StyledPanel
QFrame::Raised
-
+
4
@@ -2718,16 +2185,140 @@
4
-
-
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Add a new connection.</p></body></html>
+
- Dive Map
+
+
+
+
+ :/icons/add.ico
+
-
-
+
- <html><head/><body><p>Destination map name when using <span style=" font-weight:600;">Dive</span>. If empty, no such connection will exist.</p></body></html>
+ <html><head/><body><p>Remove the currently-selected connection.</p></body></html>
+
+
+
+
+
+
+ :/icons/delete.ico
+
+
+
+
+ -
+
+
+ Number of Connections:
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>If enabled, connections will automatically be updated on the connected map.</p></body></html>
+
+
+ Mirror to Connecting Maps
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 32
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 6
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
-
+
+
+ Map
+
+
+
+ -
+
+
+ <html><head/><body><p>The destination map name of the connection.</p></body></html>
true
@@ -2735,24 +2326,54 @@
-
-
+
- Emerge Map
+ Offset
-
-
+
- <html><head/><body><p>Destination map name when emerging using <span style=" font-weight:600;">Dive</span>. If empty, no such connection will exist.</p></body></html>
+ <html><head/><body><p>The number of metatiles to offset the connection.</p></body></html>
-
- true
+
+ -999
+
+
+ 999
-
-
+
+
+ <html><head/><body><p>The direction of the connection.</p></body></html>
+
+
-
+
+ up
+
+
+ -
+
+ right
+
+
+ -
+
+ down
+
+
+ -
+
+ left
+
+
+
+
+ -
+
Qt::Horizontal
@@ -2767,106 +2388,296 @@
+ -
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 1
+ 0
+
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 118
+ 118
+
+
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
+ 4
+
+
-
+
+
+ Dive Map
+
+
+
+ -
+
+
+ <html><head/><body><p>Destination map name when using <span style=" font-weight:600;">Dive</span>. If empty, no such connection will exist.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Emerge Map
+
+
+
+ -
+
+
+ <html><head/><body><p>Destination map name when emerging using <span style=" font-weight:600;">Dive</span>. If empty, no such connection will exist.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
- :/icons/tall_grass.ico:/icons/tall_grass.ico
-
-
- Wild Pokemon
-
-
- -
-
-
- QFrame::NoFrame
-
-
- QFrame::Raised
-
-
+
+
-
-
+
QFrame::NoFrame
- QFrame::Plain
+ QFrame::Raised
-
+
-
-
-
- Group
+
+
+ QFrame::NoFrame
+
+ QFrame::Plain
+
+
+
-
+
+
+ Group
+
+
+
+ -
+
+
+ QComboBox::AdjustToContents
+
+
+
+ -
+
+
+ <html><head/><body><p>Create a new group for wild pokemon data on this map.</p></body></html>
+
+
+
+
+
+
+ :/icons/add.ico:/icons/add.ico
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Configure JSON...
+
+
+
+
-
-
-
- QComboBox::AdjustToContents
-
-
-
- -
-
-
- <html><head/><body><p>Create a new group for wild pokemon data on this map.</p></body></html>
-
-
-
-
-
-
- :/icons/add.ico:/icons/add.ico
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Configure JSON...
-
+
+
+
- -
-
-
-
-
-
-
-
-
+
+
+
@@ -2878,7 +2689,7 @@
0
0
- 1117
+ 1287
22
@@ -2976,6 +2787,11 @@
Ctrl+O
+
+
+ Reload Project
+
+
Save
@@ -2984,6 +2800,30 @@
Ctrl+S
+
+
+ true
+
+
+ Show Wild Encounter Tables
+
+
+
+
+ true
+
+
+ Monitor Project Files
+
+
+
+
+ true
+
+
+ Use PoryScript
+
+
New Map...
@@ -3183,35 +3023,6 @@
Themes...
-
-
- Reload Project
-
-
-
-
- true
-
-
- Show Wild Encounter Tables
-
-
-
-
- true
-
-
- Monitor Project Files
-
-
-
-
- true
-
-
- Use PoryScript
-
-
Export Map Stitch Image...
@@ -3235,6 +3046,11 @@
QToolButton
+
+ QTabBar
+ QWidget
+
+
diff --git a/include/config.h b/include/config.h
index d5e5e41c..f1b1d91b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -49,7 +49,7 @@ public:
void setRecentMap(QString map);
void setMapSortOrder(MapSortOrder order);
void setPrettyCursors(bool enabled);
- void setGeometry(QByteArray, QByteArray, QByteArray, QByteArray, QByteArray);
+ void setGeometry(QByteArray, QByteArray, QByteArray, QByteArray);
void setCollisionOpacity(int opacity);
void setMetatilesZoom(int zoom);
void setShowPlayerView(bool enabled);
diff --git a/include/editor.h b/include/editor.h
index 31279095..1f9d9232 100644
--- a/include/editor.h
+++ b/include/editor.h
@@ -70,6 +70,7 @@ public:
void setEditingCollision();
void setEditingObjects();
void setEditingConnections();
+ void setMapEditingButtonsEnabled(bool enabled);
void clearWildMonTabWidgets();
void setCurrentConnectionDirection(QString curDirection);
void updateCurrentConnectionDirection(QString curDirection);
@@ -127,7 +128,6 @@ public:
QList *selected_events = nullptr;
QString map_edit_mode;
- QString prev_edit_mode;
int scale_exp = 0;
double scale_base = sqrt(2); // adjust scale factor with this
diff --git a/include/mainwindow.h b/include/mainwindow.h
index 15182ec7..1e5a65be 100644
--- a/include/mainwindow.h
+++ b/include/mainwindow.h
@@ -78,7 +78,7 @@ private slots:
void on_actionMonitor_Project_Files_triggered(bool checked);
void on_actionUse_Poryscript_triggered(bool checked);
- void on_tabWidget_currentChanged(int index);
+ void on_mainTabBar_tabBarClicked(int index);
void on_actionUndo_triggered();
void on_actionRedo_triggered();
@@ -211,6 +211,7 @@ private:
void displayMapProperties();
void checkToolButtons();
+ void clickToolButtonFromEditMode(QString editMode);
void initWindow();
void initCustomUI();
diff --git a/include/ui/eventpropertiesframe.h b/include/ui/eventpropertiesframe.h
index 49add45b..7e526ab7 100644
--- a/include/ui/eventpropertiesframe.h
+++ b/include/ui/eventpropertiesframe.h
@@ -1,6 +1,8 @@
#ifndef EVENTPROPERTIESFRAME_H
#define EVENTPROPERTIESFRAME_H
+#include "event.h"
+
#include
namespace Ui {
@@ -12,11 +14,16 @@ class EventPropertiesFrame : public QFrame
Q_OBJECT
public:
- explicit EventPropertiesFrame(QWidget *parent = nullptr);
+ explicit EventPropertiesFrame(Event *event, QWidget *parent = nullptr);
~EventPropertiesFrame();
+ void paintEvent(QPaintEvent*);
public:
Ui::EventPropertiesFrame *ui;
+
+private:
+ Event *event;
+ bool firstShow = true;
};
#endif // EVENTPROPERTIESFRAME_H
diff --git a/include/ui/mappixmapitem.h b/include/ui/mappixmapitem.h
index 0b61fff8..e0111eb0 100644
--- a/include/ui/mappixmapitem.h
+++ b/include/ui/mappixmapitem.h
@@ -13,14 +13,19 @@ private:
using QGraphicsPixmapItem::paint;
public:
+ enum class PaintMode {
+ Disabled,
+ Metatiles,
+ EventObjects
+ };
MapPixmapItem(Map *map_, MetatileSelector *metatileSelector, Settings *settings) {
this->map = map_;
this->metatileSelector = metatileSelector;
this->settings = settings;
- this->paintingEnabled = true;
+ this->paintingMode = PaintMode::Metatiles;
setAcceptHoverEvents(true);
}
- bool paintingEnabled;
+ MapPixmapItem::PaintMode paintingMode;
Map *map;
MetatileSelector *metatileSelector;
Settings *settings;
diff --git a/resources/icons/cursor.ico b/resources/icons/cursor.ico
index b502cb04..7cab3607 100644
Binary files a/resources/icons/cursor.ico and b/resources/icons/cursor.ico differ
diff --git a/resources/themes/midnight.qss b/resources/themes/midnight.qss
index 879f1db4..b8e3d4d2 100644
--- a/resources/themes/midnight.qss
+++ b/resources/themes/midnight.qss
@@ -17,7 +17,7 @@ QWidget {
}
QWidget::disabled {
- background: #272822;
+ background: #31332b;
color: #75715E;
}
diff --git a/src/config.cpp b/src/config.cpp
index de8a2f56..80fcaa83 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -127,8 +127,6 @@ void PorymapConfig::parseConfigKeyValue(QString key, QString value) {
this->windowState = bytesFromString(value);
} else if (key == "map_splitter_state") {
this->mapSplitterState = bytesFromString(value);
- } else if (key == "events_splitter_state") {
- this->eventsSlpitterState = bytesFromString(value);
} else if (key == "main_splitter_state") {
this->mainSplitterState = bytesFromString(value);
} else if (key == "collision_opacity") {
@@ -190,7 +188,6 @@ QMap PorymapConfig::getKeyValueMap() {
map.insert("window_geometry", stringFromByteArray(this->windowGeometry));
map.insert("window_state", stringFromByteArray(this->windowState));
map.insert("map_splitter_state", stringFromByteArray(this->mapSplitterState));
- map.insert("events_splitter_state", stringFromByteArray(this->eventsSlpitterState));
map.insert("main_splitter_state", stringFromByteArray(this->mainSplitterState));
map.insert("collision_opacity", QString("%1").arg(this->collisionOpacity));
map.insert("metatiles_zoom", QString("%1").arg(this->metatilesZoom));
@@ -245,12 +242,11 @@ void PorymapConfig::setMonitorFiles(bool monitor) {
this->save();
}
-void PorymapConfig::setGeometry(QByteArray windowGeometry_, QByteArray windowState_, QByteArray mapSplitterState_,
- QByteArray eventsSlpitterState_, QByteArray mainSplitterState_) {
+void PorymapConfig::setGeometry(QByteArray windowGeometry_, QByteArray windowState_,
+ QByteArray mapSplitterState_, QByteArray mainSplitterState_) {
this->windowGeometry = windowGeometry_;
this->windowState = windowState_;
this->mapSplitterState = mapSplitterState_;
- this->eventsSlpitterState = eventsSlpitterState_;
this->mainSplitterState = mainSplitterState_;
this->save();
}
@@ -305,7 +301,6 @@ QMap PorymapConfig::getGeometry() {
geometry.insert("window_geometry", this->windowGeometry);
geometry.insert("window_state", this->windowState);
geometry.insert("map_splitter_state", this->mapSplitterState);
- geometry.insert("events_splitter_state", this->eventsSlpitterState);
geometry.insert("main_splitter_state", this->mainSplitterState);
return geometry;
diff --git a/src/editor.cpp b/src/editor.cpp
index ea4c6c9e..0e8a0c30 100644
--- a/src/editor.cpp
+++ b/src/editor.cpp
@@ -54,7 +54,7 @@ void Editor::saveUiFields() {
}
void Editor::undo() {
- if (current_view && map_item->paintingEnabled) {
+ if (current_view && map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
map->undo();
map_item->draw();
collision_item->draw();
@@ -64,7 +64,7 @@ void Editor::undo() {
}
void Editor::redo() {
- if (current_view && map_item->paintingEnabled) {
+ if (current_view && map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
map->redo();
map_item->draw();
collision_item->draw();
@@ -83,7 +83,7 @@ void Editor::closeProject() {
void Editor::setEditingMap() {
current_view = map_item;
if (map_item) {
- map_item->paintingEnabled = true;
+ map_item->paintingMode = MapPixmapItem::PaintMode::Metatiles;
displayMapConnections();
map_item->draw();
map_item->setVisible(true);
@@ -99,6 +99,8 @@ void Editor::setEditingMap() {
setConnectionItemsVisible(false);
this->cursorMapTileRect->stopSingleTileMode();
this->cursorMapTileRect->setVisibility(true);
+
+ setMapEditingButtonsEnabled(true);
}
void Editor::setEditingCollision() {
@@ -110,7 +112,7 @@ void Editor::setEditingCollision() {
setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
}
if (map_item) {
- map_item->paintingEnabled = true;
+ map_item->paintingMode = MapPixmapItem::PaintMode::Metatiles;
map_item->setVisible(false);
}
if (events_group) {
@@ -120,6 +122,8 @@ void Editor::setEditingCollision() {
setConnectionItemsVisible(false);
this->cursorMapTileRect->setSingleTileMode();
this->cursorMapTileRect->setVisibility(true);
+
+ setMapEditingButtonsEnabled(true);
}
void Editor::setEditingObjects() {
@@ -128,7 +132,9 @@ void Editor::setEditingObjects() {
events_group->setVisible(true);
}
if (map_item) {
- map_item->paintingEnabled = false;
+ map_item->paintingMode = MapPixmapItem::PaintMode::EventObjects;
+ displayMapConnections();
+ map_item->draw();
map_item->setVisible(true);
setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
}
@@ -139,12 +145,30 @@ void Editor::setEditingObjects() {
setConnectionItemsVisible(false);
this->cursorMapTileRect->setSingleTileMode();
this->cursorMapTileRect->setVisibility(false);
+
+ setMapEditingButtonsEnabled(false);
+}
+
+void Editor::setMapEditingButtonsEnabled(bool enabled) {
+ this->ui->toolButton_Fill->setEnabled(enabled);
+ this->ui->toolButton_Dropper->setEnabled(enabled);
+ this->ui->pushButton_ChangeDimensions->setEnabled(enabled);
+ // If the fill button is pressed, unpress it and select the pointer.
+ if (!enabled && (this->ui->toolButton_Fill->isChecked() || this->ui->toolButton_Dropper->isChecked())) {
+ this->map_edit_mode = "select";
+ this->settings->mapCursor = QCursor();
+ this->cursorMapTileRect->setSingleTileMode();
+ this->ui->toolButton_Fill->setChecked(false);
+ this->ui->toolButton_Dropper->setChecked(false);
+ this->ui->toolButton_Select->setChecked(true);
+ }
+ this->ui->checkBox_smartPaths->setEnabled(enabled);
}
void Editor::setEditingConnections() {
current_view = map_item;
if (map_item) {
- map_item->paintingEnabled = false;
+ map_item->paintingMode = MapPixmapItem::PaintMode::Disabled;
map_item->draw();
map_item->setVisible(true);
populateConnectionMapPickers();
@@ -866,7 +890,8 @@ void Editor::onSelectedMetatilesChanged() {
void Editor::onHoveredMapMetatileChanged(int x, int y) {
this->playerViewRect->updateLocation(x, y);
this->cursorMapTileRect->updateLocation(x, y);
- if (map_item->paintingEnabled && x >= 0 && x < map->getWidth() && y >= 0 && y < map->getHeight()) {
+ if (map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles
+ && x >= 0 && x < map->getWidth() && y >= 0 && y < map->getHeight()) {
int blockIndex = y * map->getWidth() + x;
int tile = map->layout->blockdata->blocks->at(blockIndex).tile;
this->ui->statusBar->showMessage(QString("X: %1, Y: %2, Metatile: 0x%3, Scale = %4x")
@@ -880,7 +905,7 @@ void Editor::onHoveredMapMetatileChanged(int x, int y) {
void Editor::onHoveredMapMetatileCleared() {
this->playerViewRect->setVisible(false);
this->cursorMapTileRect->setVisible(false);
- if (map_item->paintingEnabled) {
+ if (map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
this->ui->statusBar->clearMessage();
}
}
@@ -888,7 +913,8 @@ void Editor::onHoveredMapMetatileCleared() {
void Editor::onHoveredMapMovementPermissionChanged(int x, int y) {
this->playerViewRect->updateLocation(x, y);
this->cursorMapTileRect->updateLocation(x, y);
- if (map_item->paintingEnabled && x >= 0 && x < map->getWidth() && y >= 0 && y < map->getHeight()) {
+ if (map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles
+ && x >= 0 && x < map->getWidth() && y >= 0 && y < map->getHeight()) {
int blockIndex = y * map->getWidth() + x;
uint16_t collision = map->layout->blockdata->blocks->at(blockIndex).collision;
uint16_t elevation = map->layout->blockdata->blocks->at(blockIndex).elevation;
@@ -903,7 +929,7 @@ void Editor::onHoveredMapMovementPermissionChanged(int x, int y) {
void Editor::onHoveredMapMovementPermissionCleared() {
this->playerViewRect->setVisible(false);
this->cursorMapTileRect->setVisible(false);
- if (map_item->paintingEnabled) {
+ if (map_item->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
this->ui->statusBar->clearMessage();
}
}
@@ -954,7 +980,7 @@ bool Editor::setMap(QString map_name) {
}
void Editor::onMapStartPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) {
- if (!item->paintingEnabled) {
+ if (!(item->paintingMode == MapPixmapItem::PaintMode::Metatiles)) {
return;
}
@@ -969,7 +995,7 @@ void Editor::onMapStartPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *ite
}
void Editor::onMapEndPaint(QGraphicsSceneMouseEvent *, MapPixmapItem *item) {
- if (!item->paintingEnabled) {
+ if (!(item->paintingMode == MapPixmapItem::PaintMode::Metatiles)) {
return;
}
this->cursorMapTileRect->stopRightClickSelectionAnchor();
@@ -987,53 +1013,96 @@ void Editor::setSmartPathCursorMode(QGraphicsSceneMouseEvent *event)
}
void Editor::mouseEvent_map(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) {
- if (!item->paintingEnabled) {
+ // TODO: add event tab object painting tool buttons stuff here
+ if (item->paintingMode == MapPixmapItem::PaintMode::Disabled) {
return;
}
- if (map_edit_mode == "paint") {
- if (event->buttons() & Qt::RightButton) {
- item->updateMetatileSelection(event);
- } else if (event->buttons() & Qt::MiddleButton) {
- if (event->modifiers() & Qt::ControlModifier) {
- item->magicFill(event);
- } else {
- item->floodFill(event);
- }
- } else {
- this->setSmartPathCursorMode(event);
- 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 if (event->modifiers() & Qt::ControlModifier) {
- item->magicFill(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);
- }
-
QPointF pos = event->pos();
int x = static_cast(pos.x()) / 16;
int y = static_cast(pos.y()) / 16;
+
+ if (item->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
+ if (map_edit_mode == "paint") {
+ if (event->buttons() & Qt::RightButton) {
+ item->updateMetatileSelection(event);
+ } else if (event->buttons() & Qt::MiddleButton) {
+ if (event->modifiers() & Qt::ControlModifier) {
+ item->magicFill(event);
+ } else {
+ item->floodFill(event);
+ }
+ } else {
+ this->setSmartPathCursorMode(event);
+ 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 if (event->modifiers() & Qt::ControlModifier) {
+ item->magicFill(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);
+ }
+ } else if (item->paintingMode == MapPixmapItem::PaintMode::EventObjects) {
+ if (map_edit_mode == "paint" && event->type() == QEvent::GraphicsSceneMousePress) {
+ // Right-clicking while in paint mode will change mode to select.
+ if (event->buttons() & Qt::RightButton) {
+ this->map_edit_mode = "select";
+ this->settings->mapCursor = QCursor();
+ this->cursorMapTileRect->setSingleTileMode();
+ this->ui->toolButton_Paint->setChecked(false);
+ this->ui->toolButton_Select->setChecked(true);
+ } else {
+ // Left-clicking while in paint mode will add a new event of the
+ // type of the first currently selected events.
+ DraggablePixmapItem * newEvent = addNewEvent(this->selected_events->first()->event->get("event_type"));
+ if (newEvent) {
+ newEvent->move(x, y);
+ selectMapEvent(newEvent, false);
+ }
+ }
+ } else if (map_edit_mode == "select") {
+ // do nothing here, at least for now
+ } else if (map_edit_mode == "shift" && item->map) {
+ static QPoint selection_origin;
+
+ if (event->type() == QEvent::GraphicsSceneMouseRelease) {
+ // TODO: commit / update history here
+ } else {
+ if (event->type() == QEvent::GraphicsSceneMousePress) {
+ selection_origin = QPoint(x, y);
+ } 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();
+
+ for (DraggablePixmapItem *item : *(getObjects())) {
+ item->move(xDelta, yDelta);
+ }
+ selection_origin = QPoint(x, y);
+ }
+ }
+ }
+ }
+ }
this->playerViewRect->updateLocation(x, y);
this->cursorMapTileRect->updateLocation(x, y);
}
void Editor::mouseEvent_collision(QGraphicsSceneMouseEvent *event, CollisionPixmapItem *item) {
- if (!item->paintingEnabled) {
+ if (item->paintingMode != MapPixmapItem::PaintMode::Metatiles) {
return;
}
@@ -1771,7 +1840,7 @@ void Editor::selectMapEvent(DraggablePixmapItem *object, bool toggle) {
}
DraggablePixmapItem* Editor::addNewEvent(QString event_type) {
- if (project && map) {
+ if (project && map && !event_type.isEmpty()) {
Event *event = Event::createNewEvent(event_type, map->name, project);
event->put("map_name", map->name);
if (event_type == "event_heal_location") {
@@ -1802,6 +1871,17 @@ void Editor::deleteEvent(Event *event) {
// variable "selectingEvent" so that we can detect whether or not the user
// is clicking on the background instead of an event.
void Editor::objectsView_onMousePress(QMouseEvent *event) {
+ // make sure we are in object editing mode
+ if (map_item && map_item->paintingMode != MapPixmapItem::PaintMode::EventObjects) {
+ return;
+ }
+ if (this->map_edit_mode == "paint" && event->buttons() & Qt::RightButton) {
+ this->map_edit_mode = "select";
+ this->settings->mapCursor = QCursor();
+ this->cursorMapTileRect->setSingleTileMode();
+ this->ui->toolButton_Paint->setChecked(false);
+ this->ui->toolButton_Select->setChecked(true);
+ }
bool multiSelect = event->modifiers() & Qt::ControlModifier;
if (!selectingEvent && !multiSelect && selected_events->length() > 1) {
DraggablePixmapItem *first = selected_events->first();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 732dc0f9..2a8cbd77 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -8,7 +8,6 @@
#include "ui_eventpropertiesframe.h"
#include "bordermetatilespixmapitem.h"
#include "currentselectedmetatilespixmapitem.h"
-#include "customattributestable.h"
#include
#include
@@ -79,6 +78,15 @@ void MainWindow::initExtraShortcuts() {
}
void MainWindow::initCustomUI() {
+ // Set up the tab bar
+ ui->mainTabBar->addTab("Map");
+ ui->mainTabBar->setTabIcon(0, QIcon(QStringLiteral(":/icons/map.ico")));
+ ui->mainTabBar->addTab("Events");
+ ui->mainTabBar->addTab("Header");
+ ui->mainTabBar->addTab("Connections");
+ ui->mainTabBar->addTab("Wild Pokemon");
+ ui->mainTabBar->setTabIcon(4, QIcon(QStringLiteral(":/icons/tall_grass.ico")));
+
// Right-clicking on items in the map list tree view brings up a context menu.
ui->mapList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->mapList, SIGNAL(customContextMenuRequested(const QPoint &)),
@@ -152,11 +160,11 @@ void MainWindow::initMapSortOrder() {
void MainWindow::setProjectSpecificUIVisibility()
{
- ui->tabWidget->setTabEnabled(4, projectConfig.getEncounterJsonActive());
-
ui->actionUse_Encounter_Json->setChecked(projectConfig.getEncounterJsonActive());
ui->actionUse_Poryscript->setChecked(projectConfig.getUsePoryScript());
+ ui->mainTabBar->setTabEnabled(4, projectConfig.getEncounterJsonActive());
+
switch (projectConfig.getBaseGameVersion())
{
case BaseGameVersion::pokeruby:
@@ -264,7 +272,6 @@ void MainWindow::restoreWindowState() {
this->restoreGeometry(geometry.value("window_geometry"));
this->restoreState(geometry.value("window_state"));
this->ui->splitter_map->restoreState(geometry.value("map_splitter_state"));
- this->ui->splitter_events->restoreState(geometry.value("events_splitter_state"));
this->ui->splitter_main->restoreState(geometry.value("main_splitter_state"));
}
@@ -444,7 +451,7 @@ void MainWindow::redrawMapScene()
if (!editor->displayMap())
return;
- on_tabWidget_currentChanged(ui->tabWidget->currentIndex());
+ on_mainTabBar_tabBarClicked(ui->mainTabBar->currentIndex());
double base = editor->scale_base;
double exp = editor->scale_exp;
@@ -455,11 +462,7 @@ void MainWindow::redrawMapScene()
ui->graphicsView_Map->setScene(editor->scene);
ui->graphicsView_Map->setSceneRect(editor->scene->sceneRect());
ui->graphicsView_Map->setFixedSize(width, height);
-
- ui->graphicsView_Objects_Map->setScene(editor->scene);
- ui->graphicsView_Objects_Map->setSceneRect(editor->scene->sceneRect());
- ui->graphicsView_Objects_Map->setFixedSize(width, height);
- ui->graphicsView_Objects_Map->editor = editor;
+ ui->graphicsView_Map->editor = editor;
ui->graphicsView_Connections->setScene(editor->scene);
ui->graphicsView_Connections->setSceneRect(editor->scene->sceneRect());
@@ -1203,17 +1206,28 @@ void MainWindow::on_action_Exit_triggered()
QApplication::quit();
}
-void MainWindow::on_tabWidget_currentChanged(int index)
+void MainWindow::on_mainTabBar_tabBarClicked(int index)
{
+ ui->mainTabBar->setCurrentIndex(index);
+
+ int tabIndexToStackIndex[5] = {0, 0, 1, 2, 3};
+ ui->mainStackedWidget->setCurrentIndex(tabIndexToStackIndex[index]);
+
if (index == 0) {
+ ui->stackedWidget_MapEvents->setCurrentIndex(0);
on_tabWidget_2_currentChanged(ui->tabWidget_2->currentIndex());
} else if (index == 1) {
+ ui->stackedWidget_MapEvents->setCurrentIndex(1);
editor->setEditingObjects();
+ QStringList validOptions = {"select", "move", "paint", "shift"};
+ QString newEditMode = validOptions.contains(editor->map_edit_mode) ? editor->map_edit_mode : "select";
+ clickToolButtonFromEditMode(newEditMode);
} else if (index == 3) {
editor->setEditingConnections();
}
if (index != 4) {
- editor->saveEncounterTabData();
+ if (projectConfig.getEncounterJsonActive())
+ editor->saveEncounterTabData();
}
}
@@ -1318,13 +1332,11 @@ void MainWindow::scaleMapView(int s) {
double sfactor = pow(base,s);
ui->graphicsView_Map->scale(sfactor,sfactor);
- ui->graphicsView_Objects_Map->scale(sfactor,sfactor);
ui->graphicsView_Connections->scale(sfactor,sfactor);
int width = static_cast(ceil((editor->scene->width()) * pow(base,exp))) + 2;
int height = static_cast(ceil((editor->scene->height()) * pow(base,exp))) + 2;
ui->graphicsView_Map->setFixedSize(width, height);
- ui->graphicsView_Objects_Map->setFixedSize(width, height);
ui->graphicsView_Connections->setFixedSize(width, height);
}
}
@@ -1430,7 +1442,7 @@ void MainWindow::updateSelectedObjects() {
bool pokefirered = projectConfig.getBaseGameVersion() == BaseGameVersion::pokefirered;
for (DraggablePixmapItem *item : *events) {
- EventPropertiesFrame *frame = new EventPropertiesFrame;
+ EventPropertiesFrame *frame = new EventPropertiesFrame(item->event);
// frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
QSpinBox *x = frame->ui->spinBox_x;
@@ -1736,13 +1748,6 @@ void MainWindow::updateSelectedObjects() {
item->bind(combo, key);
}
}
-
- // Custom fields table.
- if (event_type != EventType::HealLocation) {
- CustomAttributesTable *customAttributes = new CustomAttributesTable(item->event, frame);
- frame->layout()->addWidget(customAttributes);
- }
-
frames.append(frame);
}
@@ -2044,7 +2049,7 @@ void MainWindow::on_toolButton_Paint_clicked()
void MainWindow::on_toolButton_Select_clicked()
{
editor->map_edit_mode = "select";
- editor->settings->mapCursor = QCursor(QPixmap(":/icons/cursor.ico"), 0, 0);
+ editor->settings->mapCursor = QCursor();
editor->cursorMapTileRect->setSingleTileMode();
ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
@@ -2115,6 +2120,22 @@ void MainWindow::checkToolButtons() {
ui->toolButton_Shift->setChecked(editor->map_edit_mode == "shift");
}
+void MainWindow::clickToolButtonFromEditMode(QString editMode) {
+ if (editMode == "paint") {
+ on_toolButton_Paint_clicked();
+ } else if (editMode == "select") {
+ on_toolButton_Select_clicked();
+ } else if (editMode == "fill") {
+ on_toolButton_Fill_clicked();
+ } else if (editMode == "pick") {
+ on_toolButton_Dropper_clicked();
+ } else if (editMode == "move") {
+ on_toolButton_Move_clicked();
+ } else if (editMode == "shift") {
+ on_toolButton_Shift_clicked();
+ }
+}
+
void MainWindow::onLoadMapRequested(QString mapName, QString fromMapName) {
if (!setMap(mapName, true)) {
QMessageBox msgBox(this);
@@ -2512,7 +2533,6 @@ void MainWindow::closeEvent(QCloseEvent *event) {
this->saveGeometry(),
this->saveState(),
this->ui->splitter_map->saveState(),
- this->ui->splitter_events->saveState(),
this->ui->splitter_main->saveState()
);
porymapConfig.save();
diff --git a/src/ui/collisionpixmapitem.cpp b/src/ui/collisionpixmapitem.cpp
index 3d7079d9..94589a8d 100644
--- a/src/ui/collisionpixmapitem.cpp
+++ b/src/ui/collisionpixmapitem.cpp
@@ -4,13 +4,13 @@ void CollisionPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
int x = static_cast(event->pos().x()) / 16;
int y = static_cast(event->pos().y()) / 16;
emit this->hoveredMapMovementPermissionChanged(x, y);
- if (this->settings->betterCursors && this->paintingEnabled) {
+ if (this->settings->betterCursors && this->paintingMode == MapPixmapItem::PaintMode::Metatiles) {
setCursor(this->settings->mapCursor);
}
}
void CollisionPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
emit this->hoveredMapMovementPermissionCleared();
- if (this->settings->betterCursors && this->paintingEnabled){
+ if (this->settings->betterCursors && this->paintingMode == MapPixmapItem::PaintMode::Metatiles){
unsetCursor();
}
}
diff --git a/src/ui/eventpropertiesframe.cpp b/src/ui/eventpropertiesframe.cpp
index f340be50..d4ea2ac8 100644
--- a/src/ui/eventpropertiesframe.cpp
+++ b/src/ui/eventpropertiesframe.cpp
@@ -1,14 +1,28 @@
#include "eventpropertiesframe.h"
+#include "customattributestable.h"
+
#include "ui_eventpropertiesframe.h"
-EventPropertiesFrame::EventPropertiesFrame(QWidget *parent) :
+EventPropertiesFrame::EventPropertiesFrame(Event *event, QWidget *parent) :
QFrame(parent),
ui(new Ui::EventPropertiesFrame)
{
ui->setupUi(this);
+ this->event = event;
+ this->firstShow = true;
}
EventPropertiesFrame::~EventPropertiesFrame()
{
delete ui;
}
+
+void EventPropertiesFrame::paintEvent(QPaintEvent *painter) {
+ // Custom fields table.
+ if (firstShow && event->get("event_type") != EventType::HealLocation) {
+ CustomAttributesTable *customAttributes = new CustomAttributesTable(event, this);
+ this->layout()->addWidget(customAttributes);
+ }
+ QFrame::paintEvent(painter);
+ firstShow = false;
+}
diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp
index 103a15c5..cf67e8c9 100644
--- a/src/ui/mappixmapitem.cpp
+++ b/src/ui/mappixmapitem.cpp
@@ -558,13 +558,13 @@ void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
int x = static_cast(event->pos().x()) / 16;
int y = static_cast(event->pos().y()) / 16;
emit this->hoveredMapMetatileChanged(x, y);
- if (this->settings->betterCursors && this->paintingEnabled) {
+ if (this->settings->betterCursors && this->paintingMode != MapPixmapItem::PaintMode::Disabled) {
setCursor(this->settings->mapCursor);
}
}
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
emit this->hoveredMapMetatileCleared();
- if (this->settings->betterCursors && this->paintingEnabled) {
+ if (this->settings->betterCursors && this->paintingMode != MapPixmapItem::PaintMode::Disabled) {
unsetCursor();
}
}