From 0486332653670d6f53fea843c486ccad677e3c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:40:30 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index d2903ed7..3a481ef3 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -1028,21 +1028,33 @@ class dialog_setting_game_internal(QWidget): __extraw.setEnabled( not savehook_new_data[gameuid]["follow_default_ankisettings"] ) - savehook_new_data[gameuid]["anki_DeckName"] = globalconfig["ankiconnect"][ - "DeckName" - ] - savehook_new_data[gameuid]["anki_simulate_key_1_use"] = globalconfig[ - "ankiconnect" - ]["simulate_key"]["1"]["use"] - savehook_new_data[gameuid]["anki_simulate_key_1_keystring"] = globalconfig[ - "ankiconnect" - ]["simulate_key"]["1"]["keystring"] - savehook_new_data[gameuid]["anki_simulate_key_2_use"] = globalconfig[ - "ankiconnect" - ]["simulate_key"]["2"]["use"] - savehook_new_data[gameuid]["anki_simulate_key_2_keystring"] = globalconfig[ - "ankiconnect" - ]["simulate_key"]["2"]["keystring"] + savehook_new_data[gameuid]["anki_DeckName"] = savehook_new_data[gameuid].get( + "anki_DeckName", globalconfig["ankiconnect"]["DeckName"] + ) + savehook_new_data[gameuid]["anki_simulate_key_1_use"] = savehook_new_data[ + gameuid + ].get( + "anki_simulate_key_1_use", + globalconfig["ankiconnect"]["simulate_key"]["1"]["use"], + ) + savehook_new_data[gameuid]["anki_simulate_key_1_keystring"] = savehook_new_data[ + gameuid + ].get( + "anki_simulate_key_1_keystring", + globalconfig["ankiconnect"]["simulate_key"]["1"]["keystring"], + ) + savehook_new_data[gameuid]["anki_simulate_key_2_use"] = savehook_new_data[ + gameuid + ].get( + "anki_simulate_key_2_use", + globalconfig["ankiconnect"]["simulate_key"]["2"]["use"], + ) + savehook_new_data[gameuid]["anki_simulate_key_2_keystring"] = savehook_new_data[ + gameuid + ].get( + "anki_simulate_key_2_keystring", + globalconfig["ankiconnect"]["simulate_key"]["2"]["keystring"], + ) formLayout.addRow(__extraw) formLayout2 = QFormLayout()