Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Oct 24, 2020
2 parents fe85c29 + 8f8867d commit a64e72e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/gui/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public void mousePressed(MouseEvent e) {
{
Lizzie.frame.onRightClicked(e.getX(), e.getY());
}
if (e.getButton() == MouseEvent.BUTTON2) { // center click
Lizzie.frame.onCenterClicked(e.getX(), e.getY());
}
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/featurecat/lizzie/gui/LizzieFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,14 @@ public void onDoubleClicked(int x, int y) {
}
}

public void onCenterClicked(int x, int y) {
boolean isWinrateGraphClicked = (winrateGraph.moveNumber(x, y) >= 0);
if (isWinrateGraphClicked) {
Lizzie.config.toggleLargeWinrate();
repaint();
}
}

public boolean subBoardOnClick(MouseEvent e) {
int x = e.getX();
int y = e.getY();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/gui/LizzieMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ public void onDoubleClicked(int x, int y) {
boardPane.onDoubleClicked(x, y);
}

@Override
public void onCenterClicked(int x, int y) {}

@Override
public void onMouseDragged(int x, int y) {
winratePane.onMouseDragged(x, y);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/featurecat/lizzie/gui/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ private void onRightClickedOutsideBoard() {

public abstract boolean subBoardOnClick(MouseEvent e);

public abstract void onCenterClicked(int x, int y);

public abstract void onMouseDragged(int x, int y);

public abstract void onMouseMoved(int x, int y);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/gui/WinratePane.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public WinratePane(LizzieMain owner) {
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) { // left click
onClicked(e.getX(), e.getY());
} else if (e.getButton() == MouseEvent.BUTTON2) { // center click
Lizzie.config.toggleLargeWinrate();
owner.invalidLayout();
}
}
});
Expand Down

0 comments on commit a64e72e

Please sign in to comment.