fix encoding, cn, readme, draw text/pass

This commit is contained in:
Sander Land committed 2020-12-10 23:09:08 +01:00
1 parent 78d91b5789
commit e36dfa0db3
5 files changed
+15 -11

No files matched your search

+4 -4
View File
@@ -4,7 +4,7 @@
[![License:MIT](https://img.shields.io/pypi/l/katrain)](https://en.wikipedia.org/wiki/MIT_License)
[![GitHub Downloads](https://img.shields.io/github/downloads/sanderland/katrain/total?color=%23336699&label=github%20downloads)](https://github.com/sanderland/katrain/releases)
[![PyPI Downloads](https://pepy.tech/badge/katrain)](https://pepy.tech/project/katrain)
[![Github sponsors](https://img.shields.io/static/v1?label=sponsor&message=6&logo=GitHub&color=dcb424&link=https://github.com/sponsors/sanderland/)](https://github.com/sponsors/sanderland)
[![Github sponsors](https://img.shields.io/static/v1?label=sponsor&message=%E2%9D%A4&logo=GitHub&color=dcb424&link=https://github.com/sponsors/sanderland/)](https://github.com/sponsors/sanderland)
[![Discord](https://img.shields.io/discord/417022162348802048?logo=discord)](https://discord.com/channels/417022162348802048/629446365688365067)
<table>
@@ -152,7 +152,7 @@ Keyboard shortcuts are shown with **[key]**.
* The checkboxes at the top of the screen:
* **[q]**: Child moves are shown. On by default, can turn it off to avoid obscuring other information or when
wanting to guess the next move.
* **[w]**: Show all dots: Cycles through showingall evaluation dots, showing the last few, and showing none.
* **[w]**: Show all dots: Cycles through showing all evaluation dots, showing the last few, and showing none.
* You can configure whether they are shown for AIs under 'Teaching/Analysis Settings'.
* **[e]**: Top moves: Show the next moves KataGo considered, colored by their expected point loss.
Small/faint dots indicate high uncertainty and never show text (lower than your 'fast visits' setting).
@@ -209,8 +209,8 @@ In addition to shortcuts mentioned above and those shown in the main menu:
## <a name="support"></a> Support / Contribute
[![GitHub issues](https://img.shields.io/github/issues/sanderland/katrain)](https://github.com/sanderland/katrain/issues)
[![Contributors](https://img.shields.io/static/v1?label=contributors&message=22&color=dcb424)](CONTRIBUTIONS.md)
[![Github sponsors](https://img.shields.io/static/v1?label=sponsor&message=7&logo=GitHub&color=dcb424&link=https://github.com/sponsors/sanderland/)](https://github.com/sponsors/sanderland)
[![Contributors](https://img.shields.io/static/v1?label=contributors&message=24&color=dcb424)](CONTRIBUTIONS.md)
[![Github sponsors](https://img.shields.io/static/v1?label=sponsor&message=%E2%9D%A4&logo=GitHub&color=dcb424&link=https://github.com/sponsors/sanderland/)](https://github.com/sponsors/sanderland)
* Ideas, feedback, and contributions to code or translations are all very welcome.
* For suggestions and planned improvements, see [open issues](https://github.com/sanderland/katrain/issues) on github to check if the functionality is already planned.
+1 -2
View File
@@ -19,7 +19,6 @@ from katrain.core.constants import (
STATUS_ERROR,
STATUS_INFO,
STATUS_TEACHING,
VERSION,
SGF_INTERNAL_COMMENTS_MARKER,
)
from katrain.core.engine import KataGoEngine
@@ -40,7 +39,7 @@ class KaTrainSGF(SGF):
class Game:
"""Represents a game of go, including an implementation of capture rules."""
DEFAULT_PROPERTIES = {"GM": 1, "FF": 4, "AP": f"{PROGRAM_NAME}:{VERSION}", "CA": "UTF-8"}
DEFAULT_PROPERTIES = {"GM": 1, "FF": 4}
def __init__(
self,
+3 -1
View File
@@ -131,13 +131,15 @@ class GameNode(SGFNode):
properties["SQ"] = best_sq
if top_x and "MA" not in properties:
properties["MA"] = [top_x]
comments.append(self.comment(sgf=True, interactive=False)+SGF_INTERNAL_COMMENTS_MARKER)
comments.append(self.comment(sgf=True, interactive=False) + SGF_INTERNAL_COMMENTS_MARKER)
if self.is_root:
comments = [
i18n._("SGF start message") + SGF_INTERNAL_COMMENTS_MARKER + "\n",
*comments,
f"\nSGF generated by {PROGRAM_NAME} {VERSION}{SGF_INTERNAL_COMMENTS_MARKER}\n",
]
properties["CA"] = "UTF-8"
properties["AP"] = f"{PROGRAM_NAME}:{VERSION}"
if self.shortcut_from:
properties["KTSF"] = [id(self.shortcut_from)]
elif "KTSF" in properties:
+6 -3
View File
@@ -246,7 +246,7 @@ class BadukPanWidget(Widget):
if self.draw_coords_enabled:
grid_spaces_margin_x = [1.5, 0.75] # left, right
grid_spaces_margin_y = [1.5, 0.75] # bottom, top
else: #no coordinates means remove the offset
else: # no coordinates means remove the offset
grid_spaces_margin_x = [0.75, 0.75] # left, right
grid_spaces_margin_y = [0.75, 0.75] # bottom, top
x_grid_spaces = board_size_x - 1 + sum(grid_spaces_margin_x)
@@ -272,7 +272,10 @@ class BadukPanWidget(Widget):
else:
Color(1, 0.95, 0.8, 1) # image is a bit too light
Rectangle(
pos=(self.gridpos_x[0] - self.grid_size * grid_spaces_margin_x[0], self.gridpos_y[0] - self.grid_size * grid_spaces_margin_y[0]),
pos=(
self.gridpos_x[0] - self.grid_size * grid_spaces_margin_x[0],
self.gridpos_y[0] - self.grid_size * grid_spaces_margin_y[0],
),
size=(self.grid_size * x_grid_spaces, self.grid_size * y_grid_spaces),
texture=cached_texture("img/board.png"),
)
@@ -494,7 +497,7 @@ class BadukPanWidget(Widget):
Ellipse(pos=(center[0] - size / 2, center[1] - size / 2), size=(size, size))
Color(0.85, 0.85, 0.85)
draw_text(
pos=center, text=text, font_size=size * 0.25, halign="center", outline_color=[0.95, 0.95, 0.95]
pos=center, text=text, font_size=size * 0.25, halign="center"
)
self.redraw_hover_contents_trigger()
@@ -686,7 +686,7 @@ msgstr "Score"
#. TODO - Dropdown menu option
msgid "top_move_nothing"
msgstr "---"
msgstr "(nothing)"
#. TODO - Dropdown menu option
msgid "top_move_winrate"