fix encoding, cn, readme, draw text/pass
This commit is contained in:
1 parent
78d91b5789
commit
e36dfa0db3
5 files changed
+15
-11
No files matched your search
@@ -4,7 +4,7 @@
|
|||||||
[](https://en.wikipedia.org/wiki/MIT_License)
|
[](https://en.wikipedia.org/wiki/MIT_License)
|
||||||
[](https://github.com/sanderland/katrain/releases)
|
[](https://github.com/sanderland/katrain/releases)
|
||||||
[](https://pepy.tech/project/katrain)
|
[](https://pepy.tech/project/katrain)
|
||||||
[](https://github.com/sponsors/sanderland)
|
[](https://github.com/sponsors/sanderland)
|
||||||
[](https://discord.com/channels/417022162348802048/629446365688365067)
|
[](https://discord.com/channels/417022162348802048/629446365688365067)
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@@ -152,7 +152,7 @@ Keyboard shortcuts are shown with **[key]**.
|
|||||||
* The checkboxes at the top of the screen:
|
* 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
|
* **[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.
|
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'.
|
* 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.
|
* **[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).
|
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
|
## <a name="support"></a> Support / Contribute
|
||||||
|
|
||||||
[](https://github.com/sanderland/katrain/issues)
|
[](https://github.com/sanderland/katrain/issues)
|
||||||
[](CONTRIBUTIONS.md)
|
[](CONTRIBUTIONS.md)
|
||||||
[](https://github.com/sponsors/sanderland)
|
[](https://github.com/sponsors/sanderland)
|
||||||
|
|
||||||
* Ideas, feedback, and contributions to code or translations are all very welcome.
|
* 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.
|
* For suggestions and planned improvements, see [open issues](https://github.com/sanderland/katrain/issues) on github to check if the functionality is already planned.
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ from katrain.core.constants import (
|
|||||||
STATUS_ERROR,
|
STATUS_ERROR,
|
||||||
STATUS_INFO,
|
STATUS_INFO,
|
||||||
STATUS_TEACHING,
|
STATUS_TEACHING,
|
||||||
VERSION,
|
|
||||||
SGF_INTERNAL_COMMENTS_MARKER,
|
SGF_INTERNAL_COMMENTS_MARKER,
|
||||||
)
|
)
|
||||||
from katrain.core.engine import KataGoEngine
|
from katrain.core.engine import KataGoEngine
|
||||||
@@ -40,7 +39,7 @@ class KaTrainSGF(SGF):
|
|||||||
class Game:
|
class Game:
|
||||||
"""Represents a game of go, including an implementation of capture rules."""
|
"""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__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -131,13 +131,15 @@ class GameNode(SGFNode):
|
|||||||
properties["SQ"] = best_sq
|
properties["SQ"] = best_sq
|
||||||
if top_x and "MA" not in properties:
|
if top_x and "MA" not in properties:
|
||||||
properties["MA"] = [top_x]
|
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:
|
if self.is_root:
|
||||||
comments = [
|
comments = [
|
||||||
i18n._("SGF start message") + SGF_INTERNAL_COMMENTS_MARKER + "\n",
|
i18n._("SGF start message") + SGF_INTERNAL_COMMENTS_MARKER + "\n",
|
||||||
*comments,
|
*comments,
|
||||||
f"\nSGF generated by {PROGRAM_NAME} {VERSION}{SGF_INTERNAL_COMMENTS_MARKER}\n",
|
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:
|
if self.shortcut_from:
|
||||||
properties["KTSF"] = [id(self.shortcut_from)]
|
properties["KTSF"] = [id(self.shortcut_from)]
|
||||||
elif "KTSF" in properties:
|
elif "KTSF" in properties:
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class BadukPanWidget(Widget):
|
|||||||
if self.draw_coords_enabled:
|
if self.draw_coords_enabled:
|
||||||
grid_spaces_margin_x = [1.5, 0.75] # left, right
|
grid_spaces_margin_x = [1.5, 0.75] # left, right
|
||||||
grid_spaces_margin_y = [1.5, 0.75] # bottom, top
|
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_x = [0.75, 0.75] # left, right
|
||||||
grid_spaces_margin_y = [0.75, 0.75] # bottom, top
|
grid_spaces_margin_y = [0.75, 0.75] # bottom, top
|
||||||
x_grid_spaces = board_size_x - 1 + sum(grid_spaces_margin_x)
|
x_grid_spaces = board_size_x - 1 + sum(grid_spaces_margin_x)
|
||||||
@@ -272,7 +272,10 @@ class BadukPanWidget(Widget):
|
|||||||
else:
|
else:
|
||||||
Color(1, 0.95, 0.8, 1) # image is a bit too light
|
Color(1, 0.95, 0.8, 1) # image is a bit too light
|
||||||
Rectangle(
|
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),
|
size=(self.grid_size * x_grid_spaces, self.grid_size * y_grid_spaces),
|
||||||
texture=cached_texture("img/board.png"),
|
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))
|
Ellipse(pos=(center[0] - size / 2, center[1] - size / 2), size=(size, size))
|
||||||
Color(0.85, 0.85, 0.85)
|
Color(0.85, 0.85, 0.85)
|
||||||
draw_text(
|
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()
|
self.redraw_hover_contents_trigger()
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ msgstr "Score"
|
|||||||
|
|
||||||
#. TODO - Dropdown menu option
|
#. TODO - Dropdown menu option
|
||||||
msgid "top_move_nothing"
|
msgid "top_move_nothing"
|
||||||
msgstr "---"
|
msgstr "(nothing)"
|
||||||
|
|
||||||
#. TODO - Dropdown menu option
|
#. TODO - Dropdown menu option
|
||||||
msgid "top_move_winrate"
|
msgid "top_move_winrate"
|
||||||
|
|||||||
Reference in new issue
Block a user