Skip to content

Commit

Permalink
Merge pull request #294 from TFiFiE/patch-1
Browse files Browse the repository at this point in the history
Always show statistics for blue-ringed moves.
  • Loading branch information
featurecat authored Jun 11, 2018
2 parents 5eb17d7 + bc2ed0e commit a8eed06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ private void drawLeelazSuggestions(Graphics2D g) {
continue;

boolean isBestMove = bestMoves.get(0) == move;
boolean hasMaxWinrate = move.winrate == maxWinrate;

if (move.playouts == 0) // this actually can happen
continue;
Expand Down Expand Up @@ -573,7 +574,7 @@ private void drawLeelazSuggestions(Graphics2D g) {

if (branch == null || (isBestMove && Lizzie.frame.mouseHoverCoordinate != null && coordinates[0] == Lizzie.frame.mouseHoverCoordinate[0] && coordinates[1] == Lizzie.frame.mouseHoverCoordinate[1])) {
int strokeWidth = 1;
if (isBestMove != (move.winrate == maxWinrate)) {
if (isBestMove != hasMaxWinrate) {
strokeWidth = 2;
g.setColor(isBestMove ? Color.RED : Color.BLUE);
g.setStroke(new BasicStroke(strokeWidth));
Expand All @@ -585,7 +586,7 @@ private void drawLeelazSuggestions(Graphics2D g) {
}


if (branch == null && alpha >= MIN_ALPHA_TO_DISPLAY_TEXT || (Lizzie.frame.mouseHoverCoordinate != null && coordinates[0] == Lizzie.frame.mouseHoverCoordinate[0] && coordinates[1] == Lizzie.frame.mouseHoverCoordinate[1])) {
if (branch == null && (alpha >= MIN_ALPHA_TO_DISPLAY_TEXT || hasMaxWinrate) || (Lizzie.frame.mouseHoverCoordinate != null && coordinates[0] == Lizzie.frame.mouseHoverCoordinate[0] && coordinates[1] == Lizzie.frame.mouseHoverCoordinate[1])) {
double roundedWinrate = Math.round(move.winrate * 10) / 10.0;
if (uiConfig.getBoolean("win-rate-always-black") && !Lizzie.board.getData().blackToPlay) {
roundedWinrate = 100.0 - roundedWinrate;
Expand Down

0 comments on commit a8eed06

Please sign in to comment.