From c25aa58c6bf1b2a99e7995d7492fab225f62a991 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: Mon, 2 Sep 2024 17:39:07 +0800 Subject: [PATCH] fix --- .../LunaTranslator/LunaTranslator.py | 6 ++++ .../gui/dialog_savedgame_setting.py | 28 ++++++++----------- .../LunaTranslator/gui/textbrowser.py | 2 +- plugins/CMakeLists.txt | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index 86f79892..e7e22846 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -309,6 +309,12 @@ class MAINUI: ) except: pass + if ( + (windows.GetKeyState(windows.VK_CONTROL) < 0) + or (windows.GetKeyState(windows.VK_SHIFT) < 0) + or (windows.GetKeyState(windows.VK_RETURN) < 0) + ): + return safe_callback_none() if onlytrans == False: self.currenttext = text self.currenttranslate = "" diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py index 43fedcda..b8139ed9 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py @@ -221,14 +221,14 @@ class browserdialog(saveposwindow): def maybehavebutton(self, gameuid, post): + save_text_process_info = savehook_new_data[gameuid]["save_text_process_info"] if post == "_11": - savehook_new_data[gameuid]["save_text_process_info"]["mypost"] = str( - uuid.uuid4() - ).replace("-", "_") + if "mypost" not in save_text_process_info: + save_text_process_info["mypost"] = str(uuid.uuid4()).replace("-", "_") return getIconButton( callback=functools.partial( selectdebugfile, - savehook_new_data[gameuid]["save_text_process_info"]["mypost"], + save_text_process_info["mypost"], ismypost=True, ), icon="fa.gear", @@ -245,29 +245,25 @@ def maybehavebutton(self, gameuid, post): callback = functools.partial( postconfigdialog2x, self, - savehook_new_data[gameuid]["save_text_process_info"][ - "postprocessconfig" - ][post]["args"]["internal"], - savehook_new_data[gameuid]["save_text_process_info"][ - "postprocessconfig" - ][post]["name"], + save_text_process_info["postprocessconfig"][post]["args"][ + "internal" + ], + save_text_process_info["postprocessconfig"][post]["name"], ["正则", "转义", "原文内容", "替换为"], ) elif isinstance(list(postprocessconfig[post]["args"].values())[0], dict): callback = functools.partial( postconfigdialog, self, - savehook_new_data[gameuid]["save_text_process_info"][ - "postprocessconfig" - ][post]["args"]["替换内容"], + save_text_process_info["postprocessconfig"][post]["args"][ + "替换内容" + ], postprocessconfig[post]["name"], ["原文内容", "替换为"], ) else: items = autoinitdialog_items( - savehook_new_data[gameuid]["save_text_process_info"][ - "postprocessconfig" - ][post] + save_text_process_info["postprocessconfig"][post] ) callback = functools.partial( autoinitdialog, diff --git a/LunaTranslator/LunaTranslator/gui/textbrowser.py b/LunaTranslator/LunaTranslator/gui/textbrowser.py index 3e23aea1..99f25037 100644 --- a/LunaTranslator/LunaTranslator/gui/textbrowser.py +++ b/LunaTranslator/LunaTranslator/gui/textbrowser.py @@ -48,7 +48,7 @@ class Textbrowser(QFrame): globalconfig["rendertext_using"] = "textbrowser" tb = importlib.import_module(f"rendertext.textbrowser").TextBrowser self.textbrowser = tb(self) - + self.textbrowser.move(0, 0) self.textbrowser.setMouseTracking(True) self.textbrowser.contentsChanged.connect(self._contentsChanged) self.textbrowser.resize(size) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9248a284..e441505e 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 33) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)