Skip to content

Commit 68c9d81

Browse files
committed
feat: CTRL + ALT select can now also select a visible creature if there is one
1 parent 3fa0f82 commit 68c9d81

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

source/map_display.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,15 @@ void MapCanvas::OnMouseActionClick(wxMouseEvent& event) {
651651
if (event.ControlDown() && event.AltDown()) {
652652
Tile* tile = editor.map.getTile(mouse_map_x, mouse_map_y, floor);
653653
if (tile && tile->size() > 0) {
654+
// Select visible creature
655+
if (tile->creature && g_settings.getInteger(Config::SHOW_CREATURES)) {
656+
CreatureBrush* brush = tile->creature->getBrush();
657+
if (brush) {
658+
g_gui.SelectBrush(brush, TILESET_CREATURE);
659+
return;
660+
}
661+
}
662+
// Fall back to item selection
654663
Item* item = tile->getTopItem();
655664
if (item && item->getRAWBrush()) {
656665
g_gui.SelectBrush(item->getRAWBrush(), TILESET_RAW);

0 commit comments

Comments
 (0)