diff --git a/README.md b/README.md index c30a862..6c59de9 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ but has since grown to include a wide range of features, including: ### Play * Select the players in the main menu, or under 'New Game'. * In a teaching game, KaTrain will analyze your moves and automatically undo those that are sufficiently bad. +* When playing against AI, note that the "Undo" button will undo both the AI's last move as well as yours. #### Instant feedback while playing. diff --git a/i18n.py b/i18n.py index 5ef0b8d..b95dce8 100644 --- a/i18n.py +++ b/i18n.py @@ -28,7 +28,7 @@ for lang in locales: num_todo[lang] += 1 else: strings_to_langs[entry.msgid][lang] = entry.msgstr - strings_to_keys[entry.msgid][lang] = set(re.findall("{.*?}",entry.msgstr)) + strings_to_keys[entry.msgid][lang] = set(re.findall("{.*?}", entry.msgstr)) lang_to_strings[lang].add(entry.msgid) if num_todo[lang]: print(f"{lang} has {num_todo[lang]} TODO entries") @@ -38,8 +38,8 @@ for lang in locales: if lang != DEFAULT_LANG: for msgid in lang_to_strings[lang]: if DEFAULT_LANG in strings_to_keys[msgid] and strings_to_keys[msgid][lang] != strings_to_keys[msgid][DEFAULT_LANG]: - print(f"{msgid} has inconstent formatting keys for {lang}: ",strings_to_keys[msgid][lang],'is different from default', strings_to_keys[msgid][DEFAULT_LANG]) - errors=True + print(f"{msgid} has inconstent formatting keys for {lang}: ", strings_to_keys[msgid][lang], "is different from default", strings_to_keys[msgid][DEFAULT_LANG]) + errors = True for msgid in strings_to_langs.keys() - lang_to_strings[lang]: if lang == DEFAULT_LANG: diff --git a/katrain/config.json b/katrain/config.json index d25a359..012e329 100644 --- a/katrain/config.json +++ b/katrain/config.json @@ -8,12 +8,12 @@ "max_visits": 750, "fast_visits": 50, "max_time": 3.0, - "wide_root_noise": 0.01, + "wide_root_noise": 0.0, "_hint_wide_root_noise": "A higher value here (typically 0.05-0.1)\nmakes the analysis explore more moves\nat the cost of some strength.", "_enable_ownership": true }, "general": { - "sgf_load": "~/", + "sgf_load": "~/Downloads", "sgf_save": "./sgfout", "anim_pv_time": 0.5, "debug_level": 1, diff --git a/katrain/core/constants.py b/katrain/core/constants.py index 9e189de..eff89c0 100644 --- a/katrain/core/constants.py +++ b/katrain/core/constants.py @@ -25,7 +25,7 @@ AI_STRATEGIES_ENGINE = [AI_DEFAULT, AI_SCORELOSS, AI_JIGO] AI_STRATEGIES_PICK = [AI_PICK, AI_LOCAL, AI_TENUKI, AI_INFLUENCE, AI_TERRITORY] AI_STRATEGIES_POLICY = [AI_WEIGHTED, AI_POLICY] + AI_STRATEGIES_PICK AI_STRATEGIES = AI_STRATEGIES_ENGINE + AI_STRATEGIES_POLICY -AI_STRATEGIES_RECOMMENDED_ORDER = [AI_DEFAULT, AI_SCORELOSS, AI_WEIGHTED, AI_PICK, AI_POLICY, AI_LOCAL, AI_TENUKI, AI_TERRITORY, AI_INFLUENCE, AI_JIGO] +AI_STRATEGIES_RECOMMENDED_ORDER = [AI_DEFAULT, AI_SCORELOSS, AI_POLICY, AI_WEIGHTED, AI_PICK, AI_LOCAL, AI_TENUKI, AI_TERRITORY, AI_INFLUENCE, AI_JIGO] AI_STRENGTH = { diff --git a/katrain/gui.kv b/katrain/gui.kv index da18d5e..07bb5db 100644 --- a/katrain/gui.kv +++ b/katrain/gui.kv @@ -16,6 +16,8 @@ #:import BOX_BACKGROUND_COLOR katrain.gui.style.BOX_BACKGROUND_COLOR #:import TEXT_COLOR katrain.gui.style.TEXT_COLOR +#:import BOX_BACKGROUND_COLOR katrain.gui.style.BOX_BACKGROUND_COLOR +#:set SPINNER_OPTION_COLOR [64 / 255, 85 / 255, 110 / 255, 1] #:set LIGHTGREY [0.7,0.7,0.7,1] #:set BLACK [0.05,0.05,0.05,1] @@ -126,7 +128,7 @@ mipmap: True : - background_color: BACKGROUND_COLOR + background_color: SPINNER_OPTION_COLOR background_normal: '' lang_change_tracking: i18n._('') # for font color: WHITE @@ -337,12 +339,6 @@ MDBoxLayout: size_hint: 0.7,1 MDFloatLayout: - canvas.before: - Color: - rgba: GREEN - Line: - rectangle: (*self.pos,*self.size) - width: 1 size_hint: 0.4,1 TimerLabel: color: BACKGROUND_COLOR diff --git a/katrain/gui/popups.py b/katrain/gui/popups.py index 275fb17..36ca0e1 100644 --- a/katrain/gui/popups.py +++ b/katrain/gui/popups.py @@ -300,4 +300,6 @@ class LoadSGFPopup(BoxLayout): super().__init__(**kwargs) app = MDApp.get_running_app() self.filesel.favorites = [(os.path.abspath(app.gui.config("general/sgf_load")), "SGF Load Dir"), (os.path.abspath(app.gui.config("general/sgf_save")), "SGF Save Dir")] + self.filesel.path = os.path.abspath(os.path.expanduser(app.gui.config("general/sgf_load"))) + print(os.path.abspath(os.path.expanduser(app.gui.config("general/sgf_load")))) self.filesel.select_string = i18n._("Load File") diff --git a/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo b/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo index 7312c5b..e51830f 100644 Binary files a/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo and b/katrain/i18n/locales/en/LC_MESSAGES/katrain.mo differ diff --git a/katrain/i18n/locales/en/LC_MESSAGES/katrain.po b/katrain/i18n/locales/en/LC_MESSAGES/katrain.po index 32cf3fa..767d075 100644 --- a/katrain/i18n/locales/en/LC_MESSAGES/katrain.po +++ b/katrain/i18n/locales/en/LC_MESSAGES/katrain.po @@ -552,7 +552,7 @@ msgstr "" "strategy after the 'endgame' fraction of the board is filled." msgid "ai:p:territory" -msgstr "Respond Locally" +msgstr "Territorial Style" msgid "aihelp:p:territory" msgstr "" diff --git a/katrain/popups.kv b/katrain/popups.kv index 67ec164..e282d8b 100644 --- a/katrain/popups.kv +++ b/katrain/popups.kv @@ -390,24 +390,26 @@ rewind: rewind filesel: filesel orientation: 'vertical' - BoxLayout: - orientation: 'horizontal' + AnchorLayout: size_hint: 1,1 - DescriptionLabel: - text: i18n._("load sgf fast analysis") - size_hint: 0.45,1 - halign: 'right' - LabelledCheckBox: - id: fast - size_hint: 0.05,1 - DescriptionLabel: - text: i18n._("load sgf rewind") - halign: 'right' - size_hint: 0.45,1 - LabelledCheckBox: - id: rewind - active: True - size_hint: 0.05,1 + BoxLayout: + size_hint: 0.5,1 + orientation: 'horizontal' + DescriptionLabel: + text: i18n._("load sgf fast analysis") + size_hint: 0.45,1 + halign: 'right' + LabelledCheckBox: + id: fast + size_hint: 0.05,1 + DescriptionLabel: + text: i18n._("load sgf rewind") + halign: 'right' + size_hint: 0.45,1 + LabelledCheckBox: + id: rewind + active: True + size_hint: 0.05,1 I18NFileBrowser: id: filesel multiselect: False