icon fix, i18n
This commit is contained in:
1 parent
74c57f9433
commit
155ddd631c
15 files changed
+430
-206
No files matched your search
+6
-14
@@ -1,5 +1,6 @@
|
||||
from kivy.config import Config # isort:skip
|
||||
ICON = "img/icon.png" # isort:skip # set icon
|
||||
|
||||
ICON = "img/icon.png" # isort:skip # set icon
|
||||
Config.set("kivy", "window_icon", ICON) # isort:skip # set icon
|
||||
Config.set("input", "mouse", "mouse,multitouch_on_demand") # isort:skip # no red dots on right click
|
||||
|
||||
@@ -21,15 +22,7 @@ from kivy.uix.screenmanager import Screen
|
||||
from kivymd.app import MDApp
|
||||
|
||||
from katrain.core.ai import ai_move
|
||||
from katrain.core.common import (
|
||||
LANGUAGE,
|
||||
OUTPUT_DEBUG,
|
||||
OUTPUT_ERROR,
|
||||
OUTPUT_EXTRA_DEBUG,
|
||||
OUTPUT_INFO,
|
||||
OUTPUT_KATAGO_STDERR,
|
||||
find_package_resource,i18n
|
||||
)
|
||||
from katrain.core.common import LANGUAGE, OUTPUT_DEBUG, OUTPUT_ERROR, OUTPUT_EXTRA_DEBUG, OUTPUT_INFO, OUTPUT_KATAGO_STDERR, find_package_resource, i18n
|
||||
from katrain.core.engine import KataGoEngine
|
||||
from katrain.core.game import Game, IllegalMoveException, KaTrainSGF
|
||||
from katrain.core.sgf_parser import Move, ParseError
|
||||
@@ -39,8 +32,7 @@ from katrain.gui.graph import ScoreGraph
|
||||
from katrain.gui.kivyutils import *
|
||||
from katrain.gui.popups import ConfigPopup, LoadSGFPopup, NewGamePopup
|
||||
from katrain.gui.style import ENGINE_BUSY_COL, ENGINE_DOWN_COL, ENGINE_READY_COL
|
||||
|
||||
|
||||
from katrain.gui.style import *
|
||||
|
||||
__version__ = "1.1.0"
|
||||
|
||||
@@ -136,7 +128,7 @@ class KaTrainGui(Screen):
|
||||
# Handle prisoners and next player display
|
||||
prisoners = self.game.prisoner_count
|
||||
top, bot = [w.__self__ for w in self.board_controls.circles] # no weakref
|
||||
if self.game.next_player == "W":
|
||||
if self.game.next_player.player == "W":
|
||||
top, bot = bot, top
|
||||
self.board_controls.mid_circles_container.clear_widgets()
|
||||
self.board_controls.mid_circles_container.add_widget(bot)
|
||||
@@ -276,7 +268,7 @@ class KaTrainGui(Screen):
|
||||
try:
|
||||
move_tree = KaTrainSGF.parse(clipboard)
|
||||
except Exception as e:
|
||||
self.controls.set_status(i18n._("Failed to import from clipboard").format(error=e,contents=clipboard[:50]))
|
||||
self.controls.set_status(i18n._("Failed to import from clipboard").format(error=e, contents=clipboard[:50]))
|
||||
return
|
||||
move_tree.nodes_in_tree[-1].analyze(self.engine, analyze_fast=False) # speed up result for looking at end of game
|
||||
self._do_new_game(move_tree=move_tree, analyze_fast=True)
|
||||
|
||||
@@ -44,7 +44,7 @@ def find_package_resource(path):
|
||||
with pkg_resources.path(".".join(parts[:-1]), parts[-1]) as path_obj:
|
||||
return str(path_obj) # this will clean up if egg etc, but these don't work anyway
|
||||
except (ModuleNotFoundError, FileNotFoundError) as e:
|
||||
print(f"File {path} not found, installation possibly broken",file=sys.stderr)
|
||||
print(f"File {path} not found, installation possibly broken", file=sys.stderr)
|
||||
return f"FILENOTFOUND::{path}"
|
||||
else:
|
||||
return path # absolute path
|
||||
@@ -101,5 +101,6 @@ i18n = Lang(LANGUAGE)
|
||||
class I18NLabel(Label):
|
||||
pass
|
||||
|
||||
|
||||
class I18NTextInput(TextInput):
|
||||
pass
|
||||
@@ -57,10 +57,13 @@ class KataGoEngine:
|
||||
self.katago_process = subprocess.Popen(self.command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
except (FileNotFoundError, PermissionError, OSError) as e:
|
||||
if not self.config["katago"].strip():
|
||||
self.katrain.log( i18n._("Starting default Kata failed").format(command=self.comment,error=e), OUTPUT_ERROR,
|
||||
self.katrain.log(
|
||||
i18n._("Starting default Kata failed").format(command=self.comment, error=e), OUTPUT_ERROR,
|
||||
)
|
||||
else:
|
||||
self.katrain.log( i18n._("Starting Kata failed").format(command=self.comment,error=e) , OUTPUT_ERROR, )
|
||||
self.katrain.log(
|
||||
i18n._("Starting Kata failed").format(command=self.comment, error=e), OUTPUT_ERROR,
|
||||
)
|
||||
self.analysis_thread = threading.Thread(target=self._analysis_read_thread, daemon=True).start()
|
||||
self.stderr_thread = threading.Thread(target=self._read_stderr_thread, daemon=True).start()
|
||||
|
||||
|
||||
+11
-13
@@ -4,6 +4,7 @@ from typing import Dict, List, Optional, Tuple
|
||||
|
||||
from katrain.core.common import evaluation_class, var_to_grid, i18n
|
||||
from katrain.core.sgf_parser import Move, SGFNode
|
||||
from katrain.gui.style import PV_COLOR
|
||||
|
||||
|
||||
class GameNode(SGFNode):
|
||||
@@ -40,11 +41,7 @@ class GameNode(SGFNode):
|
||||
if comment:
|
||||
properties["C"] = ["\n".join(properties.get("C", "")) + comment]
|
||||
if self.is_root:
|
||||
properties["C"] = [
|
||||
i18n._("SGF start message") + "\n"
|
||||
+ "\n".join(properties.get("C", ""))
|
||||
+ "\nSGF with review generated by KaTrain."
|
||||
]
|
||||
properties["C"] = [i18n._("SGF start message") + "\n" + "\n".join(properties.get("C", "")) + "\nSGF with review generated by KaTrain."]
|
||||
if self.note.strip():
|
||||
properties["C"] = ["\n".join(properties.get("C", "")) + f"\nNote: {self.note}"]
|
||||
return properties
|
||||
@@ -117,7 +114,7 @@ class GameNode(SGFNode):
|
||||
def make_pv(self, player, pv, interactive):
|
||||
pvtext = f"{player}{' '.join(pv)}"
|
||||
if interactive:
|
||||
pvtext = f"[u][ref={pvtext}][color=#334466]{pvtext}[/color][/ref][/u]"
|
||||
pvtext = f"[u][ref={pvtext}][color={PV_COLOR}]{pvtext}[/color][/ref][/u]"
|
||||
return pvtext
|
||||
|
||||
def comment(self, sgf=False, teach=False, hints=False, interactive=True):
|
||||
@@ -129,8 +126,8 @@ class GameNode(SGFNode):
|
||||
if self.analysis_ready:
|
||||
score = self.score
|
||||
if sgf:
|
||||
text += f"Score: {self.format_score(score)}\n"
|
||||
text += f"Win Rate: {self.format_winrate()}\n"
|
||||
text += i18n._("Info:score").format(score=self.format_score(score)) + "\n"
|
||||
text += i18n._("Info:winrate").format(winrate=self.format_winrate()) + "\n"
|
||||
if self.parent and self.parent.analysis_ready:
|
||||
previous_top_move = self.parent.candidate_moves[0]
|
||||
if sgf or hints:
|
||||
@@ -138,19 +135,20 @@ class GameNode(SGFNode):
|
||||
points_lost = self.points_lost
|
||||
if sgf and points_lost > 0.5:
|
||||
text += i18n._("Info:point loss").format(points=points_lost) + "\n"
|
||||
text += i18n._("Info:top move").format(top_move=previous_top_move['move'],score=self.format_score(previous_top_move['scoreLead'])) +".\n"
|
||||
text += i18n._("Info:top move").format(top_move=previous_top_move["move"], score=self.format_score(previous_top_move["scoreLead"])) + "\n"
|
||||
else:
|
||||
text += i18n._("Info:best move")+"\n"
|
||||
text += i18n._("Info:best move") + "\n"
|
||||
if previous_top_move.get("pv") and (sgf or hints):
|
||||
text += i18n._("Info:PV") + ": " + self.make_pv(single_move.player,previous_top_move['pv'],interactive) + "\n"
|
||||
print("PREV", previous_top_move)
|
||||
text += i18n._("Info:PV").format(pv=self.make_pv(single_move.player, previous_top_move["pv"], interactive)) + "\n"
|
||||
|
||||
if sgf or hints or teach:
|
||||
policy_ranking = self.parent.policy_ranking
|
||||
currmove_policy_with_ix = [(ix + 1, p) for (p, m), ix in zip(policy_ranking, range(len(policy_ranking))) if m == single_move]
|
||||
if currmove_policy_with_ix:
|
||||
text += i18n._("Info:policy rank").format(rank=currmove_policy_with_ix[0][0],probability=currmove_policy_with_ix[0][1]) + "\n"
|
||||
text += i18n._("Info:policy rank").format(rank=currmove_policy_with_ix[0][0], probability=currmove_policy_with_ix[0][1]) + "\n"
|
||||
if not currmove_policy_with_ix or currmove_policy_with_ix[0] != 1 and (sgf or hints):
|
||||
text += i18n._("Info:policy best").format(move=policy_ranking[0][1].gtp(),probability=policy_ranking[0][0]) +".\n"
|
||||
text += i18n._("Info:policy best").format(move=policy_ranking[0][1].gtp(), probability=policy_ranking[0][0]) + "\n"
|
||||
if self.auto_undo and sgf:
|
||||
text += i18n._("Info:teaching undo") + "\n"
|
||||
top_pv = self.analysis_ready and self.candidate_moves[0].get("pv")
|
||||
|
||||
+79
-80
@@ -9,11 +9,13 @@
|
||||
#:set GRAPH_DOT_COLOR [0.85, 0.3, 0.3,1]
|
||||
|
||||
#-- NEW
|
||||
#:import RED __main__.RED
|
||||
|
||||
|
||||
#:set BLACK [0.05,0.05,0.05,1]
|
||||
#:set WHITE [0.95,0.95,0.95,1]
|
||||
#:set GREY [0.5,0.5,0.5,1]
|
||||
#:set GREEN [0.1,0.8,0.1,1]
|
||||
#:set RED [0.8,0.1,0.1,1]
|
||||
#:set LIGHTBLUE [0.3,0.7,0.9,1]
|
||||
#:set YELLOW [0.8,0.8,0.1,1]
|
||||
|
||||
@@ -86,6 +88,11 @@
|
||||
<SizedMDFlatButton>:
|
||||
ripple_duration_in_slow: 0.6
|
||||
|
||||
<SizedMDFlatToggleButton>:
|
||||
inactive_color: BACKGROUND_COLOR
|
||||
active_color: BOX_BACKGROUND_COLOR
|
||||
md_bg_color: self.active_color if self.state=='down' else self.inactive_color
|
||||
|
||||
<SizedMDFlatRectangleButton>:
|
||||
outline_color: root.color
|
||||
text_color: root.color
|
||||
@@ -109,8 +116,9 @@
|
||||
<TransparentIconButton>:
|
||||
background_normal: ''
|
||||
background_color: (0,0,0,0)
|
||||
icon_size: self.icon_size or [min(self.size[0],self.size[1]),min(self.size[0],self.size[1])]
|
||||
image: image
|
||||
Image:
|
||||
id: image
|
||||
size: root.icon_size
|
||||
pos: [root.pos[i] + (root.size[i] - root.icon_size[i])/2 for i in [0,1]]
|
||||
source: root.icon
|
||||
@@ -228,24 +236,6 @@
|
||||
valign: 'middle'
|
||||
size: self.texture_size
|
||||
|
||||
<CensorableLabel>:
|
||||
value : value
|
||||
orientation: 'horizontal'
|
||||
ClickableLabel:
|
||||
size_hint: 0.6,1
|
||||
id: desc
|
||||
text: root.label
|
||||
font_size: self.size[1] * 0.8
|
||||
on_press: value.opacity = 1 if value.opacity==0 else 0
|
||||
I18NLabel:
|
||||
size_hint: 0.4,1
|
||||
text: root.text
|
||||
color: root.color
|
||||
font_size: desc.font_size
|
||||
id: value
|
||||
bold: True
|
||||
|
||||
|
||||
|
||||
<CircleWithText>:
|
||||
min_size: min(self.height,self.width)
|
||||
@@ -260,7 +250,7 @@
|
||||
text: root.text
|
||||
bold: True
|
||||
color: BLACK if root.player=='White' else WHITE
|
||||
pos: (image.x, image.y+2)
|
||||
pos: (image.x, image.y)
|
||||
size: image.size
|
||||
font_size: root.min_size * 1.2 / (1 + 1 * len(self.text))
|
||||
|
||||
@@ -270,11 +260,10 @@
|
||||
size: self.parent.height, self.parent.height
|
||||
katrain: app.gui
|
||||
|
||||
<BoardControlsButton@MDFillRoundFlatIconButton>:
|
||||
|
||||
|
||||
<NavIconButton@TransparentIconButton>:
|
||||
size_hint: 0.06, 0.5
|
||||
size_hint: 0.06, 0.4
|
||||
icon_size: [min(self.size[0],self.size[1]),min(self.size[0],self.size[1])]
|
||||
pos_hint: {'center_y': 0.5}
|
||||
|
||||
<BadukPanControls>:
|
||||
@@ -293,59 +282,28 @@
|
||||
SizedMDFlatRectangleButton:
|
||||
id: pass_btn
|
||||
text: i18n._('pass-button-text')
|
||||
tooltip_text: i18n._('pass-button-tooltip')
|
||||
size_hint: None, 0.5
|
||||
width: 2*self.height
|
||||
pos_hint: {'x': 0.1,'center_y':0.5}
|
||||
on_left_release: root.katrain("play",None)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
BoxLayout:
|
||||
size_hint: None, 1
|
||||
width: 8 * self.height
|
||||
pos_hint: {'center_x': 0.5,'center_y':0.5}
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
Label:
|
||||
size_hint: 0.06, 0.5
|
||||
size_hint: 0.075, 0.5
|
||||
NavIconButton:
|
||||
icon: 'img/flaticon/previous999.png'
|
||||
on_press: root.katrain('undo',999)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
on_press: print(self.size,self.image.size,self.parent.size,self.icon_size) #root.katrain('undo',999)
|
||||
NavIconButton:
|
||||
icon: 'img/flaticon/previous5.png'
|
||||
on_press: root.katrain('undo',5)
|
||||
NavIconButton:
|
||||
icon: 'img/flaticon/previous.png'
|
||||
on_press: root.katrain('undo')
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
MDFloatLayout:
|
||||
size_hint: 0.075, 1
|
||||
size_hint: 0.065, 1
|
||||
id: mid_circles_container
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
CircleWithText:
|
||||
size_hint: 5/8, 1
|
||||
pos_hint: {'center_x': 0.5-3/16}
|
||||
@@ -361,12 +319,6 @@
|
||||
NavIconButton:
|
||||
icon: 'img/flaticon/next.png'
|
||||
on_press: root.katrain('redo')
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: RED
|
||||
Line:
|
||||
rectangle: (*self.pos,*self.size)
|
||||
width: 1
|
||||
NavIconButton:
|
||||
icon: 'img/flaticon/next5.png'
|
||||
on_press: root.katrain('redo',5)
|
||||
@@ -387,6 +339,7 @@
|
||||
<PlayerInfo@MDBoxLayout>:
|
||||
captures: 0
|
||||
name: 'Player'
|
||||
outline_color: RED
|
||||
player: 'Black'
|
||||
description: '...'
|
||||
CircleWithText:
|
||||
@@ -543,23 +496,39 @@
|
||||
opacity: int(root.show_winrate)
|
||||
|
||||
|
||||
<StatsLabel>:
|
||||
value : value
|
||||
orientation: 'horizontal'
|
||||
I18NLabel:
|
||||
size_hint: 0.6,1
|
||||
id: desc
|
||||
text: root.label if not root.hidden else ''
|
||||
font_size: self.size[1] * 0.8
|
||||
I18NLabel:
|
||||
size_hint: 0.4,1
|
||||
text: root.text if not root.hidden else ''
|
||||
color: root.color
|
||||
font_size: desc.font_size
|
||||
id: value
|
||||
bold: True
|
||||
|
||||
<StatsBox>
|
||||
orientation: 'vertical'
|
||||
background_color: BOX_BACKGROUND_COLOR
|
||||
labels: {'score':score_label,'winrate':winrate_label,'points':pointloss_label}
|
||||
CensorableLabel:
|
||||
StatsLabel:
|
||||
id: winrate_label
|
||||
label: 'Win rate'
|
||||
label: i18n._('stats:winrate')
|
||||
text: root.winrate
|
||||
color: WINRATE_COLOR
|
||||
CensorableLabel:
|
||||
StatsLabel:
|
||||
id: score_label
|
||||
label: 'Score'
|
||||
label: i18n._('stats:score')
|
||||
text: root.score
|
||||
color: SCORE_COLOR
|
||||
CensorableLabel:
|
||||
StatsLabel:
|
||||
id: pointloss_label
|
||||
label: 'Points Lost' if root.points_lost is None or root.points_lost > 0 else 'Points gained'
|
||||
label: i18n._('stats:pointslost') if root.points_lost is None or root.points_lost > 0 else i18n._('stats:pointsgained')
|
||||
text: '{}: {:.1f}'.format(root.player,abs(root.points_lost)) if root.points_lost is not None else '...'
|
||||
color: POINTLOSS_COLOR
|
||||
|
||||
@@ -635,9 +604,9 @@
|
||||
CollapsablePanel:
|
||||
height_open: root.graph_box_height
|
||||
closed_label: 'closedlabel:scoregraph'
|
||||
options: ['score','winrate','points']
|
||||
option_colors: [SCORE_COLOR,WINRATE_COLOR,POINTLOSS_COLOR]
|
||||
option_default_active: [True,False,False]
|
||||
options: ['score','winrate']
|
||||
option_colors: [SCORE_COLOR,WINRATE_COLOR]
|
||||
option_default_active: [True,False]
|
||||
options_height: root.tab_option_height
|
||||
on_option_state: graph.show_graphs(args[1])
|
||||
ScoreGraph:
|
||||
@@ -649,6 +618,7 @@
|
||||
option_colors: [SCORE_COLOR,WINRATE_COLOR,POINTLOSS_COLOR]
|
||||
option_default_active: [True,True,True]
|
||||
options_height: root.tab_option_height
|
||||
on_option_state: for k, v in args[1].items(): stats.labels[k].hidden = not v
|
||||
StatsBox:
|
||||
id: stats
|
||||
CollapsablePanel:
|
||||
@@ -657,6 +627,11 @@
|
||||
options: ['info','notes']
|
||||
option_colors: [RED,GREEN]
|
||||
option_default_active: [True,False]
|
||||
on_option_state:
|
||||
info.size_hint_y = int(args[1]['info'])+1e-9
|
||||
info.opacity = int(args[1]['info'])
|
||||
note.size_hint_y = int(args[1]['notes'])+1e-9
|
||||
note.opacity = int(args[1]['notes'])
|
||||
options_height: root.tab_option_height
|
||||
MDBoxLayout:
|
||||
orientation: 'vertical'
|
||||
@@ -669,14 +644,13 @@
|
||||
id: info
|
||||
markup: True
|
||||
on_ref_press: root.katrain.board_gui.show_pv_from_comments(args[1])
|
||||
size_hint: 1, None
|
||||
size_hint: 1, 1
|
||||
height: self.parent.height - status.height - note.height - 1
|
||||
I18NTextInput:
|
||||
id: note
|
||||
size_hint: 1, None
|
||||
size_hint: 1, 1
|
||||
on_text: root.katrain.set_note(self.text)
|
||||
hint_text: 'Your SGF notes for this position here.'
|
||||
height: min( (len(self._lines)+0.7) * self.line_height, self.parent.height - status.height - 2.7*self.line_height)
|
||||
hint_text: i18n._('SGF Notes Hint')
|
||||
Label:
|
||||
size_hint_y: 1e-9 # takes up remaining space if info is closed
|
||||
|
||||
@@ -821,11 +795,37 @@
|
||||
shortcut: 'Ctrl-N'
|
||||
on_action: root.katrain("new-game-popup")
|
||||
|
||||
<OutlineBox@MDBoxLayout+OutlineColor>:
|
||||
|
||||
|
||||
<PlayAnalyzeButton@SizedMDFlatToggleButton>:
|
||||
inactive_color: BACKGROUND_COLOR
|
||||
active_color: YELLOW
|
||||
ripple_color: BACKGROUND_COLOR
|
||||
md_bg_color: self.active_color if self.state=='down' else self.inactive_color
|
||||
text_color: self.inactive_color if self.state=='down' else self.active_color
|
||||
size_hint: 0.5,1
|
||||
group: 'play_analyze'
|
||||
allow_no_selection: False
|
||||
|
||||
<PlayAnalyzeSelect@MDFloatLayout>
|
||||
OutlineBox:
|
||||
outline_color: WHITE
|
||||
size_hint: 0.7,0.7
|
||||
pos_hint: {'center_x':0.5,'center_y':0.45}
|
||||
PlayAnalyzeButton:
|
||||
text: i18n._('btn:Play')
|
||||
id: play
|
||||
PlayAnalyzeButton:
|
||||
text: i18n._('btn:Analysis')
|
||||
id: analyze
|
||||
state: 'down'
|
||||
|
||||
<KaTrainGui>:
|
||||
board_gui: board_gui
|
||||
controls: controls
|
||||
board_controls: board_controls
|
||||
play_mode: play_mode
|
||||
analysis_controls: analysis_controls
|
||||
nav_drawer: nav_drawer
|
||||
zen: False
|
||||
@@ -854,11 +854,10 @@
|
||||
width: 0 if root.zen else self.height * 0.4
|
||||
opacity: 0 if root.zen else 1
|
||||
orientation: 'vertical'
|
||||
MDBoxLayout:
|
||||
PlayAnalyzeSelect:
|
||||
id: play_mode
|
||||
size_hint_y: None
|
||||
height: analysis_controls.height
|
||||
Label:
|
||||
text: 'BlaBla'
|
||||
ControlsPanel:
|
||||
id: controls
|
||||
MyNavigationDrawer:
|
||||
|
||||
@@ -11,7 +11,6 @@ from katrain.gui.popups import ConfigTeacherPopup, ConfigTimerPopup
|
||||
from katrain.gui.ai_settings import ConfigAIPopupContents
|
||||
|
||||
|
||||
|
||||
class ControlsPanel(BoxLayout):
|
||||
katrain = ObjectProperty(None)
|
||||
button_controls = ObjectProperty(None)
|
||||
|
||||
@@ -8,7 +8,6 @@ from katrain.gui.kivyutils import BackgroundColor
|
||||
class ScoreGraph(BackgroundColor):
|
||||
show_score = BooleanProperty(True)
|
||||
show_winrate = BooleanProperty(True)
|
||||
show_pointloss = BooleanProperty(True)
|
||||
|
||||
nodes = ListProperty([])
|
||||
score_points = ListProperty([])
|
||||
@@ -36,7 +35,6 @@ class ScoreGraph(BackgroundColor):
|
||||
def show_graphs(self, keys):
|
||||
self.show_score = keys["score"]
|
||||
self.show_winrate = keys["winrate"]
|
||||
self.show_pointloss = keys["points"]
|
||||
|
||||
def update_graph(self, *args):
|
||||
nodes = self.nodes
|
||||
|
||||
@@ -78,6 +78,11 @@ class SizedMDFlatButton(RectangularRippleBehavior, SizedMDBaseButton):
|
||||
pass
|
||||
|
||||
|
||||
class SizedMDFlatToggleButton(SizedMDFlatButton, ToggleButtonBehavior):
|
||||
inactive_color = ListProperty([0.5, 0.5, 0.5, 1])
|
||||
active_color = ListProperty([1, 1, 1, 1])
|
||||
|
||||
|
||||
class SizedMDFlatRectangleButton(SizedMDFlatButton, OutlineColor):
|
||||
color = ListProperty([1, 1, 1, 1])
|
||||
|
||||
@@ -88,7 +93,6 @@ class SizedMDFlatRectangleToggleButton(SizedMDFlatRectangleButton, ToggleButtonB
|
||||
@property
|
||||
def active(self):
|
||||
return self.state == "down"
|
||||
return self.state == "down"
|
||||
|
||||
|
||||
class AutoSizedMDFlatRectangleButton(SizedMDFlatRectangleButton):
|
||||
@@ -109,10 +113,11 @@ class LightLabel(I18NLabel):
|
||||
pass
|
||||
|
||||
|
||||
class CensorableLabel(MDBoxLayout):
|
||||
class StatsLabel(MDBoxLayout):
|
||||
text = StringProperty("")
|
||||
label = StringProperty("")
|
||||
color = ListProperty([1, 1, 1, 1])
|
||||
hidden = BooleanProperty(False)
|
||||
|
||||
|
||||
class MyNavigationDrawer(MDNavigationDrawer): # in PR - closes NavDrawer on any outside click
|
||||
|
||||
+11
-1
@@ -1,3 +1,10 @@
|
||||
def to_hexcol(kivycol):
|
||||
return "#" + "".join(f"{round(c * 255):02x}" for c in kivycol[:3])
|
||||
|
||||
|
||||
# basic color definitions
|
||||
RED = [0.8, 0.1, 0.1, 1]
|
||||
|
||||
# eval dots
|
||||
EVAL_COLORS = [
|
||||
[0.447, 0.129, 0.42, 1],
|
||||
@@ -23,7 +30,10 @@ GHOST_ALPHA = 0.5
|
||||
TOP_MOVE_ALPHA = 0.3
|
||||
CHILD_SCALE = 0.95
|
||||
|
||||
# ponder dot
|
||||
# ponder light
|
||||
ENGINE_DOWN_COL = [0.8, 0, 0, 1]
|
||||
ENGINE_BUSY_COL = [0.9, 0.4, 0.1, 1]
|
||||
ENGINE_READY_COL = [0.117, 0.588, 0, 1]
|
||||
|
||||
# info
|
||||
PV_COLOR = to_hexcol(RED)
|
||||
Binary file not shown.
@@ -10,10 +10,6 @@ msgstr ""
|
||||
msgid "Roboto"
|
||||
msgstr "Roboto"
|
||||
|
||||
msgid "Hello World"
|
||||
msgstr "Hello World"
|
||||
|
||||
#.
|
||||
msgid "English"
|
||||
msgstr "English"
|
||||
|
||||
@@ -26,11 +22,6 @@ msgstr "Korean"
|
||||
msgid "pass-button-text"
|
||||
msgstr "Pass"
|
||||
|
||||
msgid "pass-button-tooltip"
|
||||
msgstr ""
|
||||
"[space]\n"
|
||||
"Pass"
|
||||
|
||||
#. tabs and labels on the right panel
|
||||
msgid "tab:score"
|
||||
msgstr "Score"
|
||||
@@ -65,27 +56,55 @@ msgstr ""
|
||||
"game\n"
|
||||
"end"
|
||||
|
||||
#. Select mode
|
||||
msgid "btn:Play"
|
||||
msgstr "Play"
|
||||
|
||||
msgid "btn:Analysis"
|
||||
msgstr "Analysis"
|
||||
|
||||
msgid "stats:winrate"
|
||||
msgstr "Win Rate"
|
||||
|
||||
msgid "stats:score"
|
||||
msgstr "Estimated Score"
|
||||
|
||||
msgid "stats:pointslost"
|
||||
msgstr "Points Lost"
|
||||
|
||||
#. better than expected best move
|
||||
msgid "stats:pointsgained"
|
||||
msgstr "Points Gained"
|
||||
|
||||
#. SGF and move comment messages
|
||||
msgid "SGF start message"
|
||||
msgstr "Moves marked 'X' indicate the top move according to KataGo, those with a square are moves that lose less than 0.5 points.
|
||||
msgstr ""
|
||||
"Moves marked 'X' indicate the top move according to KataGo, those with a "
|
||||
"square are moves that lose less than 0.5 points"
|
||||
|
||||
msgid "Info:score"
|
||||
msgstr "Score: {score}"
|
||||
|
||||
msgid "Info:winrate"
|
||||
msgstr "Win rate: {winrate}"
|
||||
|
||||
msgid "Info:point loss"
|
||||
msgstr "Estimated point loss: {points_lost:.1f}"
|
||||
|
||||
msgid "Info:top move"
|
||||
msgid "Predicted top move was {top_move} ({score})."
|
||||
msgstr "Predicted top move was {top_move} ({score})."
|
||||
|
||||
msgid "Info:best move"
|
||||
msgstr "Move was predicted best move.
|
||||
msgstr "Move was predicted best move"
|
||||
|
||||
msgid "Info:PV"
|
||||
msgstr "PV"
|
||||
msgstr "PV: {pv}"
|
||||
|
||||
msgid "Info:policy rank"
|
||||
msgstr "Move was #{rank} according to policy ({probability:.2%})."
|
||||
|
||||
msgid "Info:policy best"
|
||||
msgstr "Top policy move was {move} ({policy_ranking[0][0]:.1%})."
|
||||
msgstr "Top policy move was {move} ({probability:.1%})."
|
||||
|
||||
msgid "Info:teaching undo"
|
||||
msgstr "Move was automatically undone in teaching mode."
|
||||
@@ -102,21 +121,34 @@ msgstr "No analysis available"
|
||||
msgid "Analyzing move..."
|
||||
msgstr "Analyzing move..."
|
||||
|
||||
#.misc errors and info messages
|
||||
msgid "SGF Notes Hint"
|
||||
msgstr "Your SGF notes for this position here."
|
||||
|
||||
#. misc errors and info messages
|
||||
msgid "Copied SGF to clipboard."
|
||||
msgstr "Copied SGF to clipboard."
|
||||
|
||||
msgid "Failed to import from clipboard"
|
||||
msgstr "Failed to import game from clipboard: {error}\nClipboard contents: {contents}..."
|
||||
msgstr ""
|
||||
"Failed to import game from clipboard: {error}\n"
|
||||
"Clipboard contents: {contents}..."
|
||||
|
||||
msgid "Failed to load SGF"
|
||||
msgstr "Failed to load SGF. Parse Error: {error}"
|
||||
|
||||
msgid "Starting default Kata failed"
|
||||
msgstr "Starting KataGo with command '{command}' failed with error {error}. If on MacOS, see the manual on how to use brew to install katago first, and add it to your path or 'engine/katago' setting."
|
||||
msgstr ""
|
||||
"Starting KataGo with command '{command}' failed with error {error}. If on "
|
||||
"MacOS, see the manual on how to use brew to install katago first, and add it"
|
||||
" to your path or 'engine/katago' setting."
|
||||
|
||||
msgid "Starting Kata failed"
|
||||
msgstr "Starting kata with command '{command}' failed with error {error}. Please make sure the 'katago' value under 'engine' in settings points to the correct KataGo executable."
|
||||
msgstr ""
|
||||
"Starting kata with command '{command}' failed with error {error}. Please "
|
||||
"make sure the 'katago' value under 'engine' in settings points to the "
|
||||
"correct KataGo executable."
|
||||
|
||||
msgid "Engine died unexpectedly"
|
||||
msgstr "Engine died unexpectedly without sending output, possibly due to out of memory: {e}"
|
||||
msgstr ""
|
||||
"Engine died unexpectedly without sending output, possibly due to out of "
|
||||
"memory: {e}"
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
# KaTrain i18n file
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Language: Nederlands\n"
|
||||
"Language: Korean\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -10,9 +10,6 @@ msgstr ""
|
||||
msgid "Roboto"
|
||||
msgstr "fonts/NotoSansKR-Regular.otf"
|
||||
|
||||
msgid "Hello World"
|
||||
msgstr "안녕하세요 여러분"
|
||||
|
||||
msgid "English"
|
||||
msgstr "영어"
|
||||
|
||||
@@ -23,51 +20,133 @@ msgid "Korean"
|
||||
msgstr "한국어"
|
||||
|
||||
msgid "pass-button-text"
|
||||
msgstr "페스"
|
||||
msgstr "착수 넘김"
|
||||
|
||||
msgid "pass-button-tooltip"
|
||||
msgstr ""
|
||||
"[스페이스 바]\n"
|
||||
"페스"
|
||||
#. tabs and labels on the right panel
|
||||
msgid "tab:score"
|
||||
msgstr "점수"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:winrate"
|
||||
msgstr "Win Rate"
|
||||
msgstr "승리 확률"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:info"
|
||||
msgstr "Info"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:points"
|
||||
msgstr "Point Loss"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:info"
|
||||
msgstr "Info"
|
||||
|
||||
msgid "tab:notes"
|
||||
msgstr "Notes"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:scoregraph"
|
||||
msgstr "Score Graph"
|
||||
msgstr "점수/확률 그래프"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:movestats"
|
||||
msgstr "Move Stats"
|
||||
msgstr "수의 통계"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:score"
|
||||
msgstr "Score"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:info¬es"
|
||||
msgstr "Move Info & Notes"
|
||||
msgstr "수의 정보 & 메모"
|
||||
|
||||
#. TODO
|
||||
msgid "board-game-end"
|
||||
msgstr ""
|
||||
"게임\n"
|
||||
"끝났다"
|
||||
|
||||
#. TODO
|
||||
#. on board in circle
|
||||
msgid "board-pass"
|
||||
msgstr "페스"
|
||||
msgstr "착수\n넘김"
|
||||
|
||||
msgid "board-game-end"
|
||||
msgstr "게임\n끝났다"
|
||||
|
||||
#. Select mode
|
||||
msgid "btn:Play"
|
||||
msgstr "게임하기"
|
||||
|
||||
msgid "btn:Analysis"
|
||||
msgstr "분석하기"
|
||||
|
||||
msgid "stats:winrate"
|
||||
msgstr "승리 확률"
|
||||
|
||||
msgid "stats:score"
|
||||
msgstr "예상 점수"
|
||||
|
||||
msgid "stats:pointslost"
|
||||
msgstr "Points Lost"
|
||||
|
||||
#. better than expected best move
|
||||
msgid "stats:pointsgained"
|
||||
msgstr "Points Gained"
|
||||
|
||||
#. SGF and move comment messages
|
||||
msgid "SGF start message"
|
||||
msgstr ""
|
||||
"Moves marked 'X' indicate the top move according to KataGo, those with a "
|
||||
"square are moves that lose less than 0.5 points"
|
||||
|
||||
msgid "Info:score"
|
||||
msgstr "예상 점수: {score}"
|
||||
|
||||
msgid "Info:winrate"
|
||||
msgstr "승리 확률: {winrate}"
|
||||
|
||||
msgid "Info:point loss"
|
||||
msgstr "Estimated point loss: {points_lost:.1f}"
|
||||
|
||||
msgid "Info:top move"
|
||||
msgstr "Predicted top move was {top_move} ({score})."
|
||||
|
||||
msgid "Info:best move"
|
||||
msgstr "Move was predicted best move"
|
||||
|
||||
msgid "Info:PV"
|
||||
msgstr "PV: {pv}"
|
||||
|
||||
msgid "Info:policy rank"
|
||||
msgstr "Move was #{rank} according to policy ({probability:.2%})."
|
||||
|
||||
msgid "Info:policy best"
|
||||
msgstr "Top policy move was {move} ({probability:.1%})."
|
||||
|
||||
msgid "Info:teaching undo"
|
||||
msgstr "Move was automatically undone in teaching mode."
|
||||
|
||||
msgid "Info:undo predicted PV"
|
||||
msgstr "Predicted follow-up: {pv}"
|
||||
|
||||
msgid "Info:AI thoughts"
|
||||
msgstr "AI thought process: {thoughts}"
|
||||
|
||||
msgid "No analysis available"
|
||||
msgstr "No analysis available"
|
||||
|
||||
msgid "Analyzing move..."
|
||||
msgstr "Analyzing move..."
|
||||
|
||||
msgid "SGF Notes Hint"
|
||||
msgstr "Your SGF notes for this position here."
|
||||
|
||||
#. misc errors and info messages
|
||||
msgid "Copied SGF to clipboard."
|
||||
msgstr "Copied SGF to clipboard."
|
||||
|
||||
msgid "Failed to import from clipboard"
|
||||
msgstr ""
|
||||
"Failed to import game from clipboard: {error}\n"
|
||||
"Clipboard contents: {contents}..."
|
||||
|
||||
msgid "Failed to load SGF"
|
||||
msgstr "Failed to load SGF. Parse Error: {error}"
|
||||
|
||||
msgid "Starting default Kata failed"
|
||||
msgstr ""
|
||||
"Starting KataGo with command '{command}' failed with error {error}. If on "
|
||||
"MacOS, see the manual on how to use brew to install katago first, and add it"
|
||||
" to your path or 'engine/katago' setting."
|
||||
|
||||
msgid "Starting Kata failed"
|
||||
msgstr ""
|
||||
"Starting kata with command '{command}' failed with error {error}. Please "
|
||||
"make sure the 'katago' value under 'engine' in settings points to the "
|
||||
"correct KataGo executable."
|
||||
|
||||
msgid "Engine died unexpectedly"
|
||||
msgstr ""
|
||||
"Engine died unexpectedly without sending output, possibly due to out of "
|
||||
"memory: {e}"
|
||||
Binary file not shown.
@@ -10,9 +10,6 @@ msgstr ""
|
||||
msgid "Roboto"
|
||||
msgstr "Roboto"
|
||||
|
||||
msgid "Hello World"
|
||||
msgstr "Hallo wereld"
|
||||
|
||||
msgid "English"
|
||||
msgstr "Engels"
|
||||
|
||||
@@ -25,53 +22,164 @@ msgstr "Koreaans"
|
||||
msgid "pass-button-text"
|
||||
msgstr "Pas"
|
||||
|
||||
msgid "pass-button-tooltip"
|
||||
msgstr ""
|
||||
"[spatiebalk]\n"
|
||||
"Pas"
|
||||
|
||||
#. TODO
|
||||
msgid "KataGo"
|
||||
msgstr "KataGo"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:winrate"
|
||||
msgstr "Win Rate"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:points"
|
||||
msgstr "Point Loss"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:score"
|
||||
msgstr "Score"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:notes"
|
||||
msgstr "Notes"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:info"
|
||||
msgstr "Info"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:PV"
|
||||
msgstr "PV: {pv}"
|
||||
|
||||
#. TODO
|
||||
msgid "board-pass"
|
||||
msgstr "pass"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:scoregraph"
|
||||
msgstr "Score Graph"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:info¬es"
|
||||
msgstr "Move Info & Notes"
|
||||
msgid "Starting default Kata failed"
|
||||
msgstr ""
|
||||
"Starting KataGo with command '{command}' failed with error {error}. If on "
|
||||
"MacOS, see the manual on how to use brew to install katago first, and add it"
|
||||
" to your path or 'engine/katago' setting."
|
||||
|
||||
#. TODO
|
||||
msgid "Failed to load SGF"
|
||||
msgstr "Failed to load SGF. Parse Error: {error}"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:AI thoughts"
|
||||
msgstr "AI thought process: {thoughts}"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:winrate"
|
||||
msgstr "Win Rate"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:undo predicted PV"
|
||||
msgstr "Predicted follow-up: {pv}"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:notes"
|
||||
msgstr "Notes"
|
||||
|
||||
#. TODO
|
||||
msgid "SGF start message"
|
||||
msgstr ""
|
||||
"Moves marked 'X' indicate the top move according to KataGo, those with a "
|
||||
"square are moves that lose less than 0.5 points"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:teaching undo"
|
||||
msgstr "Move was automatically undone in teaching mode."
|
||||
|
||||
#. TODO
|
||||
msgid "Failed to import from clipboard"
|
||||
msgstr ""
|
||||
"Failed to import game from clipboard: {error}\n"
|
||||
"Clipboard contents: {contents}..."
|
||||
|
||||
#. TODO
|
||||
msgid "Info:policy best"
|
||||
msgstr "Top policy move was {move} ({probability:.1%})."
|
||||
|
||||
#. TODO
|
||||
msgid "Info:policy rank"
|
||||
msgstr "Move was #{rank} according to policy ({probability:.2%})."
|
||||
|
||||
#. TODO
|
||||
msgid "Analyzing move..."
|
||||
msgstr "Analyzing move..."
|
||||
|
||||
#. TODO
|
||||
msgid "Copied SGF to clipboard."
|
||||
msgstr "Copied SGF to clipboard."
|
||||
|
||||
#. TODO
|
||||
msgid "Engine died unexpectedly"
|
||||
msgstr ""
|
||||
"Engine died unexpectedly without sending output, possibly due to out of "
|
||||
"memory: {e}"
|
||||
|
||||
#. TODO
|
||||
msgid "board-game-end"
|
||||
msgstr ""
|
||||
"game\n"
|
||||
"end"
|
||||
|
||||
#. TODO
|
||||
msgid "Starting Kata failed"
|
||||
msgstr ""
|
||||
"Starting kata with command '{command}' failed with error {error}. Please "
|
||||
"make sure the 'katago' value under 'engine' in settings points to the "
|
||||
"correct KataGo executable."
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:movestats"
|
||||
msgstr "Move Stats"
|
||||
|
||||
#. TODO
|
||||
msgid "board-game-end"
|
||||
msgstr ""
|
||||
"einde\n"
|
||||
"partij"
|
||||
msgid "Info:top move"
|
||||
msgstr "Predicted top move was {top_move} ({score})."
|
||||
|
||||
#. TODO
|
||||
msgid "board-pass"
|
||||
msgstr "pas"
|
||||
msgid "Info:score"
|
||||
msgstr "Score: {score}"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:point loss"
|
||||
msgstr "Estimated point loss: {points_lost:.1f}"
|
||||
|
||||
#. TODO
|
||||
msgid "No analysis available"
|
||||
msgstr "No analysis available"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:score"
|
||||
msgstr "Score"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:best move"
|
||||
msgstr "Move was predicted best move"
|
||||
|
||||
#. TODO
|
||||
msgid "tab:points"
|
||||
msgstr "Point Loss"
|
||||
|
||||
#. TODO
|
||||
msgid "Info:winrate"
|
||||
msgstr "Win rate: {winrate}"
|
||||
|
||||
#. TODO
|
||||
msgid "closedlabel:info¬es"
|
||||
msgstr "Move Info & Notes"
|
||||
|
||||
#. TODO
|
||||
msgid "btn:Analysis"
|
||||
msgstr "Analysis"
|
||||
|
||||
#. TODO
|
||||
msgid "btn:Play"
|
||||
msgstr "Play"
|
||||
|
||||
#. TODO
|
||||
msgid "stats:winrate"
|
||||
msgstr "Win Rate"
|
||||
|
||||
#. TODO
|
||||
msgid "stats:pointslost"
|
||||
msgstr "Points Lost"
|
||||
|
||||
#. TODO
|
||||
msgid "stats:score"
|
||||
msgstr "Estimated Score"
|
||||
|
||||
#. TODO
|
||||
msgid "stats:pointsgained"
|
||||
msgstr "Points Gained"
|
||||
|
||||
#. TODO
|
||||
msgid "SGF Notes Hint"
|
||||
msgstr "Your SGF notes for this position here."
|
||||
Reference in new issue
Block a user