Skip to content

Commit

Permalink
Merge pull request #106 from Cattlesquat/Bugfix13196
Browse files Browse the repository at this point in the history
13196 Ctrl+Click toggles rather than "only" deselects
  • Loading branch information
uckelman authored Jul 21, 2020
2 parents 19f7b8f + ffbbc25 commit 1b0f849
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions vassal-app/src/main/java/VASSAL/build/module/map/KeyBufferer.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,17 @@ public void mousePressed(MouseEvent e) {
}
// RFE 1629255 - If the top piece of an unexpanded stack is left-clicked
// while not selected, then select all of the pieces in the stack
// RFE 1659481 - Control clicking only deselects
if (!SwingUtils.isControlDown(e)) {
if (movingStacksPickupUnits ||
p.getParent() == null ||
p.getParent().isExpanded() ||
SwingUtils.isRightMouseButton(e) ||
Boolean.TRUE.equals(p.getProperty(Properties.SELECTED)))
{
kbuf.add(p);
}
else {
Stack s = p.getParent();
s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().add(gamePiece));
}
if (movingStacksPickupUnits ||
p.getParent() == null ||
p.getParent().isExpanded() ||
SwingUtils.isRightMouseButton(e) ||
Boolean.TRUE.equals(p.getProperty(Properties.SELECTED)))
{
kbuf.add(p);
}
else {
Stack s = p.getParent();
s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().add(gamePiece));
}
// End RFE 1629255
}
Expand All @@ -154,6 +151,9 @@ public void mousePressed(MouseEvent e) {
}
else if (!s.isExpanded()) {
s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().remove(gamePiece));
}
else {
kbuf.remove(p);
}
}
// End RFE 1659481
Expand Down

0 comments on commit 1b0f849

Please sign in to comment.