red-green colourblind mode
This commit is contained in:
1 parent
f13d5bba1c
commit
05d2ceafc7
20 files changed
+144
-20
No files matched your search
@@ -164,8 +164,9 @@ class BadukPanWidget(Widget):
|
||||
|
||||
def eval_color(self, points_lost, show_dots_for_class: List[bool] = None) -> Optional[List[float]]:
|
||||
i = evaluation_class(points_lost, self.trainer_config["eval_thresholds"])
|
||||
colors = EVAL_COLORS[self.trainer_config["theme"]]
|
||||
if show_dots_for_class is None or show_dots_for_class[i]:
|
||||
return EVAL_COLORS[i]
|
||||
return colors[i]
|
||||
|
||||
def draw_board(self, *_args):
|
||||
if not (self.katrain and self.katrain.game):
|
||||
|
||||
@@ -19,13 +19,13 @@ from katrain.core.ai import ai_rank_estimation
|
||||
from katrain.core.constants import (
|
||||
AI_CONFIG_DEFAULT,
|
||||
AI_DEFAULT,
|
||||
AI_KEY_PROPERTIES,
|
||||
AI_OPTION_VALUES,
|
||||
AI_STRATEGIES_RECOMMENDED_ORDER,
|
||||
OUTPUT_DEBUG,
|
||||
OUTPUT_ERROR,
|
||||
OUTPUT_INFO,
|
||||
STATUS_INFO,
|
||||
AI_KEY_PROPERTIES,
|
||||
)
|
||||
from katrain.core.engine import KataGoEngine
|
||||
from katrain.core.lang import i18n, rank_label
|
||||
@@ -269,13 +269,16 @@ class ConfigTeacherPopup(QuickConfigGui):
|
||||
self.options_grid.add_widget(wrap_anchor(widget))
|
||||
|
||||
def build_and_set_properties(self, *_args):
|
||||
theme = self.katrain.config("trainer/theme", "theme:normal")
|
||||
undos = self.katrain.config("trainer/num_undo_prompts")
|
||||
thresholds = self.katrain.config("trainer/eval_thresholds")
|
||||
savesgfs = self.katrain.config("trainer/save_feedback")
|
||||
show_dots = self.katrain.config("trainer/show_dots")
|
||||
|
||||
self.themes_spinner.value_refs = list(EVAL_COLORS.keys())
|
||||
self.options_grid.clear_widgets()
|
||||
for i, (color, threshold, undo, show_dot, savesgf) in enumerate(
|
||||
zip(EVAL_COLORS, thresholds, undos, show_dots, savesgfs)
|
||||
zip(EVAL_COLORS[theme], thresholds, undos, show_dots, savesgfs)
|
||||
):
|
||||
self.add_option_widgets(
|
||||
[
|
||||
@@ -288,6 +291,10 @@ class ConfigTeacherPopup(QuickConfigGui):
|
||||
)
|
||||
super().build_and_set_properties()
|
||||
|
||||
def update_config(self, save_to_file=True):
|
||||
super().update_config(save_to_file=save_to_file)
|
||||
self.build_and_set_properties()
|
||||
|
||||
|
||||
class DescriptionLabel(Label):
|
||||
pass
|
||||
|
||||
+23
-11
@@ -26,14 +26,26 @@ WINRATE_COLOR = GREEN
|
||||
POINTLOSS_COLOR = YELLOW
|
||||
|
||||
# eval dots
|
||||
EVAL_COLORS = [
|
||||
[0.447, 0.129, 0.42, 1],
|
||||
[0.8, 0, 0, 1],
|
||||
[0.9, 0.4, 0.1, 1],
|
||||
[0.85, 0.89, 0.3, 1],
|
||||
[0.67, 0.9, 0.18, 1],
|
||||
[0.117, 0.588, 0, 1],
|
||||
]
|
||||
EVAL_COLORS = {
|
||||
"theme:normal": [
|
||||
[0.447, 0.129, 0.42, 1],
|
||||
[0.8, 0, 0, 1],
|
||||
[0.9, 0.4, 0.1, 1],
|
||||
[0.85, 0.89, 0.3, 1],
|
||||
[0.67, 0.9, 0.18, 1],
|
||||
[0.117, 0.588, 0, 1],
|
||||
],
|
||||
"theme:red-green-colourblind": [
|
||||
[1, 0, 1, 1],
|
||||
[1, 0, 0, 1],
|
||||
[1, 0.5, 0, 1],
|
||||
[0.85, 0.89, 0.3, 1],
|
||||
[0, 1, 1, 1],
|
||||
[0, 0, 1, 1],
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
EVAL_DOT_MAX_SIZE = 0.5
|
||||
EVAL_DOT_MIN_SIZE = 0.25
|
||||
|
||||
@@ -55,9 +67,9 @@ TOP_MOVE_BORDER_COLOR = [46 / 255, 65 / 255, 88 / 255, 0.9]
|
||||
CHILD_SCALE = 0.95
|
||||
|
||||
# ponder light
|
||||
ENGINE_DOWN_COL = EVAL_COLORS[1]
|
||||
ENGINE_BUSY_COL = EVAL_COLORS[2]
|
||||
ENGINE_READY_COL = EVAL_COLORS[-1]
|
||||
ENGINE_DOWN_COL = EVAL_COLORS["theme:normal"][1]
|
||||
ENGINE_BUSY_COL = EVAL_COLORS["theme:normal"][2]
|
||||
ENGINE_READY_COL = EVAL_COLORS["theme:normal"][-1]
|
||||
|
||||
# info
|
||||
INFO_PV_COLOR = to_hexcol(YELLOW)
|
||||
Binary file not shown.
@@ -595,3 +595,15 @@ msgstr "每步棋计算深度"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -639,3 +639,15 @@ msgstr "Anzahl der Visits pro Zug"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -643,3 +643,15 @@ msgstr "Number of visits per move"
|
||||
#. on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
|
||||
#. theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
Binary file not shown.
@@ -635,3 +635,15 @@ msgstr "Número de visitas por jugada"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -676,3 +676,15 @@ msgstr ""
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -622,3 +622,15 @@ msgstr "着手毎の読み手数"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "この手以降を削除"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -611,3 +611,15 @@ msgstr "한 수당 visit 수"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
Binary file not shown.
@@ -636,3 +636,15 @@ msgstr "Количество посещений на ход"
|
||||
#. TODO - on move tree editing
|
||||
msgid "Delete Node"
|
||||
msgstr "Delete Node"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:red-green-colourblind"
|
||||
msgstr "Red-Green Colourblind"
|
||||
|
||||
#. TODO - theme name
|
||||
msgid "theme:normal"
|
||||
msgstr "Default Theme"
|
||||
|
||||
#. TODO - theme label
|
||||
msgid "theme"
|
||||
msgstr "Colour Theme"
|
||||
+14
-6
@@ -213,6 +213,7 @@
|
||||
|
||||
<ConfigTeacherPopup>
|
||||
options_grid: options_grid
|
||||
themes_spinner: themes_spinner
|
||||
GridLayout:
|
||||
cols: 5
|
||||
rows: 7
|
||||
@@ -229,22 +230,29 @@
|
||||
DescriptionLabel:
|
||||
text: i18n._("save dots")
|
||||
AnchorLayout:
|
||||
size_hint: 1, 2
|
||||
size_hint: 1, 3
|
||||
GridLayout:
|
||||
cols: 2
|
||||
rows: 3
|
||||
rows: 4
|
||||
padding: 4
|
||||
size_hint: 0.66, 1
|
||||
size_hint: 0.8, 1
|
||||
DescriptionLabel:
|
||||
font_size: DESC_FONT_SIZE * 0.8
|
||||
text: i18n._("theme")
|
||||
AnchorLayout:
|
||||
LabelledSpinner:
|
||||
size_hint: 0.8,0.8
|
||||
input_property: 'trainer/theme'
|
||||
font_size: DESC_FONT_SIZE * 0.8
|
||||
id: themes_spinner
|
||||
DescriptionLabel:
|
||||
font_size: DESC_FONT_SIZE * 0.8
|
||||
text: i18n._("show last n dots")
|
||||
size_hint: 2,1
|
||||
AnchorLayout:
|
||||
LabelledIntInput:
|
||||
size_hint_x: 0.33
|
||||
size_hint_x: 0.15
|
||||
input_property: "trainer/eval_off_show_last"
|
||||
DescriptionLabel:
|
||||
size_hint: 2,1
|
||||
font_size: DESC_FONT_SIZE * 0.8
|
||||
text: i18n._("show ai dots")
|
||||
AnchorLayout:
|
||||
|
||||
Reference in new issue
Block a user