Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some useful shortcuts #290

Merged
merged 3 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docsrc/manual/editing-map-tiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ The border's visibility, including the surrounding map connections, can be toggl

You can zoom in and out on the map with *View -> Zoom In* (``Ctrl++`` or ``Ctrl+Mouse Wheel Scroll Up``) and *View -> Zoom Out* (``Ctrl+-`` or ``Ctrl+Mouse Wheel Scroll Down``).

By default, the mouse cursor will show a white indicator outline of the currently-hovered tile(s) of what will be painted. You can disable this outline with *View -> Cursor Tile Outline*. Additionally, the cursor changes its appearance depending on which tool you currently have selected in the toolbar. You can disable this with *View -> Cursor Icons*.
By default, the mouse cursor will show a white indicator outline of the currently-hovered tile(s) of what will be painted. You can disable this outline with *View -> Cursor Tile Outline* (``C``). Additionally, the cursor changes its appearance depending on which tool you currently have selected in the toolbar. You can disable this with *View -> Cursor Icons*.

An indicator outline for the player's in-game view radius can be toggled with *View -> Player View Rectangle*.
An indicator outline for the player's in-game view radius can be toggled with *View -> Player View Rectangle* (``V``).

The Metatile Selection Pane can be zoomed in or out using the slider on the bottom.

Expand Down
4 changes: 2 additions & 2 deletions docsrc/manual/navigation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Wild Pokémon Tab
Tileset Editor
--------------

The Tileset Editor can be opened with *File -> Tileset Editor*. When the Tileset Editor is opened, it is opened in the context of the currently-opened map. Every map has a primary and secondary tileset, so you will work with a combination of the two whenever you use the Tileset Editor. The left-side pane shows the primary and secondary tilesets' metatiles. The right-side panes allow you to modify the currently-selected metatile.
The Tileset Editor can be opened with *File -> Tileset Editor* (``Ctrl+T``). When the Tileset Editor is opened, it is opened in the context of the currently-opened map. Every map has a primary and secondary tileset, so you will work with a combination of the two whenever you use the Tileset Editor. The left-side pane shows the primary and secondary tilesets' metatiles. The right-side panes allow you to modify the currently-selected metatile.

.. figure:: images/navigation/tileset-editor.png
:alt: Tileset Editor
Expand All @@ -83,7 +83,7 @@ The Tileset Editor can be opened with *File -> Tileset Editor*. When the Tilese
Region Map Editor
-----------------

The Region Map Editor can be opened with *File -> Region Map Editor*. This window will allow you to modify the look and layout of maps on the game's region map. You can also modify the city map images using the bottom two panes. Currently the Region Map Editor is only available for pokeemerald and pokeruby projects.
The Region Map Editor can be opened with *File -> Region Map Editor* (``Ctrl+M``). This window will allow you to modify the look and layout of maps on the game's region map. You can also modify the city map images using the bottom two panes. Currently the Region Map Editor is only available for pokeemerald and pokeruby projects.

.. figure:: images/navigation/region-map-editor.png
:alt: Region Map Editor
Expand Down
12 changes: 12 additions & 0 deletions forms/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,9 @@
<property name="text">
<string>Tileset Editor</string>
</property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
</action>
<action name="actionSort_by_Area">
<property name="checkable">
Expand Down Expand Up @@ -2972,6 +2975,9 @@
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Show the player's view rectangle on the map based on the cursor's position.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="shortcut">
<string>V</string>
</property>
</action>
<action name="actionCursor_Tile_Outline">
<property name="checkable">
Expand All @@ -2983,11 +2989,17 @@
<property name="text">
<string>Cursor Tile Outline</string>
</property>
<property name="shortcut">
<string>C</string>
</property>
</action>
<action name="actionRegion_Map_Editor">
<property name="text">
<string>Region Map Editor</string>
</property>
<property name="shortcut">
<string>Ctrl+M</string>
</property>
</action>
<action name="actionNew_Tileset">
<property name="text">
Expand Down
2 changes: 2 additions & 0 deletions include/ui/mappixmapitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MapPixmapItem : public QObject, public QGraphicsPixmapItem {
MetatileSelector *metatileSelector;
Settings *settings;
bool active;
bool has_mouse = false;
bool right_click;
int paint_tile_initial_x;
int paint_tile_initial_y;
Expand Down Expand Up @@ -80,6 +81,7 @@ class MapPixmapItem : public QObject, public QGraphicsPixmapItem {

protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent*);
void hoverEnterEvent(QGraphicsSceneHoverEvent*);
void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
Expand Down
6 changes: 6 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1366,13 +1366,19 @@ void MainWindow::on_actionPlayer_View_Rectangle_triggered()
bool enabled = ui->actionPlayer_View_Rectangle->isChecked();
porymapConfig.setShowPlayerView(enabled);
this->editor->settings->playerViewRectEnabled = enabled;
if (this->editor->map_item->has_mouse) {
this->editor->playerViewRect->setVisible(enabled);
}
}

void MainWindow::on_actionCursor_Tile_Outline_triggered()
{
bool enabled = ui->actionCursor_Tile_Outline->isChecked();
porymapConfig.setShowCursorTile(enabled);
this->editor->settings->cursorTileRectEnabled = enabled;
if (this->editor->map_item->has_mouse) {
this->editor->cursorMapTileRect->setVisible(enabled);
}
}

void MainWindow::on_actionUse_Encounter_Json_triggered(bool checked)
Expand Down
4 changes: 4 additions & 0 deletions src/ui/mappixmapitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,15 @@ void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
setCursor(this->settings->mapCursor);
}
}
void MapPixmapItem::hoverEnterEvent(QGraphicsSceneHoverEvent *) {
this->has_mouse = true;
}
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
emit this->hoveredMapMetatileCleared();
if (this->settings->betterCursors && this->paintingMode != MapPixmapItem::PaintMode::Disabled) {
unsetCursor();
}
this->has_mouse = false;
}
void MapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
QPointF pos = event->pos();
Expand Down