Skip to content

Commit

Permalink
Add setting to hide status text
Browse files Browse the repository at this point in the history
I found it particularly annoying to have the "Pondering on" text on top
of the goban.
  • Loading branch information
OlivierBlanvillain committed Jul 14, 2018
1 parent bf7eb98 commit b5bb15a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/main/java/featurecat/lizzie/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Config {
public boolean showRawBoard = false;
public boolean handicapInsteadOfWinrate = false;

public boolean showStatus = true;
public boolean showBranch = true;
public boolean showBestMoves = true;
public boolean showNextMoves = true;
Expand Down Expand Up @@ -133,6 +134,7 @@ public Config() throws IOException {
uiConfig = config.getJSONObject("ui");

showMoveNumber = uiConfig.getBoolean("show-move-number");
showStatus = uiConfig.getBoolean("show-status");
showBranch = uiConfig.getBoolean("show-leelaz-variation");
showWinrate = uiConfig.getBoolean("show-winrate");
showVariationGraph = uiConfig.getBoolean("show-variation-graph");
Expand Down Expand Up @@ -248,6 +250,7 @@ private JSONObject createDefaultConfig() {
ui.put("fancy-board", true);
ui.put("shadow-size", 100);
ui.put("show-move-number", false);
ui.put("show-status", true);
ui.put("show-leelaz-variation", true);
ui.put("show-winrate", true);
ui.put("show-variation-graph", true);
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/featurecat/lizzie/gui/LizzieFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public LizzieFrame() {
variationTree = new VariationTree();
winrateGraph = new WinrateGraph();

setMinimumSize( new Dimension(640,480) );
setMinimumSize( new Dimension(640,480) );
setLocationRelativeTo(null); // start centered
JSONArray windowSize = Lizzie.config.uiConfig.getJSONArray("window-size");
setSize(windowSize.getInt(0), windowSize.getInt(1)); // use config file window size
Expand Down Expand Up @@ -373,16 +373,19 @@ public void paint(Graphics g0) {
cachedImage = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) cachedImage.getGraphics();

drawCommandString(g);
if (Lizzie.config.showStatus)
drawCommandString(g);

boardRenderer.setLocation(boardX, boardY);
boardRenderer.setBoardLength(maxSize);
boardRenderer.draw(g);

if (Lizzie.leelaz != null && Lizzie.leelaz.isLoaded()) {
drawPonderingState(g, resourceBundle.getString("LizzieFrame.display.pondering") +
(Lizzie.leelaz.isPondering()?resourceBundle.getString("LizzieFrame.display.on"):resourceBundle.getString("LizzieFrame.display.off")),
ponderingX, ponderingY, ponderingSize);
if (Lizzie.config.showStatus) {
drawPonderingState(g, resourceBundle.getString("LizzieFrame.display.pondering") +
(Lizzie.leelaz.isPondering()?resourceBundle.getString("LizzieFrame.display.on"):resourceBundle.getString("LizzieFrame.display.off")),
ponderingX, ponderingY, ponderingSize);
}

// Todo: Make board move over when there is no space beside the board
if (Lizzie.config.showWinrate) {
Expand All @@ -404,7 +407,7 @@ public void paint(Graphics g0) {
// This can happen when no space is left for subboard.
}
}
} else {
} else if (Lizzie.config.showStatus) {
drawPonderingState(g, resourceBundle.getString("LizzieFrame.display.loading"), loadingX, loadingY, loadingSize);
}

Expand Down

0 comments on commit b5bb15a

Please sign in to comment.